From b838b4cea0d78c08b2acce6d2d98c1c840f23309 Mon Sep 17 00:00:00 2001 From: carson <104383295+codebycarson@users.noreply.github.com> Date: Wed, 8 May 2024 14:54:55 -0700 Subject: [PATCH] Precompile additions and feegrant protos (#171) --- .changeset/sharp-geckos-dress.md | 6 + packages/evm/src/precompiles/bank.ts | 31 +- packages/evm/src/precompiles/oracle.ts | 191 ++++++ packages/evm/src/precompiles/pointer.ts | 166 +++++ packages/evm/src/precompiles/pointerview.ts | 176 +++++ packages/evm/src/precompiles/wasm.ts | 18 + packages/proto/scripts/codegen.js | 1 - packages/proto/src/codegen/cosmos/bundle.ts | 186 ++--- packages/proto/src/codegen/cosmos/client.ts | 4 + .../cosmos/feegrant/v1beta1/feegrant.ts | 631 +++++++++++++++++ .../cosmos/feegrant/v1beta1/genesis.ts | 93 +++ .../cosmos/feegrant/v1beta1/query.lcd.ts | 44 ++ .../feegrant/v1beta1/query.rpc.Query.ts | 55 ++ .../codegen/cosmos/feegrant/v1beta1/query.ts | 634 ++++++++++++++++++ .../cosmos/feegrant/v1beta1/tx.amino.ts | 13 + .../cosmos/feegrant/v1beta1/tx.registry.ts | 53 ++ .../cosmos/feegrant/v1beta1/tx.rpc.msg.ts | 34 + .../src/codegen/cosmos/feegrant/v1beta1/tx.ts | 444 ++++++++++++ packages/proto/src/codegen/cosmos/lcd.ts | 5 + .../proto/src/codegen/cosmos/rpc.query.ts | 3 + packages/proto/src/codegen/cosmos/rpc.tx.ts | 3 + packages/proto/src/codegen/cosmwasm/bundle.ts | 54 +- packages/proto/src/codegen/cosmwasm/lcd.ts | 5 + .../proto/src/codegen/cosmwasm/rpc.query.ts | 3 + packages/proto/src/codegen/cosmwasm/rpc.tx.ts | 3 + .../proto/src/codegen/gogoproto/bundle.ts | 4 +- packages/proto/src/codegen/google/bundle.ts | 20 +- packages/proto/src/codegen/ibc/bundle.ts | 176 ++--- packages/proto/src/codegen/ibc/lcd.ts | 5 + packages/proto/src/codegen/ibc/rpc.query.ts | 3 + packages/proto/src/codegen/ibc/rpc.tx.ts | 3 + .../proto/src/codegen/seiprotocol/bundle.ts | 232 +++---- packages/proto/src/codegen/seiprotocol/lcd.ts | 5 + .../src/codegen/seiprotocol/rpc.query.ts | 3 + .../proto/src/codegen/seiprotocol/rpc.tx.ts | 3 + .../proto/src/codegen/tendermint/bundle.ts | 44 +- 36 files changed, 2999 insertions(+), 355 deletions(-) create mode 100644 .changeset/sharp-geckos-dress.md create mode 100644 packages/evm/src/precompiles/oracle.ts create mode 100644 packages/evm/src/precompiles/pointer.ts create mode 100644 packages/evm/src/precompiles/pointerview.ts create mode 100644 packages/proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts create mode 100644 packages/proto/src/codegen/cosmos/feegrant/v1beta1/genesis.ts create mode 100644 packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts create mode 100644 packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts create mode 100644 packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.ts create mode 100644 packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts create mode 100644 packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts create mode 100644 packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts create mode 100644 packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts diff --git a/.changeset/sharp-geckos-dress.md b/.changeset/sharp-geckos-dress.md new file mode 100644 index 00000000..a31723a9 --- /dev/null +++ b/.changeset/sharp-geckos-dress.md @@ -0,0 +1,6 @@ +--- +"@sei-js/proto": patch +"@sei-js/evm": patch +--- + +Added new precompiles for pointer, pointerview, and oracle. Added feegrant to @sei-js/proto diff --git a/packages/evm/src/precompiles/bank.ts b/packages/evm/src/precompiles/bank.ts index 7f1117d2..3766919a 100644 --- a/packages/evm/src/precompiles/bank.ts +++ b/packages/evm/src/precompiles/bank.ts @@ -151,6 +151,23 @@ export const BANK_PRECOMPILE_ADDRESS: `0x${string}` = '0x00000000000000000000000 * @category Cosmos Interoperability */ export const BANK_PRECOMPILE_ABI: Abi = [ + { + inputs: [{ internalType: 'address', name: 'acc', type: 'address' }], + name: 'all_balances', + outputs: [ + { + components: [ + { internalType: 'uint256', name: 'amount', type: 'uint256' }, + { internalType: 'string', name: 'denom', type: 'string' } + ], + internalType: 'struct IBank.Coin[]', + name: 'response', + type: 'tuple[]' + } + ], + stateMutability: 'view', + type: 'function' + }, { inputs: [ { internalType: 'address', name: 'acc', type: 'address' }, @@ -187,6 +204,13 @@ export const BANK_PRECOMPILE_ABI: Abi = [ stateMutability: 'nonpayable', type: 'function' }, + { + inputs: [{ internalType: 'string', name: 'toNativeAddress', type: 'string' }], + name: 'sendNative', + outputs: [{ internalType: 'bool', name: 'success', type: 'bool' }], + stateMutability: 'payable', + type: 'function' + }, { inputs: [{ internalType: 'string', name: 'denom', type: 'string' }], name: 'supply', @@ -200,13 +224,6 @@ export const BANK_PRECOMPILE_ABI: Abi = [ outputs: [{ internalType: 'string', name: 'response', type: 'string' }], stateMutability: 'view', type: 'function' - }, - { - inputs: [{ internalType: 'string', name: 'toNativeAddress', type: 'string' }], - name: 'sendNative', - outputs: [{ internalType: 'bool', name: 'success', type: 'bool' }], - stateMutability: 'payable', - type: 'function' } ]; diff --git a/packages/evm/src/precompiles/oracle.ts b/packages/evm/src/precompiles/oracle.ts new file mode 100644 index 00000000..bb266d0a --- /dev/null +++ b/packages/evm/src/precompiles/oracle.ts @@ -0,0 +1,191 @@ +import { Abi } from 'viem'; +import { ContractRunner, ethers, InterfaceAbi } from 'ethers'; + +/** + * Represents the functions available in the Oracle precompile contract, + * facilitating interoperability between the EVM and Cosmos. + * @category Cosmos Interoperability + */ +export interface OraclePrecompileFunctions { + /** + * Retrieves the exchange rates for all denominations. + * @returns A Promise resolving to an array of denomination and exchange rate pairs. + * @category Cosmos Interoperability + */ + getExchangeRates(): Promise< + { + denom: string; + oracleExchangeRateVal: { + exchangeRate: string; + lastUpdate: string; + lastUpdateTimestamp: number; + }; + }[] + >; + + /** + * Retrieves Oracle Time-Weighted Average Prices (TWAPs) for the specified lookback period. + * @param lookbackSeconds The number of seconds to look back for the TWAP calculation. + * @returns A Promise resolving to an array of denomination and TWAP pairs. + * @category Cosmos Interoperability + */ + getOracleTwaps(lookbackSeconds: number): Promise< + { + denom: string; + twap: string; + lookbackSeconds: number; + }[] + >; +} + +/** Represents the typed contract instance for the Oracle precompile contract. + * @category Cosmos Interoperability + */ +export type OraclePrecompileContract = ethers.Contract & OraclePrecompileFunctions; + +/** + * The address of the Oracle precompile contract, which can be used for interoperability between the EVM and Cosmos. + * + * @example + * Wagmi: Use the `useReadContract` hook to read the exchange rates. + * ```tsx + * import { ORACLE_PRECOMPILE_ADDRESS, ORACLE_PRECOMPILE_ABI } from '@sei-js/evm'; + * import { useReadContract } from 'wagmi'; + * + * // Make sure your component is wrapped in a WagmiProvider + * const { data } = useReadContract({ + * abi: ORACLE_PRECOMPILE_ABI, + * address: ORACLE_PRECOMPILE_ADDRESS, + * functionName: 'getExchangeRates' + * }); + * + * console.log(data); + * ``` + * + * @example + * ethers v6: Use the `ethers` library and precompiles to read the exchange rates. + * ```tsx + * import { ORACLE_PRECOMPILE_ADDRESS, getOraclePrecompileEthersV6Contract } from '@sei-js/evm'; + * import { ethers } from 'ethers'; + * + * const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider + * const signer = await provider.getSigner(); + * + * const oraclePrecompileContract = getOraclePrecompileEthersV6Contract(ORACLE_PRECOMPILE_ADDRESS, signer); + * + * const exchangeRates = await oraclePrecompileContract.getExchangeRates(); + * console.log(exchangeRates); + * ``` + * + * @category Cosmos Interoperability + */ +export const ORACLE_PRECOMPILE_ADDRESS: `0x${string}` = '0x0000000000000000000000000000000000001002'; + +/** + * The ABI for the Oracle precompile contract, which can be used for interoperability between the EVM and Cosmos. + * + * @example + * Wagmi: Use the `useReadContract` hook to read the exchange rates. + * ```tsx + * import { ORACLE_PRECOMPILE_ADDRESS, ORACLE_PRECOMPILE_ABI } from '@sei-js/evm'; + * import { useReadContract } from 'wagmi'; + * + * // Make sure your component is wrapped in a WagmiProvider + * const { data } = useReadContract({ + * abi: ORACLE_PRECOMPILE_ABI, + * address: ORACLE_PRECOMPILE_ADDRESS, + * functionName: 'getExchangeRates' + * }); + * + * console.log(data); + * ``` + * + * @example + * ethers v6: Use the `ethers` library and precompiles to read the exchange rates. + * ```tsx + * import { ORACLE_PRECOMPILE_ADDRESS, ORACLE_PRECOMPILE_ABI, OraclePrecompileContract } from '@sei-js/evm'; + * import { ethers } from 'ethers'; + * + * const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider + * const signer = await provider.getSigner(); + * + * const oraclePrecompileContract = new ethers.Contract(ORACLE_PRECOMPILE_ADDRESS, ORACLE_PRECOMPILE_ABI, signer) as OraclePrecompileContract; + * + * const exchangeRates = await oraclePrecompileContract.getExchangeRates(); + * console.log(exchangeRates); + * ``` + * + * @category Cosmos Interoperability + */ +export const ORACLE_PRECOMPILE_ABI: Abi = [ + { + inputs: [], + name: 'getExchangeRates', + outputs: [ + { + components: [ + { internalType: 'string', name: 'denom', type: 'string' }, + { + components: [ + { internalType: 'string', name: 'exchangeRate', type: 'string' }, + { internalType: 'string', name: 'lastUpdate', type: 'string' }, + { internalType: 'int64', name: 'lastUpdateTimestamp', type: 'int64' } + ], + internalType: 'struct IOracle.OracleExchangeRate', + name: 'oracleExchangeRateVal', + type: 'tuple' + } + ], + internalType: 'struct IOracle.DenomOracleExchangeRatePair[]', + name: '', + type: 'tuple[]' + } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [{ internalType: 'uint64', name: 'lookback_seconds', type: 'uint64' }], + name: 'getOracleTwaps', + outputs: [ + { + components: [ + { internalType: 'string', name: 'denom', type: 'string' }, + { internalType: 'string', name: 'twap', type: 'string' }, + { internalType: 'int64', name: 'lookbackSeconds', type: 'int64' } + ], + internalType: 'struct IOracle.OracleTwap[]', + name: '', + type: 'tuple[]' + } + ], + stateMutability: 'view', + type: 'function' + } +]; + +/** + * Creates and returns an ethers v6 contract instance with the provided signer, for use in interoperability between the EVM and Cosmos. + * + * @example + * ```tsx + * import { ORACLE_PRECOMPILE_ADDRESS, getOraclePrecompileEthersV6Contract } from '@sei-js/evm'; + * import { ethers } from 'ethers'; + * + * const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider + * const signer = await provider.getSigner(); + * + * const oraclePrecompileContract = getOraclePrecompileEthersV6Contract(ORACLE_PRECOMPILE_ADDRESS, signer); + * + * const exchangeRates = await oraclePrecompileContract.getExchangeRates(); + * console.log(exchangeRates); + * ``` + * + * @param precompileAddress The 0X address of the precompile contract. + * @param runner a [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract. + * @returns The typed contract instance allowing interaction with the precompile contract. + * @category Cosmos Interoperability + */ +export const getOraclePrecompileEthersV6Contract = (precompileAddress: `0x${string}`, runner: ContractRunner): OraclePrecompileContract => { + return new ethers.Contract(precompileAddress, ORACLE_PRECOMPILE_ABI as InterfaceAbi, runner) as OraclePrecompileContract; +}; diff --git a/packages/evm/src/precompiles/pointer.ts b/packages/evm/src/precompiles/pointer.ts new file mode 100644 index 00000000..cc9995ff --- /dev/null +++ b/packages/evm/src/precompiles/pointer.ts @@ -0,0 +1,166 @@ +import { Abi } from 'viem'; +import { ContractRunner, ethers, InterfaceAbi } from 'ethers'; + +/** + * Represents the functions available in the Pointer precompile contract, + * facilitating interoperability between the EVM and Cosmos for tokens. + * @category Cosmos Interoperability + */ +export interface PointerPrecompileFunctions { + /** + * Adds a CW20 pointer for the contract. + * @param cwAddr The CW20 contract address to add. + * @returns A Promise resolving to the Ethereum address of the pointer. + * @category Cosmos Interoperability + */ + addCW20Pointer(cwAddr: string): Promise; + + /** + * Adds a CW721 pointer for the contract. + * @param cwAddr The CW721 contract address to add. + * @returns A Promise resolving to the Ethereum address of the pointer. + * @category Cosmos Interoperability + */ + addCW721Pointer(cwAddr: string): Promise; + + /** + * Adds a native pointer for the contract. + * @param token The native token to add. + * @returns A Promise resolving to the Ethereum address of the pointer. + * @category Cosmos Interoperability + */ + addNativePointer(token: string): Promise; +} + +/** Represents the typed contract instance for the Pointer precompile contract. + * @category Cosmos Interoperability + */ +export type PointerPrecompileContract = ethers.Contract & PointerPrecompileFunctions; + +/** + * The address of the Pointer precompile contract, which can be used for interoperability between the EVM and Cosmos. + * + * @example + * Wagmi: Use the `useWriteContract` hook to add a CW20 pointer. + * ```tsx + * import { POINTER_PRECOMPILE_ADDRESS, POINTER_PRECOMPILE_ABI } from '@sei-js/evm'; + * import { useWriteContract } from 'wagmi'; + * + * // Make sure your component is wrapped in a WagmiProvider + * const { write } = useWriteContract({ + * abi: POINTER_PRECOMPILE_ABI, + * address: POINTER_PRECOMPILE_ADDRESS, + * functionName: 'addCW20Pointer', + * args: ['CW20_CONTRACT_ADDRESS'], + * value: ethers.utils.parseEther('0.01') + * }); + * + * write(); + * ``` + * + * @example + * ethers v6: Use the `ethers` library and precompiles to add a CW20 pointer. + * ```tsx + * import { POINTER_PRECOMPILE_ADDRESS, getPointerPrecompileEthersV6Contract } from '@sei-js/evm'; + * import { ethers } from 'ethers'; + * + * const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider + * const signer = await provider.getSigner(); + * + * const pointerPrecompileContract = getPointerPrecompileEthersV6Contract(POINTER_PRECOMPILE_ADDRESS, signer); + * + * const tx = await pointerPrecompileContract.addCW20Pointer('CW20_CONTRACT_ADDRESS', { value: ethers.utils.parseEther('0.01') }); + * console.log(tx); + * ``` + * + * @category Cosmos Interoperability + */ +export const POINTER_PRECOMPILE_ADDRESS: `0x${string}` = '0x000000000000000000000000000000000000100B'; + +/** + * The ABI for the Pointer precompile contract, which can be used for interoperability between the EVM and Cosmos. + * + * @example + * Wagmi: Use the `useWriteContract` hook to add a CW20 pointer. + * ```tsx + * import { POINTER_PRECOMPILE_ADDRESS, POINTER_PRECOMPILE_ABI } from '@sei-js/evm'; + * import { useWriteContract } from 'wagmi'; + * + * // Make sure your component is wrapped in a WagmiProvider + * const { write } = useWriteContract({ + * abi: POINTER_PRECOMPILE_ABI, + * address: POINTER_PRECOMPILE_ADDRESS, + * functionName: 'addCW20Pointer', + * args: ['CW20_CONTRACT_ADDRESS'], + * value: ethers.utils.parseEther('0.01') + * }); + * + * write(); + * ``` + * + * @example + * ethers v6: Use the `ethers` library and precompiles to add a CW20 pointer. + * ```tsx + * import { POINTER_PRECOMPILE_ADDRESS, POINTER_PRECOMPILE_ABI, PointerPrecompileContract } from '@sei-js/evm'; + * import { ethers } from 'ethers'; + * + * const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider + * const signer = await provider.getSigner(); + * + * const pointerPrecompileContract = new ethers.Contract(POINTER_PRECOMPILE_ADDRESS, POINTER_PRECOMPILE_ABI, signer) as PointerPrecompileContract; + * + * const tx = await pointerPrecompileContract.addCW20Pointer('CW20_CONTRACT_ADDRESS', { value: ethers.utils.parseEther('0.01') }); + * console.log(tx); + * ``` + * + * @category Cosmos Interoperability + */ +export const POINTER_PRECOMPILE_ABI: Abi = [ + { + inputs: [{ internalType: 'string', name: 'cwAddr', type: 'string' }], + name: 'addCW20Pointer', + outputs: [{ internalType: 'address', name: 'ret', type: 'address' }], + stateMutability: 'payable', + type: 'function' + }, + { + inputs: [{ internalType: 'string', name: 'cwAddr', type: 'string' }], + name: 'addCW721Pointer', + outputs: [{ internalType: 'address', name: 'ret', type: 'address' }], + stateMutability: 'payable', + type: 'function' + }, + { + inputs: [{ internalType: 'string', name: 'token', type: 'string' }], + name: 'addNativePointer', + outputs: [{ internalType: 'address', name: 'ret', type: 'address' }], + stateMutability: 'payable', + type: 'function' + } +]; + +/** + * Creates and returns an ethers v6 contract instance with the provided signer, for use in interoperability between the EVM and Cosmos. + * + * @example + * ```tsx + * import { POINTER_PRECOMPILE_ADDRESS, getPointerPrecompileEthersV6Contract } from '@sei-js/evm'; + * import { ethers } from 'ethers'; + * + * const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider + * const signer = await provider.getSigner(); + * + * const pointerPrecompileContract = getPointerPrecompileEthersV6Contract(POINTER_PRECOMPILE_ADDRESS, signer); + * + * const tx = await pointerPrecompileContract.addCW20Pointer('CW20_CONTRACT_ADDRESS', { value: ethers.utils.parseEther('0.01') }); + * console.log(tx); + * ``` + * + * @param precompileAddress The 0X address of the precompile contract. + * @param runner a [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract. + * @returns The typed contract instance allowing interaction with the precompile contract. + * @category Cosmos Interoperability + */ +export const getPointerPrecompileEthersV6Contract = (precompileAddress: `0x${string}`, runner: ContractRunner): PointerPrecompileContract => { + return new ethers.Contract(precompileAddress, POINTER_PRECOMPILE_ABI as InterfaceAbi, runner) as PointerPrecompileContract; +}; diff --git a/packages/evm/src/precompiles/pointerview.ts b/packages/evm/src/precompiles/pointerview.ts new file mode 100644 index 00000000..3e140eba --- /dev/null +++ b/packages/evm/src/precompiles/pointerview.ts @@ -0,0 +1,176 @@ +import { Abi } from 'viem'; +import { ContractRunner, ethers, InterfaceAbi } from 'ethers'; + +/** + * Represents the functions available in the Pointer precompile contract, + * facilitating interoperability between the EVM and Cosmos. + * @category Cosmos Interoperability + */ +export interface PointerviewPrecompileFunctions { + /** + * Retrieves the pointer address, version, and existence status for the specified CW20 contract address. + * @param cwAddr The CW20 contract address to query. + * @returns A Promise resolving to an object containing the address, version, and existence status. + * @category Cosmos Interoperability + */ + getCW20Pointer(cwAddr: string): Promise<{ addr: string; version: number; exists: boolean }>; + + /** + * Retrieves the pointer address, version, and existence status for the specified CW721 contract address. + * @param cwAddr The CW721 contract address to query. + * @returns A Promise resolving to an object containing the address, version, and existence status. + * @category Cosmos Interoperability + */ + getCW721Pointer(cwAddr: string): Promise<{ addr: string; version: number; exists: boolean }>; + + /** + * Retrieves the pointer address, version, and existence status for the specified native token. + * @param token The native token to query. + * @returns A Promise resolving to an object containing the address, version, and existence status. + * @category Cosmos Interoperability + */ + getNativePointer(token: string): Promise<{ addr: string; version: number; exists: boolean }>; +} + +/** Represents the typed contract instance for the Pointer precompile contract. + * @category Cosmos Interoperability + */ +export type PointerviewPrecompileContract = ethers.Contract & PointerviewPrecompileFunctions; + +/** + * The address of the Pointer precompile contract, which can be used for interoperability between the EVM and Cosmos. + * + * @example + * Wagmi: Use the `useReadContract` hook to read the pointer of a CW20 contract. + * ```tsx + * import { POINTERVIEW_PRECOMPILE_ADDRESS, POINTERVIEW_PRECOMPILE_ABI } from '@sei-js/evm'; + * import { useReadContract } from 'wagmi'; + * + * // Make sure your component is wrapped in a WagmiProvider + * const { data } = useReadContract({ + * abi: POINTERVIEW_PRECOMPILE_ABI, + * address: POINTERVIEW_PRECOMPILE_ADDRESS, + * functionName: 'getCW20Pointer', + * args: ['CW20_CONTRACT_ADDRESS'] + * }); + * + * console.log(data); + * ``` + * + * @example + * ethers v6: Use the `ethers` library and precompiles to read the pointer of a CW20 contract. + * ```tsx + * import { POINTERVIEW_PRECOMPILE_ADDRESS, getPointerviewPrecompileEthersV6Contract } from '@sei-js/evm'; + * import { ethers } from 'ethers'; + * + * const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider + * const signer = await provider.getSigner(); + * + * const pointerviewPrecompileContract = getPointerviewPrecompileEthersV6Contract(POINTERVIEW_PRECOMPILE_ADDRESS, signer); + * + * const pointer = await pointerviewPrecompileContract.getCW20Pointer('CW20_CONTRACT_ADDRESS'); + * console.log(pointer); + * ``` + * + * @category Cosmos Interoperability + */ +export const POINTERVIEW_PRECOMPILE_ADDRESS: `0x${string}` = '0x000000000000000000000000000000000000100A'; + +/** + * The ABI for the precompile contract, which can be used for interoperability between the EVM and Cosmos. + * + * @example + * Wagmi: Use the `useReadContract` hook to read the pointer of a CW20 contract. + * ```tsx + * import { POINTERVIEW_PRECOMPILE_ADDRESS, POINTERVIEW_PRECOMPILE_ABI } from '@sei-js/evm'; + * import { useReadContract } from 'wagmi'; + * + * // Make sure your component is wrapped in a WagmiProvider + * const { data } = useReadContract({ + * abi: POINTERVIEW_PRECOMPILE_ABI, + * address: POINTERVIEW_PRECOMPILE_ADDRESS, + * functionName: 'getCW20Pointer', + * args: ['CW20_CONTRACT_ADDRESS'] + * }); + * + * console.log(data); + * ``` + * + * @example + * ethers v6: Use the `ethers` library and precompiles to read the pointer of a CW20 contract. + * ```tsx + * import { POINTERVIEW_PRECOMPILE_ADDRESS, POINTERVIEW_PRECOMPILE_ABI, PointerviewPrecompileContract } from '@sei-js/evm'; + * import { ethers } from 'ethers'; + * + * const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider + * const signer = await provider.getSigner(); + * + * const pointerviewPrecompileContract = new ethers.Contract(POINTERVIEW_PRECOMPILE_ADDRESS, POINTERVIEW_PRECOMPILE_ABI, signer) as PointerviewPrecompileContract; + * + * const pointer = await pointerviewPrecompileContract.getCW20Pointer('CW20_CONTRACT_ADDRESS'); + * console.log(pointer); + * ``` + * + * @category Cosmos Interoperability + */ +export const POINTERVIEW_PRECOMPILE_ABI: Abi = [ + { + inputs: [{ internalType: 'string', name: 'cwAddr', type: 'string' }], + name: 'getCW20Pointer', + outputs: [ + { internalType: 'address', name: 'addr', type: 'address' }, + { internalType: 'uint16', name: 'version', type: 'uint16' }, + { internalType: 'bool', name: 'exists', type: 'bool' } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [{ internalType: 'string', name: 'cwAddr', type: 'string' }], + name: 'getCW721Pointer', + outputs: [ + { internalType: 'address', name: 'addr', type: 'address' }, + { internalType: 'uint16', name: 'version', type: 'uint16' }, + { internalType: 'bool', name: 'exists', type: 'bool' } + ], + stateMutability: 'view', + type: 'function' + }, + { + inputs: [{ internalType: 'string', name: 'token', type: 'string' }], + name: 'getNativePointer', + outputs: [ + { internalType: 'address', name: 'addr', type: 'address' }, + { internalType: 'uint16', name: 'version', type: 'uint16' }, + { internalType: 'bool', name: 'exists', type: 'bool' } + ], + stateMutability: 'view', + type: 'function' + } +]; + +/** + * Creates and returns an ethers v6 contract instance with the provided signer, for use in interoperability between the EVM and Cosmos. + * + * @example + * ```tsx + * import { POINTERVIEW_PRECOMPILE_ADDRESS, getPointerviewPrecompileEthersV6Contract } from '@sei-js/evm'; + * import { ethers } from 'ethers'; + * + * const provider = new ethers.BrowserProvider(window.ethereum); // or any other provider + * const signer = await provider.getSigner(); + * + * const pointerviewPrecompileContract = getPointerviewPrecompileEthersV6Contract(POINTERVIEW_PRECOMPILE_ADDRESS, signer); + * + * const pointer = await pointerviewPrecompileContract.getCW20Pointer('CW20_CONTRACT_ADDRESS'); + * console.log(pointer); + * ``` + * + * @param precompileAddress The 0X address of the precompile contract. + * @param runner a [Provider](https://docs.ethers.org/v6/api/providers/) (read-only) or ethers.Signer to use with the contract. + * @returns The typed contract instance allowing interaction with the precompile contract. + * @category Cosmos Interoperability + */ +export const getPointerviewPrecompileEthersV6Contract = (precompileAddress: `0x${string}`, runner: ContractRunner): PointerviewPrecompileContract => { + return new ethers.Contract(precompileAddress, POINTERVIEW_PRECOMPILE_ABI as InterfaceAbi, runner) as PointerviewPrecompileContract; +}; diff --git a/packages/evm/src/precompiles/wasm.ts b/packages/evm/src/precompiles/wasm.ts index be280bfb..b51af5a3 100644 --- a/packages/evm/src/precompiles/wasm.ts +++ b/packages/evm/src/precompiles/wasm.ts @@ -111,6 +111,24 @@ export const WASM_PRECOMPILE_ABI: Abi = [ stateMutability: 'payable', type: 'function' }, + { + inputs: [ + { + components: [ + { internalType: 'string', name: 'contractAddress', type: 'string' }, + { internalType: 'bytes', name: 'msg', type: 'bytes' }, + { internalType: 'bytes', name: 'coins', type: 'bytes' } + ], + internalType: 'struct IWasmd.ExecuteMsg[]', + name: 'executeMsgs', + type: 'tuple[]' + } + ], + name: 'execute_batch', + outputs: [{ internalType: 'bytes[]', name: 'responses', type: 'bytes[]' }], + stateMutability: 'payable', + type: 'function' + }, { inputs: [ { internalType: 'uint64', name: 'codeID', type: 'uint64' }, diff --git a/packages/proto/scripts/codegen.js b/packages/proto/scripts/codegen.js index dfd6d6d3..fcf03a6d 100644 --- a/packages/proto/scripts/codegen.js +++ b/packages/proto/scripts/codegen.js @@ -30,7 +30,6 @@ telescope({ 'cosmos.capability.v1beta1', 'cosmos.crisis.v1beta1', 'cosmos.evidence.v1beta1', - 'cosmos.feegrant.v1beta1', 'cosmos.genutil.v1beta1', 'cosmos.gov.v1', 'cosmos.group.v1', diff --git a/packages/proto/src/codegen/cosmos/bundle.ts b/packages/proto/src/codegen/cosmos/bundle.ts index 832f7b8f..be90095f 100644 --- a/packages/proto/src/codegen/cosmos/bundle.ts +++ b/packages/proto/src/codegen/cosmos/bundle.ts @@ -20,61 +20,70 @@ import * as _21 from './distribution/v1beta1/distribution'; import * as _22 from './distribution/v1beta1/genesis'; import * as _23 from './distribution/v1beta1/query'; import * as _24 from './distribution/v1beta1/tx'; -import * as _25 from './gov/v1beta1/genesis'; -import * as _26 from './gov/v1beta1/gov'; -import * as _27 from './gov/v1beta1/query'; -import * as _28 from './gov/v1beta1/tx'; -import * as _29 from './staking/v1beta1/authz'; -import * as _30 from './staking/v1beta1/genesis'; -import * as _31 from './staking/v1beta1/query'; -import * as _32 from './staking/v1beta1/staking'; -import * as _33 from './staking/v1beta1/tx'; -import * as _34 from './tx/signing/v1beta1/signing'; -import * as _35 from './tx/v1beta1/service'; -import * as _36 from './tx/v1beta1/tx'; -import * as _37 from './upgrade/v1beta1/query'; -import * as _38 from './upgrade/v1beta1/tx'; -import * as _39 from './upgrade/v1beta1/upgrade'; -import * as _133 from './bank/v1beta1/tx.amino'; -import * as _134 from './distribution/v1beta1/tx.amino'; -import * as _135 from './gov/v1beta1/tx.amino'; -import * as _136 from './staking/v1beta1/tx.amino'; -import * as _137 from './upgrade/v1beta1/tx.amino'; -import * as _138 from './bank/v1beta1/tx.registry'; -import * as _139 from './distribution/v1beta1/tx.registry'; -import * as _140 from './gov/v1beta1/tx.registry'; -import * as _141 from './staking/v1beta1/tx.registry'; -import * as _142 from './upgrade/v1beta1/tx.registry'; -import * as _143 from './auth/v1beta1/query.lcd'; -import * as _144 from './bank/v1beta1/query.lcd'; -import * as _145 from './distribution/v1beta1/query.lcd'; -import * as _146 from './gov/v1beta1/query.lcd'; -import * as _147 from './staking/v1beta1/query.lcd'; -import * as _148 from './tx/v1beta1/service.lcd'; -import * as _149 from './upgrade/v1beta1/query.lcd'; -import * as _150 from './auth/v1beta1/query.rpc.Query'; -import * as _151 from './bank/v1beta1/query.rpc.Query'; -import * as _152 from './distribution/v1beta1/query.rpc.Query'; -import * as _153 from './gov/v1beta1/query.rpc.Query'; -import * as _154 from './staking/v1beta1/query.rpc.Query'; -import * as _155 from './tx/v1beta1/service.rpc.Service'; -import * as _156 from './upgrade/v1beta1/query.rpc.Query'; -import * as _157 from './bank/v1beta1/tx.rpc.msg'; -import * as _158 from './distribution/v1beta1/tx.rpc.msg'; -import * as _159 from './gov/v1beta1/tx.rpc.msg'; -import * as _160 from './staking/v1beta1/tx.rpc.msg'; -import * as _161 from './upgrade/v1beta1/tx.rpc.msg'; -import * as _211 from './lcd'; -import * as _212 from './rpc.query'; -import * as _213 from './rpc.tx'; +import * as _25 from './feegrant/v1beta1/feegrant'; +import * as _26 from './feegrant/v1beta1/genesis'; +import * as _27 from './feegrant/v1beta1/query'; +import * as _28 from './feegrant/v1beta1/tx'; +import * as _29 from './gov/v1beta1/genesis'; +import * as _30 from './gov/v1beta1/gov'; +import * as _31 from './gov/v1beta1/query'; +import * as _32 from './gov/v1beta1/tx'; +import * as _33 from './staking/v1beta1/authz'; +import * as _34 from './staking/v1beta1/genesis'; +import * as _35 from './staking/v1beta1/query'; +import * as _36 from './staking/v1beta1/staking'; +import * as _37 from './staking/v1beta1/tx'; +import * as _38 from './tx/signing/v1beta1/signing'; +import * as _39 from './tx/v1beta1/service'; +import * as _40 from './tx/v1beta1/tx'; +import * as _41 from './upgrade/v1beta1/query'; +import * as _42 from './upgrade/v1beta1/tx'; +import * as _43 from './upgrade/v1beta1/upgrade'; +import * as _137 from './bank/v1beta1/tx.amino'; +import * as _138 from './distribution/v1beta1/tx.amino'; +import * as _139 from './feegrant/v1beta1/tx.amino'; +import * as _140 from './gov/v1beta1/tx.amino'; +import * as _141 from './staking/v1beta1/tx.amino'; +import * as _142 from './upgrade/v1beta1/tx.amino'; +import * as _143 from './bank/v1beta1/tx.registry'; +import * as _144 from './distribution/v1beta1/tx.registry'; +import * as _145 from './feegrant/v1beta1/tx.registry'; +import * as _146 from './gov/v1beta1/tx.registry'; +import * as _147 from './staking/v1beta1/tx.registry'; +import * as _148 from './upgrade/v1beta1/tx.registry'; +import * as _149 from './auth/v1beta1/query.lcd'; +import * as _150 from './bank/v1beta1/query.lcd'; +import * as _151 from './distribution/v1beta1/query.lcd'; +import * as _152 from './feegrant/v1beta1/query.lcd'; +import * as _153 from './gov/v1beta1/query.lcd'; +import * as _154 from './staking/v1beta1/query.lcd'; +import * as _155 from './tx/v1beta1/service.lcd'; +import * as _156 from './upgrade/v1beta1/query.lcd'; +import * as _157 from './auth/v1beta1/query.rpc.Query'; +import * as _158 from './bank/v1beta1/query.rpc.Query'; +import * as _159 from './distribution/v1beta1/query.rpc.Query'; +import * as _160 from './feegrant/v1beta1/query.rpc.Query'; +import * as _161 from './gov/v1beta1/query.rpc.Query'; +import * as _162 from './staking/v1beta1/query.rpc.Query'; +import * as _163 from './tx/v1beta1/service.rpc.Service'; +import * as _164 from './upgrade/v1beta1/query.rpc.Query'; +import * as _165 from './bank/v1beta1/tx.rpc.msg'; +import * as _166 from './distribution/v1beta1/tx.rpc.msg'; +import * as _167 from './feegrant/v1beta1/tx.rpc.msg'; +import * as _168 from './gov/v1beta1/tx.rpc.msg'; +import * as _169 from './staking/v1beta1/tx.rpc.msg'; +import * as _170 from './upgrade/v1beta1/tx.rpc.msg'; +import * as _220 from './lcd'; +import * as _221 from './rpc.query'; +import * as _222 from './rpc.tx'; export namespace cosmos { export namespace auth { export const v1beta1 = { ..._3, ..._4, ..._5, - ..._143, - ..._150 + ..._149, + ..._157 }; } export namespace bank { @@ -84,11 +93,11 @@ export namespace cosmos { ..._8, ..._9, ..._10, - ..._133, - ..._138, - ..._144, - ..._151, - ..._157 + ..._137, + ..._143, + ..._150, + ..._158, + ..._165 }; } export namespace base { @@ -141,68 +150,81 @@ export namespace cosmos { ..._22, ..._23, ..._24, - ..._134, - ..._139, - ..._145, - ..._152, - ..._158 + ..._138, + ..._144, + ..._151, + ..._159, + ..._166 }; } - export namespace gov { + export namespace feegrant { export const v1beta1 = { ..._25, ..._26, ..._27, ..._28, - ..._135, - ..._140, - ..._146, - ..._153, - ..._159 + ..._139, + ..._145, + ..._152, + ..._160, + ..._167 }; } - export namespace staking { + export namespace gov { export const v1beta1 = { ..._29, ..._30, ..._31, ..._32, + ..._140, + ..._146, + ..._153, + ..._161, + ..._168 + }; + } + export namespace staking { + export const v1beta1 = { ..._33, - ..._136, + ..._34, + ..._35, + ..._36, + ..._37, ..._141, ..._147, ..._154, - ..._160 + ..._162, + ..._169 }; } export namespace tx { export namespace signing { export const v1beta1 = { - ..._34 + ..._38 }; } export const v1beta1 = { - ..._35, - ..._36, - ..._148, - ..._155 + ..._39, + ..._40, + ..._155, + ..._163 }; } export namespace upgrade { export const v1beta1 = { - ..._37, - ..._38, - ..._39, - ..._137, + ..._41, + ..._42, + ..._43, ..._142, - ..._149, + ..._148, ..._156, - ..._161 + ..._164, + ..._170 }; } export const ClientFactory = { - ..._211, - ..._212, - ..._213 + ..._220, + ..._221, + ..._222 }; } diff --git a/packages/proto/src/codegen/cosmos/client.ts b/packages/proto/src/codegen/cosmos/client.ts index 6272fc74..c46b9516 100644 --- a/packages/proto/src/codegen/cosmos/client.ts +++ b/packages/proto/src/codegen/cosmos/client.ts @@ -3,17 +3,20 @@ import { AminoTypes, SigningStargateClient } from '@cosmjs/stargate'; import { HttpEndpoint } from '@cosmjs/tendermint-rpc'; 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 cosmosGovV1beta1TxRegistry from './gov/v1beta1/tx.registry'; import * as cosmosStakingV1beta1TxRegistry from './staking/v1beta1/tx.registry'; import * as cosmosUpgradeV1beta1TxRegistry from './upgrade/v1beta1/tx.registry'; 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 cosmosGovV1beta1TxAmino from './gov/v1beta1/tx.amino'; import * as cosmosStakingV1beta1TxAmino from './staking/v1beta1/tx.amino'; import * as cosmosUpgradeV1beta1TxAmino from './upgrade/v1beta1/tx.amino'; export const cosmosAminoConverters = { ...cosmosBankV1beta1TxAmino.AminoConverter, ...cosmosDistributionV1beta1TxAmino.AminoConverter, + ...cosmosFeegrantV1beta1TxAmino.AminoConverter, ...cosmosGovV1beta1TxAmino.AminoConverter, ...cosmosStakingV1beta1TxAmino.AminoConverter, ...cosmosUpgradeV1beta1TxAmino.AminoConverter @@ -21,6 +24,7 @@ export const cosmosAminoConverters = { export const cosmosProtoRegistry: ReadonlyArray<[string, GeneratedType]> = [ ...cosmosBankV1beta1TxRegistry.registry, ...cosmosDistributionV1beta1TxRegistry.registry, + ...cosmosFeegrantV1beta1TxRegistry.registry, ...cosmosGovV1beta1TxRegistry.registry, ...cosmosStakingV1beta1TxRegistry.registry, ...cosmosUpgradeV1beta1TxRegistry.registry diff --git a/packages/proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts new file mode 100644 index 00000000..4d0171a3 --- /dev/null +++ b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/feegrant.ts @@ -0,0 +1,631 @@ +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 tokens + * 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 tokens that can be spent + * by this allowance and will be updated as tokens 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 tokens + * that optionally expires. The grantee can use up to SpendLimit to cover fees. + */ +export interface BasicAllowanceAmino { + /** + * spend_limit specifies the maximum amount of tokens that can be spent + * by this allowance and will be updated as tokens 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 tokens + * 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): 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())); + 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): BasicAllowanceAmino { + const obj: any = {}; + if (message.spendLimit) { + obj.spend_limit = message.spendLimit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.spend_limit = message.spendLimit; + } + obj.expiration = message.expiration ? Timestamp.toAmino(toTimestamp(message.expiration)) : undefined; + return obj; + }, + fromAminoMsg(object: BasicAllowanceAminoMsg): BasicAllowance { + return BasicAllowance.fromAmino(object.value); + }, + toAminoMsg(message: BasicAllowance): BasicAllowanceAminoMsg { + return { + type: "cosmos-sdk/BasicAllowance", + value: BasicAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: BasicAllowanceProtoMsg): BasicAllowance { + return BasicAllowance.decode(message.value); + }, + 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): 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()); + break; + case 2: + message.period = Duration.decode(reader, reader.uint32()); + break; + case 3: + message.periodSpendLimit.push(Coin.decode(reader, reader.uint32())); + break; + case 4: + message.periodCanSpend.push(Coin.decode(reader, reader.uint32())); + 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): PeriodicAllowanceAmino { + const obj: any = {}; + obj.basic = message.basic ? BasicAllowance.toAmino(message.basic) : undefined; + obj.period = message.period ? Duration.toAmino(message.period) : undefined; + if (message.periodSpendLimit) { + obj.period_spend_limit = message.periodSpendLimit.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.period_spend_limit = message.periodSpendLimit; + } + if (message.periodCanSpend) { + obj.period_can_spend = message.periodCanSpend.map(e => e ? Coin.toAmino(e) : undefined); + } else { + obj.period_can_spend = message.periodCanSpend; + } + obj.period_reset = message.periodReset ? Timestamp.toAmino(toTimestamp(message.periodReset)) : undefined; + return obj; + }, + fromAminoMsg(object: PeriodicAllowanceAminoMsg): PeriodicAllowance { + return PeriodicAllowance.fromAmino(object.value); + }, + toAminoMsg(message: PeriodicAllowance): PeriodicAllowanceAminoMsg { + return { + type: "cosmos-sdk/PeriodicAllowance", + value: PeriodicAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: PeriodicAllowanceProtoMsg): PeriodicAllowance { + return PeriodicAllowance.decode(message.value); + }, + 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): 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 = (Cosmos_feegrantFeeAllowanceI_InterfaceDecoder(reader) as Any); + 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_feegrantFeeAllowanceI_FromAmino(object.allowance); + } + message.allowedMessages = object.allowed_messages?.map(e => e) || []; + return message; + }, + toAmino(message: AllowedMsgAllowance): AllowedMsgAllowanceAmino { + const obj: any = {}; + obj.allowance = message.allowance ? Cosmos_feegrantFeeAllowanceI_ToAmino((message.allowance as Any)) : undefined; + if (message.allowedMessages) { + obj.allowed_messages = message.allowedMessages.map(e => e); + } else { + obj.allowed_messages = message.allowedMessages; + } + return obj; + }, + fromAminoMsg(object: AllowedMsgAllowanceAminoMsg): AllowedMsgAllowance { + return AllowedMsgAllowance.fromAmino(object.value); + }, + toAminoMsg(message: AllowedMsgAllowance): AllowedMsgAllowanceAminoMsg { + return { + type: "cosmos-sdk/AllowedMsgAllowance", + value: AllowedMsgAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: AllowedMsgAllowanceProtoMsg): AllowedMsgAllowance { + return AllowedMsgAllowance.decode(message.value); + }, + 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): 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 = (Cosmos_feegrantFeeAllowanceI_InterfaceDecoder(reader) as Any); + 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_feegrantFeeAllowanceI_FromAmino(object.allowance); + } + return message; + }, + toAmino(message: Grant): GrantAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.allowance = message.allowance ? Cosmos_feegrantFeeAllowanceI_ToAmino((message.allowance as Any)) : undefined; + return obj; + }, + fromAminoMsg(object: GrantAminoMsg): Grant { + return Grant.fromAmino(object.value); + }, + toAminoMsg(message: Grant): GrantAminoMsg { + return { + type: "cosmos-sdk/Grant", + value: Grant.toAmino(message) + }; + }, + fromProtoMsg(message: GrantProtoMsg): Grant { + return Grant.decode(message.value); + }, + 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_feegrantFeeAllowanceI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return BasicAllowance.decode(data.value); + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return PeriodicAllowance.decode(data.value); + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return AllowedMsgAllowance.decode(data.value); + default: + return data; + } +}; +export const Cosmos_feegrantFeeAllowanceI_FromAmino = (content: AnyAmino): Any => { + 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_feegrantFeeAllowanceI_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return { + type: "cosmos-sdk/BasicAllowance", + value: BasicAllowance.toAmino(BasicAllowance.decode(content.value, undefined)) + }; + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return { + type: "cosmos-sdk/PeriodicAllowance", + value: PeriodicAllowance.toAmino(PeriodicAllowance.decode(content.value, undefined)) + }; + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return { + type: "cosmos-sdk/AllowedMsgAllowance", + value: AllowedMsgAllowance.toAmino(AllowedMsgAllowance.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/packages/proto/src/codegen/cosmos/feegrant/v1beta1/genesis.ts b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/genesis.ts new file mode 100644 index 00000000..d59a42b6 --- /dev/null +++ b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/genesis.ts @@ -0,0 +1,93 @@ +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): 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())); + 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): GenesisStateAmino { + const obj: any = {}; + if (message.allowances) { + obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e) : undefined); + } else { + obj.allowances = message.allowances; + } + return obj; + }, + fromAminoMsg(object: GenesisStateAminoMsg): GenesisState { + return GenesisState.fromAmino(object.value); + }, + toAminoMsg(message: GenesisState): GenesisStateAminoMsg { + return { + type: "cosmos-sdk/GenesisState", + value: GenesisState.toAmino(message) + }; + }, + fromProtoMsg(message: GenesisStateProtoMsg): GenesisState { + return GenesisState.decode(message.value); + }, + 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/proto/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts new file mode 100644 index 00000000..6ecda480 --- /dev/null +++ b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.lcd.ts @@ -0,0 +1,44 @@ +import { setPaginationParams } from "../../../helpers"; +import { LCDClient } from "@cosmology/lcd"; +import { QueryAllowanceRequest, QueryAllowanceResponseSDKType, QueryAllowancesRequest, QueryAllowancesResponseSDKType, QueryAllowancesByGranterRequest, QueryAllowancesByGranterResponseSDKType } from "./query"; +export class LCDQueryClient { + req: LCDClient; + constructor({ + requestClient + }: { + requestClient: LCDClient; + }) { + this.req = requestClient; + this.allowance = this.allowance.bind(this); + this.allowances = this.allowances.bind(this); + this.allowancesByGranter = this.allowancesByGranter.bind(this); + } + /* Allowance returns fee granted to the grantee by the granter. */ + async allowance(params: QueryAllowanceRequest): Promise { + const endpoint = `cosmos/feegrant/v1beta1/allowance/${params.granter}/${params.grantee}`; + return await this.req.get(endpoint); + } + /* Allowances returns all the grants for address. */ + async allowances(params: QueryAllowancesRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/feegrant/v1beta1/allowances/${params.grantee}`; + return await this.req.get(endpoint, options); + } + /* AllowancesByGranter returns all the grants given by an address + Since v0.46 */ + async allowancesByGranter(params: QueryAllowancesByGranterRequest): Promise { + const options: any = { + params: {} + }; + if (typeof params?.pagination !== "undefined") { + setPaginationParams(options, params.pagination); + } + const endpoint = `cosmos/feegrant/v1beta1/issued/${params.granter}`; + return await this.req.get(endpoint, options); + } +} \ No newline at end of file diff --git a/packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts new file mode 100644 index 00000000..48f1a154 --- /dev/null +++ b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.rpc.Query.ts @@ -0,0 +1,55 @@ +import { TxRpc } from "../../../types"; +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 fee granted to the grantee by the granter. */ + allowance(request: QueryAllowanceRequest): Promise; + /** Allowances returns all the grants for address. */ + allowances(request: QueryAllowancesRequest): Promise; + /** + * AllowancesByGranter returns all the grants given by an address + * Since v0.46 + */ + allowancesByGranter(request: QueryAllowancesByGranterRequest): Promise; +} +export class QueryClientImpl implements Query { + private readonly rpc: TxRpc; + constructor(rpc: TxRpc) { + this.rpc = rpc; + this.allowance = this.allowance.bind(this); + this.allowances = this.allowances.bind(this); + this.allowancesByGranter = this.allowancesByGranter.bind(this); + } + allowance(request: QueryAllowanceRequest): 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))); + } + allowances(request: QueryAllowancesRequest): 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))); + } + allowancesByGranter(request: QueryAllowancesByGranterRequest): 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))); + } +} +export const createRpcQueryExtension = (base: QueryClient) => { + const rpc = createProtobufRpcClient(base); + const queryService = new QueryClientImpl(rpc); + return { + allowance(request: QueryAllowanceRequest): Promise { + return queryService.allowance(request); + }, + allowances(request: QueryAllowancesRequest): Promise { + return queryService.allowances(request); + }, + allowancesByGranter(request: QueryAllowancesByGranterRequest): Promise { + return queryService.allowancesByGranter(request); + } + }; +}; \ No newline at end of file diff --git a/packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.ts b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.ts new file mode 100644 index 00000000..01eb41b9 --- /dev/null +++ b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/query.ts @@ -0,0 +1,634 @@ +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): 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): QueryAllowanceRequestAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: QueryAllowanceRequestAminoMsg): QueryAllowanceRequest { + return QueryAllowanceRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowanceRequest): QueryAllowanceRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllowanceRequest", + value: QueryAllowanceRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowanceRequestProtoMsg): QueryAllowanceRequest { + return QueryAllowanceRequest.decode(message.value); + }, + 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): 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()); + 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): QueryAllowanceResponseAmino { + const obj: any = {}; + obj.allowance = message.allowance ? Grant.toAmino(message.allowance) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowanceResponseAminoMsg): QueryAllowanceResponse { + return QueryAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowanceResponse): QueryAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllowanceResponse", + value: QueryAllowanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowanceResponseProtoMsg): QueryAllowanceResponse { + return QueryAllowanceResponse.decode(message.value); + }, + 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): 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()); + 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): QueryAllowancesRequestAmino { + const obj: any = {}; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesRequestAminoMsg): QueryAllowancesRequest { + return QueryAllowancesRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesRequest): QueryAllowancesRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesRequest", + value: QueryAllowancesRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowancesRequestProtoMsg): QueryAllowancesRequest { + return QueryAllowancesRequest.decode(message.value); + }, + 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): 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())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + 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): QueryAllowancesResponseAmino { + const obj: any = {}; + if (message.allowances) { + obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e) : undefined); + } else { + obj.allowances = message.allowances; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesResponseAminoMsg): QueryAllowancesResponse { + return QueryAllowancesResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesResponse): QueryAllowancesResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesResponse", + value: QueryAllowancesResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowancesResponseProtoMsg): QueryAllowancesResponse { + return QueryAllowancesResponse.decode(message.value); + }, + 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): 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()); + 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): QueryAllowancesByGranterRequestAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.pagination = message.pagination ? PageRequest.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesByGranterRequestAminoMsg): QueryAllowancesByGranterRequest { + return QueryAllowancesByGranterRequest.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesByGranterRequest): QueryAllowancesByGranterRequestAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesByGranterRequest", + value: QueryAllowancesByGranterRequest.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowancesByGranterRequestProtoMsg): QueryAllowancesByGranterRequest { + return QueryAllowancesByGranterRequest.decode(message.value); + }, + 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): 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())); + break; + case 2: + message.pagination = PageResponse.decode(reader, reader.uint32()); + 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): QueryAllowancesByGranterResponseAmino { + const obj: any = {}; + if (message.allowances) { + obj.allowances = message.allowances.map(e => e ? Grant.toAmino(e) : undefined); + } else { + obj.allowances = message.allowances; + } + obj.pagination = message.pagination ? PageResponse.toAmino(message.pagination) : undefined; + return obj; + }, + fromAminoMsg(object: QueryAllowancesByGranterResponseAminoMsg): QueryAllowancesByGranterResponse { + return QueryAllowancesByGranterResponse.fromAmino(object.value); + }, + toAminoMsg(message: QueryAllowancesByGranterResponse): QueryAllowancesByGranterResponseAminoMsg { + return { + type: "cosmos-sdk/QueryAllowancesByGranterResponse", + value: QueryAllowancesByGranterResponse.toAmino(message) + }; + }, + fromProtoMsg(message: QueryAllowancesByGranterResponseProtoMsg): QueryAllowancesByGranterResponse { + return QueryAllowancesByGranterResponse.decode(message.value); + }, + 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/proto/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts new file mode 100644 index 00000000..1a5cbbbd --- /dev/null +++ b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.amino.ts @@ -0,0 +1,13 @@ +import { MsgGrantAllowance, MsgRevokeAllowance } 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 + } +}; \ No newline at end of file diff --git a/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts new file mode 100644 index 00000000..40972d95 --- /dev/null +++ b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.registry.ts @@ -0,0 +1,53 @@ +import { TelescopeGeneratedType } from "../../../types"; +import { Registry } from "@cosmjs/proto-signing"; +import { MsgGrantAllowance, MsgRevokeAllowance } from "./tx"; +export const registry: ReadonlyArray<[string, TelescopeGeneratedType]> = [["/cosmos.feegrant.v1beta1.MsgGrantAllowance", MsgGrantAllowance], ["/cosmos.feegrant.v1beta1.MsgRevokeAllowance", MsgRevokeAllowance]]; +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() + }; + } + }, + withTypeUrl: { + grantAllowance(value: MsgGrantAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgGrantAllowance", + value + }; + }, + revokeAllowance(value: MsgRevokeAllowance) { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowance", + 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) + }; + } + } +}; \ No newline at end of file diff --git a/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts new file mode 100644 index 00000000..c587e720 --- /dev/null +++ b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.rpc.msg.ts @@ -0,0 +1,34 @@ +import { TxRpc } from "../../../types"; +import { BinaryReader } from "../../../binary"; +import { MsgGrantAllowance, MsgGrantAllowanceResponse, MsgRevokeAllowance, MsgRevokeAllowanceResponse } 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; +} +export class MsgClientImpl implements Msg { + private readonly rpc: TxRpc; + constructor(rpc: TxRpc) { + this.rpc = rpc; + this.grantAllowance = this.grantAllowance.bind(this); + this.revokeAllowance = this.revokeAllowance.bind(this); + } + grantAllowance(request: MsgGrantAllowance): 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))); + } + revokeAllowance(request: MsgRevokeAllowance): 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))); + } +} \ No newline at end of file diff --git a/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts new file mode 100644 index 00000000..93f078df --- /dev/null +++ b/packages/proto/src/codegen/cosmos/feegrant/v1beta1/tx.ts @@ -0,0 +1,444 @@ +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 {} +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): 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 = (Cosmos_feegrantFeeAllowanceI_InterfaceDecoder(reader) as Any); + 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_feegrantFeeAllowanceI_FromAmino(object.allowance); + } + return message; + }, + toAmino(message: MsgGrantAllowance): MsgGrantAllowanceAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + obj.allowance = message.allowance ? Cosmos_feegrantFeeAllowanceI_ToAmino((message.allowance as Any)) : undefined; + return obj; + }, + fromAminoMsg(object: MsgGrantAllowanceAminoMsg): MsgGrantAllowance { + return MsgGrantAllowance.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantAllowance): MsgGrantAllowanceAminoMsg { + return { + type: "cosmos-sdk/MsgGrantAllowance", + value: MsgGrantAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantAllowanceProtoMsg): MsgGrantAllowance { + return MsgGrantAllowance.decode(message.value); + }, + 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): 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): MsgGrantAllowanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgGrantAllowanceResponseAminoMsg): MsgGrantAllowanceResponse { + return MsgGrantAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgGrantAllowanceResponse): MsgGrantAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/MsgGrantAllowanceResponse", + value: MsgGrantAllowanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgGrantAllowanceResponseProtoMsg): MsgGrantAllowanceResponse { + return MsgGrantAllowanceResponse.decode(message.value); + }, + 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): 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): MsgRevokeAllowanceAmino { + const obj: any = {}; + obj.granter = message.granter === "" ? undefined : message.granter; + obj.grantee = message.grantee === "" ? undefined : message.grantee; + return obj; + }, + fromAminoMsg(object: MsgRevokeAllowanceAminoMsg): MsgRevokeAllowance { + return MsgRevokeAllowance.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeAllowance): MsgRevokeAllowanceAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeAllowance", + value: MsgRevokeAllowance.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeAllowanceProtoMsg): MsgRevokeAllowance { + return MsgRevokeAllowance.decode(message.value); + }, + 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): 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): MsgRevokeAllowanceResponseAmino { + const obj: any = {}; + return obj; + }, + fromAminoMsg(object: MsgRevokeAllowanceResponseAminoMsg): MsgRevokeAllowanceResponse { + return MsgRevokeAllowanceResponse.fromAmino(object.value); + }, + toAminoMsg(message: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseAminoMsg { + return { + type: "cosmos-sdk/MsgRevokeAllowanceResponse", + value: MsgRevokeAllowanceResponse.toAmino(message) + }; + }, + fromProtoMsg(message: MsgRevokeAllowanceResponseProtoMsg): MsgRevokeAllowanceResponse { + return MsgRevokeAllowanceResponse.decode(message.value); + }, + toProto(message: MsgRevokeAllowanceResponse): Uint8Array { + return MsgRevokeAllowanceResponse.encode(message).finish(); + }, + toProtoMsg(message: MsgRevokeAllowanceResponse): MsgRevokeAllowanceResponseProtoMsg { + return { + typeUrl: "/cosmos.feegrant.v1beta1.MsgRevokeAllowanceResponse", + value: MsgRevokeAllowanceResponse.encode(message).finish() + }; + } +}; +export const Cosmos_feegrantFeeAllowanceI_InterfaceDecoder = (input: BinaryReader | Uint8Array): BasicAllowance | PeriodicAllowance | AllowedMsgAllowance | Any => { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + const data = Any.decode(reader, reader.uint32()); + switch (data.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return BasicAllowance.decode(data.value); + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return PeriodicAllowance.decode(data.value); + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return AllowedMsgAllowance.decode(data.value); + default: + return data; + } +}; +export const Cosmos_feegrantFeeAllowanceI_FromAmino = (content: AnyAmino): Any => { + 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_feegrantFeeAllowanceI_ToAmino = (content: Any) => { + switch (content.typeUrl) { + case "/cosmos.feegrant.v1beta1.BasicAllowance": + return { + type: "cosmos-sdk/BasicAllowance", + value: BasicAllowance.toAmino(BasicAllowance.decode(content.value, undefined)) + }; + case "/cosmos.feegrant.v1beta1.PeriodicAllowance": + return { + type: "cosmos-sdk/PeriodicAllowance", + value: PeriodicAllowance.toAmino(PeriodicAllowance.decode(content.value, undefined)) + }; + case "/cosmos.feegrant.v1beta1.AllowedMsgAllowance": + return { + type: "cosmos-sdk/AllowedMsgAllowance", + value: AllowedMsgAllowance.toAmino(AllowedMsgAllowance.decode(content.value, undefined)) + }; + default: + return Any.toAmino(content); + } +}; \ No newline at end of file diff --git a/packages/proto/src/codegen/cosmos/lcd.ts b/packages/proto/src/codegen/cosmos/lcd.ts index 5b8bf576..ec90bce0 100644 --- a/packages/proto/src/codegen/cosmos/lcd.ts +++ b/packages/proto/src/codegen/cosmos/lcd.ts @@ -20,6 +20,11 @@ export const createLCDClient = async ({ restEndpoint }: { restEndpoint: string } requestClient }) }, + feegrant: { + v1beta1: new (await import('./feegrant/v1beta1/query.lcd')).LCDQueryClient({ + requestClient + }) + }, gov: { v1beta1: new (await import('./gov/v1beta1/query.lcd')).LCDQueryClient({ requestClient diff --git a/packages/proto/src/codegen/cosmos/rpc.query.ts b/packages/proto/src/codegen/cosmos/rpc.query.ts index 5aa4f2f2..5cd5a288 100644 --- a/packages/proto/src/codegen/cosmos/rpc.query.ts +++ b/packages/proto/src/codegen/cosmos/rpc.query.ts @@ -14,6 +14,9 @@ export const createRPCQueryClient = async ({ rpcEndpoint }: { rpcEndpoint: strin distribution: { v1beta1: (await import('./distribution/v1beta1/query.rpc.Query')).createRpcQueryExtension(client) }, + feegrant: { + v1beta1: (await import('./feegrant/v1beta1/query.rpc.Query')).createRpcQueryExtension(client) + }, gov: { v1beta1: (await import('./gov/v1beta1/query.rpc.Query')).createRpcQueryExtension(client) }, diff --git a/packages/proto/src/codegen/cosmos/rpc.tx.ts b/packages/proto/src/codegen/cosmos/rpc.tx.ts index 65538194..52b676b3 100644 --- a/packages/proto/src/codegen/cosmos/rpc.tx.ts +++ b/packages/proto/src/codegen/cosmos/rpc.tx.ts @@ -7,6 +7,9 @@ export const createRPCMsgClient = async ({ rpc }: { rpc: Rpc }) => ({ 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: { v1beta1: new (await import('./gov/v1beta1/tx.rpc.msg')).MsgClientImpl(rpc) }, diff --git a/packages/proto/src/codegen/cosmwasm/bundle.ts b/packages/proto/src/codegen/cosmwasm/bundle.ts index a1d8588d..0f45b09d 100644 --- a/packages/proto/src/codegen/cosmwasm/bundle.ts +++ b/packages/proto/src/codegen/cosmwasm/bundle.ts @@ -1,38 +1,38 @@ -import * as _40 from './wasm/v1/authz'; -import * as _41 from './wasm/v1/genesis'; -import * as _42 from './wasm/v1/ibc'; -import * as _43 from './wasm/v1/proposal'; -import * as _44 from './wasm/v1/query'; -import * as _45 from './wasm/v1/tx'; -import * as _46 from './wasm/v1/types'; -import * as _162 from './wasm/v1/tx.amino'; -import * as _163 from './wasm/v1/tx.registry'; -import * as _164 from './wasm/v1/query.lcd'; -import * as _165 from './wasm/v1/query.rpc.Query'; -import * as _166 from './wasm/v1/tx.rpc.msg'; -import * as _214 from './lcd'; -import * as _215 from './rpc.query'; -import * as _216 from './rpc.tx'; +import * as _44 from './wasm/v1/authz'; +import * as _45 from './wasm/v1/genesis'; +import * as _46 from './wasm/v1/ibc'; +import * as _47 from './wasm/v1/proposal'; +import * as _48 from './wasm/v1/query'; +import * as _49 from './wasm/v1/tx'; +import * as _50 from './wasm/v1/types'; +import * as _171 from './wasm/v1/tx.amino'; +import * as _172 from './wasm/v1/tx.registry'; +import * as _173 from './wasm/v1/query.lcd'; +import * as _174 from './wasm/v1/query.rpc.Query'; +import * as _175 from './wasm/v1/tx.rpc.msg'; +import * as _223 from './lcd'; +import * as _224 from './rpc.query'; +import * as _225 from './rpc.tx'; export namespace cosmwasm { export namespace wasm { export const v1 = { - ..._40, - ..._41, - ..._42, - ..._43, ..._44, ..._45, ..._46, - ..._162, - ..._163, - ..._164, - ..._165, - ..._166 + ..._47, + ..._48, + ..._49, + ..._50, + ..._171, + ..._172, + ..._173, + ..._174, + ..._175 }; } export const ClientFactory = { - ..._214, - ..._215, - ..._216 + ..._223, + ..._224, + ..._225 }; } diff --git a/packages/proto/src/codegen/cosmwasm/lcd.ts b/packages/proto/src/codegen/cosmwasm/lcd.ts index 2af0eeac..022d5b24 100644 --- a/packages/proto/src/codegen/cosmwasm/lcd.ts +++ b/packages/proto/src/codegen/cosmwasm/lcd.ts @@ -20,6 +20,11 @@ export const createLCDClient = async ({ restEndpoint }: { restEndpoint: string } requestClient }) }, + feegrant: { + v1beta1: new (await import('../cosmos/feegrant/v1beta1/query.lcd')).LCDQueryClient({ + requestClient + }) + }, gov: { v1beta1: new (await import('../cosmos/gov/v1beta1/query.lcd')).LCDQueryClient({ requestClient diff --git a/packages/proto/src/codegen/cosmwasm/rpc.query.ts b/packages/proto/src/codegen/cosmwasm/rpc.query.ts index 7b75d1db..4e0f1415 100644 --- a/packages/proto/src/codegen/cosmwasm/rpc.query.ts +++ b/packages/proto/src/codegen/cosmwasm/rpc.query.ts @@ -14,6 +14,9 @@ export const createRPCQueryClient = async ({ rpcEndpoint }: { rpcEndpoint: strin 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: { v1beta1: (await import('../cosmos/gov/v1beta1/query.rpc.Query')).createRpcQueryExtension(client) }, diff --git a/packages/proto/src/codegen/cosmwasm/rpc.tx.ts b/packages/proto/src/codegen/cosmwasm/rpc.tx.ts index 153f7c6a..5f385b8b 100644 --- a/packages/proto/src/codegen/cosmwasm/rpc.tx.ts +++ b/packages/proto/src/codegen/cosmwasm/rpc.tx.ts @@ -7,6 +7,9 @@ export const createRPCMsgClient = async ({ rpc }: { rpc: 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: { v1beta1: new (await import('../cosmos/gov/v1beta1/tx.rpc.msg')).MsgClientImpl(rpc) }, diff --git a/packages/proto/src/codegen/gogoproto/bundle.ts b/packages/proto/src/codegen/gogoproto/bundle.ts index 85245670..3709e0e1 100644 --- a/packages/proto/src/codegen/gogoproto/bundle.ts +++ b/packages/proto/src/codegen/gogoproto/bundle.ts @@ -1,4 +1,4 @@ -import * as _94 from './gogo'; +import * as _98 from './gogo'; export const gogoproto = { - ..._94 + ..._98 }; diff --git a/packages/proto/src/codegen/google/bundle.ts b/packages/proto/src/codegen/google/bundle.ts index 19782667..be79f805 100644 --- a/packages/proto/src/codegen/google/bundle.ts +++ b/packages/proto/src/codegen/google/bundle.ts @@ -1,14 +1,14 @@ -import * as _95 from './protobuf/any'; -import * as _96 from './protobuf/descriptor'; -import * as _97 from './protobuf/duration'; -import * as _98 from './protobuf/empty'; -import * as _99 from './protobuf/timestamp'; +import * as _99 from './protobuf/any'; +import * as _100 from './protobuf/descriptor'; +import * as _101 from './protobuf/duration'; +import * as _102 from './protobuf/empty'; +import * as _103 from './protobuf/timestamp'; export namespace google { export const protobuf = { - ..._95, - ..._96, - ..._97, - ..._98, - ..._99 + ..._99, + ..._100, + ..._101, + ..._102, + ..._103 }; } diff --git a/packages/proto/src/codegen/ibc/bundle.ts b/packages/proto/src/codegen/ibc/bundle.ts index 4bdc41e5..b085367e 100644 --- a/packages/proto/src/codegen/ibc/bundle.ts +++ b/packages/proto/src/codegen/ibc/bundle.ts @@ -1,136 +1,136 @@ -import * as _100 from './applications/transfer/v1/genesis'; -import * as _101 from './applications/transfer/v1/query'; -import * as _102 from './applications/transfer/v1/transfer'; -import * as _103 from './applications/transfer/v1/tx'; -import * as _104 from './applications/transfer/v2/packet'; -import * as _105 from './core/channel/v1/channel'; -import * as _106 from './core/channel/v1/genesis'; -import * as _107 from './core/channel/v1/query'; -import * as _108 from './core/channel/v1/tx'; -import * as _109 from './core/client/v1/client'; -import * as _110 from './core/client/v1/genesis'; -import * as _111 from './core/client/v1/query'; -import * as _112 from './core/client/v1/tx'; -import * as _113 from './core/commitment/v1/commitment'; -import * as _114 from './core/connection/v1/connection'; -import * as _115 from './core/connection/v1/genesis'; -import * as _116 from './core/connection/v1/query'; -import * as _117 from './core/connection/v1/tx'; -import * as _118 from './lightclients/localhost/v1/localhost'; -import * as _119 from './lightclients/solomachine/v1/solomachine'; -import * as _120 from './lightclients/solomachine/v2/solomachine'; -import * as _121 from './lightclients/tendermint/v1/tendermint'; -import * as _191 from './applications/transfer/v1/tx.amino'; -import * as _192 from './core/channel/v1/tx.amino'; -import * as _193 from './core/client/v1/tx.amino'; -import * as _194 from './core/connection/v1/tx.amino'; -import * as _195 from './applications/transfer/v1/tx.registry'; -import * as _196 from './core/channel/v1/tx.registry'; -import * as _197 from './core/client/v1/tx.registry'; -import * as _198 from './core/connection/v1/tx.registry'; -import * as _199 from './applications/transfer/v1/query.lcd'; -import * as _200 from './core/channel/v1/query.lcd'; -import * as _201 from './core/client/v1/query.lcd'; -import * as _202 from './core/connection/v1/query.lcd'; -import * as _203 from './applications/transfer/v1/query.rpc.Query'; -import * as _204 from './core/channel/v1/query.rpc.Query'; -import * as _205 from './core/client/v1/query.rpc.Query'; -import * as _206 from './core/connection/v1/query.rpc.Query'; -import * as _207 from './applications/transfer/v1/tx.rpc.msg'; -import * as _208 from './core/channel/v1/tx.rpc.msg'; -import * as _209 from './core/client/v1/tx.rpc.msg'; -import * as _210 from './core/connection/v1/tx.rpc.msg'; -import * as _220 from './lcd'; -import * as _221 from './rpc.query'; -import * as _222 from './rpc.tx'; +import * as _104 from './applications/transfer/v1/genesis'; +import * as _105 from './applications/transfer/v1/query'; +import * as _106 from './applications/transfer/v1/transfer'; +import * as _107 from './applications/transfer/v1/tx'; +import * as _108 from './applications/transfer/v2/packet'; +import * as _109 from './core/channel/v1/channel'; +import * as _110 from './core/channel/v1/genesis'; +import * as _111 from './core/channel/v1/query'; +import * as _112 from './core/channel/v1/tx'; +import * as _113 from './core/client/v1/client'; +import * as _114 from './core/client/v1/genesis'; +import * as _115 from './core/client/v1/query'; +import * as _116 from './core/client/v1/tx'; +import * as _117 from './core/commitment/v1/commitment'; +import * as _118 from './core/connection/v1/connection'; +import * as _119 from './core/connection/v1/genesis'; +import * as _120 from './core/connection/v1/query'; +import * as _121 from './core/connection/v1/tx'; +import * as _122 from './lightclients/localhost/v1/localhost'; +import * as _123 from './lightclients/solomachine/v1/solomachine'; +import * as _124 from './lightclients/solomachine/v2/solomachine'; +import * as _125 from './lightclients/tendermint/v1/tendermint'; +import * as _200 from './applications/transfer/v1/tx.amino'; +import * as _201 from './core/channel/v1/tx.amino'; +import * as _202 from './core/client/v1/tx.amino'; +import * as _203 from './core/connection/v1/tx.amino'; +import * as _204 from './applications/transfer/v1/tx.registry'; +import * as _205 from './core/channel/v1/tx.registry'; +import * as _206 from './core/client/v1/tx.registry'; +import * as _207 from './core/connection/v1/tx.registry'; +import * as _208 from './applications/transfer/v1/query.lcd'; +import * as _209 from './core/channel/v1/query.lcd'; +import * as _210 from './core/client/v1/query.lcd'; +import * as _211 from './core/connection/v1/query.lcd'; +import * as _212 from './applications/transfer/v1/query.rpc.Query'; +import * as _213 from './core/channel/v1/query.rpc.Query'; +import * as _214 from './core/client/v1/query.rpc.Query'; +import * as _215 from './core/connection/v1/query.rpc.Query'; +import * as _216 from './applications/transfer/v1/tx.rpc.msg'; +import * as _217 from './core/channel/v1/tx.rpc.msg'; +import * as _218 from './core/client/v1/tx.rpc.msg'; +import * as _219 from './core/connection/v1/tx.rpc.msg'; +import * as _229 from './lcd'; +import * as _230 from './rpc.query'; +import * as _231 from './rpc.tx'; export namespace ibc { export namespace applications { export namespace transfer { export const v1 = { - ..._100, - ..._101, - ..._102, - ..._103, - ..._191, - ..._195, - ..._199, - ..._203, - ..._207 - }; - export const v2 = { - ..._104 - }; - } - } - export namespace core { - export namespace channel { - export const v1 = { + ..._104, ..._105, ..._106, ..._107, - ..._108, - ..._192, - ..._196, ..._200, ..._204, - ..._208 + ..._208, + ..._212, + ..._216 + }; + export const v2 = { + ..._108 }; } - export namespace client { + } + export namespace core { + export namespace channel { export const v1 = { ..._109, ..._110, ..._111, ..._112, - ..._193, - ..._197, ..._201, ..._205, - ..._209 + ..._209, + ..._213, + ..._217 }; } - export namespace commitment { - export const v1 = { - ..._113 - }; - } - export namespace connection { + export namespace client { export const v1 = { + ..._113, ..._114, ..._115, ..._116, - ..._117, - ..._194, - ..._198, ..._202, ..._206, - ..._210 + ..._210, + ..._214, + ..._218 + }; + } + export namespace commitment { + export const v1 = { + ..._117 + }; + } + export namespace connection { + export const v1 = { + ..._118, + ..._119, + ..._120, + ..._121, + ..._203, + ..._207, + ..._211, + ..._215, + ..._219 }; } } export namespace lightclients { export namespace localhost { export const v1 = { - ..._118 + ..._122 }; } export namespace solomachine { export const v1 = { - ..._119 + ..._123 }; export const v2 = { - ..._120 + ..._124 }; } export namespace tendermint { export const v1 = { - ..._121 + ..._125 }; } } export const ClientFactory = { - ..._220, - ..._221, - ..._222 + ..._229, + ..._230, + ..._231 }; } diff --git a/packages/proto/src/codegen/ibc/lcd.ts b/packages/proto/src/codegen/ibc/lcd.ts index a3b2d890..900fb5cb 100644 --- a/packages/proto/src/codegen/ibc/lcd.ts +++ b/packages/proto/src/codegen/ibc/lcd.ts @@ -20,6 +20,11 @@ export const createLCDClient = async ({ restEndpoint }: { restEndpoint: string } requestClient }) }, + feegrant: { + v1beta1: new (await import('../cosmos/feegrant/v1beta1/query.lcd')).LCDQueryClient({ + requestClient + }) + }, gov: { v1beta1: new (await import('../cosmos/gov/v1beta1/query.lcd')).LCDQueryClient({ requestClient diff --git a/packages/proto/src/codegen/ibc/rpc.query.ts b/packages/proto/src/codegen/ibc/rpc.query.ts index 76588c34..2e60a3f9 100644 --- a/packages/proto/src/codegen/ibc/rpc.query.ts +++ b/packages/proto/src/codegen/ibc/rpc.query.ts @@ -14,6 +14,9 @@ export const createRPCQueryClient = async ({ rpcEndpoint }: { rpcEndpoint: strin 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: { v1beta1: (await import('../cosmos/gov/v1beta1/query.rpc.Query')).createRpcQueryExtension(client) }, diff --git a/packages/proto/src/codegen/ibc/rpc.tx.ts b/packages/proto/src/codegen/ibc/rpc.tx.ts index 16197617..5863d808 100644 --- a/packages/proto/src/codegen/ibc/rpc.tx.ts +++ b/packages/proto/src/codegen/ibc/rpc.tx.ts @@ -7,6 +7,9 @@ export const createRPCMsgClient = async ({ rpc }: { rpc: 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: { v1beta1: new (await import('../cosmos/gov/v1beta1/tx.rpc.msg')).MsgClientImpl(rpc) }, diff --git a/packages/proto/src/codegen/seiprotocol/bundle.ts b/packages/proto/src/codegen/seiprotocol/bundle.ts index c0a070cb..e342562d 100644 --- a/packages/proto/src/codegen/seiprotocol/bundle.ts +++ b/packages/proto/src/codegen/seiprotocol/bundle.ts @@ -1,84 +1,80 @@ -import * as _47 from '../dex/asset_list'; -import * as _48 from '../dex/contract'; -import * as _49 from '../dex/deposit'; -import * as _50 from '../dex/enums'; -import * as _51 from '../dex/genesis'; -import * as _52 from '../dex/gov'; -import * as _53 from '../dex/long_book'; -import * as _54 from '../dex/match_result'; -import * as _55 from '../dex/order_entry'; -import * as _56 from '../dex/order'; -import * as _57 from '../dex/pair'; -import * as _58 from '../dex/params'; -import * as _59 from '../dex/price'; -import * as _60 from '../dex/query'; -import * as _61 from '../dex/settlement'; -import * as _62 from '../dex/short_book'; -import * as _63 from '../dex/tick_size'; -import * as _64 from '../dex/twap'; -import * as _65 from '../dex/tx'; -import * as _66 from '../epoch/epoch'; -import * as _67 from '../epoch/genesis'; -import * as _68 from '../epoch/params'; -import * as _69 from '../epoch/query'; -import * as _70 from '../epoch/tx'; -import * as _71 from '../eth/tx'; -import * as _72 from '../evm/config'; -import * as _73 from '../evm/enums'; -import * as _74 from '../evm/genesis'; -import * as _75 from '../evm/gov'; -import * as _76 from '../evm/params'; -import * as _77 from '../evm/query'; -import * as _78 from '../evm/receipt'; -import * as _79 from '../evm/tx'; -import * as _80 from '../evm/types'; -import * as _81 from '../mint/v1beta1/genesis'; -import * as _82 from '../mint/v1beta1/gov'; -import * as _83 from '../mint/v1beta1/mint'; -import * as _84 from '../mint/v1beta1/query'; -import * as _85 from '../oracle/genesis'; -import * as _86 from '../oracle/oracle'; -import * as _87 from '../oracle/query'; -import * as _88 from '../oracle/tx'; -import * as _89 from '../tokenfactory/authorityMetadata'; -import * as _90 from '../tokenfactory/genesis'; -import * as _91 from '../tokenfactory/params'; -import * as _92 from '../tokenfactory/query'; -import * as _93 from '../tokenfactory/tx'; -import * as _167 from '../dex/tx.amino'; -import * as _168 from '../evm/tx.amino'; -import * as _169 from '../oracle/tx.amino'; -import * as _170 from '../tokenfactory/tx.amino'; -import * as _171 from '../dex/tx.registry'; -import * as _172 from '../evm/tx.registry'; -import * as _173 from '../oracle/tx.registry'; -import * as _174 from '../tokenfactory/tx.registry'; -import * as _175 from '../dex/query.lcd'; -import * as _176 from '../epoch/query.lcd'; -import * as _177 from '../evm/query.lcd'; -import * as _178 from '../mint/v1beta1/query.lcd'; -import * as _179 from '../oracle/query.lcd'; -import * as _180 from '../tokenfactory/query.lcd'; -import * as _181 from '../dex/query.rpc.Query'; -import * as _182 from '../epoch/query.rpc.Query'; -import * as _183 from '../evm/query.rpc.Query'; -import * as _184 from '../mint/v1beta1/query.rpc.Query'; -import * as _185 from '../oracle/query.rpc.Query'; -import * as _186 from '../tokenfactory/query.rpc.Query'; -import * as _187 from '../dex/tx.rpc.msg'; -import * as _188 from '../evm/tx.rpc.msg'; -import * as _189 from '../oracle/tx.rpc.msg'; -import * as _190 from '../tokenfactory/tx.rpc.msg'; -import * as _217 from './lcd'; -import * as _218 from './rpc.query'; -import * as _219 from './rpc.tx'; +import * as _51 from '../dex/asset_list'; +import * as _52 from '../dex/contract'; +import * as _53 from '../dex/deposit'; +import * as _54 from '../dex/enums'; +import * as _55 from '../dex/genesis'; +import * as _56 from '../dex/gov'; +import * as _57 from '../dex/long_book'; +import * as _58 from '../dex/match_result'; +import * as _59 from '../dex/order_entry'; +import * as _60 from '../dex/order'; +import * as _61 from '../dex/pair'; +import * as _62 from '../dex/params'; +import * as _63 from '../dex/price'; +import * as _64 from '../dex/query'; +import * as _65 from '../dex/settlement'; +import * as _66 from '../dex/short_book'; +import * as _67 from '../dex/tick_size'; +import * as _68 from '../dex/twap'; +import * as _69 from '../dex/tx'; +import * as _70 from '../epoch/epoch'; +import * as _71 from '../epoch/genesis'; +import * as _72 from '../epoch/params'; +import * as _73 from '../epoch/query'; +import * as _74 from '../epoch/tx'; +import * as _75 from '../eth/tx'; +import * as _76 from '../evm/config'; +import * as _77 from '../evm/enums'; +import * as _78 from '../evm/genesis'; +import * as _79 from '../evm/gov'; +import * as _80 from '../evm/params'; +import * as _81 from '../evm/query'; +import * as _82 from '../evm/receipt'; +import * as _83 from '../evm/tx'; +import * as _84 from '../evm/types'; +import * as _85 from '../mint/v1beta1/genesis'; +import * as _86 from '../mint/v1beta1/gov'; +import * as _87 from '../mint/v1beta1/mint'; +import * as _88 from '../mint/v1beta1/query'; +import * as _89 from '../oracle/genesis'; +import * as _90 from '../oracle/oracle'; +import * as _91 from '../oracle/query'; +import * as _92 from '../oracle/tx'; +import * as _93 from '../tokenfactory/authorityMetadata'; +import * as _94 from '../tokenfactory/genesis'; +import * as _95 from '../tokenfactory/params'; +import * as _96 from '../tokenfactory/query'; +import * as _97 from '../tokenfactory/tx'; +import * as _176 from '../dex/tx.amino'; +import * as _177 from '../evm/tx.amino'; +import * as _178 from '../oracle/tx.amino'; +import * as _179 from '../tokenfactory/tx.amino'; +import * as _180 from '../dex/tx.registry'; +import * as _181 from '../evm/tx.registry'; +import * as _182 from '../oracle/tx.registry'; +import * as _183 from '../tokenfactory/tx.registry'; +import * as _184 from '../dex/query.lcd'; +import * as _185 from '../epoch/query.lcd'; +import * as _186 from '../evm/query.lcd'; +import * as _187 from '../mint/v1beta1/query.lcd'; +import * as _188 from '../oracle/query.lcd'; +import * as _189 from '../tokenfactory/query.lcd'; +import * as _190 from '../dex/query.rpc.Query'; +import * as _191 from '../epoch/query.rpc.Query'; +import * as _192 from '../evm/query.rpc.Query'; +import * as _193 from '../mint/v1beta1/query.rpc.Query'; +import * as _194 from '../oracle/query.rpc.Query'; +import * as _195 from '../tokenfactory/query.rpc.Query'; +import * as _196 from '../dex/tx.rpc.msg'; +import * as _197 from '../evm/tx.rpc.msg'; +import * as _198 from '../oracle/tx.rpc.msg'; +import * as _199 from '../tokenfactory/tx.rpc.msg'; +import * as _226 from './lcd'; +import * as _227 from './rpc.query'; +import * as _228 from './rpc.tx'; export namespace seiprotocol { export namespace seichain { export const dex = { - ..._47, - ..._48, - ..._49, - ..._50, ..._51, ..._52, ..._53, @@ -94,75 +90,79 @@ export namespace seiprotocol { ..._63, ..._64, ..._65, - ..._167, - ..._171, - ..._175, - ..._181, - ..._187 - }; - export const epoch = { ..._66, ..._67, ..._68, ..._69, - ..._70, ..._176, - ..._182 - }; - export const eth = { - ..._71 + ..._180, + ..._184, + ..._190, + ..._196 }; - export const evm = { + export const epoch = { + ..._70, + ..._71, ..._72, ..._73, ..._74, - ..._75, + ..._185, + ..._191 + }; + export const eth = { + ..._75 + }; + export const evm = { ..._76, ..._77, ..._78, ..._79, ..._80, - ..._168, - ..._172, - ..._177, - ..._183, - ..._188 - }; - export const mint = { ..._81, ..._82, ..._83, ..._84, - ..._178, - ..._184 + ..._177, + ..._181, + ..._186, + ..._192, + ..._197 }; - export const oracle = { + export const mint = { ..._85, ..._86, ..._87, ..._88, - ..._169, - ..._173, - ..._179, - ..._185, - ..._189 + ..._187, + ..._193 }; - export const tokenfactory = { + export const oracle = { ..._89, ..._90, ..._91, ..._92, + ..._178, + ..._182, + ..._188, + ..._194, + ..._198 + }; + export const tokenfactory = { ..._93, - ..._170, - ..._174, - ..._180, - ..._186, - ..._190 + ..._94, + ..._95, + ..._96, + ..._97, + ..._179, + ..._183, + ..._189, + ..._195, + ..._199 }; } export const ClientFactory = { - ..._217, - ..._218, - ..._219 + ..._226, + ..._227, + ..._228 }; } diff --git a/packages/proto/src/codegen/seiprotocol/lcd.ts b/packages/proto/src/codegen/seiprotocol/lcd.ts index bea27da3..32865f2c 100644 --- a/packages/proto/src/codegen/seiprotocol/lcd.ts +++ b/packages/proto/src/codegen/seiprotocol/lcd.ts @@ -20,6 +20,11 @@ export const createLCDClient = async ({ restEndpoint }: { restEndpoint: string } requestClient }) }, + feegrant: { + v1beta1: new (await import('../cosmos/feegrant/v1beta1/query.lcd')).LCDQueryClient({ + requestClient + }) + }, gov: { v1beta1: new (await import('../cosmos/gov/v1beta1/query.lcd')).LCDQueryClient({ requestClient diff --git a/packages/proto/src/codegen/seiprotocol/rpc.query.ts b/packages/proto/src/codegen/seiprotocol/rpc.query.ts index c7d9c0ca..f4cbe5b2 100644 --- a/packages/proto/src/codegen/seiprotocol/rpc.query.ts +++ b/packages/proto/src/codegen/seiprotocol/rpc.query.ts @@ -14,6 +14,9 @@ export const createRPCQueryClient = async ({ rpcEndpoint }: { rpcEndpoint: strin 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: { v1beta1: (await import('../cosmos/gov/v1beta1/query.rpc.Query')).createRpcQueryExtension(client) }, diff --git a/packages/proto/src/codegen/seiprotocol/rpc.tx.ts b/packages/proto/src/codegen/seiprotocol/rpc.tx.ts index 4a8ebac7..59ad6e4d 100644 --- a/packages/proto/src/codegen/seiprotocol/rpc.tx.ts +++ b/packages/proto/src/codegen/seiprotocol/rpc.tx.ts @@ -7,6 +7,9 @@ export const createRPCMsgClient = async ({ rpc }: { rpc: 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: { v1beta1: new (await import('../cosmos/gov/v1beta1/tx.rpc.msg')).MsgClientImpl(rpc) }, diff --git a/packages/proto/src/codegen/tendermint/bundle.ts b/packages/proto/src/codegen/tendermint/bundle.ts index 7b5f7184..9f3aec5e 100644 --- a/packages/proto/src/codegen/tendermint/bundle.ts +++ b/packages/proto/src/codegen/tendermint/bundle.ts @@ -1,38 +1,38 @@ -import * as _122 from './abci/types'; -import * as _123 from './crypto/keys'; -import * as _124 from './crypto/proof'; -import * as _125 from './libs/bits/types'; -import * as _126 from './p2p/types'; -import * as _127 from './types/block'; -import * as _128 from './types/evidence'; -import * as _129 from './types/params'; -import * as _130 from './types/types'; -import * as _131 from './types/validator'; -import * as _132 from './version/types'; +import * as _126 from './abci/types'; +import * as _127 from './crypto/keys'; +import * as _128 from './crypto/proof'; +import * as _129 from './libs/bits/types'; +import * as _130 from './p2p/types'; +import * as _131 from './types/block'; +import * as _132 from './types/evidence'; +import * as _133 from './types/params'; +import * as _134 from './types/types'; +import * as _135 from './types/validator'; +import * as _136 from './version/types'; export namespace tendermint { export const abci = { - ..._122 + ..._126 }; export const crypto = { - ..._123, - ..._124 + ..._127, + ..._128 }; export namespace libs { export const bits = { - ..._125 + ..._129 }; } export const p2p = { - ..._126 + ..._130 }; export const types = { - ..._127, - ..._128, - ..._129, - ..._130, - ..._131 + ..._131, + ..._132, + ..._133, + ..._134, + ..._135 }; export const version = { - ..._132 + ..._136 }; }