diff --git a/README.md b/README.md index a59212fa..de480ad5 100644 --- a/README.md +++ b/README.md @@ -126,6 +126,44 @@ Typescript types and interfaces are generated in separate files so they can be i | `types.aliasExecuteMsg` | generate a type alias based on the contract name | | `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | +### BaseClient +The `baseClient.ts` will be generated as dependency for most files. It includes the base client for interchainjs. + +#### Gas Configuration + +The generated client provides flexible gas fee configuration options to handle different blockchain networks and fee settings. + +##### Default Gas Settings + +By default, the client uses a gas limit of `200000` for all transactions. You can customize this behavior through the `setDefaultGasAmount`. + +##### ChainConfig Options + +The `ChainConfig` interface supports two approaches for gas configuration: + +1. Chain Registry Integration (Recommended) + +When you provide chain information, the client automatically fetches gas prices from the chain registry: + +```typescript +import { useChain } from '@interchain-kit/react'; + +const { chain } = useChain('osmosistestnet'); +const chainConfig: ChainConfig = { chain: chain }; +``` + +2. Manual Gas Price Configuration +You can explicitly set gas prices for more control: + +```typescript +const chainConfig: ChainConfig = { + gasPrice: { + denom: 'uosmo', + amount: '0.025' + } +}; +``` + ### Client The `client` plugin will generate TS client classes for your contracts. This option generates a `QueryClient` for queries as well as a `Client` for queries and mutations. @@ -173,7 +211,7 @@ Generate [recoil](https://recoiljs.org/) bindings for your contracts with the `r ### Message Composer -Generate pure message objects with the proper `utf8` encoding and `typeUrl` configured that you can broadcast yourself via `cosmjs` with the `message-composer` command. +Generate pure message objects with the proper `utf8` encoding and `typeUrl` configured that you can broadcast yourself via `interchainjs` with the `message-composer` command. [see example output code](https://github.com/hyperweb-io/ts-codegen/blob/main/__output__/sg721/Sg721.message-composer.ts) diff --git a/__fixtures__/issues/98/out/98.client.ts b/__fixtures__/issues/98/out/98.client.ts index 77d95750..5396087c 100644 --- a/__fixtures__/issues/98/out/98.client.ts +++ b/__fixtures__/issues/98/out/98.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Uint128, InstantiateMsg, Coin, ExecuteMsg, InstallableExecMsg, Binary, ExecMsg, QueryMsg, InstallableQueryMsg, QueryMsg1, ConfigResponse, NullablePlugin, CanonicalAddr, Plugin, PluginsResponse } from "./98.types"; export interface 98ReadOnlyInterface { contractAddress: string; @@ -24,9 +24,9 @@ export interface 98ReadOnlyInterface { }) => Promise; } export class 98QueryClient implements 98ReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.getConfig = this.getConfig.bind(this); @@ -73,7 +73,7 @@ export interface 98Interface extends 98ReadOnlyInterface { }: { id: number; instantiateMsg: Binary; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; registerPlugin: ({ checksum, codeId, @@ -88,12 +88,12 @@ export interface 98Interface extends 98ReadOnlyInterface { ipfsHash: string; name: string; version: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; unregisterPlugin: ({ id }: { id: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updatePlugin: ({ checksum, codeId, @@ -110,23 +110,23 @@ export interface 98Interface extends 98ReadOnlyInterface { ipfsHash?: string; name?: string; version?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateRegistryFee: ({ newFee }: { newFee: Coin; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateDaoAddr: ({ newAddr }: { newAddr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class 98Client extends 98QueryClient implements 98Interface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -144,7 +144,7 @@ export class 98Client extends 98QueryClient implements 98Interface { }: { id: number; instantiateMsg: Binary; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { proxy_install_plugin: { id, @@ -166,7 +166,7 @@ export class 98Client extends 98QueryClient implements 98Interface { ipfsHash: string; name: string; version: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register_plugin: { checksum, @@ -182,7 +182,7 @@ export class 98Client extends 98QueryClient implements 98Interface { id }: { id: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister_plugin: { id @@ -205,7 +205,7 @@ export class 98Client extends 98QueryClient implements 98Interface { ipfsHash?: string; name?: string; version?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_plugin: { checksum, @@ -222,7 +222,7 @@ export class 98Client extends 98QueryClient implements 98Interface { newFee }: { newFee: Coin; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_registry_fee: { new_fee: newFee @@ -233,7 +233,7 @@ export class 98Client extends 98QueryClient implements 98Interface { newAddr }: { newAddr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_dao_addr: { new_addr: newAddr diff --git a/__fixtures__/issues/98/out/baseClient.ts b/__fixtures__/issues/98/out/baseClient.ts new file mode 100644 index 00000000..a51e9339 --- /dev/null +++ b/__fixtures__/issues/98/out/baseClient.ts @@ -0,0 +1,189 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + + +import { StdFee, Coin, DeliverTxResponse } from '@interchainjs/types'; +import { SigningClient } from '@interchainjs/cosmos/signing-client'; +import { getSmartContractState } from 'interchainjs/cosmwasm/wasm/v1/query.rpc.func'; +import { executeContract } from 'interchainjs/cosmwasm/wasm/v1/tx.rpc.func'; +import { QuerySmartContractStateRequest, QuerySmartContractStateResponse } from 'interchainjs/cosmwasm/wasm/v1/query'; +import { MsgExecuteContract } from 'interchainjs/cosmwasm/wasm/v1/tx'; +import { Chain } from '@chain-registry/v2-types'; + +// Encoding utility functions +const fromUint8Array = (uint8Array: Uint8Array): T => { + const text = new TextDecoder().decode(uint8Array); + return JSON.parse(text); +}; + +const toUint8Array = (obj: any): Uint8Array => { + const text = JSON.stringify(obj); + return new TextEncoder().encode(text); +}; + +// Chain registry configuration +// The amount under gasPrice represents gas price per unit +export interface ChainConfig { + chain?: Chain; + gasPrice?: { + denom: string; + amount: string; + }; +} + +// Gas fee calculation utilities +export const calculateGasFromChain = (chain: Chain, gasAmount: string): StdFee => { + try { + const feeTokens = chain.fees?.feeTokens; + + if (feeTokens && feeTokens.length > 0) { + const primaryToken = feeTokens[0]; + // v2 chain-registry uses camelCase: averageGasPrice, lowGasPrice, fixedMinGasPrice + const gasPrice = primaryToken.averageGasPrice || primaryToken.lowGasPrice || primaryToken.fixedMinGasPrice || 0.025; + const gasAmountNum = parseInt(gasAmount); + const feeAmount = Math.ceil(gasAmountNum * gasPrice).toString(); + + return { + amount: [{ + denom: primaryToken.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + } catch (error) { + console.warn('Failed to calculate gas from chain registry:', error); + } + + // Fallback to default + return { amount: [], gas: gasAmount }; +}; + +// Default gas amount - users can easily change this +export let DEFAULT_GAS_AMOUNT = '200000'; + +// Allow users to set their preferred default gas amount +export const setDefaultGasAmount = (gasAmount: string): void => { + DEFAULT_GAS_AMOUNT = gasAmount; +}; + +// Get current default gas amount +export const getDefaultGasAmount = (): string => DEFAULT_GAS_AMOUNT; + +export const getAutoGasFee = (chainConfig?: ChainConfig): StdFee => { + const gasAmount = DEFAULT_GAS_AMOUNT; + + if (chainConfig?.chain) { + return calculateGasFromChain(chainConfig.chain, gasAmount); + } + + if (chainConfig?.gasPrice) { + const gasAmountNum = parseInt(gasAmount); + const gasPriceNum = parseFloat(chainConfig.gasPrice.amount); + const feeAmount = Math.ceil(gasAmountNum * gasPriceNum).toString(); + + return { + amount: [{ + denom: chainConfig.gasPrice.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + + // Fallback: no fee tokens, just gas amount + return { amount: [], gas: gasAmount }; +}; + +// InterchainJS interfaces for CosmWasm clients +export interface ICosmWasmClient { + queryContractSmart(contractAddr: string, query: any): Promise; +} + +export interface ISigningCosmWasmClient { + execute( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ): Promise; +} + +export interface ISigningClient { + signAndBroadcast( + signerAddress: string, + messages: any[], + fee: number | StdFee | "auto", + memo?: string + ): Promise; +} + +// Helper functions to create InterchainJS clients +export function getCosmWasmClient(rpcEndpoint: string): ICosmWasmClient { + return { + queryContractSmart: async (contractAddr: string, query: any) => { + // Create the request object + const request: QuerySmartContractStateRequest = { + address: contractAddr, + queryData: toUint8Array(query) + }; + + // Execute the query using InterchainJS + const response: QuerySmartContractStateResponse = await getSmartContractState(rpcEndpoint, request); + + // Parse and return the result + return fromUint8Array(response.data); + }, + }; +} + +export function getSigningCosmWasmClient(signingClient: SigningClient): ISigningCosmWasmClient { + return { + execute: async ( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ) => { + // Handle fee conversion + let finalFee: StdFee; + if (typeof fee === 'number') { + finalFee = { amount: [], gas: fee.toString() }; + } else if (fee === 'auto') { + finalFee = getAutoGasFee(chainConfig); + } else if (fee) { + finalFee = fee; + } else { + finalFee = getAutoGasFee(chainConfig); + } + + // Create the message object + const message: MsgExecuteContract = { + sender, + contract: contractAddress, + msg: toUint8Array(msg), + funds: funds || [] + }; + + // Execute the transaction using InterchainJS + const result = await executeContract( + signingClient as any, + sender, + message, + finalFee, + memo || '' + ); + + return result; + }, + }; +} diff --git a/__fixtures__/issues/98/out/bundle.ts b/__fixtures__/issues/98/out/bundle.ts index d66bc6b2..7a7a0184 100644 --- a/__fixtures__/issues/98/out/bundle.ts +++ b/__fixtures__/issues/98/out/bundle.ts @@ -7,10 +7,14 @@ import * as _0 from "./98.types"; import * as _1 from "./98.client"; import * as _2 from "./98.react-query"; +import * as _3 from "./baseClient"; export namespace contracts { export const 98 = { ..._0, ..._1, ..._2 }; + export const baseClient = { + ..._3 + }; } \ No newline at end of file diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts index b5fa7ddd..f5aef4e8 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.client.ts @@ -4,16 +4,16 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; export interface CwAdminFactoryReadOnlyInterface { contractAddress: string; } export class CwAdminFactoryQueryClient implements CwAdminFactoryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -29,13 +29,13 @@ export interface CwAdminFactoryInterface { codeId: number; instantiateMsg: Binary; label: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwAdminFactoryClient implements CwAdminFactoryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -49,7 +49,7 @@ export class CwAdminFactoryClient implements CwAdminFactoryInterface { codeId: number; instantiateMsg: Binary; label: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { instantiate_contract_with_self_admin: { code_id: codeId, diff --git a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts index 22ce8618..3ae6418d 100644 --- a/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwAdminFactory.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; export interface CwAdminFactoryMsg { contractAddress: string; @@ -20,7 +20,7 @@ export interface CwAdminFactoryMsg { codeId: number; instantiateMsg: Binary; label: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { sender: string; @@ -38,7 +38,7 @@ export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { codeId: number; instantiateMsg: Binary; label: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts index 7023ff59..30486add 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; export interface CwCodeIdRegistryReadOnlyInterface { contractAddress: string; @@ -35,9 +35,9 @@ export interface CwCodeIdRegistryReadOnlyInterface { }) => Promise; } export class CwCodeIdRegistryQueryClient implements CwCodeIdRegistryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -107,7 +107,7 @@ export interface CwCodeIdRegistryInterface { amount: Uint128; msg: Binary; sender: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; register: ({ chainId, checksum, @@ -120,7 +120,7 @@ export interface CwCodeIdRegistryInterface { codeId: number; name: string; version: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; setOwner: ({ chainId, name, @@ -129,27 +129,27 @@ export interface CwCodeIdRegistryInterface { chainId: string; name: string; owner?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -167,7 +167,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { amount: Uint128; msg: Binary; sender: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, @@ -188,7 +188,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { codeId: number; name: string; version: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register: { chain_id: chainId, @@ -207,7 +207,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { chainId: string; name: string; owner?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_owner: { chain_id: chainId, @@ -222,7 +222,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { }: { chainId: string; codeId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister: { chain_id: chainId, @@ -236,7 +236,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { admin, diff --git a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts index 52549383..454b0c1d 100644 --- a/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwCodeIdRegistry.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; export interface CwCodeIdRegistryMsg { contractAddress: string; @@ -20,7 +20,7 @@ export interface CwCodeIdRegistryMsg { amount: Uint128; msg: Binary; sender: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; register: ({ chainId, checksum, @@ -33,7 +33,7 @@ export interface CwCodeIdRegistryMsg { codeId: number; name: string; version: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; setOwner: ({ chainId, name, @@ -42,21 +42,21 @@ export interface CwCodeIdRegistryMsg { chainId: string; name: string; owner?: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { sender: string; @@ -78,7 +78,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { amount: Uint128; msg: Binary; sender: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -107,7 +107,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { codeId: number; name: string; version: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -134,7 +134,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { chainId: string; name: string; owner?: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -157,7 +157,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { }: { chainId: string; codeId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -179,7 +179,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/bundler_test/contracts/CwSingle.client.ts b/__output__/builder/bundler_test/contracts/CwSingle.client.ts index 7c4c65f8..3d858b91 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.client.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; export interface CwSingleReadOnlyInterface { contractAddress: string; @@ -51,9 +51,9 @@ export interface CwSingleReadOnlyInterface { info: () => Promise; } export class CwSingleQueryClient implements CwSingleReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -174,24 +174,24 @@ export interface CwSingleInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -208,33 +208,33 @@ export interface CwSingleInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwSingleClient implements CwSingleInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -256,7 +256,7 @@ export class CwSingleClient implements CwSingleInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, @@ -271,7 +271,7 @@ export class CwSingleClient implements CwSingleInterface { }: { proposalId: number; vote: Vote; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, @@ -283,7 +283,7 @@ export class CwSingleClient implements CwSingleInterface { proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId @@ -294,7 +294,7 @@ export class CwSingleClient implements CwSingleInterface { proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId @@ -317,7 +317,7 @@ export class CwSingleClient implements CwSingleInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -334,7 +334,7 @@ export class CwSingleClient implements CwSingleInterface { address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address @@ -345,7 +345,7 @@ export class CwSingleClient implements CwSingleInterface { address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address @@ -356,7 +356,7 @@ export class CwSingleClient implements CwSingleInterface { address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address @@ -367,7 +367,7 @@ export class CwSingleClient implements CwSingleInterface { address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address diff --git a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts index d848ba61..a1918731 100644 --- a/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/CwSingle.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; export interface CwSingleMsg { contractAddress: string; @@ -19,24 +19,24 @@ export interface CwSingleMsg { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; execute: ({ proposalId }: { proposalId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; close: ({ proposalId }: { proposalId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateConfig: ({ allowRevoting, dao, @@ -53,27 +53,27 @@ export interface CwSingleMsg { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addProposalHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeProposalHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addVoteHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeVoteHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwSingleMsgComposer implements CwSingleMsg { sender: string; @@ -99,7 +99,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -122,7 +122,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { }: { proposalId: number; vote: Vote; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -142,7 +142,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { proposalId }: { proposalId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -161,7 +161,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { proposalId }: { proposalId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -192,7 +192,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -217,7 +217,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -236,7 +236,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -255,7 +255,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -274,7 +274,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/bundler_test/contracts/Factory.client.ts b/__output__/builder/bundler_test/contracts/Factory.client.ts index 0cb3b137..1b670c8c 100644 --- a/__output__/builder/bundler_test/contracts/Factory.client.ts +++ b/__output__/builder/bundler_test/contracts/Factory.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; export interface FactoryReadOnlyInterface { contractAddress: string; @@ -35,9 +35,9 @@ export interface FactoryReadOnlyInterface { adminAddr: () => Promise; } export class FactoryQueryClient implements FactoryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.wallets = this.wallets.bind(this); @@ -112,49 +112,49 @@ export interface FactoryInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateWalletFee: ({ newFee }: { newFee: Coin; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateGovecAddr: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateAdmin: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class FactoryClient implements FactoryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -170,7 +170,7 @@ export class FactoryClient implements FactoryInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_wallet: { create_wallet_msg: createWalletMsg @@ -183,7 +183,7 @@ export class FactoryClient implements FactoryInterface { }: { newUser: Addr; oldUser: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_proxy_user: { new_user: newUser, @@ -197,7 +197,7 @@ export class FactoryClient implements FactoryInterface { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { migrate_wallet: { migration_msg: migrationMsg, @@ -211,7 +211,7 @@ export class FactoryClient implements FactoryInterface { }: { newCodeId: number; ty: CodeIdType; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_code_id: { new_code_id: newCodeId, @@ -223,7 +223,7 @@ export class FactoryClient implements FactoryInterface { newFee }: { newFee: Coin; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_wallet_fee: { new_fee: newFee @@ -234,7 +234,7 @@ export class FactoryClient implements FactoryInterface { addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_govec_addr: { addr @@ -245,7 +245,7 @@ export class FactoryClient implements FactoryInterface { addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { addr diff --git a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts index 7929f947..88112d8d 100644 --- a/__output__/builder/bundler_test/contracts/Factory.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/Factory.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; export interface FactoryMsg { contractAddress: string; @@ -15,43 +15,43 @@ export interface FactoryMsg { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateWalletFee: ({ newFee }: { newFee: Coin; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateGovecAddr: ({ addr }: { addr: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateAdmin: ({ addr }: { addr: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class FactoryMsgComposer implements FactoryMsg { sender: string; @@ -71,7 +71,7 @@ export class FactoryMsgComposer implements FactoryMsg { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -92,7 +92,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { newUser: Addr; oldUser: Addr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -114,7 +114,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -136,7 +136,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { newCodeId: number; ty: CodeIdType; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -156,7 +156,7 @@ export class FactoryMsgComposer implements FactoryMsg { newFee }: { newFee: Coin; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -175,7 +175,7 @@ export class FactoryMsgComposer implements FactoryMsg { addr }: { addr: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -194,7 +194,7 @@ export class FactoryMsgComposer implements FactoryMsg { addr }: { addr: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/bundler_test/contracts/Minter.client.ts b/__output__/builder/bundler_test/contracts/Minter.client.ts index bc909514..02ed98d9 100644 --- a/__output__/builder/bundler_test/contracts/Minter.client.ts +++ b/__output__/builder/bundler_test/contracts/Minter.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, Timestamp, Uint64, Uint128, Config, Coin, ConfigResponse, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; export interface MinterReadOnlyInterface { contractAddress: string; @@ -20,9 +20,9 @@ export interface MinterReadOnlyInterface { }) => Promise; } export class MinterQueryClient implements MinterReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -66,37 +66,37 @@ export class MinterQueryClient implements MinterReadOnlyInterface { export interface MinterInterface { contractAddress: string; sender: string; - mint: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + mint: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; setWhitelist: ({ whitelist }: { whitelist: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - updateStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + updateStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mintTo: ({ recipient }: { recipient: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - withdraw: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + withdraw: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class MinterClient implements MinterInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -108,7 +108,7 @@ export class MinterClient implements MinterInterface { this.mintFor = this.mintFor.bind(this); this.withdraw = this.withdraw.bind(this); } - mint = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + mint = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: {} }, fee_, memo_, funds_); @@ -117,14 +117,14 @@ export class MinterClient implements MinterInterface { whitelist }: { whitelist: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_whitelist: { whitelist } }, fee_, memo_, funds_); }; - updateStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + updateStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_start_time: {} }, fee_, memo_, funds_); @@ -133,7 +133,7 @@ export class MinterClient implements MinterInterface { perAddressLimit }: { perAddressLimit: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_per_address_limit: { per_address_limit: perAddressLimit @@ -144,7 +144,7 @@ export class MinterClient implements MinterInterface { recipient }: { recipient: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_to: { recipient @@ -157,7 +157,7 @@ export class MinterClient implements MinterInterface { }: { recipient: string; tokenId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_for: { recipient, @@ -165,7 +165,7 @@ export class MinterClient implements MinterInterface { } }, fee_, memo_, funds_); }; - withdraw = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + withdraw = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw: {} }, fee_, memo_, funds_); diff --git a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts index 96c264bb..6e8a0d29 100644 --- a/__output__/builder/bundler_test/contracts/Minter.message-composer.ts +++ b/__output__/builder/bundler_test/contracts/Minter.message-composer.ts @@ -4,38 +4,38 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, Timestamp, Uint64, Uint128, Config, Coin, ConfigResponse, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; export interface MinterMsg { contractAddress: string; sender: string; - mint: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + mint: (funds_?: Coin[]) => EncodeObject; setWhitelist: ({ whitelist }: { whitelist: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - updateStartTime: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + updateStartTime: (funds_?: Coin[]) => EncodeObject; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; mintTo: ({ recipient }: { recipient: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - withdraw: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + withdraw: (funds_?: Coin[]) => EncodeObject; } export class MinterMsgComposer implements MinterMsg { sender: string; @@ -51,7 +51,7 @@ export class MinterMsgComposer implements MinterMsg { this.mintFor = this.mintFor.bind(this); this.withdraw = this.withdraw.bind(this); } - mint = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + mint = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -68,7 +68,7 @@ export class MinterMsgComposer implements MinterMsg { whitelist }: { whitelist: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -83,7 +83,7 @@ export class MinterMsgComposer implements MinterMsg { }) }; }; - updateStartTime = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + updateStartTime = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -100,7 +100,7 @@ export class MinterMsgComposer implements MinterMsg { perAddressLimit }: { perAddressLimit: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -119,7 +119,7 @@ export class MinterMsgComposer implements MinterMsg { recipient }: { recipient: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -140,7 +140,7 @@ export class MinterMsgComposer implements MinterMsg { }: { recipient: string; tokenId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -156,7 +156,7 @@ export class MinterMsgComposer implements MinterMsg { }) }; }; - withdraw = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + withdraw = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/bundler_test/contracts/baseClient.ts b/__output__/builder/bundler_test/contracts/baseClient.ts new file mode 100644 index 00000000..a51e9339 --- /dev/null +++ b/__output__/builder/bundler_test/contracts/baseClient.ts @@ -0,0 +1,189 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + + +import { StdFee, Coin, DeliverTxResponse } from '@interchainjs/types'; +import { SigningClient } from '@interchainjs/cosmos/signing-client'; +import { getSmartContractState } from 'interchainjs/cosmwasm/wasm/v1/query.rpc.func'; +import { executeContract } from 'interchainjs/cosmwasm/wasm/v1/tx.rpc.func'; +import { QuerySmartContractStateRequest, QuerySmartContractStateResponse } from 'interchainjs/cosmwasm/wasm/v1/query'; +import { MsgExecuteContract } from 'interchainjs/cosmwasm/wasm/v1/tx'; +import { Chain } from '@chain-registry/v2-types'; + +// Encoding utility functions +const fromUint8Array = (uint8Array: Uint8Array): T => { + const text = new TextDecoder().decode(uint8Array); + return JSON.parse(text); +}; + +const toUint8Array = (obj: any): Uint8Array => { + const text = JSON.stringify(obj); + return new TextEncoder().encode(text); +}; + +// Chain registry configuration +// The amount under gasPrice represents gas price per unit +export interface ChainConfig { + chain?: Chain; + gasPrice?: { + denom: string; + amount: string; + }; +} + +// Gas fee calculation utilities +export const calculateGasFromChain = (chain: Chain, gasAmount: string): StdFee => { + try { + const feeTokens = chain.fees?.feeTokens; + + if (feeTokens && feeTokens.length > 0) { + const primaryToken = feeTokens[0]; + // v2 chain-registry uses camelCase: averageGasPrice, lowGasPrice, fixedMinGasPrice + const gasPrice = primaryToken.averageGasPrice || primaryToken.lowGasPrice || primaryToken.fixedMinGasPrice || 0.025; + const gasAmountNum = parseInt(gasAmount); + const feeAmount = Math.ceil(gasAmountNum * gasPrice).toString(); + + return { + amount: [{ + denom: primaryToken.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + } catch (error) { + console.warn('Failed to calculate gas from chain registry:', error); + } + + // Fallback to default + return { amount: [], gas: gasAmount }; +}; + +// Default gas amount - users can easily change this +export let DEFAULT_GAS_AMOUNT = '200000'; + +// Allow users to set their preferred default gas amount +export const setDefaultGasAmount = (gasAmount: string): void => { + DEFAULT_GAS_AMOUNT = gasAmount; +}; + +// Get current default gas amount +export const getDefaultGasAmount = (): string => DEFAULT_GAS_AMOUNT; + +export const getAutoGasFee = (chainConfig?: ChainConfig): StdFee => { + const gasAmount = DEFAULT_GAS_AMOUNT; + + if (chainConfig?.chain) { + return calculateGasFromChain(chainConfig.chain, gasAmount); + } + + if (chainConfig?.gasPrice) { + const gasAmountNum = parseInt(gasAmount); + const gasPriceNum = parseFloat(chainConfig.gasPrice.amount); + const feeAmount = Math.ceil(gasAmountNum * gasPriceNum).toString(); + + return { + amount: [{ + denom: chainConfig.gasPrice.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + + // Fallback: no fee tokens, just gas amount + return { amount: [], gas: gasAmount }; +}; + +// InterchainJS interfaces for CosmWasm clients +export interface ICosmWasmClient { + queryContractSmart(contractAddr: string, query: any): Promise; +} + +export interface ISigningCosmWasmClient { + execute( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ): Promise; +} + +export interface ISigningClient { + signAndBroadcast( + signerAddress: string, + messages: any[], + fee: number | StdFee | "auto", + memo?: string + ): Promise; +} + +// Helper functions to create InterchainJS clients +export function getCosmWasmClient(rpcEndpoint: string): ICosmWasmClient { + return { + queryContractSmart: async (contractAddr: string, query: any) => { + // Create the request object + const request: QuerySmartContractStateRequest = { + address: contractAddr, + queryData: toUint8Array(query) + }; + + // Execute the query using InterchainJS + const response: QuerySmartContractStateResponse = await getSmartContractState(rpcEndpoint, request); + + // Parse and return the result + return fromUint8Array(response.data); + }, + }; +} + +export function getSigningCosmWasmClient(signingClient: SigningClient): ISigningCosmWasmClient { + return { + execute: async ( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ) => { + // Handle fee conversion + let finalFee: StdFee; + if (typeof fee === 'number') { + finalFee = { amount: [], gas: fee.toString() }; + } else if (fee === 'auto') { + finalFee = getAutoGasFee(chainConfig); + } else if (fee) { + finalFee = fee; + } else { + finalFee = getAutoGasFee(chainConfig); + } + + // Create the message object + const message: MsgExecuteContract = { + sender, + contract: contractAddress, + msg: toUint8Array(msg), + funds: funds || [] + }; + + // Execute the transaction using InterchainJS + const result = await executeContract( + signingClient as any, + sender, + message, + finalFee, + memo || '' + ); + + return result; + }, + }; +} diff --git a/__output__/builder/bundler_test/contracts/contractContextBase.ts b/__output__/builder/bundler_test/contracts/contractContextBase.ts index b69b781b..df8c53d7 100644 --- a/__output__/builder/bundler_test/contracts/contractContextBase.ts +++ b/__output__/builder/bundler_test/contracts/contractContextBase.ts @@ -6,14 +6,16 @@ import { - CosmWasmClient, - SigningCosmWasmClient, -} from '@cosmjs/cosmwasm-stargate'; + ICosmWasmClient, + ISigningCosmWasmClient, + getCosmWasmClient, + getSigningCosmWasmClient, +} from './baseClient'; export interface IContractConstructor { address: string | undefined; - cosmWasmClient: CosmWasmClient | undefined; - signingCosmWasmClient: SigningCosmWasmClient | undefined; + cosmWasmClient: ICosmWasmClient | undefined; + signingCosmWasmClient: ISigningCosmWasmClient | undefined; } export const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected'; @@ -55,15 +57,15 @@ export class ContractBase< > { constructor( protected address: string | undefined, - protected cosmWasmClient: CosmWasmClient | undefined, - protected signingCosmWasmClient: SigningCosmWasmClient | undefined, + protected cosmWasmClient: ICosmWasmClient | undefined, + protected signingCosmWasmClient: ISigningCosmWasmClient | undefined, private TSign?: new ( - client: SigningCosmWasmClient, + client: ISigningCosmWasmClient, sender: string, contractAddress: string ) => TSign, private TQuery?: new ( - client: CosmWasmClient, + client: ICosmWasmClient, contractAddress: string ) => TQuery, private TMsgComposer?: new ( diff --git a/__output__/builder/bundler_test/contracts/contractContextProviders.ts b/__output__/builder/bundler_test/contracts/contractContextProviders.ts index ca57a66e..7500aa4f 100644 --- a/__output__/builder/bundler_test/contracts/contractContextProviders.ts +++ b/__output__/builder/bundler_test/contracts/contractContextProviders.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate"; +import { ICosmWasmClient, ISigningCosmWasmClient, getCosmWasmClient, getSigningCosmWasmClient } from "./baseClient"; import { IQueryClientProvider, ISigningClientProvider, IMessageComposerProvider } from "./contractContextBase"; import { FactoryQueryClient } from "./Factory.client"; import { FactoryClient } from "./Factory.client"; @@ -33,7 +33,7 @@ export interface IContractsContext { cwCodeIdRegistry: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; cwSingle: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; } -export const getProviders = (address?: string, cosmWasmClient?: CosmWasmClient, signingCosmWasmClient?: SigningCosmWasmClient) => ({ +export const getProviders = (address?: string, cosmWasmClient?: ICosmWasmClient, signingCosmWasmClient?: ISigningCosmWasmClient) => ({ factory: new Factory({ address, cosmWasmClient, diff --git a/__output__/builder/bundler_test/contracts/contracts-context.tsx b/__output__/builder/bundler_test/contracts/contracts-context.tsx index b50ed508..b57f633d 100644 --- a/__output__/builder/bundler_test/contracts/contracts-context.tsx +++ b/__output__/builder/bundler_test/contracts/contracts-context.tsx @@ -7,16 +7,16 @@ import React, { useEffect, useMemo, useRef, useState, useContext } from 'react'; import { - CosmWasmClient, - SigningCosmWasmClient, -} from '@cosmjs/cosmwasm-stargate'; + ICosmWasmClient, + ISigningCosmWasmClient, +} from './baseClient'; import { IContractsContext, getProviders } from './contractContextProviders'; export interface ContractsConfig { address: string | undefined; - getCosmWasmClient: () => Promise; - getSigningCosmWasmClient: () => Promise; + getCosmWasmClient: () => Promise; + getSigningCosmWasmClient: () => Promise; } const ContractsContext = React.createContext(null); @@ -28,9 +28,9 @@ export const ContractsProvider = ({ children: React.ReactNode; contractsConfig: ContractsConfig; }) => { - const [cosmWasmClient, setCosmWasmClient] = useState(); + const [cosmWasmClient, setCosmWasmClient] = useState(); const [signingCosmWasmClient, setSigningCosmWasmClient] = - useState(); + useState(); const { address, getCosmWasmClient, getSigningCosmWasmClient } = contractsConfig; diff --git a/__output__/builder/bundler_test/index.ts b/__output__/builder/bundler_test/index.ts index c1b4905a..424e3ab1 100644 --- a/__output__/builder/bundler_test/index.ts +++ b/__output__/builder/bundler_test/index.ts @@ -4,89 +4,93 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import * as _83 from "./contracts/Factory.types"; -import * as _84 from "./contracts/Factory.client"; -import * as _85 from "./contracts/Factory.message-composer"; -import * as _86 from "./contracts/Factory.react-query"; -import * as _87 from "./contracts/Factory.recoil"; -import * as _88 from "./contracts/Factory.provider"; -import * as _89 from "./contracts/Minter.types"; -import * as _90 from "./contracts/Minter.client"; -import * as _91 from "./contracts/Minter.message-composer"; -import * as _92 from "./contracts/Minter.react-query"; -import * as _93 from "./contracts/Minter.recoil"; -import * as _94 from "./contracts/Minter.provider"; -import * as _95 from "./contracts/CwAdminFactory.types"; -import * as _96 from "./contracts/CwAdminFactory.client"; -import * as _97 from "./contracts/CwAdminFactory.message-composer"; -import * as _98 from "./contracts/CwAdminFactory.react-query"; -import * as _99 from "./contracts/CwAdminFactory.recoil"; -import * as _100 from "./contracts/CwAdminFactory.provider"; -import * as _101 from "./contracts/CwCodeIdRegistry.types"; -import * as _102 from "./contracts/CwCodeIdRegistry.client"; -import * as _103 from "./contracts/CwCodeIdRegistry.message-composer"; -import * as _104 from "./contracts/CwCodeIdRegistry.react-query"; -import * as _105 from "./contracts/CwCodeIdRegistry.recoil"; -import * as _106 from "./contracts/CwCodeIdRegistry.provider"; -import * as _107 from "./contracts/CwSingle.types"; -import * as _108 from "./contracts/CwSingle.client"; -import * as _109 from "./contracts/CwSingle.message-composer"; -import * as _110 from "./contracts/CwSingle.react-query"; -import * as _111 from "./contracts/CwSingle.recoil"; -import * as _112 from "./contracts/CwSingle.provider"; -import * as _113 from "./contracts/contractContextProviders"; -import * as _114 from "./contracts/contractContextBase"; -import * as _115 from "./contracts/contracts-context"; +import * as _86 from "./contracts/Factory.types"; +import * as _87 from "./contracts/Factory.client"; +import * as _88 from "./contracts/Factory.message-composer"; +import * as _89 from "./contracts/Factory.react-query"; +import * as _90 from "./contracts/Factory.recoil"; +import * as _91 from "./contracts/Factory.provider"; +import * as _92 from "./contracts/Minter.types"; +import * as _93 from "./contracts/Minter.client"; +import * as _94 from "./contracts/Minter.message-composer"; +import * as _95 from "./contracts/Minter.react-query"; +import * as _96 from "./contracts/Minter.recoil"; +import * as _97 from "./contracts/Minter.provider"; +import * as _98 from "./contracts/CwAdminFactory.types"; +import * as _99 from "./contracts/CwAdminFactory.client"; +import * as _100 from "./contracts/CwAdminFactory.message-composer"; +import * as _101 from "./contracts/CwAdminFactory.react-query"; +import * as _102 from "./contracts/CwAdminFactory.recoil"; +import * as _103 from "./contracts/CwAdminFactory.provider"; +import * as _104 from "./contracts/CwCodeIdRegistry.types"; +import * as _105 from "./contracts/CwCodeIdRegistry.client"; +import * as _106 from "./contracts/CwCodeIdRegistry.message-composer"; +import * as _107 from "./contracts/CwCodeIdRegistry.react-query"; +import * as _108 from "./contracts/CwCodeIdRegistry.recoil"; +import * as _109 from "./contracts/CwCodeIdRegistry.provider"; +import * as _110 from "./contracts/CwSingle.types"; +import * as _111 from "./contracts/CwSingle.client"; +import * as _112 from "./contracts/CwSingle.message-composer"; +import * as _113 from "./contracts/CwSingle.react-query"; +import * as _114 from "./contracts/CwSingle.recoil"; +import * as _115 from "./contracts/CwSingle.provider"; +import * as _116 from "./contracts/contractContextProviders"; +import * as _117 from "./contracts/baseClient"; +import * as _118 from "./contracts/contractContextBase"; +import * as _119 from "./contracts/contracts-context"; export namespace smart { export namespace contracts { export const Factory = { - ..._83, - ..._84, - ..._85, ..._86, ..._87, - ..._88 - }; - export const Minter = { + ..._88, ..._89, ..._90, - ..._91, + ..._91 + }; + export const Minter = { ..._92, ..._93, - ..._94 - }; - export const CwAdminFactory = { + ..._94, ..._95, ..._96, - ..._97, + ..._97 + }; + export const CwAdminFactory = { ..._98, ..._99, - ..._100 - }; - export const CwCodeIdRegistry = { + ..._100, ..._101, ..._102, - ..._103, + ..._103 + }; + export const CwCodeIdRegistry = { ..._104, ..._105, - ..._106 - }; - export const CwSingle = { + ..._106, ..._107, ..._108, - ..._109, + ..._109 + }; + export const CwSingle = { ..._110, ..._111, - ..._112 + ..._112, + ..._113, + ..._114, + ..._115 }; export const undefined = { - ..._113 + ..._116 + }; + export const baseClient = { + ..._117 }; export const contractContextBase = { - ..._114 + ..._118 }; export const contractsContext = { - ..._115 + ..._119 }; } } \ No newline at end of file diff --git a/__output__/builder/default/CwAdminFactory.client.ts b/__output__/builder/default/CwAdminFactory.client.ts index 64c66aee..e8a8fcd8 100644 --- a/__output__/builder/default/CwAdminFactory.client.ts +++ b/__output__/builder/default/CwAdminFactory.client.ts @@ -4,16 +4,16 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; export interface CwAdminFactoryReadOnlyInterface { contractAddress: string; } export class CwAdminFactoryQueryClient implements CwAdminFactoryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -29,13 +29,13 @@ export interface CwAdminFactoryInterface extends CwAdminFactoryReadOnlyInterface codeId: number; instantiateMsg: Binary; label: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements CwAdminFactoryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -50,7 +50,7 @@ export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements C codeId: number; instantiateMsg: Binary; label: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { instantiate_contract_with_self_admin: { code_id: codeId, diff --git a/__output__/builder/default/CwAdminFactory.message-composer.ts b/__output__/builder/default/CwAdminFactory.message-composer.ts index 22ce8618..3ae6418d 100644 --- a/__output__/builder/default/CwAdminFactory.message-composer.ts +++ b/__output__/builder/default/CwAdminFactory.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; export interface CwAdminFactoryMsg { contractAddress: string; @@ -20,7 +20,7 @@ export interface CwAdminFactoryMsg { codeId: number; instantiateMsg: Binary; label: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { sender: string; @@ -38,7 +38,7 @@ export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { codeId: number; instantiateMsg: Binary; label: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/default/CwCodeIdRegistry.client.ts b/__output__/builder/default/CwCodeIdRegistry.client.ts index 59e6ff67..90fe4821 100644 --- a/__output__/builder/default/CwCodeIdRegistry.client.ts +++ b/__output__/builder/default/CwCodeIdRegistry.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; export interface CwCodeIdRegistryReadOnlyInterface { contractAddress: string; @@ -35,9 +35,9 @@ export interface CwCodeIdRegistryReadOnlyInterface { }) => Promise; } export class CwCodeIdRegistryQueryClient implements CwCodeIdRegistryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -107,7 +107,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter amount: Uint128; msg: Binary; sender: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; register: ({ chainId, checksum, @@ -120,7 +120,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter codeId: number; name: string; version: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; setOwner: ({ chainId, name, @@ -129,27 +129,27 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter chainId: string; name: string; owner?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implements CwCodeIdRegistryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -168,7 +168,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen amount: Uint128; msg: Binary; sender: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, @@ -189,7 +189,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen codeId: number; name: string; version: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register: { chain_id: chainId, @@ -208,7 +208,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen chainId: string; name: string; owner?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_owner: { chain_id: chainId, @@ -223,7 +223,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { chainId: string; codeId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister: { chain_id: chainId, @@ -237,7 +237,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { admin, diff --git a/__output__/builder/default/CwCodeIdRegistry.message-composer.ts b/__output__/builder/default/CwCodeIdRegistry.message-composer.ts index 52549383..454b0c1d 100644 --- a/__output__/builder/default/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/default/CwCodeIdRegistry.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; export interface CwCodeIdRegistryMsg { contractAddress: string; @@ -20,7 +20,7 @@ export interface CwCodeIdRegistryMsg { amount: Uint128; msg: Binary; sender: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; register: ({ chainId, checksum, @@ -33,7 +33,7 @@ export interface CwCodeIdRegistryMsg { codeId: number; name: string; version: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; setOwner: ({ chainId, name, @@ -42,21 +42,21 @@ export interface CwCodeIdRegistryMsg { chainId: string; name: string; owner?: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { sender: string; @@ -78,7 +78,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { amount: Uint128; msg: Binary; sender: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -107,7 +107,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { codeId: number; name: string; version: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -134,7 +134,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { chainId: string; name: string; owner?: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -157,7 +157,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { }: { chainId: string; codeId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -179,7 +179,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/default/CwSingle.client.ts b/__output__/builder/default/CwSingle.client.ts index 1e4a6868..46753f00 100644 --- a/__output__/builder/default/CwSingle.client.ts +++ b/__output__/builder/default/CwSingle.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; export interface CwSingleReadOnlyInterface { contractAddress: string; @@ -51,9 +51,9 @@ export interface CwSingleReadOnlyInterface { info: () => Promise; } export class CwSingleQueryClient implements CwSingleReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -174,24 +174,24 @@ export interface CwSingleInterface extends CwSingleReadOnlyInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -208,33 +208,33 @@ export interface CwSingleInterface extends CwSingleReadOnlyInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwSingleClient extends CwSingleQueryClient implements CwSingleInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -257,7 +257,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, @@ -272,7 +272,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter }: { proposalId: number; vote: Vote; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, @@ -284,7 +284,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId @@ -295,7 +295,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId @@ -318,7 +318,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -335,7 +335,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address @@ -346,7 +346,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address @@ -357,7 +357,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address @@ -368,7 +368,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address diff --git a/__output__/builder/default/CwSingle.message-composer.ts b/__output__/builder/default/CwSingle.message-composer.ts index d848ba61..a1918731 100644 --- a/__output__/builder/default/CwSingle.message-composer.ts +++ b/__output__/builder/default/CwSingle.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; export interface CwSingleMsg { contractAddress: string; @@ -19,24 +19,24 @@ export interface CwSingleMsg { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; execute: ({ proposalId }: { proposalId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; close: ({ proposalId }: { proposalId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateConfig: ({ allowRevoting, dao, @@ -53,27 +53,27 @@ export interface CwSingleMsg { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addProposalHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeProposalHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addVoteHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeVoteHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwSingleMsgComposer implements CwSingleMsg { sender: string; @@ -99,7 +99,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -122,7 +122,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { }: { proposalId: number; vote: Vote; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -142,7 +142,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { proposalId }: { proposalId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -161,7 +161,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { proposalId }: { proposalId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -192,7 +192,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -217,7 +217,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -236,7 +236,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -255,7 +255,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -274,7 +274,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/default/Factory.client.ts b/__output__/builder/default/Factory.client.ts index 3fda4056..fba8797e 100644 --- a/__output__/builder/default/Factory.client.ts +++ b/__output__/builder/default/Factory.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; export interface FactoryReadOnlyInterface { contractAddress: string; @@ -35,9 +35,9 @@ export interface FactoryReadOnlyInterface { adminAddr: () => Promise; } export class FactoryQueryClient implements FactoryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.wallets = this.wallets.bind(this); @@ -112,49 +112,49 @@ export interface FactoryInterface extends FactoryReadOnlyInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateWalletFee: ({ newFee }: { newFee: Coin; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateGovecAddr: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateAdmin: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class FactoryClient extends FactoryQueryClient implements FactoryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -171,7 +171,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_wallet: { create_wallet_msg: createWalletMsg @@ -184,7 +184,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newUser: Addr; oldUser: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_proxy_user: { new_user: newUser, @@ -198,7 +198,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { migrate_wallet: { migration_msg: migrationMsg, @@ -212,7 +212,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newCodeId: number; ty: CodeIdType; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_code_id: { new_code_id: newCodeId, @@ -224,7 +224,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac newFee }: { newFee: Coin; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_wallet_fee: { new_fee: newFee @@ -235,7 +235,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_govec_addr: { addr @@ -246,7 +246,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { addr diff --git a/__output__/builder/default/Factory.message-composer.ts b/__output__/builder/default/Factory.message-composer.ts index 7929f947..88112d8d 100644 --- a/__output__/builder/default/Factory.message-composer.ts +++ b/__output__/builder/default/Factory.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; export interface FactoryMsg { contractAddress: string; @@ -15,43 +15,43 @@ export interface FactoryMsg { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateWalletFee: ({ newFee }: { newFee: Coin; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateGovecAddr: ({ addr }: { addr: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateAdmin: ({ addr }: { addr: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class FactoryMsgComposer implements FactoryMsg { sender: string; @@ -71,7 +71,7 @@ export class FactoryMsgComposer implements FactoryMsg { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -92,7 +92,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { newUser: Addr; oldUser: Addr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -114,7 +114,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -136,7 +136,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { newCodeId: number; ty: CodeIdType; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -156,7 +156,7 @@ export class FactoryMsgComposer implements FactoryMsg { newFee }: { newFee: Coin; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -175,7 +175,7 @@ export class FactoryMsgComposer implements FactoryMsg { addr }: { addr: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -194,7 +194,7 @@ export class FactoryMsgComposer implements FactoryMsg { addr }: { addr: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/default/Minter.client.ts b/__output__/builder/default/Minter.client.ts index 8945b0d4..8aced0b5 100644 --- a/__output__/builder/default/Minter.client.ts +++ b/__output__/builder/default/Minter.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, Timestamp, Uint64, Uint128, Config, Coin, ConfigResponse, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; export interface MinterReadOnlyInterface { contractAddress: string; @@ -20,9 +20,9 @@ export interface MinterReadOnlyInterface { }) => Promise; } export class MinterQueryClient implements MinterReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -66,37 +66,37 @@ export class MinterQueryClient implements MinterReadOnlyInterface { export interface MinterInterface extends MinterReadOnlyInterface { contractAddress: string; sender: string; - mint: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + mint: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; setWhitelist: ({ whitelist }: { whitelist: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - updateStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + updateStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mintTo: ({ recipient }: { recipient: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - withdraw: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + withdraw: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class MinterClient extends MinterQueryClient implements MinterInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -109,7 +109,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { this.mintFor = this.mintFor.bind(this); this.withdraw = this.withdraw.bind(this); } - mint = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + mint = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: {} }, fee_, memo_, funds_); @@ -118,14 +118,14 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { whitelist }: { whitelist: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_whitelist: { whitelist } }, fee_, memo_, funds_); }; - updateStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + updateStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_start_time: {} }, fee_, memo_, funds_); @@ -134,7 +134,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { perAddressLimit }: { perAddressLimit: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_per_address_limit: { per_address_limit: perAddressLimit @@ -145,7 +145,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { recipient }: { recipient: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_to: { recipient @@ -158,7 +158,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { }: { recipient: string; tokenId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_for: { recipient, @@ -166,7 +166,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { } }, fee_, memo_, funds_); }; - withdraw = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + withdraw = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw: {} }, fee_, memo_, funds_); diff --git a/__output__/builder/default/Minter.message-composer.ts b/__output__/builder/default/Minter.message-composer.ts index 96c264bb..6e8a0d29 100644 --- a/__output__/builder/default/Minter.message-composer.ts +++ b/__output__/builder/default/Minter.message-composer.ts @@ -4,38 +4,38 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, Timestamp, Uint64, Uint128, Config, Coin, ConfigResponse, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; export interface MinterMsg { contractAddress: string; sender: string; - mint: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + mint: (funds_?: Coin[]) => EncodeObject; setWhitelist: ({ whitelist }: { whitelist: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - updateStartTime: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + updateStartTime: (funds_?: Coin[]) => EncodeObject; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; mintTo: ({ recipient }: { recipient: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - withdraw: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + withdraw: (funds_?: Coin[]) => EncodeObject; } export class MinterMsgComposer implements MinterMsg { sender: string; @@ -51,7 +51,7 @@ export class MinterMsgComposer implements MinterMsg { this.mintFor = this.mintFor.bind(this); this.withdraw = this.withdraw.bind(this); } - mint = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + mint = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -68,7 +68,7 @@ export class MinterMsgComposer implements MinterMsg { whitelist }: { whitelist: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -83,7 +83,7 @@ export class MinterMsgComposer implements MinterMsg { }) }; }; - updateStartTime = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + updateStartTime = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -100,7 +100,7 @@ export class MinterMsgComposer implements MinterMsg { perAddressLimit }: { perAddressLimit: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -119,7 +119,7 @@ export class MinterMsgComposer implements MinterMsg { recipient }: { recipient: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -140,7 +140,7 @@ export class MinterMsgComposer implements MinterMsg { }: { recipient: string; tokenId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -156,7 +156,7 @@ export class MinterMsgComposer implements MinterMsg { }) }; }; - withdraw = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + withdraw = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/default/baseClient.ts b/__output__/builder/default/baseClient.ts new file mode 100644 index 00000000..a51e9339 --- /dev/null +++ b/__output__/builder/default/baseClient.ts @@ -0,0 +1,189 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + + +import { StdFee, Coin, DeliverTxResponse } from '@interchainjs/types'; +import { SigningClient } from '@interchainjs/cosmos/signing-client'; +import { getSmartContractState } from 'interchainjs/cosmwasm/wasm/v1/query.rpc.func'; +import { executeContract } from 'interchainjs/cosmwasm/wasm/v1/tx.rpc.func'; +import { QuerySmartContractStateRequest, QuerySmartContractStateResponse } from 'interchainjs/cosmwasm/wasm/v1/query'; +import { MsgExecuteContract } from 'interchainjs/cosmwasm/wasm/v1/tx'; +import { Chain } from '@chain-registry/v2-types'; + +// Encoding utility functions +const fromUint8Array = (uint8Array: Uint8Array): T => { + const text = new TextDecoder().decode(uint8Array); + return JSON.parse(text); +}; + +const toUint8Array = (obj: any): Uint8Array => { + const text = JSON.stringify(obj); + return new TextEncoder().encode(text); +}; + +// Chain registry configuration +// The amount under gasPrice represents gas price per unit +export interface ChainConfig { + chain?: Chain; + gasPrice?: { + denom: string; + amount: string; + }; +} + +// Gas fee calculation utilities +export const calculateGasFromChain = (chain: Chain, gasAmount: string): StdFee => { + try { + const feeTokens = chain.fees?.feeTokens; + + if (feeTokens && feeTokens.length > 0) { + const primaryToken = feeTokens[0]; + // v2 chain-registry uses camelCase: averageGasPrice, lowGasPrice, fixedMinGasPrice + const gasPrice = primaryToken.averageGasPrice || primaryToken.lowGasPrice || primaryToken.fixedMinGasPrice || 0.025; + const gasAmountNum = parseInt(gasAmount); + const feeAmount = Math.ceil(gasAmountNum * gasPrice).toString(); + + return { + amount: [{ + denom: primaryToken.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + } catch (error) { + console.warn('Failed to calculate gas from chain registry:', error); + } + + // Fallback to default + return { amount: [], gas: gasAmount }; +}; + +// Default gas amount - users can easily change this +export let DEFAULT_GAS_AMOUNT = '200000'; + +// Allow users to set their preferred default gas amount +export const setDefaultGasAmount = (gasAmount: string): void => { + DEFAULT_GAS_AMOUNT = gasAmount; +}; + +// Get current default gas amount +export const getDefaultGasAmount = (): string => DEFAULT_GAS_AMOUNT; + +export const getAutoGasFee = (chainConfig?: ChainConfig): StdFee => { + const gasAmount = DEFAULT_GAS_AMOUNT; + + if (chainConfig?.chain) { + return calculateGasFromChain(chainConfig.chain, gasAmount); + } + + if (chainConfig?.gasPrice) { + const gasAmountNum = parseInt(gasAmount); + const gasPriceNum = parseFloat(chainConfig.gasPrice.amount); + const feeAmount = Math.ceil(gasAmountNum * gasPriceNum).toString(); + + return { + amount: [{ + denom: chainConfig.gasPrice.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + + // Fallback: no fee tokens, just gas amount + return { amount: [], gas: gasAmount }; +}; + +// InterchainJS interfaces for CosmWasm clients +export interface ICosmWasmClient { + queryContractSmart(contractAddr: string, query: any): Promise; +} + +export interface ISigningCosmWasmClient { + execute( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ): Promise; +} + +export interface ISigningClient { + signAndBroadcast( + signerAddress: string, + messages: any[], + fee: number | StdFee | "auto", + memo?: string + ): Promise; +} + +// Helper functions to create InterchainJS clients +export function getCosmWasmClient(rpcEndpoint: string): ICosmWasmClient { + return { + queryContractSmart: async (contractAddr: string, query: any) => { + // Create the request object + const request: QuerySmartContractStateRequest = { + address: contractAddr, + queryData: toUint8Array(query) + }; + + // Execute the query using InterchainJS + const response: QuerySmartContractStateResponse = await getSmartContractState(rpcEndpoint, request); + + // Parse and return the result + return fromUint8Array(response.data); + }, + }; +} + +export function getSigningCosmWasmClient(signingClient: SigningClient): ISigningCosmWasmClient { + return { + execute: async ( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ) => { + // Handle fee conversion + let finalFee: StdFee; + if (typeof fee === 'number') { + finalFee = { amount: [], gas: fee.toString() }; + } else if (fee === 'auto') { + finalFee = getAutoGasFee(chainConfig); + } else if (fee) { + finalFee = fee; + } else { + finalFee = getAutoGasFee(chainConfig); + } + + // Create the message object + const message: MsgExecuteContract = { + sender, + contract: contractAddress, + msg: toUint8Array(msg), + funds: funds || [] + }; + + // Execute the transaction using InterchainJS + const result = await executeContract( + signingClient as any, + sender, + message, + finalFee, + memo || '' + ); + + return result; + }, + }; +} diff --git a/__output__/builder/default/contractContextBase.ts b/__output__/builder/default/contractContextBase.ts index 75594b12..eabceab5 100644 --- a/__output__/builder/default/contractContextBase.ts +++ b/__output__/builder/default/contractContextBase.ts @@ -6,14 +6,16 @@ import { - CosmWasmClient, - SigningCosmWasmClient, -} from '@cosmjs/cosmwasm-stargate'; + ICosmWasmClient, + ISigningCosmWasmClient, + getCosmWasmClient, + getSigningCosmWasmClient, +} from './baseClient'; export interface IContractConstructor { address: string | undefined; - cosmWasmClient: CosmWasmClient | undefined; - signingCosmWasmClient: SigningCosmWasmClient | undefined; + cosmWasmClient: ICosmWasmClient | undefined; + signingCosmWasmClient: ISigningCosmWasmClient | undefined; } export const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected'; @@ -55,15 +57,15 @@ export class ContractBase< > { address: string | undefined; - cosmWasmClient: CosmWasmClient | undefined; - signingCosmWasmClient: SigningCosmWasmClient | undefined; + cosmWasmClient: ICosmWasmClient | undefined; + signingCosmWasmClient: ISigningCosmWasmClient | undefined; TSign?: new ( - client: SigningCosmWasmClient, + client: ISigningCosmWasmClient, sender: string, contractAddress: string ) => TSign; TQuery?: new ( - client: CosmWasmClient, + client: ICosmWasmClient, contractAddress: string ) => TQuery; TMsgComposer?: new ( @@ -73,15 +75,15 @@ export class ContractBase< constructor( address: string | undefined, - cosmWasmClient: CosmWasmClient | undefined, - signingCosmWasmClient: SigningCosmWasmClient | undefined, + cosmWasmClient: ICosmWasmClient | undefined, + signingCosmWasmClient: ISigningCosmWasmClient | undefined, TSign?: new ( - client: SigningCosmWasmClient, + client: ISigningCosmWasmClient, sender: string, contractAddress: string ) => TSign, TQuery?: new ( - client: CosmWasmClient, + client: ICosmWasmClient, contractAddress: string ) => TQuery, TMsgComposer?: new ( diff --git a/__output__/builder/default/contractContextProviders.ts b/__output__/builder/default/contractContextProviders.ts index ca57a66e..7500aa4f 100644 --- a/__output__/builder/default/contractContextProviders.ts +++ b/__output__/builder/default/contractContextProviders.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate"; +import { ICosmWasmClient, ISigningCosmWasmClient, getCosmWasmClient, getSigningCosmWasmClient } from "./baseClient"; import { IQueryClientProvider, ISigningClientProvider, IMessageComposerProvider } from "./contractContextBase"; import { FactoryQueryClient } from "./Factory.client"; import { FactoryClient } from "./Factory.client"; @@ -33,7 +33,7 @@ export interface IContractsContext { cwCodeIdRegistry: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; cwSingle: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; } -export const getProviders = (address?: string, cosmWasmClient?: CosmWasmClient, signingCosmWasmClient?: SigningCosmWasmClient) => ({ +export const getProviders = (address?: string, cosmWasmClient?: ICosmWasmClient, signingCosmWasmClient?: ISigningCosmWasmClient) => ({ factory: new Factory({ address, cosmWasmClient, diff --git a/__output__/builder/default/contracts-context.tsx b/__output__/builder/default/contracts-context.tsx index b50ed508..b57f633d 100644 --- a/__output__/builder/default/contracts-context.tsx +++ b/__output__/builder/default/contracts-context.tsx @@ -7,16 +7,16 @@ import React, { useEffect, useMemo, useRef, useState, useContext } from 'react'; import { - CosmWasmClient, - SigningCosmWasmClient, -} from '@cosmjs/cosmwasm-stargate'; + ICosmWasmClient, + ISigningCosmWasmClient, +} from './baseClient'; import { IContractsContext, getProviders } from './contractContextProviders'; export interface ContractsConfig { address: string | undefined; - getCosmWasmClient: () => Promise; - getSigningCosmWasmClient: () => Promise; + getCosmWasmClient: () => Promise; + getSigningCosmWasmClient: () => Promise; } const ContractsContext = React.createContext(null); @@ -28,9 +28,9 @@ export const ContractsProvider = ({ children: React.ReactNode; contractsConfig: ContractsConfig; }) => { - const [cosmWasmClient, setCosmWasmClient] = useState(); + const [cosmWasmClient, setCosmWasmClient] = useState(); const [signingCosmWasmClient, setSigningCosmWasmClient] = - useState(); + useState(); const { address, getCosmWasmClient, getSigningCosmWasmClient } = contractsConfig; diff --git a/__output__/builder/default/index.ts b/__output__/builder/default/index.ts index 7af98ed4..62fd8b27 100644 --- a/__output__/builder/default/index.ts +++ b/__output__/builder/default/index.ts @@ -4,99 +4,103 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import * as _15 from "./Factory.types"; -import * as _16 from "./Factory.client"; -import * as _17 from "./Factory.message-composer"; -import * as _18 from "./Factory.react-query"; -import * as _19 from "./Factory.recoil"; -import * as _20 from "./Factory.message-builder"; -import * as _21 from "./Factory.provider"; -import * as _22 from "./Minter.types"; -import * as _23 from "./Minter.client"; -import * as _24 from "./Minter.message-composer"; -import * as _25 from "./Minter.react-query"; -import * as _26 from "./Minter.recoil"; -import * as _27 from "./Minter.message-builder"; -import * as _28 from "./Minter.provider"; -import * as _29 from "./CwAdminFactory.types"; -import * as _30 from "./CwAdminFactory.client"; -import * as _31 from "./CwAdminFactory.message-composer"; -import * as _32 from "./CwAdminFactory.react-query"; -import * as _33 from "./CwAdminFactory.recoil"; -import * as _34 from "./CwAdminFactory.message-builder"; -import * as _35 from "./CwAdminFactory.provider"; -import * as _36 from "./CwCodeIdRegistry.types"; -import * as _37 from "./CwCodeIdRegistry.client"; -import * as _38 from "./CwCodeIdRegistry.message-composer"; -import * as _39 from "./CwCodeIdRegistry.react-query"; -import * as _40 from "./CwCodeIdRegistry.recoil"; -import * as _41 from "./CwCodeIdRegistry.message-builder"; -import * as _42 from "./CwCodeIdRegistry.provider"; -import * as _43 from "./CwSingle.types"; -import * as _44 from "./CwSingle.client"; -import * as _45 from "./CwSingle.message-composer"; -import * as _46 from "./CwSingle.react-query"; -import * as _47 from "./CwSingle.recoil"; -import * as _48 from "./CwSingle.message-builder"; -import * as _49 from "./CwSingle.provider"; -import * as _50 from "./contractContextProviders"; -import * as _51 from "./contractContextBase"; -import * as _52 from "./contracts-context"; +import * as _16 from "./Factory.types"; +import * as _17 from "./Factory.client"; +import * as _18 from "./Factory.message-composer"; +import * as _19 from "./Factory.react-query"; +import * as _20 from "./Factory.recoil"; +import * as _21 from "./Factory.message-builder"; +import * as _22 from "./Factory.provider"; +import * as _23 from "./Minter.types"; +import * as _24 from "./Minter.client"; +import * as _25 from "./Minter.message-composer"; +import * as _26 from "./Minter.react-query"; +import * as _27 from "./Minter.recoil"; +import * as _28 from "./Minter.message-builder"; +import * as _29 from "./Minter.provider"; +import * as _30 from "./CwAdminFactory.types"; +import * as _31 from "./CwAdminFactory.client"; +import * as _32 from "./CwAdminFactory.message-composer"; +import * as _33 from "./CwAdminFactory.react-query"; +import * as _34 from "./CwAdminFactory.recoil"; +import * as _35 from "./CwAdminFactory.message-builder"; +import * as _36 from "./CwAdminFactory.provider"; +import * as _37 from "./CwCodeIdRegistry.types"; +import * as _38 from "./CwCodeIdRegistry.client"; +import * as _39 from "./CwCodeIdRegistry.message-composer"; +import * as _40 from "./CwCodeIdRegistry.react-query"; +import * as _41 from "./CwCodeIdRegistry.recoil"; +import * as _42 from "./CwCodeIdRegistry.message-builder"; +import * as _43 from "./CwCodeIdRegistry.provider"; +import * as _44 from "./CwSingle.types"; +import * as _45 from "./CwSingle.client"; +import * as _46 from "./CwSingle.message-composer"; +import * as _47 from "./CwSingle.react-query"; +import * as _48 from "./CwSingle.recoil"; +import * as _49 from "./CwSingle.message-builder"; +import * as _50 from "./CwSingle.provider"; +import * as _51 from "./contractContextProviders"; +import * as _52 from "./baseClient"; +import * as _53 from "./contractContextBase"; +import * as _54 from "./contracts-context"; export namespace smart { export namespace contracts { export const Factory = { - ..._15, ..._16, ..._17, ..._18, ..._19, ..._20, - ..._21 + ..._21, + ..._22 }; export const Minter = { - ..._22, ..._23, ..._24, ..._25, ..._26, ..._27, - ..._28 + ..._28, + ..._29 }; export const CwAdminFactory = { - ..._29, ..._30, ..._31, ..._32, ..._33, ..._34, - ..._35 + ..._35, + ..._36 }; export const CwCodeIdRegistry = { - ..._36, ..._37, ..._38, ..._39, ..._40, ..._41, - ..._42 + ..._42, + ..._43 }; export const CwSingle = { - ..._43, ..._44, ..._45, ..._46, ..._47, ..._48, - ..._49 + ..._49, + ..._50 }; export const undefined = { - ..._50 + ..._51 + }; + export const baseClient = { + ..._52 }; export const contractContextBase = { - ..._51 + ..._53 }; export const contractsContext = { - ..._52 + ..._54 }; } } \ No newline at end of file diff --git a/__output__/builder/invoke/CwAdminFactory.client.ts b/__output__/builder/invoke/CwAdminFactory.client.ts index 64c66aee..e8a8fcd8 100644 --- a/__output__/builder/invoke/CwAdminFactory.client.ts +++ b/__output__/builder/invoke/CwAdminFactory.client.ts @@ -4,16 +4,16 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; export interface CwAdminFactoryReadOnlyInterface { contractAddress: string; } export class CwAdminFactoryQueryClient implements CwAdminFactoryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -29,13 +29,13 @@ export interface CwAdminFactoryInterface extends CwAdminFactoryReadOnlyInterface codeId: number; instantiateMsg: Binary; label: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements CwAdminFactoryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -50,7 +50,7 @@ export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements C codeId: number; instantiateMsg: Binary; label: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { instantiate_contract_with_self_admin: { code_id: codeId, diff --git a/__output__/builder/invoke/CwCodeIdRegistry.client.ts b/__output__/builder/invoke/CwCodeIdRegistry.client.ts index 59e6ff67..90fe4821 100644 --- a/__output__/builder/invoke/CwCodeIdRegistry.client.ts +++ b/__output__/builder/invoke/CwCodeIdRegistry.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; export interface CwCodeIdRegistryReadOnlyInterface { contractAddress: string; @@ -35,9 +35,9 @@ export interface CwCodeIdRegistryReadOnlyInterface { }) => Promise; } export class CwCodeIdRegistryQueryClient implements CwCodeIdRegistryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -107,7 +107,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter amount: Uint128; msg: Binary; sender: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; register: ({ chainId, checksum, @@ -120,7 +120,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter codeId: number; name: string; version: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; setOwner: ({ chainId, name, @@ -129,27 +129,27 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter chainId: string; name: string; owner?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implements CwCodeIdRegistryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -168,7 +168,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen amount: Uint128; msg: Binary; sender: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, @@ -189,7 +189,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen codeId: number; name: string; version: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register: { chain_id: chainId, @@ -208,7 +208,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen chainId: string; name: string; owner?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_owner: { chain_id: chainId, @@ -223,7 +223,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { chainId: string; codeId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister: { chain_id: chainId, @@ -237,7 +237,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { admin, diff --git a/__output__/builder/invoke/CwSingle.client.ts b/__output__/builder/invoke/CwSingle.client.ts index 1e4a6868..46753f00 100644 --- a/__output__/builder/invoke/CwSingle.client.ts +++ b/__output__/builder/invoke/CwSingle.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; export interface CwSingleReadOnlyInterface { contractAddress: string; @@ -51,9 +51,9 @@ export interface CwSingleReadOnlyInterface { info: () => Promise; } export class CwSingleQueryClient implements CwSingleReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -174,24 +174,24 @@ export interface CwSingleInterface extends CwSingleReadOnlyInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -208,33 +208,33 @@ export interface CwSingleInterface extends CwSingleReadOnlyInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwSingleClient extends CwSingleQueryClient implements CwSingleInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -257,7 +257,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, @@ -272,7 +272,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter }: { proposalId: number; vote: Vote; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, @@ -284,7 +284,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId @@ -295,7 +295,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId @@ -318,7 +318,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -335,7 +335,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address @@ -346,7 +346,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address @@ -357,7 +357,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address @@ -368,7 +368,7 @@ export class CwSingleClient extends CwSingleQueryClient implements CwSingleInter address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address diff --git a/__output__/builder/invoke/Factory.client.ts b/__output__/builder/invoke/Factory.client.ts index 3fda4056..fba8797e 100644 --- a/__output__/builder/invoke/Factory.client.ts +++ b/__output__/builder/invoke/Factory.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; export interface FactoryReadOnlyInterface { contractAddress: string; @@ -35,9 +35,9 @@ export interface FactoryReadOnlyInterface { adminAddr: () => Promise; } export class FactoryQueryClient implements FactoryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.wallets = this.wallets.bind(this); @@ -112,49 +112,49 @@ export interface FactoryInterface extends FactoryReadOnlyInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateWalletFee: ({ newFee }: { newFee: Coin; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateGovecAddr: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateAdmin: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class FactoryClient extends FactoryQueryClient implements FactoryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -171,7 +171,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_wallet: { create_wallet_msg: createWalletMsg @@ -184,7 +184,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newUser: Addr; oldUser: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_proxy_user: { new_user: newUser, @@ -198,7 +198,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { migrate_wallet: { migration_msg: migrationMsg, @@ -212,7 +212,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newCodeId: number; ty: CodeIdType; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_code_id: { new_code_id: newCodeId, @@ -224,7 +224,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac newFee }: { newFee: Coin; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_wallet_fee: { new_fee: newFee @@ -235,7 +235,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_govec_addr: { addr @@ -246,7 +246,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { addr diff --git a/__output__/builder/invoke/Minter.client.ts b/__output__/builder/invoke/Minter.client.ts index 8945b0d4..8aced0b5 100644 --- a/__output__/builder/invoke/Minter.client.ts +++ b/__output__/builder/invoke/Minter.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, Timestamp, Uint64, Uint128, Config, Coin, ConfigResponse, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; export interface MinterReadOnlyInterface { contractAddress: string; @@ -20,9 +20,9 @@ export interface MinterReadOnlyInterface { }) => Promise; } export class MinterQueryClient implements MinterReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -66,37 +66,37 @@ export class MinterQueryClient implements MinterReadOnlyInterface { export interface MinterInterface extends MinterReadOnlyInterface { contractAddress: string; sender: string; - mint: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + mint: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; setWhitelist: ({ whitelist }: { whitelist: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - updateStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + updateStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mintTo: ({ recipient }: { recipient: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - withdraw: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + withdraw: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class MinterClient extends MinterQueryClient implements MinterInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -109,7 +109,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { this.mintFor = this.mintFor.bind(this); this.withdraw = this.withdraw.bind(this); } - mint = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + mint = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: {} }, fee_, memo_, funds_); @@ -118,14 +118,14 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { whitelist }: { whitelist: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_whitelist: { whitelist } }, fee_, memo_, funds_); }; - updateStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + updateStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_start_time: {} }, fee_, memo_, funds_); @@ -134,7 +134,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { perAddressLimit }: { perAddressLimit: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_per_address_limit: { per_address_limit: perAddressLimit @@ -145,7 +145,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { recipient }: { recipient: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_to: { recipient @@ -158,7 +158,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { }: { recipient: string; tokenId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_for: { recipient, @@ -166,7 +166,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { } }, fee_, memo_, funds_); }; - withdraw = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + withdraw = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw: {} }, fee_, memo_, funds_); diff --git a/__output__/builder/invoke/baseClient.ts b/__output__/builder/invoke/baseClient.ts new file mode 100644 index 00000000..a51e9339 --- /dev/null +++ b/__output__/builder/invoke/baseClient.ts @@ -0,0 +1,189 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + + +import { StdFee, Coin, DeliverTxResponse } from '@interchainjs/types'; +import { SigningClient } from '@interchainjs/cosmos/signing-client'; +import { getSmartContractState } from 'interchainjs/cosmwasm/wasm/v1/query.rpc.func'; +import { executeContract } from 'interchainjs/cosmwasm/wasm/v1/tx.rpc.func'; +import { QuerySmartContractStateRequest, QuerySmartContractStateResponse } from 'interchainjs/cosmwasm/wasm/v1/query'; +import { MsgExecuteContract } from 'interchainjs/cosmwasm/wasm/v1/tx'; +import { Chain } from '@chain-registry/v2-types'; + +// Encoding utility functions +const fromUint8Array = (uint8Array: Uint8Array): T => { + const text = new TextDecoder().decode(uint8Array); + return JSON.parse(text); +}; + +const toUint8Array = (obj: any): Uint8Array => { + const text = JSON.stringify(obj); + return new TextEncoder().encode(text); +}; + +// Chain registry configuration +// The amount under gasPrice represents gas price per unit +export interface ChainConfig { + chain?: Chain; + gasPrice?: { + denom: string; + amount: string; + }; +} + +// Gas fee calculation utilities +export const calculateGasFromChain = (chain: Chain, gasAmount: string): StdFee => { + try { + const feeTokens = chain.fees?.feeTokens; + + if (feeTokens && feeTokens.length > 0) { + const primaryToken = feeTokens[0]; + // v2 chain-registry uses camelCase: averageGasPrice, lowGasPrice, fixedMinGasPrice + const gasPrice = primaryToken.averageGasPrice || primaryToken.lowGasPrice || primaryToken.fixedMinGasPrice || 0.025; + const gasAmountNum = parseInt(gasAmount); + const feeAmount = Math.ceil(gasAmountNum * gasPrice).toString(); + + return { + amount: [{ + denom: primaryToken.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + } catch (error) { + console.warn('Failed to calculate gas from chain registry:', error); + } + + // Fallback to default + return { amount: [], gas: gasAmount }; +}; + +// Default gas amount - users can easily change this +export let DEFAULT_GAS_AMOUNT = '200000'; + +// Allow users to set their preferred default gas amount +export const setDefaultGasAmount = (gasAmount: string): void => { + DEFAULT_GAS_AMOUNT = gasAmount; +}; + +// Get current default gas amount +export const getDefaultGasAmount = (): string => DEFAULT_GAS_AMOUNT; + +export const getAutoGasFee = (chainConfig?: ChainConfig): StdFee => { + const gasAmount = DEFAULT_GAS_AMOUNT; + + if (chainConfig?.chain) { + return calculateGasFromChain(chainConfig.chain, gasAmount); + } + + if (chainConfig?.gasPrice) { + const gasAmountNum = parseInt(gasAmount); + const gasPriceNum = parseFloat(chainConfig.gasPrice.amount); + const feeAmount = Math.ceil(gasAmountNum * gasPriceNum).toString(); + + return { + amount: [{ + denom: chainConfig.gasPrice.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + + // Fallback: no fee tokens, just gas amount + return { amount: [], gas: gasAmount }; +}; + +// InterchainJS interfaces for CosmWasm clients +export interface ICosmWasmClient { + queryContractSmart(contractAddr: string, query: any): Promise; +} + +export interface ISigningCosmWasmClient { + execute( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ): Promise; +} + +export interface ISigningClient { + signAndBroadcast( + signerAddress: string, + messages: any[], + fee: number | StdFee | "auto", + memo?: string + ): Promise; +} + +// Helper functions to create InterchainJS clients +export function getCosmWasmClient(rpcEndpoint: string): ICosmWasmClient { + return { + queryContractSmart: async (contractAddr: string, query: any) => { + // Create the request object + const request: QuerySmartContractStateRequest = { + address: contractAddr, + queryData: toUint8Array(query) + }; + + // Execute the query using InterchainJS + const response: QuerySmartContractStateResponse = await getSmartContractState(rpcEndpoint, request); + + // Parse and return the result + return fromUint8Array(response.data); + }, + }; +} + +export function getSigningCosmWasmClient(signingClient: SigningClient): ISigningCosmWasmClient { + return { + execute: async ( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ) => { + // Handle fee conversion + let finalFee: StdFee; + if (typeof fee === 'number') { + finalFee = { amount: [], gas: fee.toString() }; + } else if (fee === 'auto') { + finalFee = getAutoGasFee(chainConfig); + } else if (fee) { + finalFee = fee; + } else { + finalFee = getAutoGasFee(chainConfig); + } + + // Create the message object + const message: MsgExecuteContract = { + sender, + contract: contractAddress, + msg: toUint8Array(msg), + funds: funds || [] + }; + + // Execute the transaction using InterchainJS + const result = await executeContract( + signingClient as any, + sender, + message, + finalFee, + memo || '' + ); + + return result; + }, + }; +} diff --git a/__output__/builder/invoke/bundle.ts b/__output__/builder/invoke/bundle.ts index e2473ca0..59ffdf50 100644 --- a/__output__/builder/invoke/bundle.ts +++ b/__output__/builder/invoke/bundle.ts @@ -19,6 +19,7 @@ import * as _11 from "./CwCodeIdRegistry.react-query"; import * as _12 from "./CwSingle.types"; import * as _13 from "./CwSingle.client"; import * as _14 from "./CwSingle.react-query"; +import * as _15 from "./baseClient"; export namespace contracts { export const Factory = { ..._0, @@ -45,4 +46,7 @@ export namespace contracts { ..._13, ..._14 }; + export const baseClient = { + ..._15 + }; } \ No newline at end of file diff --git a/__output__/builder/no-extends/CwAdminFactory.client.ts b/__output__/builder/no-extends/CwAdminFactory.client.ts index b5fa7ddd..f5aef4e8 100644 --- a/__output__/builder/no-extends/CwAdminFactory.client.ts +++ b/__output__/builder/no-extends/CwAdminFactory.client.ts @@ -4,16 +4,16 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; export interface CwAdminFactoryReadOnlyInterface { contractAddress: string; } export class CwAdminFactoryQueryClient implements CwAdminFactoryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -29,13 +29,13 @@ export interface CwAdminFactoryInterface { codeId: number; instantiateMsg: Binary; label: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwAdminFactoryClient implements CwAdminFactoryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -49,7 +49,7 @@ export class CwAdminFactoryClient implements CwAdminFactoryInterface { codeId: number; instantiateMsg: Binary; label: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { instantiate_contract_with_self_admin: { code_id: codeId, diff --git a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts index 22ce8618..3ae6418d 100644 --- a/__output__/builder/no-extends/CwAdminFactory.message-composer.ts +++ b/__output__/builder/no-extends/CwAdminFactory.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; export interface CwAdminFactoryMsg { contractAddress: string; @@ -20,7 +20,7 @@ export interface CwAdminFactoryMsg { codeId: number; instantiateMsg: Binary; label: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { sender: string; @@ -38,7 +38,7 @@ export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { codeId: number; instantiateMsg: Binary; label: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.client.ts b/__output__/builder/no-extends/CwCodeIdRegistry.client.ts index 7023ff59..30486add 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.client.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; export interface CwCodeIdRegistryReadOnlyInterface { contractAddress: string; @@ -35,9 +35,9 @@ export interface CwCodeIdRegistryReadOnlyInterface { }) => Promise; } export class CwCodeIdRegistryQueryClient implements CwCodeIdRegistryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -107,7 +107,7 @@ export interface CwCodeIdRegistryInterface { amount: Uint128; msg: Binary; sender: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; register: ({ chainId, checksum, @@ -120,7 +120,7 @@ export interface CwCodeIdRegistryInterface { codeId: number; name: string; version: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; setOwner: ({ chainId, name, @@ -129,27 +129,27 @@ export interface CwCodeIdRegistryInterface { chainId: string; name: string; owner?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -167,7 +167,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { amount: Uint128; msg: Binary; sender: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, @@ -188,7 +188,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { codeId: number; name: string; version: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register: { chain_id: chainId, @@ -207,7 +207,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { chainId: string; name: string; owner?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_owner: { chain_id: chainId, @@ -222,7 +222,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { }: { chainId: string; codeId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister: { chain_id: chainId, @@ -236,7 +236,7 @@ export class CwCodeIdRegistryClient implements CwCodeIdRegistryInterface { }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { admin, diff --git a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts index 52549383..454b0c1d 100644 --- a/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts +++ b/__output__/builder/no-extends/CwCodeIdRegistry.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; export interface CwCodeIdRegistryMsg { contractAddress: string; @@ -20,7 +20,7 @@ export interface CwCodeIdRegistryMsg { amount: Uint128; msg: Binary; sender: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; register: ({ chainId, checksum, @@ -33,7 +33,7 @@ export interface CwCodeIdRegistryMsg { codeId: number; name: string; version: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; setOwner: ({ chainId, name, @@ -42,21 +42,21 @@ export interface CwCodeIdRegistryMsg { chainId: string; name: string; owner?: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { sender: string; @@ -78,7 +78,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { amount: Uint128; msg: Binary; sender: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -107,7 +107,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { codeId: number; name: string; version: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -134,7 +134,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { chainId: string; name: string; owner?: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -157,7 +157,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { }: { chainId: string; codeId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -179,7 +179,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/no-extends/CwSingle.client.ts b/__output__/builder/no-extends/CwSingle.client.ts index 7c4c65f8..3d858b91 100644 --- a/__output__/builder/no-extends/CwSingle.client.ts +++ b/__output__/builder/no-extends/CwSingle.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; export interface CwSingleReadOnlyInterface { contractAddress: string; @@ -51,9 +51,9 @@ export interface CwSingleReadOnlyInterface { info: () => Promise; } export class CwSingleQueryClient implements CwSingleReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -174,24 +174,24 @@ export interface CwSingleInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -208,33 +208,33 @@ export interface CwSingleInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwSingleClient implements CwSingleInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -256,7 +256,7 @@ export class CwSingleClient implements CwSingleInterface { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, @@ -271,7 +271,7 @@ export class CwSingleClient implements CwSingleInterface { }: { proposalId: number; vote: Vote; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, @@ -283,7 +283,7 @@ export class CwSingleClient implements CwSingleInterface { proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId @@ -294,7 +294,7 @@ export class CwSingleClient implements CwSingleInterface { proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId @@ -317,7 +317,7 @@ export class CwSingleClient implements CwSingleInterface { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -334,7 +334,7 @@ export class CwSingleClient implements CwSingleInterface { address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address @@ -345,7 +345,7 @@ export class CwSingleClient implements CwSingleInterface { address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address @@ -356,7 +356,7 @@ export class CwSingleClient implements CwSingleInterface { address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address @@ -367,7 +367,7 @@ export class CwSingleClient implements CwSingleInterface { address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address diff --git a/__output__/builder/no-extends/CwSingle.message-composer.ts b/__output__/builder/no-extends/CwSingle.message-composer.ts index d848ba61..a1918731 100644 --- a/__output__/builder/no-extends/CwSingle.message-composer.ts +++ b/__output__/builder/no-extends/CwSingle.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwSingle.types"; export interface CwSingleMsg { contractAddress: string; @@ -19,24 +19,24 @@ export interface CwSingleMsg { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; execute: ({ proposalId }: { proposalId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; close: ({ proposalId }: { proposalId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateConfig: ({ allowRevoting, dao, @@ -53,27 +53,27 @@ export interface CwSingleMsg { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addProposalHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeProposalHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addVoteHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeVoteHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwSingleMsgComposer implements CwSingleMsg { sender: string; @@ -99,7 +99,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -122,7 +122,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { }: { proposalId: number; vote: Vote; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -142,7 +142,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { proposalId }: { proposalId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -161,7 +161,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { proposalId }: { proposalId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -192,7 +192,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -217,7 +217,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -236,7 +236,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -255,7 +255,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -274,7 +274,7 @@ export class CwSingleMsgComposer implements CwSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/no-extends/Factory.client.ts b/__output__/builder/no-extends/Factory.client.ts index 0cb3b137..1b670c8c 100644 --- a/__output__/builder/no-extends/Factory.client.ts +++ b/__output__/builder/no-extends/Factory.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; export interface FactoryReadOnlyInterface { contractAddress: string; @@ -35,9 +35,9 @@ export interface FactoryReadOnlyInterface { adminAddr: () => Promise; } export class FactoryQueryClient implements FactoryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.wallets = this.wallets.bind(this); @@ -112,49 +112,49 @@ export interface FactoryInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateWalletFee: ({ newFee }: { newFee: Coin; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateGovecAddr: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateAdmin: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class FactoryClient implements FactoryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -170,7 +170,7 @@ export class FactoryClient implements FactoryInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_wallet: { create_wallet_msg: createWalletMsg @@ -183,7 +183,7 @@ export class FactoryClient implements FactoryInterface { }: { newUser: Addr; oldUser: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_proxy_user: { new_user: newUser, @@ -197,7 +197,7 @@ export class FactoryClient implements FactoryInterface { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { migrate_wallet: { migration_msg: migrationMsg, @@ -211,7 +211,7 @@ export class FactoryClient implements FactoryInterface { }: { newCodeId: number; ty: CodeIdType; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_code_id: { new_code_id: newCodeId, @@ -223,7 +223,7 @@ export class FactoryClient implements FactoryInterface { newFee }: { newFee: Coin; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_wallet_fee: { new_fee: newFee @@ -234,7 +234,7 @@ export class FactoryClient implements FactoryInterface { addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_govec_addr: { addr @@ -245,7 +245,7 @@ export class FactoryClient implements FactoryInterface { addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { addr diff --git a/__output__/builder/no-extends/Factory.message-composer.ts b/__output__/builder/no-extends/Factory.message-composer.ts index 7929f947..88112d8d 100644 --- a/__output__/builder/no-extends/Factory.message-composer.ts +++ b/__output__/builder/no-extends/Factory.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; export interface FactoryMsg { contractAddress: string; @@ -15,43 +15,43 @@ export interface FactoryMsg { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateWalletFee: ({ newFee }: { newFee: Coin; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateGovecAddr: ({ addr }: { addr: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateAdmin: ({ addr }: { addr: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class FactoryMsgComposer implements FactoryMsg { sender: string; @@ -71,7 +71,7 @@ export class FactoryMsgComposer implements FactoryMsg { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -92,7 +92,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { newUser: Addr; oldUser: Addr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -114,7 +114,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -136,7 +136,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { newCodeId: number; ty: CodeIdType; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -156,7 +156,7 @@ export class FactoryMsgComposer implements FactoryMsg { newFee }: { newFee: Coin; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -175,7 +175,7 @@ export class FactoryMsgComposer implements FactoryMsg { addr }: { addr: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -194,7 +194,7 @@ export class FactoryMsgComposer implements FactoryMsg { addr }: { addr: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/no-extends/Minter.client.ts b/__output__/builder/no-extends/Minter.client.ts index bc909514..02ed98d9 100644 --- a/__output__/builder/no-extends/Minter.client.ts +++ b/__output__/builder/no-extends/Minter.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, Timestamp, Uint64, Uint128, Config, Coin, ConfigResponse, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; export interface MinterReadOnlyInterface { contractAddress: string; @@ -20,9 +20,9 @@ export interface MinterReadOnlyInterface { }) => Promise; } export class MinterQueryClient implements MinterReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -66,37 +66,37 @@ export class MinterQueryClient implements MinterReadOnlyInterface { export interface MinterInterface { contractAddress: string; sender: string; - mint: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + mint: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; setWhitelist: ({ whitelist }: { whitelist: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - updateStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + updateStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mintTo: ({ recipient }: { recipient: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - withdraw: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + withdraw: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class MinterClient implements MinterInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -108,7 +108,7 @@ export class MinterClient implements MinterInterface { this.mintFor = this.mintFor.bind(this); this.withdraw = this.withdraw.bind(this); } - mint = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + mint = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: {} }, fee_, memo_, funds_); @@ -117,14 +117,14 @@ export class MinterClient implements MinterInterface { whitelist }: { whitelist: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_whitelist: { whitelist } }, fee_, memo_, funds_); }; - updateStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + updateStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_start_time: {} }, fee_, memo_, funds_); @@ -133,7 +133,7 @@ export class MinterClient implements MinterInterface { perAddressLimit }: { perAddressLimit: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_per_address_limit: { per_address_limit: perAddressLimit @@ -144,7 +144,7 @@ export class MinterClient implements MinterInterface { recipient }: { recipient: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_to: { recipient @@ -157,7 +157,7 @@ export class MinterClient implements MinterInterface { }: { recipient: string; tokenId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_for: { recipient, @@ -165,7 +165,7 @@ export class MinterClient implements MinterInterface { } }, fee_, memo_, funds_); }; - withdraw = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + withdraw = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw: {} }, fee_, memo_, funds_); diff --git a/__output__/builder/no-extends/Minter.message-composer.ts b/__output__/builder/no-extends/Minter.message-composer.ts index 96c264bb..6e8a0d29 100644 --- a/__output__/builder/no-extends/Minter.message-composer.ts +++ b/__output__/builder/no-extends/Minter.message-composer.ts @@ -4,38 +4,38 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, Timestamp, Uint64, Uint128, Config, Coin, ConfigResponse, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; export interface MinterMsg { contractAddress: string; sender: string; - mint: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + mint: (funds_?: Coin[]) => EncodeObject; setWhitelist: ({ whitelist }: { whitelist: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - updateStartTime: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + updateStartTime: (funds_?: Coin[]) => EncodeObject; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; mintTo: ({ recipient }: { recipient: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - withdraw: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + withdraw: (funds_?: Coin[]) => EncodeObject; } export class MinterMsgComposer implements MinterMsg { sender: string; @@ -51,7 +51,7 @@ export class MinterMsgComposer implements MinterMsg { this.mintFor = this.mintFor.bind(this); this.withdraw = this.withdraw.bind(this); } - mint = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + mint = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -68,7 +68,7 @@ export class MinterMsgComposer implements MinterMsg { whitelist }: { whitelist: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -83,7 +83,7 @@ export class MinterMsgComposer implements MinterMsg { }) }; }; - updateStartTime = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + updateStartTime = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -100,7 +100,7 @@ export class MinterMsgComposer implements MinterMsg { perAddressLimit }: { perAddressLimit: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -119,7 +119,7 @@ export class MinterMsgComposer implements MinterMsg { recipient }: { recipient: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -140,7 +140,7 @@ export class MinterMsgComposer implements MinterMsg { }: { recipient: string; tokenId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -156,7 +156,7 @@ export class MinterMsgComposer implements MinterMsg { }) }; }; - withdraw = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + withdraw = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/builder/no-extends/baseClient.ts b/__output__/builder/no-extends/baseClient.ts new file mode 100644 index 00000000..a51e9339 --- /dev/null +++ b/__output__/builder/no-extends/baseClient.ts @@ -0,0 +1,189 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + + +import { StdFee, Coin, DeliverTxResponse } from '@interchainjs/types'; +import { SigningClient } from '@interchainjs/cosmos/signing-client'; +import { getSmartContractState } from 'interchainjs/cosmwasm/wasm/v1/query.rpc.func'; +import { executeContract } from 'interchainjs/cosmwasm/wasm/v1/tx.rpc.func'; +import { QuerySmartContractStateRequest, QuerySmartContractStateResponse } from 'interchainjs/cosmwasm/wasm/v1/query'; +import { MsgExecuteContract } from 'interchainjs/cosmwasm/wasm/v1/tx'; +import { Chain } from '@chain-registry/v2-types'; + +// Encoding utility functions +const fromUint8Array = (uint8Array: Uint8Array): T => { + const text = new TextDecoder().decode(uint8Array); + return JSON.parse(text); +}; + +const toUint8Array = (obj: any): Uint8Array => { + const text = JSON.stringify(obj); + return new TextEncoder().encode(text); +}; + +// Chain registry configuration +// The amount under gasPrice represents gas price per unit +export interface ChainConfig { + chain?: Chain; + gasPrice?: { + denom: string; + amount: string; + }; +} + +// Gas fee calculation utilities +export const calculateGasFromChain = (chain: Chain, gasAmount: string): StdFee => { + try { + const feeTokens = chain.fees?.feeTokens; + + if (feeTokens && feeTokens.length > 0) { + const primaryToken = feeTokens[0]; + // v2 chain-registry uses camelCase: averageGasPrice, lowGasPrice, fixedMinGasPrice + const gasPrice = primaryToken.averageGasPrice || primaryToken.lowGasPrice || primaryToken.fixedMinGasPrice || 0.025; + const gasAmountNum = parseInt(gasAmount); + const feeAmount = Math.ceil(gasAmountNum * gasPrice).toString(); + + return { + amount: [{ + denom: primaryToken.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + } catch (error) { + console.warn('Failed to calculate gas from chain registry:', error); + } + + // Fallback to default + return { amount: [], gas: gasAmount }; +}; + +// Default gas amount - users can easily change this +export let DEFAULT_GAS_AMOUNT = '200000'; + +// Allow users to set their preferred default gas amount +export const setDefaultGasAmount = (gasAmount: string): void => { + DEFAULT_GAS_AMOUNT = gasAmount; +}; + +// Get current default gas amount +export const getDefaultGasAmount = (): string => DEFAULT_GAS_AMOUNT; + +export const getAutoGasFee = (chainConfig?: ChainConfig): StdFee => { + const gasAmount = DEFAULT_GAS_AMOUNT; + + if (chainConfig?.chain) { + return calculateGasFromChain(chainConfig.chain, gasAmount); + } + + if (chainConfig?.gasPrice) { + const gasAmountNum = parseInt(gasAmount); + const gasPriceNum = parseFloat(chainConfig.gasPrice.amount); + const feeAmount = Math.ceil(gasAmountNum * gasPriceNum).toString(); + + return { + amount: [{ + denom: chainConfig.gasPrice.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + + // Fallback: no fee tokens, just gas amount + return { amount: [], gas: gasAmount }; +}; + +// InterchainJS interfaces for CosmWasm clients +export interface ICosmWasmClient { + queryContractSmart(contractAddr: string, query: any): Promise; +} + +export interface ISigningCosmWasmClient { + execute( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ): Promise; +} + +export interface ISigningClient { + signAndBroadcast( + signerAddress: string, + messages: any[], + fee: number | StdFee | "auto", + memo?: string + ): Promise; +} + +// Helper functions to create InterchainJS clients +export function getCosmWasmClient(rpcEndpoint: string): ICosmWasmClient { + return { + queryContractSmart: async (contractAddr: string, query: any) => { + // Create the request object + const request: QuerySmartContractStateRequest = { + address: contractAddr, + queryData: toUint8Array(query) + }; + + // Execute the query using InterchainJS + const response: QuerySmartContractStateResponse = await getSmartContractState(rpcEndpoint, request); + + // Parse and return the result + return fromUint8Array(response.data); + }, + }; +} + +export function getSigningCosmWasmClient(signingClient: SigningClient): ISigningCosmWasmClient { + return { + execute: async ( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ) => { + // Handle fee conversion + let finalFee: StdFee; + if (typeof fee === 'number') { + finalFee = { amount: [], gas: fee.toString() }; + } else if (fee === 'auto') { + finalFee = getAutoGasFee(chainConfig); + } else if (fee) { + finalFee = fee; + } else { + finalFee = getAutoGasFee(chainConfig); + } + + // Create the message object + const message: MsgExecuteContract = { + sender, + contract: contractAddress, + msg: toUint8Array(msg), + funds: funds || [] + }; + + // Execute the transaction using InterchainJS + const result = await executeContract( + signingClient as any, + sender, + message, + finalFee, + memo || '' + ); + + return result; + }, + }; +} diff --git a/__output__/builder/no-extends/index.ts b/__output__/builder/no-extends/index.ts index 411acd2a..4d610ecd 100644 --- a/__output__/builder/no-extends/index.ts +++ b/__output__/builder/no-extends/index.ts @@ -4,77 +4,81 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import * as _53 from "./Factory.types"; -import * as _54 from "./Factory.client"; -import * as _55 from "./Factory.message-composer"; -import * as _56 from "./Factory.react-query"; -import * as _57 from "./Factory.recoil"; -import * as _58 from "./Factory.message-builder"; -import * as _59 from "./Minter.types"; -import * as _60 from "./Minter.client"; -import * as _61 from "./Minter.message-composer"; -import * as _62 from "./Minter.react-query"; -import * as _63 from "./Minter.recoil"; -import * as _64 from "./Minter.message-builder"; -import * as _65 from "./CwAdminFactory.types"; -import * as _66 from "./CwAdminFactory.client"; -import * as _67 from "./CwAdminFactory.message-composer"; -import * as _68 from "./CwAdminFactory.react-query"; -import * as _69 from "./CwAdminFactory.recoil"; -import * as _70 from "./CwAdminFactory.message-builder"; -import * as _71 from "./CwCodeIdRegistry.types"; -import * as _72 from "./CwCodeIdRegistry.client"; -import * as _73 from "./CwCodeIdRegistry.message-composer"; -import * as _74 from "./CwCodeIdRegistry.react-query"; -import * as _75 from "./CwCodeIdRegistry.recoil"; -import * as _76 from "./CwCodeIdRegistry.message-builder"; -import * as _77 from "./CwSingle.types"; -import * as _78 from "./CwSingle.client"; -import * as _79 from "./CwSingle.message-composer"; -import * as _80 from "./CwSingle.react-query"; -import * as _81 from "./CwSingle.recoil"; -import * as _82 from "./CwSingle.message-builder"; +import * as _55 from "./Factory.types"; +import * as _56 from "./Factory.client"; +import * as _57 from "./Factory.message-composer"; +import * as _58 from "./Factory.react-query"; +import * as _59 from "./Factory.recoil"; +import * as _60 from "./Factory.message-builder"; +import * as _61 from "./Minter.types"; +import * as _62 from "./Minter.client"; +import * as _63 from "./Minter.message-composer"; +import * as _64 from "./Minter.react-query"; +import * as _65 from "./Minter.recoil"; +import * as _66 from "./Minter.message-builder"; +import * as _67 from "./CwAdminFactory.types"; +import * as _68 from "./CwAdminFactory.client"; +import * as _69 from "./CwAdminFactory.message-composer"; +import * as _70 from "./CwAdminFactory.react-query"; +import * as _71 from "./CwAdminFactory.recoil"; +import * as _72 from "./CwAdminFactory.message-builder"; +import * as _73 from "./CwCodeIdRegistry.types"; +import * as _74 from "./CwCodeIdRegistry.client"; +import * as _75 from "./CwCodeIdRegistry.message-composer"; +import * as _76 from "./CwCodeIdRegistry.react-query"; +import * as _77 from "./CwCodeIdRegistry.recoil"; +import * as _78 from "./CwCodeIdRegistry.message-builder"; +import * as _79 from "./CwSingle.types"; +import * as _80 from "./CwSingle.client"; +import * as _81 from "./CwSingle.message-composer"; +import * as _82 from "./CwSingle.react-query"; +import * as _83 from "./CwSingle.recoil"; +import * as _84 from "./CwSingle.message-builder"; +import * as _85 from "./baseClient"; export namespace smart { export namespace contracts { export const Factory = { - ..._53, - ..._54, ..._55, ..._56, ..._57, - ..._58 + ..._58, + ..._59, + ..._60 }; export const Minter = { - ..._59, - ..._60, ..._61, ..._62, ..._63, - ..._64 + ..._64, + ..._65, + ..._66 }; export const CwAdminFactory = { - ..._65, - ..._66, ..._67, ..._68, ..._69, - ..._70 + ..._70, + ..._71, + ..._72 }; export const CwCodeIdRegistry = { - ..._71, - ..._72, ..._73, ..._74, ..._75, - ..._76 + ..._76, + ..._77, + ..._78 }; export const CwSingle = { - ..._77, - ..._78, ..._79, ..._80, ..._81, - ..._82 + ..._82, + ..._83, + ..._84 + }; + export const baseClient = { + ..._85 }; } } \ No newline at end of file diff --git a/__output__/daodao/cw-admin-factory/CwAdminFactory.client.ts b/__output__/daodao/cw-admin-factory/CwAdminFactory.client.ts index 64c66aee..e8a8fcd8 100644 --- a/__output__/daodao/cw-admin-factory/CwAdminFactory.client.ts +++ b/__output__/daodao/cw-admin-factory/CwAdminFactory.client.ts @@ -4,16 +4,16 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; export interface CwAdminFactoryReadOnlyInterface { contractAddress: string; } export class CwAdminFactoryQueryClient implements CwAdminFactoryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -29,13 +29,13 @@ export interface CwAdminFactoryInterface extends CwAdminFactoryReadOnlyInterface codeId: number; instantiateMsg: Binary; label: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements CwAdminFactoryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -50,7 +50,7 @@ export class CwAdminFactoryClient extends CwAdminFactoryQueryClient implements C codeId: number; instantiateMsg: Binary; label: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { instantiate_contract_with_self_admin: { code_id: codeId, diff --git a/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts b/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts index 22ce8618..3ae6418d 100644 --- a/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts +++ b/__output__/daodao/cw-admin-factory/CwAdminFactory.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { ExecuteMsg, Binary, InstantiateMsg, QueryMsg } from "./CwAdminFactory.types"; export interface CwAdminFactoryMsg { contractAddress: string; @@ -20,7 +20,7 @@ export interface CwAdminFactoryMsg { codeId: number; instantiateMsg: Binary; label: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { sender: string; @@ -38,7 +38,7 @@ export class CwAdminFactoryMsgComposer implements CwAdminFactoryMsg { codeId: number; instantiateMsg: Binary; label: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.client.ts b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.client.ts index 59e6ff67..90fe4821 100644 --- a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.client.ts +++ b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; export interface CwCodeIdRegistryReadOnlyInterface { contractAddress: string; @@ -35,9 +35,9 @@ export interface CwCodeIdRegistryReadOnlyInterface { }) => Promise; } export class CwCodeIdRegistryQueryClient implements CwCodeIdRegistryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -107,7 +107,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter amount: Uint128; msg: Binary; sender: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; register: ({ chainId, checksum, @@ -120,7 +120,7 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter codeId: number; name: string; version: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; setOwner: ({ chainId, name, @@ -129,27 +129,27 @@ export interface CwCodeIdRegistryInterface extends CwCodeIdRegistryReadOnlyInter chainId: string; name: string; owner?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implements CwCodeIdRegistryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -168,7 +168,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen amount: Uint128; msg: Binary; sender: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, @@ -189,7 +189,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen codeId: number; name: string; version: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { register: { chain_id: chainId, @@ -208,7 +208,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen chainId: string; name: string; owner?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_owner: { chain_id: chainId, @@ -223,7 +223,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { chainId: string; codeId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { unregister: { chain_id: chainId, @@ -237,7 +237,7 @@ export class CwCodeIdRegistryClient extends CwCodeIdRegistryQueryClient implemen }: { admin?: string; paymentInfo?: PaymentInfo; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { admin, diff --git a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts index 52549383..454b0c1d 100644 --- a/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts +++ b/__output__/daodao/cw-code-id-registry/CwCodeIdRegistry.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, PaymentInfo, Uint128, ConfigResponse, ExecuteMsg, Binary, Cw20ReceiveMsg, GetRegistrationResponse, Registration, InfoForCodeIdResponse, InstantiateMsg, ListRegistrationsResponse, QueryMsg, ReceiveMsg } from "./CwCodeIdRegistry.types"; export interface CwCodeIdRegistryMsg { contractAddress: string; @@ -20,7 +20,7 @@ export interface CwCodeIdRegistryMsg { amount: Uint128; msg: Binary; sender: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; register: ({ chainId, checksum, @@ -33,7 +33,7 @@ export interface CwCodeIdRegistryMsg { codeId: number; name: string; version: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; setOwner: ({ chainId, name, @@ -42,21 +42,21 @@ export interface CwCodeIdRegistryMsg { chainId: string; name: string; owner?: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; unregister: ({ chainId, codeId }: { chainId: string; codeId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateConfig: ({ admin, paymentInfo }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { sender: string; @@ -78,7 +78,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { amount: Uint128; msg: Binary; sender: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -107,7 +107,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { codeId: number; name: string; version: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -134,7 +134,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { chainId: string; name: string; owner?: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -157,7 +157,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { }: { chainId: string; codeId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -179,7 +179,7 @@ export class CwCodeIdRegistryMsgComposer implements CwCodeIdRegistryMsg { }: { admin?: string; paymentInfo?: PaymentInfo; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/daodao/cw-named-groups/CwNamedGroups.client.ts b/__output__/daodao/cw-named-groups/CwNamedGroups.client.ts index 6b61ee81..fcf9cefe 100644 --- a/__output__/daodao/cw-named-groups/CwNamedGroups.client.ts +++ b/__output__/daodao/cw-named-groups/CwNamedGroups.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { DumpResponse, Group, ExecuteMsg, InstantiateMsg, Addr, ListAddressesResponse, ListGroupsResponse, QueryMsg } from "./CwNamedGroups.types"; export interface CwNamedGroupsReadOnlyInterface { contractAddress: string; @@ -37,9 +37,9 @@ export interface CwNamedGroupsReadOnlyInterface { }) => Promise; } export class CwNamedGroupsQueryClient implements CwNamedGroupsReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.dump = this.dump.bind(this); @@ -112,23 +112,23 @@ export interface CwNamedGroupsInterface extends CwNamedGroupsReadOnlyInterface { addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeGroup: ({ group }: { group: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateOwner: ({ owner }: { owner: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwNamedGroupsClient extends CwNamedGroupsQueryClient implements CwNamedGroupsInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -145,7 +145,7 @@ export class CwNamedGroupsClient extends CwNamedGroupsQueryClient implements CwN addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update: { addresses_to_add: addressesToAdd, @@ -158,7 +158,7 @@ export class CwNamedGroupsClient extends CwNamedGroupsQueryClient implements CwN group }: { group: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_group: { group @@ -169,7 +169,7 @@ export class CwNamedGroupsClient extends CwNamedGroupsQueryClient implements CwN owner }: { owner: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_owner: { owner diff --git a/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts b/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts index e5636426..12e7583e 100644 --- a/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts +++ b/__output__/daodao/cw-named-groups/CwNamedGroups.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { DumpResponse, Group, ExecuteMsg, InstantiateMsg, Addr, ListAddressesResponse, ListGroupsResponse, QueryMsg } from "./CwNamedGroups.types"; export interface CwNamedGroupsMsg { contractAddress: string; @@ -20,17 +20,17 @@ export interface CwNamedGroupsMsg { addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeGroup: ({ group }: { group: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateOwner: ({ owner }: { owner: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwNamedGroupsMsgComposer implements CwNamedGroupsMsg { sender: string; @@ -50,7 +50,7 @@ export class CwNamedGroupsMsgComposer implements CwNamedGroupsMsg { addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -71,7 +71,7 @@ export class CwNamedGroupsMsgComposer implements CwNamedGroupsMsg { group }: { group: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -90,7 +90,7 @@ export class CwNamedGroupsMsgComposer implements CwNamedGroupsMsg { owner }: { owner: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/daodao/cw-proposal-single/CwProposalSingle.client.ts b/__output__/daodao/cw-proposal-single/CwProposalSingle.client.ts index 6970026d..592ff547 100644 --- a/__output__/daodao/cw-proposal-single/CwProposalSingle.client.ts +++ b/__output__/daodao/cw-proposal-single/CwProposalSingle.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwProposalSingle.types"; export interface CwProposalSingleReadOnlyInterface { contractAddress: string; @@ -51,9 +51,9 @@ export interface CwProposalSingleReadOnlyInterface { info: () => Promise; } export class CwProposalSingleQueryClient implements CwProposalSingleReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -174,24 +174,24 @@ export interface CwProposalSingleInterface extends CwProposalSingleReadOnlyInter description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -208,33 +208,33 @@ export interface CwProposalSingleInterface extends CwProposalSingleReadOnlyInter minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CwProposalSingleClient extends CwProposalSingleQueryClient implements CwProposalSingleInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -257,7 +257,7 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, @@ -272,7 +272,7 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen }: { proposalId: number; vote: Vote; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, @@ -284,7 +284,7 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId @@ -295,7 +295,7 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId @@ -318,7 +318,7 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -335,7 +335,7 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address @@ -346,7 +346,7 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address @@ -357,7 +357,7 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address @@ -368,7 +368,7 @@ export class CwProposalSingleClient extends CwProposalSingleQueryClient implemen address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address diff --git a/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts b/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts index ccf5cb16..61654b33 100644 --- a/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts +++ b/__output__/daodao/cw-proposal-single/CwProposalSingle.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, Uint128, Duration, Threshold, PercentageThreshold, Decimal, ConfigResponse, CheckedDepositInfo, ExecuteMsg, CosmosMsgForEmpty, BankMsg, StakingMsg, DistributionMsg, Binary, IbcMsg, Timestamp, Uint64, WasmMsg, GovMsg, VoteOption, Vote, DepositToken, Coin, Empty, IbcTimeout, IbcTimeoutBlock, DepositInfo, GovernanceModulesResponse, InfoResponse, ContractVersion, InstantiateMsg, Expiration, Status, ListProposalsResponse, ProposalResponse, Proposal, Votes, ListVotesResponse, VoteInfo, MigrateMsg, ProposalCountResponse, ProposalHooksResponse, QueryMsg, ReverseProposalsResponse, VoteHooksResponse, VoteResponse } from "./CwProposalSingle.types"; export interface CwProposalSingleMsg { contractAddress: string; @@ -19,24 +19,24 @@ export interface CwProposalSingleMsg { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; execute: ({ proposalId }: { proposalId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; close: ({ proposalId }: { proposalId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateConfig: ({ allowRevoting, dao, @@ -53,27 +53,27 @@ export interface CwProposalSingleMsg { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addProposalHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeProposalHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addVoteHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeVoteHook: ({ address }: { address: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class CwProposalSingleMsgComposer implements CwProposalSingleMsg { sender: string; @@ -99,7 +99,7 @@ export class CwProposalSingleMsgComposer implements CwProposalSingleMsg { description: string; msgs: CosmosMsgForEmpty[]; title: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -122,7 +122,7 @@ export class CwProposalSingleMsgComposer implements CwProposalSingleMsg { }: { proposalId: number; vote: Vote; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -142,7 +142,7 @@ export class CwProposalSingleMsgComposer implements CwProposalSingleMsg { proposalId }: { proposalId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -161,7 +161,7 @@ export class CwProposalSingleMsgComposer implements CwProposalSingleMsg { proposalId }: { proposalId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -192,7 +192,7 @@ export class CwProposalSingleMsgComposer implements CwProposalSingleMsg { minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -217,7 +217,7 @@ export class CwProposalSingleMsgComposer implements CwProposalSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -236,7 +236,7 @@ export class CwProposalSingleMsgComposer implements CwProposalSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -255,7 +255,7 @@ export class CwProposalSingleMsgComposer implements CwProposalSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -274,7 +274,7 @@ export class CwProposalSingleMsgComposer implements CwProposalSingleMsg { address }: { address: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/idl-version/accounts-nft/AccountsNft.client.ts b/__output__/idl-version/accounts-nft/AccountsNft.client.ts index 5ca96aae..0a826cf0 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.client.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, VaultBaseForString, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ArrayOfVaultBaseForString, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; export interface AccountsNftReadOnlyInterface { contractAddress: string; @@ -92,9 +92,9 @@ export interface AccountsNftReadOnlyInterface { minter: () => Promise; } export class AccountsNftQueryClient implements AccountsNftReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.proposedNewOwner = this.proposedNewOwner.bind(this); @@ -295,20 +295,20 @@ export interface AccountsNftInterface extends AccountsNftReadOnlyInterface { newOwner }: { newOwner: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - acceptOwnership: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + acceptOwnership: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mint: ({ user }: { user: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; transferNft: ({ recipient, tokenId }: { recipient: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; sendNft: ({ contract, msg, @@ -317,7 +317,7 @@ export interface AccountsNftInterface extends AccountsNftReadOnlyInterface { contract: string; msg: Binary; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approve: ({ expires, spender, @@ -326,37 +326,37 @@ export interface AccountsNftInterface extends AccountsNftReadOnlyInterface { expires?: Expiration; spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; revokeAll: ({ operator }: { operator: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; burn: ({ tokenId }: { tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class AccountsNftClient extends AccountsNftQueryClient implements AccountsNftInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -376,14 +376,14 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account newOwner }: { newOwner: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose_new_owner: { new_owner: newOwner } }, fee_, memo_, funds_); }; - acceptOwnership = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + acceptOwnership = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { accept_ownership: {} }, fee_, memo_, funds_); @@ -392,7 +392,7 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account user }: { user: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { user @@ -405,7 +405,7 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -421,7 +421,7 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -438,7 +438,7 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -453,7 +453,7 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -467,7 +467,7 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -479,7 +479,7 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -490,7 +490,7 @@ export class AccountsNftClient extends AccountsNftQueryClient implements Account tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId diff --git a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts index a0c07119..e1d08bbe 100644 --- a/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts +++ b/__output__/idl-version/accounts-nft/AccountsNft.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, QueryMsg, VaultBaseForString, Uint128, ArrayOfSharesResponseItem, SharesResponseItem, AllNftInfoResponseForEmpty, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, OperatorsResponse, String, TokensResponse, ArrayOfVaultBaseForString, ApprovalResponse, ApprovalsResponse, ContractInfoResponse, MinterResponse, NumTokensResponse } from "./AccountsNft.types"; export interface AccountsNftMsg { contractAddress: string; @@ -16,20 +16,20 @@ export interface AccountsNftMsg { newOwner }: { newOwner: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - acceptOwnership: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + acceptOwnership: (funds_?: Coin[]) => EncodeObject; mint: ({ user }: { user: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; transferNft: ({ recipient, tokenId }: { recipient: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; sendNft: ({ contract, msg, @@ -38,7 +38,7 @@ export interface AccountsNftMsg { contract: string; msg: Binary; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; approve: ({ expires, spender, @@ -47,31 +47,31 @@ export interface AccountsNftMsg { expires?: Expiration; spender: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; revokeAll: ({ operator }: { operator: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; burn: ({ tokenId }: { tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class AccountsNftMsgComposer implements AccountsNftMsg { sender: string; @@ -94,7 +94,7 @@ export class AccountsNftMsgComposer implements AccountsNftMsg { newOwner }: { newOwner: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -109,7 +109,7 @@ export class AccountsNftMsgComposer implements AccountsNftMsg { }) }; }; - acceptOwnership = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + acceptOwnership = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -126,7 +126,7 @@ export class AccountsNftMsgComposer implements AccountsNftMsg { user }: { user: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -147,7 +147,7 @@ export class AccountsNftMsgComposer implements AccountsNftMsg { }: { recipient: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -171,7 +171,7 @@ export class AccountsNftMsgComposer implements AccountsNftMsg { contract: string; msg: Binary; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -196,7 +196,7 @@ export class AccountsNftMsgComposer implements AccountsNftMsg { expires?: Expiration; spender: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -219,7 +219,7 @@ export class AccountsNftMsgComposer implements AccountsNftMsg { }: { spender: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -241,7 +241,7 @@ export class AccountsNftMsgComposer implements AccountsNftMsg { }: { expires?: Expiration; operator: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -261,7 +261,7 @@ export class AccountsNftMsgComposer implements AccountsNftMsg { operator }: { operator: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -280,7 +280,7 @@ export class AccountsNftMsgComposer implements AccountsNftMsg { tokenId }: { tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts index d544c0d9..75c62d16 100644 --- a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Duration, Threshold, Decimal, InstantiateMsg, Voter, ExecuteMsg, Expiration, Timestamp, Uint64, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Vote, Coin, Empty, QueryMsg, Status, ThresholdResponse, ProposalListResponse, ProposalResponseForEmpty, VoterListResponse, VoterDetail, VoteListResponse, VoteInfo, VoteResponse, VoterResponse } from "./Cw3FixedMultiSig.types"; export interface Cw3FixedMultiSigReadOnlyInterface { contractAddress: string; @@ -59,9 +59,9 @@ export interface Cw3FixedMultiSigReadOnlyInterface { }) => Promise; } export class Cw3FixedMultiSigQueryClient implements Cw3FixedMultiSigReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.threshold = this.threshold.bind(this); @@ -187,30 +187,30 @@ export interface Cw3FixedMultiSigInterface extends Cw3FixedMultiSigReadOnlyInter latest?: Expiration; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class Cw3FixedMultiSigClient extends Cw3FixedMultiSigQueryClient implements Cw3FixedMultiSigInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -230,7 +230,7 @@ export class Cw3FixedMultiSigClient extends Cw3FixedMultiSigQueryClient implemen latest?: Expiration; msgs: CosmosMsgForEmpty[]; title: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, @@ -246,7 +246,7 @@ export class Cw3FixedMultiSigClient extends Cw3FixedMultiSigQueryClient implemen }: { proposalId: number; vote: Vote; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, @@ -258,7 +258,7 @@ export class Cw3FixedMultiSigClient extends Cw3FixedMultiSigQueryClient implemen proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId @@ -269,7 +269,7 @@ export class Cw3FixedMultiSigClient extends Cw3FixedMultiSigQueryClient implemen proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId diff --git a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts index 9c68ea31..aa7c7eb3 100644 --- a/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts +++ b/__output__/idl-version/cw3-fixed-multisig/Cw3FixedMultiSig.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Duration, Threshold, Decimal, InstantiateMsg, Voter, ExecuteMsg, Expiration, Timestamp, Uint64, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Vote, Coin, Empty, QueryMsg, Status, ThresholdResponse, ProposalListResponse, ProposalResponseForEmpty, VoterListResponse, VoterDetail, VoteListResponse, VoteInfo, VoteResponse, VoterResponse } from "./Cw3FixedMultiSig.types"; export interface Cw3FixedMultiSigMsg { contractAddress: string; @@ -21,24 +21,24 @@ export interface Cw3FixedMultiSigMsg { latest?: Expiration; msgs: CosmosMsgForEmpty[]; title: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; execute: ({ proposalId }: { proposalId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; close: ({ proposalId }: { proposalId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class Cw3FixedMultiSigMsgComposer implements Cw3FixedMultiSigMsg { sender: string; @@ -61,7 +61,7 @@ export class Cw3FixedMultiSigMsgComposer implements Cw3FixedMultiSigMsg { latest?: Expiration; msgs: CosmosMsgForEmpty[]; title: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -85,7 +85,7 @@ export class Cw3FixedMultiSigMsgComposer implements Cw3FixedMultiSigMsg { }: { proposalId: number; vote: Vote; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -105,7 +105,7 @@ export class Cw3FixedMultiSigMsgComposer implements Cw3FixedMultiSigMsg { proposalId }: { proposalId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -124,7 +124,7 @@ export class Cw3FixedMultiSigMsgComposer implements Cw3FixedMultiSigMsg { proposalId }: { proposalId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/idl-version/cw4-group/Cw4Group.client.ts b/__output__/idl-version/cw4-group/Cw4Group.client.ts index 0769f36b..928e9c3b 100644 --- a/__output__/idl-version/cw4-group/Cw4Group.client.ts +++ b/__output__/idl-version/cw4-group/Cw4Group.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, AdminResponse, HooksResponse, MemberListResponse, MemberResponse, TotalWeightResponse } from "./Cw4Group.types"; export interface Cw4GroupReadOnlyInterface { contractAddress: string; @@ -28,9 +28,9 @@ export interface Cw4GroupReadOnlyInterface { hooks: () => Promise; } export class Cw4GroupQueryClient implements Cw4GroupReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.admin = this.admin.bind(this); @@ -90,30 +90,30 @@ export interface Cw4GroupInterface extends Cw4GroupReadOnlyInterface { admin }: { admin?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateMembers: ({ add, remove }: { add: Member[]; remove: string[]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addHook: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeHook: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class Cw4GroupClient extends Cw4GroupQueryClient implements Cw4GroupInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -127,7 +127,7 @@ export class Cw4GroupClient extends Cw4GroupQueryClient implements Cw4GroupInter admin }: { admin?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { admin @@ -140,7 +140,7 @@ export class Cw4GroupClient extends Cw4GroupQueryClient implements Cw4GroupInter }: { add: Member[]; remove: string[]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_members: { add, @@ -152,7 +152,7 @@ export class Cw4GroupClient extends Cw4GroupQueryClient implements Cw4GroupInter addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_hook: { addr @@ -163,7 +163,7 @@ export class Cw4GroupClient extends Cw4GroupQueryClient implements Cw4GroupInter addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_hook: { addr diff --git a/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts b/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts index 8ade1bfe..b7d92ab5 100644 --- a/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts +++ b/__output__/idl-version/cw4-group/Cw4Group.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { InstantiateMsg, Member, ExecuteMsg, QueryMsg, AdminResponse, HooksResponse, MemberListResponse, MemberResponse, TotalWeightResponse } from "./Cw4Group.types"; export interface Cw4GroupMsg { contractAddress: string; @@ -16,24 +16,24 @@ export interface Cw4GroupMsg { admin }: { admin?: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateMembers: ({ add, remove }: { add: Member[]; remove: string[]; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addHook: ({ addr }: { addr: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeHook: ({ addr }: { addr: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class Cw4GroupMsgComposer implements Cw4GroupMsg { sender: string; @@ -50,7 +50,7 @@ export class Cw4GroupMsgComposer implements Cw4GroupMsg { admin }: { admin?: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -71,7 +71,7 @@ export class Cw4GroupMsgComposer implements Cw4GroupMsg { }: { add: Member[]; remove: string[]; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -91,7 +91,7 @@ export class Cw4GroupMsgComposer implements Cw4GroupMsg { addr }: { addr: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -110,7 +110,7 @@ export class Cw4GroupMsgComposer implements Cw4GroupMsg { addr }: { addr: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/idl-version/cyberpunk/CyberPunk.client.ts b/__output__/idl-version/cyberpunk/CyberPunk.client.ts index cc996b06..c18ad0f0 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.client.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.client.ts @@ -4,17 +4,17 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { InstantiateMsg, ExecuteMsg, QueryMsg, Timestamp, Uint64, Addr, Env, BlockInfo, ContractInfo, TransactionInfo } from "./CyberPunk.types"; export interface CyberPunkReadOnlyInterface { contractAddress: string; mirrorEnv: () => Promise; } export class CyberPunkQueryClient implements CyberPunkReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.mirrorEnv = this.mirrorEnv.bind(this); @@ -34,14 +34,14 @@ export interface CyberPunkInterface extends CyberPunkReadOnlyInterface { }: { memCost: number; timeCost: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - mirrorEnv: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + mirrorEnv: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class CyberPunkClient extends CyberPunkQueryClient implements CyberPunkInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -55,7 +55,7 @@ export class CyberPunkClient extends CyberPunkQueryClient implements CyberPunkIn }: { memCost: number; timeCost: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { argon2: { mem_cost: memCost, @@ -63,7 +63,7 @@ export class CyberPunkClient extends CyberPunkQueryClient implements CyberPunkIn } }, fee_, memo_, funds_); }; - mirrorEnv = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + mirrorEnv = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mirror_env: {} }, fee_, memo_, funds_); diff --git a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts index 2e1953a9..eead78d0 100644 --- a/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts +++ b/__output__/idl-version/cyberpunk/CyberPunk.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { InstantiateMsg, ExecuteMsg, QueryMsg, Timestamp, Uint64, Addr, Env, BlockInfo, ContractInfo, TransactionInfo } from "./CyberPunk.types"; export interface CyberPunkMsg { contractAddress: string; @@ -18,8 +18,8 @@ export interface CyberPunkMsg { }: { memCost: number; timeCost: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - mirrorEnv: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + mirrorEnv: (funds_?: Coin[]) => EncodeObject; } export class CyberPunkMsgComposer implements CyberPunkMsg { sender: string; @@ -36,7 +36,7 @@ export class CyberPunkMsgComposer implements CyberPunkMsg { }: { memCost: number; timeCost: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -52,7 +52,7 @@ export class CyberPunkMsgComposer implements CyberPunkMsg { }) }; }; - mirrorEnv = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + mirrorEnv = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/idl-version/hackatom/HackAtom.client.ts b/__output__/idl-version/hackatom/HackAtom.client.ts index ac52ec1c..bf927566 100644 --- a/__output__/idl-version/hackatom/HackAtom.client.ts +++ b/__output__/idl-version/hackatom/HackAtom.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin, IntResponse, AllBalanceResponse, Binary, RecurseResponse, VerifierResponse } from "./HackAtom.types"; export interface HackAtomReadOnlyInterface { contractAddress: string; @@ -25,9 +25,9 @@ export interface HackAtomReadOnlyInterface { getInt: () => Promise; } export class HackAtomQueryClient implements HackAtomReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.verifier = this.verifier.bind(this); @@ -74,24 +74,24 @@ export class HackAtomQueryClient implements HackAtomReadOnlyInterface { export interface HackAtomInterface extends HackAtomReadOnlyInterface { contractAddress: string; sender: string; - release: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - cpuLoop: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - storageLoop: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - memoryLoop: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - messageLoop: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + release: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + cpuLoop: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + storageLoop: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + memoryLoop: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + messageLoop: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; allocateLargeMemory: ({ pages }: { pages: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - panic: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - userErrorsInApiCalls: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + panic: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + userErrorsInApiCalls: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class HackAtomClient extends HackAtomQueryClient implements HackAtomInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -105,27 +105,27 @@ export class HackAtomClient extends HackAtomQueryClient implements HackAtomInter this.panic = this.panic.bind(this); this.userErrorsInApiCalls = this.userErrorsInApiCalls.bind(this); } - release = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + release = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { release: {} }, fee_, memo_, funds_); }; - cpuLoop = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + cpuLoop = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { cpu_loop: {} }, fee_, memo_, funds_); }; - storageLoop = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + storageLoop = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { storage_loop: {} }, fee_, memo_, funds_); }; - memoryLoop = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + memoryLoop = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { memory_loop: {} }, fee_, memo_, funds_); }; - messageLoop = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + messageLoop = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { message_loop: {} }, fee_, memo_, funds_); @@ -134,19 +134,19 @@ export class HackAtomClient extends HackAtomQueryClient implements HackAtomInter pages }: { pages: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { allocate_large_memory: { pages } }, fee_, memo_, funds_); }; - panic = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + panic = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { panic: {} }, fee_, memo_, funds_); }; - userErrorsInApiCalls = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + userErrorsInApiCalls = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { user_errors_in_api_calls: {} }, fee_, memo_, funds_); diff --git a/__output__/idl-version/hackatom/HackAtom.message-composer.ts b/__output__/idl-version/hackatom/HackAtom.message-composer.ts index 1758460a..8be02c9e 100644 --- a/__output__/idl-version/hackatom/HackAtom.message-composer.ts +++ b/__output__/idl-version/hackatom/HackAtom.message-composer.ts @@ -4,25 +4,25 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { InstantiateMsg, ExecuteMsg, QueryMsg, MigrateMsg, SudoMsg, Uint128, Coin, IntResponse, AllBalanceResponse, Binary, RecurseResponse, VerifierResponse } from "./HackAtom.types"; export interface HackAtomMsg { contractAddress: string; sender: string; - release: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; - cpuLoop: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; - storageLoop: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; - memoryLoop: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; - messageLoop: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + release: (funds_?: Coin[]) => EncodeObject; + cpuLoop: (funds_?: Coin[]) => EncodeObject; + storageLoop: (funds_?: Coin[]) => EncodeObject; + memoryLoop: (funds_?: Coin[]) => EncodeObject; + messageLoop: (funds_?: Coin[]) => EncodeObject; allocateLargeMemory: ({ pages }: { pages: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - panic: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; - userErrorsInApiCalls: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + panic: (funds_?: Coin[]) => EncodeObject; + userErrorsInApiCalls: (funds_?: Coin[]) => EncodeObject; } export class HackAtomMsgComposer implements HackAtomMsg { sender: string; @@ -39,7 +39,7 @@ export class HackAtomMsgComposer implements HackAtomMsg { this.panic = this.panic.bind(this); this.userErrorsInApiCalls = this.userErrorsInApiCalls.bind(this); } - release = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + release = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -52,7 +52,7 @@ export class HackAtomMsgComposer implements HackAtomMsg { }) }; }; - cpuLoop = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + cpuLoop = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -65,7 +65,7 @@ export class HackAtomMsgComposer implements HackAtomMsg { }) }; }; - storageLoop = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + storageLoop = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -78,7 +78,7 @@ export class HackAtomMsgComposer implements HackAtomMsg { }) }; }; - memoryLoop = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + memoryLoop = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -91,7 +91,7 @@ export class HackAtomMsgComposer implements HackAtomMsg { }) }; }; - messageLoop = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + messageLoop = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -108,7 +108,7 @@ export class HackAtomMsgComposer implements HackAtomMsg { pages }: { pages: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -123,7 +123,7 @@ export class HackAtomMsgComposer implements HackAtomMsg { }) }; }; - panic = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + panic = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -136,7 +136,7 @@ export class HackAtomMsgComposer implements HackAtomMsg { }) }; }; - userErrorsInApiCalls = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + userErrorsInApiCalls = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/minter/Minter.client.ts b/__output__/minter/Minter.client.ts index 8945b0d4..8aced0b5 100644 --- a/__output__/minter/Minter.client.ts +++ b/__output__/minter/Minter.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Addr, Timestamp, Uint64, Uint128, Config, Coin, ConfigResponse, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; export interface MinterReadOnlyInterface { contractAddress: string; @@ -20,9 +20,9 @@ export interface MinterReadOnlyInterface { }) => Promise; } export class MinterQueryClient implements MinterReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); @@ -66,37 +66,37 @@ export class MinterQueryClient implements MinterReadOnlyInterface { export interface MinterInterface extends MinterReadOnlyInterface { contractAddress: string; sender: string; - mint: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + mint: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; setWhitelist: ({ whitelist }: { whitelist: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - updateStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + updateStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mintTo: ({ recipient }: { recipient: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - withdraw: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + withdraw: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class MinterClient extends MinterQueryClient implements MinterInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -109,7 +109,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { this.mintFor = this.mintFor.bind(this); this.withdraw = this.withdraw.bind(this); } - mint = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + mint = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: {} }, fee_, memo_, funds_); @@ -118,14 +118,14 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { whitelist }: { whitelist: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_whitelist: { whitelist } }, fee_, memo_, funds_); }; - updateStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + updateStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_start_time: {} }, fee_, memo_, funds_); @@ -134,7 +134,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { perAddressLimit }: { perAddressLimit: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_per_address_limit: { per_address_limit: perAddressLimit @@ -145,7 +145,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { recipient }: { recipient: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_to: { recipient @@ -158,7 +158,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { }: { recipient: string; tokenId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint_for: { recipient, @@ -166,7 +166,7 @@ export class MinterClient extends MinterQueryClient implements MinterInterface { } }, fee_, memo_, funds_); }; - withdraw = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + withdraw = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw: {} }, fee_, memo_, funds_); diff --git a/__output__/minter/Minter.message-composer.ts b/__output__/minter/Minter.message-composer.ts index 96c264bb..6e8a0d29 100644 --- a/__output__/minter/Minter.message-composer.ts +++ b/__output__/minter/Minter.message-composer.ts @@ -4,38 +4,38 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Addr, Timestamp, Uint64, Uint128, Config, Coin, ConfigResponse, ExecuteMsg, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoForRoyaltyInfoResponse, RoyaltyInfoResponse, QueryMsg } from "./Minter.types"; export interface MinterMsg { contractAddress: string; sender: string; - mint: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + mint: (funds_?: Coin[]) => EncodeObject; setWhitelist: ({ whitelist }: { whitelist: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - updateStartTime: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + updateStartTime: (funds_?: Coin[]) => EncodeObject; updatePerAddressLimit: ({ perAddressLimit }: { perAddressLimit: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; mintTo: ({ recipient }: { recipient: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; mintFor: ({ recipient, tokenId }: { recipient: string; tokenId: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - withdraw: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + withdraw: (funds_?: Coin[]) => EncodeObject; } export class MinterMsgComposer implements MinterMsg { sender: string; @@ -51,7 +51,7 @@ export class MinterMsgComposer implements MinterMsg { this.mintFor = this.mintFor.bind(this); this.withdraw = this.withdraw.bind(this); } - mint = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + mint = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -68,7 +68,7 @@ export class MinterMsgComposer implements MinterMsg { whitelist }: { whitelist: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -83,7 +83,7 @@ export class MinterMsgComposer implements MinterMsg { }) }; }; - updateStartTime = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + updateStartTime = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -100,7 +100,7 @@ export class MinterMsgComposer implements MinterMsg { perAddressLimit }: { perAddressLimit: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -119,7 +119,7 @@ export class MinterMsgComposer implements MinterMsg { recipient }: { recipient: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -140,7 +140,7 @@ export class MinterMsgComposer implements MinterMsg { }: { recipient: string; tokenId: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -156,7 +156,7 @@ export class MinterMsgComposer implements MinterMsg { }) }; }; - withdraw = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + withdraw = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/sg721-updatable/Sg721Updatable.client.ts b/__output__/sg721-updatable/Sg721Updatable.client.ts index ce499bf7..9db3fdfa 100644 --- a/__output__/sg721-updatable/Sg721Updatable.client.ts +++ b/__output__/sg721-updatable/Sg721Updatable.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForNullable_EmptyAndEmpty, Binary, UpdateCollectionInfoMsgForRoyaltyInfoResponse, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, QueryMsg, TokensResponse } from "./Sg721Updatable.types"; export interface Sg721UpdatableReadOnlyInterface { contractAddress: string; @@ -77,9 +77,9 @@ export interface Sg721UpdatableReadOnlyInterface { collectionInfo: () => Promise; } export class Sg721UpdatableQueryClient implements Sg721UpdatableReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.ownerOf = this.ownerOf.bind(this); @@ -240,22 +240,22 @@ export class Sg721UpdatableQueryClient implements Sg721UpdatableReadOnlyInterfac export interface Sg721UpdatableInterface extends Sg721UpdatableReadOnlyInterface { contractAddress: string; sender: string; - freezeTokenMetadata: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + freezeTokenMetadata: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateTokenMetadata: ({ tokenId, tokenUri }: { tokenId: string; tokenUri?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - enableUpdatable: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + enableUpdatable: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; transferNft: ({ recipient, tokenId }: { recipient: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; sendNft: ({ contract, msg, @@ -264,7 +264,7 @@ export interface Sg721UpdatableInterface extends Sg721UpdatableReadOnlyInterface contract: string; msg: Binary; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approve: ({ expires, spender, @@ -273,38 +273,38 @@ export interface Sg721UpdatableInterface extends Sg721UpdatableReadOnlyInterface expires?: Expiration; spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; revokeAll: ({ operator }: { operator: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; burn: ({ tokenId }: { tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateCollectionInfo: ({ collectionInfo }: { collectionInfo: UpdateCollectionInfoMsgForRoyaltyInfoResponse; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - updateTradingStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - freezeCollectionInfo: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + updateTradingStartTime: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + freezeCollectionInfo: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mint: ({ extension, owner, @@ -315,18 +315,18 @@ export interface Sg721UpdatableInterface extends Sg721UpdatableReadOnlyInterface owner: string; tokenId: string; tokenUri?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; extension: ({ msg }: { msg: Empty; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements Sg721UpdatableInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -347,7 +347,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S this.mint = this.mint.bind(this); this.extension = this.extension.bind(this); } - freezeTokenMetadata = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + freezeTokenMetadata = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { freeze_token_metadata: {} }, fee_, memo_, funds_); @@ -358,7 +358,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S }: { tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_token_metadata: { token_id: tokenId, @@ -366,7 +366,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S } }, fee_, memo_, funds_); }; - enableUpdatable = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + enableUpdatable = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { enable_updatable: {} }, fee_, memo_, funds_); @@ -377,7 +377,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -393,7 +393,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -410,7 +410,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -425,7 +425,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -439,7 +439,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -451,7 +451,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -462,7 +462,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -473,19 +473,19 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S collectionInfo }: { collectionInfo: UpdateCollectionInfoMsgForRoyaltyInfoResponse; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_collection_info: { collection_info: collectionInfo } }, fee_, memo_, funds_); }; - updateTradingStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + updateTradingStartTime = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_trading_start_time: {} }, fee_, memo_, funds_); }; - freezeCollectionInfo = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + freezeCollectionInfo = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { freeze_collection_info: {} }, fee_, memo_, funds_); @@ -500,7 +500,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -514,7 +514,7 @@ export class Sg721UpdatableClient extends Sg721UpdatableQueryClient implements S msg }: { msg: Empty; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { extension: { msg diff --git a/__output__/sg721-updatable/Sg721Updatable.message-composer.ts b/__output__/sg721-updatable/Sg721Updatable.message-composer.ts index 5cee4c38..fc13763b 100644 --- a/__output__/sg721-updatable/Sg721Updatable.message-composer.ts +++ b/__output__/sg721-updatable/Sg721Updatable.message-composer.ts @@ -4,30 +4,30 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForNullable_EmptyAndEmpty, Binary, UpdateCollectionInfoMsgForRoyaltyInfoResponse, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, QueryMsg, TokensResponse } from "./Sg721Updatable.types"; export interface Sg721UpdatableMsg { contractAddress: string; sender: string; - freezeTokenMetadata: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + freezeTokenMetadata: (funds_?: Coin[]) => EncodeObject; updateTokenMetadata: ({ tokenId, tokenUri }: { tokenId: string; tokenUri?: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - enableUpdatable: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + enableUpdatable: (funds_?: Coin[]) => EncodeObject; transferNft: ({ recipient, tokenId }: { recipient: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; sendNft: ({ contract, msg, @@ -36,7 +36,7 @@ export interface Sg721UpdatableMsg { contract: string; msg: Binary; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; approve: ({ expires, spender, @@ -45,38 +45,38 @@ export interface Sg721UpdatableMsg { expires?: Expiration; spender: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; revokeAll: ({ operator }: { operator: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; burn: ({ tokenId }: { tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateCollectionInfo: ({ collectionInfo }: { collectionInfo: UpdateCollectionInfoMsgForRoyaltyInfoResponse; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - updateTradingStartTime: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; - freezeCollectionInfo: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + updateTradingStartTime: (funds_?: Coin[]) => EncodeObject; + freezeCollectionInfo: (funds_?: Coin[]) => EncodeObject; mint: ({ extension, owner, @@ -87,12 +87,12 @@ export interface Sg721UpdatableMsg { owner: string; tokenId: string; tokenUri?: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; extension: ({ msg }: { msg: Empty; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { sender: string; @@ -116,7 +116,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { this.mint = this.mint.bind(this); this.extension = this.extension.bind(this); } - freezeTokenMetadata = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + freezeTokenMetadata = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -135,7 +135,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { }: { tokenId: string; tokenUri?: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -151,7 +151,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { }) }; }; - enableUpdatable = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + enableUpdatable = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -170,7 +170,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { }: { recipient: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -194,7 +194,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { contract: string; msg: Binary; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -219,7 +219,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { expires?: Expiration; spender: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -242,7 +242,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { }: { spender: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -264,7 +264,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { }: { expires?: Expiration; operator: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -284,7 +284,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { operator }: { operator: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -303,7 +303,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { tokenId }: { tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -322,7 +322,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { collectionInfo }: { collectionInfo: UpdateCollectionInfoMsgForRoyaltyInfoResponse; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -337,7 +337,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { }) }; }; - updateTradingStartTime = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + updateTradingStartTime = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -350,7 +350,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { }) }; }; - freezeCollectionInfo = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + freezeCollectionInfo = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -373,7 +373,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { owner: string; tokenId: string; tokenUri?: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -395,7 +395,7 @@ export class Sg721UpdatableMsgComposer implements Sg721UpdatableMsg { msg }: { msg: Empty; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/sg721-updatable/baseClient.ts b/__output__/sg721-updatable/baseClient.ts new file mode 100644 index 00000000..a51e9339 --- /dev/null +++ b/__output__/sg721-updatable/baseClient.ts @@ -0,0 +1,189 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@latest. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + + +import { StdFee, Coin, DeliverTxResponse } from '@interchainjs/types'; +import { SigningClient } from '@interchainjs/cosmos/signing-client'; +import { getSmartContractState } from 'interchainjs/cosmwasm/wasm/v1/query.rpc.func'; +import { executeContract } from 'interchainjs/cosmwasm/wasm/v1/tx.rpc.func'; +import { QuerySmartContractStateRequest, QuerySmartContractStateResponse } from 'interchainjs/cosmwasm/wasm/v1/query'; +import { MsgExecuteContract } from 'interchainjs/cosmwasm/wasm/v1/tx'; +import { Chain } from '@chain-registry/v2-types'; + +// Encoding utility functions +const fromUint8Array = (uint8Array: Uint8Array): T => { + const text = new TextDecoder().decode(uint8Array); + return JSON.parse(text); +}; + +const toUint8Array = (obj: any): Uint8Array => { + const text = JSON.stringify(obj); + return new TextEncoder().encode(text); +}; + +// Chain registry configuration +// The amount under gasPrice represents gas price per unit +export interface ChainConfig { + chain?: Chain; + gasPrice?: { + denom: string; + amount: string; + }; +} + +// Gas fee calculation utilities +export const calculateGasFromChain = (chain: Chain, gasAmount: string): StdFee => { + try { + const feeTokens = chain.fees?.feeTokens; + + if (feeTokens && feeTokens.length > 0) { + const primaryToken = feeTokens[0]; + // v2 chain-registry uses camelCase: averageGasPrice, lowGasPrice, fixedMinGasPrice + const gasPrice = primaryToken.averageGasPrice || primaryToken.lowGasPrice || primaryToken.fixedMinGasPrice || 0.025; + const gasAmountNum = parseInt(gasAmount); + const feeAmount = Math.ceil(gasAmountNum * gasPrice).toString(); + + return { + amount: [{ + denom: primaryToken.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + } catch (error) { + console.warn('Failed to calculate gas from chain registry:', error); + } + + // Fallback to default + return { amount: [], gas: gasAmount }; +}; + +// Default gas amount - users can easily change this +export let DEFAULT_GAS_AMOUNT = '200000'; + +// Allow users to set their preferred default gas amount +export const setDefaultGasAmount = (gasAmount: string): void => { + DEFAULT_GAS_AMOUNT = gasAmount; +}; + +// Get current default gas amount +export const getDefaultGasAmount = (): string => DEFAULT_GAS_AMOUNT; + +export const getAutoGasFee = (chainConfig?: ChainConfig): StdFee => { + const gasAmount = DEFAULT_GAS_AMOUNT; + + if (chainConfig?.chain) { + return calculateGasFromChain(chainConfig.chain, gasAmount); + } + + if (chainConfig?.gasPrice) { + const gasAmountNum = parseInt(gasAmount); + const gasPriceNum = parseFloat(chainConfig.gasPrice.amount); + const feeAmount = Math.ceil(gasAmountNum * gasPriceNum).toString(); + + return { + amount: [{ + denom: chainConfig.gasPrice.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + + // Fallback: no fee tokens, just gas amount + return { amount: [], gas: gasAmount }; +}; + +// InterchainJS interfaces for CosmWasm clients +export interface ICosmWasmClient { + queryContractSmart(contractAddr: string, query: any): Promise; +} + +export interface ISigningCosmWasmClient { + execute( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ): Promise; +} + +export interface ISigningClient { + signAndBroadcast( + signerAddress: string, + messages: any[], + fee: number | StdFee | "auto", + memo?: string + ): Promise; +} + +// Helper functions to create InterchainJS clients +export function getCosmWasmClient(rpcEndpoint: string): ICosmWasmClient { + return { + queryContractSmart: async (contractAddr: string, query: any) => { + // Create the request object + const request: QuerySmartContractStateRequest = { + address: contractAddr, + queryData: toUint8Array(query) + }; + + // Execute the query using InterchainJS + const response: QuerySmartContractStateResponse = await getSmartContractState(rpcEndpoint, request); + + // Parse and return the result + return fromUint8Array(response.data); + }, + }; +} + +export function getSigningCosmWasmClient(signingClient: SigningClient): ISigningCosmWasmClient { + return { + execute: async ( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ) => { + // Handle fee conversion + let finalFee: StdFee; + if (typeof fee === 'number') { + finalFee = { amount: [], gas: fee.toString() }; + } else if (fee === 'auto') { + finalFee = getAutoGasFee(chainConfig); + } else if (fee) { + finalFee = fee; + } else { + finalFee = getAutoGasFee(chainConfig); + } + + // Create the message object + const message: MsgExecuteContract = { + sender, + contract: contractAddress, + msg: toUint8Array(msg), + funds: funds || [] + }; + + // Execute the transaction using InterchainJS + const result = await executeContract( + signingClient as any, + sender, + message, + finalFee, + memo || '' + ); + + return result; + }, + }; +} diff --git a/__output__/sg721-updatable/bundle.ts b/__output__/sg721-updatable/bundle.ts index 68f5eb80..60644e3b 100644 --- a/__output__/sg721-updatable/bundle.ts +++ b/__output__/sg721-updatable/bundle.ts @@ -8,6 +8,7 @@ import * as _0 from "./Sg721Updatable.types"; import * as _1 from "./Sg721Updatable.client"; import * as _2 from "./Sg721Updatable.message-composer"; import * as _3 from "./Sg721Updatable.react-query"; +import * as _4 from "./baseClient"; export namespace contracts { export const Sg721Updatable = { ..._0, @@ -15,4 +16,7 @@ export namespace contracts { ..._2, ..._3 }; + export const baseClient = { + ..._4 + }; } \ No newline at end of file diff --git a/__output__/sg721/Sg721.client.ts b/__output__/sg721/Sg721.client.ts index 868bbca4..0493e62c 100644 --- a/__output__/sg721/Sg721.client.ts +++ b/__output__/sg721/Sg721.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { Coin, StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { Coin, DeliverTxResponse, StdFee } from "@interchainjs/types"; import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForEmpty, Binary, MintMsgForEmpty, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, OperatorsResponse, QueryMsg, TokensResponse } from "./Sg721.types"; export interface Sg721ReadOnlyInterface { contractAddress: string; @@ -77,9 +77,9 @@ export interface Sg721ReadOnlyInterface { collectionInfo: () => Promise; } export class Sg721QueryClient implements Sg721ReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.ownerOf = this.ownerOf.bind(this); @@ -246,7 +246,7 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface { }: { recipient: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; sendNft: ({ contract, msg, @@ -255,7 +255,7 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface { contract: string; msg: Binary; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approve: ({ expires, spender, @@ -264,26 +264,26 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface { expires?: Expiration; spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; revokeAll: ({ operator }: { operator: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mint: ({ extension, owner, @@ -294,18 +294,18 @@ export interface Sg721Interface extends Sg721ReadOnlyInterface { owner: string; tokenId: string; tokenUri?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; burn: ({ tokenId }: { tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class Sg721Client extends Sg721QueryClient implements Sg721Interface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -325,7 +325,7 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -341,7 +341,7 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -358,7 +358,7 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -373,7 +373,7 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -387,7 +387,7 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -399,7 +399,7 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -416,7 +416,7 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -430,7 +430,7 @@ export class Sg721Client extends Sg721QueryClient implements Sg721Interface { tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId diff --git a/__output__/sg721/Sg721.message-composer.ts b/__output__/sg721/Sg721.message-composer.ts index b024522d..256a39d4 100644 --- a/__output__/sg721/Sg721.message-composer.ts +++ b/__output__/sg721/Sg721.message-composer.ts @@ -4,10 +4,10 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { Coin } from "@cosmjs/amino"; -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { Coin } from "@interchainjs/types"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { Expiration, Timestamp, Uint64, AllNftInfoResponse, OwnerOfResponse, Approval, NftInfoResponseForEmpty, Empty, AllOperatorsResponse, AllTokensResponse, ApprovalResponse, ApprovalsResponse, Decimal, CollectionInfoResponse, RoyaltyInfoResponse, ContractInfoResponse, ExecuteMsgForEmpty, Binary, MintMsgForEmpty, InstantiateMsg, CollectionInfoForRoyaltyInfoResponse, MinterResponse, NftInfoResponse, NumTokensResponse, OperatorsResponse, QueryMsg, TokensResponse } from "./Sg721.types"; export interface Sg721Msg { contractAddress: string; @@ -18,7 +18,7 @@ export interface Sg721Msg { }: { recipient: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; sendNft: ({ contract, msg, @@ -27,7 +27,7 @@ export interface Sg721Msg { contract: string; msg: Binary; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; approve: ({ expires, spender, @@ -36,26 +36,26 @@ export interface Sg721Msg { expires?: Expiration; spender: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; revokeAll: ({ operator }: { operator: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; mint: ({ extension, owner, @@ -66,12 +66,12 @@ export interface Sg721Msg { owner: string; tokenId: string; tokenUri?: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; burn: ({ tokenId }: { tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class Sg721MsgComposer implements Sg721Msg { sender: string; @@ -94,7 +94,7 @@ export class Sg721MsgComposer implements Sg721Msg { }: { recipient: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -118,7 +118,7 @@ export class Sg721MsgComposer implements Sg721Msg { contract: string; msg: Binary; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -143,7 +143,7 @@ export class Sg721MsgComposer implements Sg721Msg { expires?: Expiration; spender: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -166,7 +166,7 @@ export class Sg721MsgComposer implements Sg721Msg { }: { spender: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -188,7 +188,7 @@ export class Sg721MsgComposer implements Sg721Msg { }: { expires?: Expiration; operator: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -208,7 +208,7 @@ export class Sg721MsgComposer implements Sg721Msg { operator }: { operator: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -233,7 +233,7 @@ export class Sg721MsgComposer implements Sg721Msg { owner: string; tokenId: string; tokenUri?: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -255,7 +255,7 @@ export class Sg721MsgComposer implements Sg721Msg { tokenId }: { tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/sg721/contractContextProviders.ts b/__output__/sg721/contractContextProviders.ts index 58948411..ecba4d61 100644 --- a/__output__/sg721/contractContextProviders.ts +++ b/__output__/sg721/contractContextProviders.ts @@ -4,7 +4,7 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient } from "@cosmjs/cosmwasm-stargate"; +import { ICosmWasmClient, ISigningCosmWasmClient, getCosmWasmClient, getSigningCosmWasmClient } from "./baseClient"; import { IQueryClientProvider, ISigningClientProvider, IMessageComposerProvider } from "./contractContextBase"; import { Sg721QueryClient } from "./Sg721.client"; import { Sg721Client } from "./Sg721.client"; @@ -13,7 +13,7 @@ import { Sg721 } from "./Sg721.provider"; export interface IContractsContext { sg721: IQueryClientProvider & ISigningClientProvider & IMessageComposerProvider; } -export const getProviders = (address?: string, cosmWasmClient?: CosmWasmClient, signingCosmWasmClient?: SigningCosmWasmClient) => ({ +export const getProviders = (address?: string, cosmWasmClient?: ICosmWasmClient, signingCosmWasmClient?: ISigningCosmWasmClient) => ({ sg721: new Sg721({ address, cosmWasmClient, diff --git a/__output__/vectis/factory-w-mutations/Factory.react-query.ts b/__output__/vectis/factory-w-mutations/Factory.react-query.ts index 93a6f935..8e53a1dc 100644 --- a/__output__/vectis/factory-w-mutations/Factory.react-query.ts +++ b/__output__/vectis/factory-w-mutations/Factory.react-query.ts @@ -5,8 +5,7 @@ */ import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from "@tanstack/react-query"; -import { ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; import { FactoryQueryClient, FactoryClient } from "./Factory.client"; export interface FactoryReactQuery { @@ -95,8 +94,8 @@ export interface FactoryUpdateAdminMutation { funds?: Coin[]; }; } -export function useFactoryUpdateAdminMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useFactoryUpdateAdminMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -117,8 +116,8 @@ export interface FactoryUpdateGovecAddrMutation { funds?: Coin[]; }; } -export function useFactoryUpdateGovecAddrMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useFactoryUpdateGovecAddrMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -139,8 +138,8 @@ export interface FactoryUpdateWalletFeeMutation { funds?: Coin[]; }; } -export function useFactoryUpdateWalletFeeMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useFactoryUpdateWalletFeeMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -162,8 +161,8 @@ export interface FactoryUpdateCodeIdMutation { funds?: Coin[]; }; } -export function useFactoryUpdateCodeIdMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useFactoryUpdateCodeIdMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -185,8 +184,8 @@ export interface FactoryMigrateWalletMutation { funds?: Coin[]; }; } -export function useFactoryMigrateWalletMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useFactoryMigrateWalletMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -208,8 +207,8 @@ export interface FactoryUpdateProxyUserMutation { funds?: Coin[]; }; } -export function useFactoryUpdateProxyUserMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useFactoryUpdateProxyUserMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -230,8 +229,8 @@ export interface FactoryCreateWalletMutation { funds?: Coin[]; }; } -export function useFactoryCreateWalletMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useFactoryCreateWalletMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { diff --git a/__output__/vectis/factory/Factory.client.ts b/__output__/vectis/factory/Factory.client.ts index 3fda4056..fba8797e 100644 --- a/__output__/vectis/factory/Factory.client.ts +++ b/__output__/vectis/factory/Factory.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; export interface FactoryReadOnlyInterface { contractAddress: string; @@ -35,9 +35,9 @@ export interface FactoryReadOnlyInterface { adminAddr: () => Promise; } export class FactoryQueryClient implements FactoryReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.wallets = this.wallets.bind(this); @@ -112,49 +112,49 @@ export interface FactoryInterface extends FactoryReadOnlyInterface { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateWalletFee: ({ newFee }: { newFee: Coin; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateGovecAddr: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateAdmin: ({ addr }: { addr: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class FactoryClient extends FactoryQueryClient implements FactoryInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -171,7 +171,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_wallet: { create_wallet_msg: createWalletMsg @@ -184,7 +184,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newUser: Addr; oldUser: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_proxy_user: { new_user: newUser, @@ -198,7 +198,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { migrate_wallet: { migration_msg: migrationMsg, @@ -212,7 +212,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac }: { newCodeId: number; ty: CodeIdType; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_code_id: { new_code_id: newCodeId, @@ -224,7 +224,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac newFee }: { newFee: Coin; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_wallet_fee: { new_fee: newFee @@ -235,7 +235,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_govec_addr: { addr @@ -246,7 +246,7 @@ export class FactoryClient extends FactoryQueryClient implements FactoryInterfac addr }: { addr: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_admin: { addr diff --git a/__output__/vectis/factory/Factory.message-composer.ts b/__output__/vectis/factory/Factory.message-composer.ts index 7929f947..88112d8d 100644 --- a/__output__/vectis/factory/Factory.message-composer.ts +++ b/__output__/vectis/factory/Factory.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { AdminAddrResponse, CodeIdResponse, CodeIdType, Uint128, Binary, CreateWalletMsg, Guardians, MultiSig, Coin, Cw20Coin, ExecuteMsg, Addr, ProxyMigrationTxMsg, WalletAddr, CanonicalAddr, RelayTransaction, FeeResponse, GovecAddrResponse, InstantiateMsg, QueryMsg, WalletQueryPrefix, Duration, StakingOptions, WalletInfo, ContractVersion, WalletsOfResponse, WalletsResponse } from "./Factory.types"; export interface FactoryMsg { contractAddress: string; @@ -15,43 +15,43 @@ export interface FactoryMsg { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateProxyUser: ({ newUser, oldUser }: { newUser: Addr; oldUser: Addr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; migrateWallet: ({ migrationMsg, walletAddress }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateCodeId: ({ newCodeId, ty }: { newCodeId: number; ty: CodeIdType; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateWalletFee: ({ newFee }: { newFee: Coin; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateGovecAddr: ({ addr }: { addr: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateAdmin: ({ addr }: { addr: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class FactoryMsgComposer implements FactoryMsg { sender: string; @@ -71,7 +71,7 @@ export class FactoryMsgComposer implements FactoryMsg { createWalletMsg }: { createWalletMsg: CreateWalletMsg; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -92,7 +92,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { newUser: Addr; oldUser: Addr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -114,7 +114,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { migrationMsg: ProxyMigrationTxMsg; walletAddress: WalletAddr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -136,7 +136,7 @@ export class FactoryMsgComposer implements FactoryMsg { }: { newCodeId: number; ty: CodeIdType; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -156,7 +156,7 @@ export class FactoryMsgComposer implements FactoryMsg { newFee }: { newFee: Coin; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -175,7 +175,7 @@ export class FactoryMsgComposer implements FactoryMsg { addr }: { addr: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -194,7 +194,7 @@ export class FactoryMsgComposer implements FactoryMsg { addr }: { addr: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/vectis/govec/Govec.client.ts b/__output__/vectis/govec/Govec.client.ts index 33128fb8..3f31b615 100644 --- a/__output__/vectis/govec/Govec.client.ts +++ b/__output__/vectis/govec/Govec.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { CanExecuteRelayResponse, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Coin, Empty, ExecuteMsgForEmpty, Addr, RelayTransaction, Guardians, MultiSig, InfoResponse, ContractVersion, InstantiateMsg, CreateWalletMsg, QueryMsg, Uint64 } from "./Govec.types"; export interface GovecReadOnlyInterface { contractAddress: string; @@ -17,9 +17,9 @@ export interface GovecReadOnlyInterface { }) => Promise; } export class GovecQueryClient implements GovecReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.info = this.info.bind(this); @@ -49,46 +49,46 @@ export interface GovecInterface extends GovecReadOnlyInterface { msgs }: { msgs: CosmosMsgForEmpty[]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - revertFreezeStatus: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + revertFreezeStatus: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; relay: ({ transaction }: { transaction: RelayTransaction; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; rotateUserKey: ({ newUserAddress }: { newUserAddress: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addRelayer: ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeRelayer: ({ relayerAddress }: { relayerAddress: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateGuardians: ({ guardians, newMultisigCodeId }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateLabel: ({ newLabel }: { newLabel: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class GovecClient extends GovecQueryClient implements GovecInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -106,14 +106,14 @@ export class GovecClient extends GovecQueryClient implements GovecInterface { msgs }: { msgs: CosmosMsgForEmpty[]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { msgs } }, fee_, memo_, funds_); }; - revertFreezeStatus = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + revertFreezeStatus = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revert_freeze_status: {} }, fee_, memo_, funds_); @@ -122,7 +122,7 @@ export class GovecClient extends GovecQueryClient implements GovecInterface { transaction }: { transaction: RelayTransaction; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { relay: { transaction @@ -133,7 +133,7 @@ export class GovecClient extends GovecQueryClient implements GovecInterface { newUserAddress }: { newUserAddress: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { rotate_user_key: { new_user_address: newUserAddress @@ -144,7 +144,7 @@ export class GovecClient extends GovecQueryClient implements GovecInterface { newRelayerAddress }: { newRelayerAddress: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_relayer: { new_relayer_address: newRelayerAddress @@ -155,7 +155,7 @@ export class GovecClient extends GovecQueryClient implements GovecInterface { relayerAddress }: { relayerAddress: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_relayer: { relayer_address: relayerAddress @@ -168,7 +168,7 @@ export class GovecClient extends GovecQueryClient implements GovecInterface { }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_guardians: { guardians, @@ -180,7 +180,7 @@ export class GovecClient extends GovecQueryClient implements GovecInterface { newLabel }: { newLabel: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_label: { new_label: newLabel diff --git a/__output__/vectis/govec/Govec.message-composer.ts b/__output__/vectis/govec/Govec.message-composer.ts index 783cfa59..c3441bd8 100644 --- a/__output__/vectis/govec/Govec.message-composer.ts +++ b/__output__/vectis/govec/Govec.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { CanExecuteRelayResponse, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Coin, Empty, ExecuteMsgForEmpty, Addr, RelayTransaction, Guardians, MultiSig, InfoResponse, ContractVersion, InstantiateMsg, CreateWalletMsg, QueryMsg, Uint64 } from "./Govec.types"; export interface GovecMsg { contractAddress: string; @@ -15,40 +15,40 @@ export interface GovecMsg { msgs }: { msgs: CosmosMsgForEmpty[]; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - revertFreezeStatus: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + revertFreezeStatus: (funds_?: Coin[]) => EncodeObject; relay: ({ transaction }: { transaction: RelayTransaction; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; rotateUserKey: ({ newUserAddress }: { newUserAddress: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addRelayer: ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeRelayer: ({ relayerAddress }: { relayerAddress: Addr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateGuardians: ({ guardians, newMultisigCodeId }: { guardians: Guardians; newMultisigCodeId?: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateLabel: ({ newLabel }: { newLabel: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class GovecMsgComposer implements GovecMsg { sender: string; @@ -69,7 +69,7 @@ export class GovecMsgComposer implements GovecMsg { msgs }: { msgs: CosmosMsgForEmpty[]; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -84,7 +84,7 @@ export class GovecMsgComposer implements GovecMsg { }) }; }; - revertFreezeStatus = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + revertFreezeStatus = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -101,7 +101,7 @@ export class GovecMsgComposer implements GovecMsg { transaction }: { transaction: RelayTransaction; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -120,7 +120,7 @@ export class GovecMsgComposer implements GovecMsg { newUserAddress }: { newUserAddress: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -139,7 +139,7 @@ export class GovecMsgComposer implements GovecMsg { newRelayerAddress }: { newRelayerAddress: Addr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -158,7 +158,7 @@ export class GovecMsgComposer implements GovecMsg { relayerAddress }: { relayerAddress: Addr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -179,7 +179,7 @@ export class GovecMsgComposer implements GovecMsg { }: { guardians: Guardians; newMultisigCodeId?: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -199,7 +199,7 @@ export class GovecMsgComposer implements GovecMsg { newLabel }: { newLabel: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/__output__/vectis/proxy/Proxy.client.ts b/__output__/vectis/proxy/Proxy.client.ts index 300dbb8c..d420a9e5 100644 --- a/__output__/vectis/proxy/Proxy.client.ts +++ b/__output__/vectis/proxy/Proxy.client.ts @@ -4,8 +4,8 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; -import { StdFee } from "@cosmjs/amino"; +import { ICosmWasmClient, ISigningCosmWasmClient } from "./baseClient"; +import { DeliverTxResponse, StdFee } from "@interchainjs/types"; import { CanExecuteRelayResponse, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Coin, Empty, ExecuteMsgForEmpty, Addr, RelayTransaction, Guardians, MultiSig, InfoResponse, ContractVersion, InstantiateMsg, CreateWalletMsg, QueryMsg, Uint64 } from "./Proxy.types"; export interface ProxyReadOnlyInterface { contractAddress: string; @@ -17,9 +17,9 @@ export interface ProxyReadOnlyInterface { }) => Promise; } export class ProxyQueryClient implements ProxyReadOnlyInterface { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.info = this.info.bind(this); @@ -49,46 +49,46 @@ export interface ProxyInterface extends ProxyReadOnlyInterface { msgs }: { msgs: CosmosMsgForEmpty[]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - revertFreezeStatus: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + revertFreezeStatus: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; relay: ({ transaction }: { transaction: RelayTransaction; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; rotateUserKey: ({ newUserAddress }: { newUserAddress: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addRelayer: ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeRelayer: ({ relayerAddress }: { relayerAddress: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateGuardians: ({ guardians, newMultisigCodeId }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateLabel: ({ newLabel }: { newLabel: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; } export class ProxyClient extends ProxyQueryClient implements ProxyInterface { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -106,14 +106,14 @@ export class ProxyClient extends ProxyQueryClient implements ProxyInterface { msgs }: { msgs: CosmosMsgForEmpty[]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { msgs } }, fee_, memo_, funds_); }; - revertFreezeStatus = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + revertFreezeStatus = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revert_freeze_status: {} }, fee_, memo_, funds_); @@ -122,7 +122,7 @@ export class ProxyClient extends ProxyQueryClient implements ProxyInterface { transaction }: { transaction: RelayTransaction; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { relay: { transaction @@ -133,7 +133,7 @@ export class ProxyClient extends ProxyQueryClient implements ProxyInterface { newUserAddress }: { newUserAddress: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { rotate_user_key: { new_user_address: newUserAddress @@ -144,7 +144,7 @@ export class ProxyClient extends ProxyQueryClient implements ProxyInterface { newRelayerAddress }: { newRelayerAddress: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_relayer: { new_relayer_address: newRelayerAddress @@ -155,7 +155,7 @@ export class ProxyClient extends ProxyQueryClient implements ProxyInterface { relayerAddress }: { relayerAddress: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_relayer: { relayer_address: relayerAddress @@ -168,7 +168,7 @@ export class ProxyClient extends ProxyQueryClient implements ProxyInterface { }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_guardians: { guardians, @@ -180,7 +180,7 @@ export class ProxyClient extends ProxyQueryClient implements ProxyInterface { newLabel }: { newLabel: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_label: { new_label: newLabel diff --git a/__output__/vectis/proxy/Proxy.message-composer.ts b/__output__/vectis/proxy/Proxy.message-composer.ts index ec983ca1..5be37ec3 100644 --- a/__output__/vectis/proxy/Proxy.message-composer.ts +++ b/__output__/vectis/proxy/Proxy.message-composer.ts @@ -4,9 +4,9 @@ * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import { MsgExecuteContractEncodeObject } from "@cosmjs/cosmwasm-stargate"; -import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx"; -import { toUtf8 } from "@cosmjs/encoding"; +import { EncodeObject } from "@interchainjs/cosmos-types"; +import { MsgExecuteContract } from "interchainjs/cosmwasm/wasm/v1/tx"; +import { toUtf8 } from "@interchainjs/encoding"; import { CanExecuteRelayResponse, CosmosMsgForEmpty, BankMsg, Uint128, StakingMsg, DistributionMsg, WasmMsg, Binary, Coin, Empty, ExecuteMsgForEmpty, Addr, RelayTransaction, Guardians, MultiSig, InfoResponse, ContractVersion, InstantiateMsg, CreateWalletMsg, QueryMsg, Uint64 } from "./Proxy.types"; export interface ProxyMsg { contractAddress: string; @@ -15,40 +15,40 @@ export interface ProxyMsg { msgs }: { msgs: CosmosMsgForEmpty[]; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - revertFreezeStatus: (funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + revertFreezeStatus: (funds_?: Coin[]) => EncodeObject; relay: ({ transaction }: { transaction: RelayTransaction; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; rotateUserKey: ({ newUserAddress }: { newUserAddress: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; addRelayer: ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; removeRelayer: ({ relayerAddress }: { relayerAddress: Addr; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateGuardians: ({ guardians, newMultisigCodeId }: { guardians: Guardians; newMultisigCodeId?: number; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; updateLabel: ({ newLabel }: { newLabel: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; } export class ProxyMsgComposer implements ProxyMsg { sender: string; @@ -69,7 +69,7 @@ export class ProxyMsgComposer implements ProxyMsg { msgs }: { msgs: CosmosMsgForEmpty[]; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -84,7 +84,7 @@ export class ProxyMsgComposer implements ProxyMsg { }) }; }; - revertFreezeStatus = (funds_?: Coin[]): MsgExecuteContractEncodeObject => { + revertFreezeStatus = (funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -101,7 +101,7 @@ export class ProxyMsgComposer implements ProxyMsg { transaction }: { transaction: RelayTransaction; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -120,7 +120,7 @@ export class ProxyMsgComposer implements ProxyMsg { newUserAddress }: { newUserAddress: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -139,7 +139,7 @@ export class ProxyMsgComposer implements ProxyMsg { newRelayerAddress }: { newRelayerAddress: Addr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -158,7 +158,7 @@ export class ProxyMsgComposer implements ProxyMsg { relayerAddress }: { relayerAddress: Addr; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -179,7 +179,7 @@ export class ProxyMsgComposer implements ProxyMsg { }: { guardians: Guardians; newMultisigCodeId?: number; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -199,7 +199,7 @@ export class ProxyMsgComposer implements ProxyMsg { newLabel }: { newLabel: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ diff --git a/package.json b/package.json index dcce768e..f567ec86 100644 --- a/package.json +++ b/package.json @@ -46,5 +46,6 @@ "repository": { "type": "git", "url": "https://github.com/hyperweb-io/ts-codegen" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.account-nfts.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.account-nfts.test.ts.snap index b4a36f11..6ba65efc 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.account-nfts.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.account-nfts.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute classes array types 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -25,7 +25,7 @@ exports[`execute classes array types 1`] = ` this.allTokens = this.allTokens.bind(this); this.minter = this.minter.bind(this); } - proposedNewOwner = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + proposedNewOwner = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { proposed_new_owner: {} }, fee_, memo_, funds_); @@ -36,7 +36,7 @@ exports[`execute classes array types 1`] = ` }: { limit?: number; startAfter?: VaultBase_for_String; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { allowed_vaults: { limit, @@ -50,7 +50,7 @@ exports[`execute classes array types 1`] = ` }: { limit?: number; startAfter?: string[][]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_debt_shares: { limit, @@ -58,7 +58,7 @@ exports[`execute classes array types 1`] = ` } }, fee_, memo_, funds_); }; - allPreviousOwners = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + allPreviousOwners = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_previous_owners: {} }, fee_, memo_, funds_); @@ -69,7 +69,7 @@ exports[`execute classes array types 1`] = ` }: { includeExpired?: boolean; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { owner_of: { include_expired: includeExpired, @@ -85,7 +85,7 @@ exports[`execute classes array types 1`] = ` includeExpired?: boolean; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approval: { include_expired: includeExpired, @@ -100,7 +100,7 @@ exports[`execute classes array types 1`] = ` }: { includeExpired?: boolean; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approvals: { include_expired: includeExpired, @@ -118,7 +118,7 @@ exports[`execute classes array types 1`] = ` limit?: number; owner: string; startAfter?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_operators: { include_expired: includeExpired, @@ -128,12 +128,12 @@ exports[`execute classes array types 1`] = ` } }, fee_, memo_, funds_); }; - numTokens = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + numTokens = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { num_tokens: {} }, fee_, memo_, funds_); }; - contractInfo = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + contractInfo = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { contract_info: {} }, fee_, memo_, funds_); @@ -142,7 +142,7 @@ exports[`execute classes array types 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { nft_info: { token_id: tokenId @@ -155,7 +155,7 @@ exports[`execute classes array types 1`] = ` }: { includeExpired?: boolean; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_nft_info: { include_expired: includeExpired, @@ -171,7 +171,7 @@ exports[`execute classes array types 1`] = ` limit?: number; owner: string; startAfter?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { tokens: { limit, @@ -186,7 +186,7 @@ exports[`execute classes array types 1`] = ` }: { limit?: number; startAfter?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_tokens: { limit, @@ -194,7 +194,7 @@ exports[`execute classes array types 1`] = ` } }, fee_, memo_, funds_); }; - minter = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + minter = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { minter: {} }, fee_, memo_, funds_); @@ -206,29 +206,29 @@ exports[`execute interfaces no extends 1`] = ` "export interface SG721Instance { contractAddress: string; sender: string; - proposedNewOwner: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + proposedNewOwner: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; allowedVaults: ({ limit, startAfter }: { limit?: number; startAfter?: VaultBase_for_String; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; allDebtShares: ({ limit, startAfter }: { limit?: number; startAfter?: string[][]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - allPreviousOwners: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + allPreviousOwners: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; ownerOf: ({ includeExpired, tokenId }: { includeExpired?: boolean; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approval: ({ includeExpired, spender, @@ -237,14 +237,14 @@ exports[`execute interfaces no extends 1`] = ` includeExpired?: boolean; spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approvals: ({ includeExpired, tokenId }: { includeExpired?: boolean; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; allOperators: ({ includeExpired, limit, @@ -255,21 +255,21 @@ exports[`execute interfaces no extends 1`] = ` limit?: number; owner: string; startAfter?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - numTokens: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - contractInfo: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + numTokens: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + contractInfo: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; nftInfo: ({ tokenId }: { tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; allNftInfo: ({ includeExpired, tokenId }: { includeExpired?: boolean; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; tokens: ({ limit, owner, @@ -278,15 +278,15 @@ exports[`execute interfaces no extends 1`] = ` limit?: number; owner: string; startAfter?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; allTokens: ({ limit, startAfter }: { limit?: number; startAfter?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - minter: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + minter: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -294,9 +294,9 @@ exports[`execute_msg_for__empty 1`] = `"export type QueryMsg = QueryMsg;"`; exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.proposedNewOwner = this.proposedNewOwner.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.arrays-item-tuples.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.arrays-item-tuples.test.ts.snap index cf42041a..3da033fb 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.arrays-item-tuples.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.arrays-item-tuples.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute classes array types 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -23,7 +23,7 @@ exports[`execute classes array types 1`] = ` edges: number[][]; nested: number[][][]; supernested: string[][][][][][]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_edges: { edges3, @@ -53,15 +53,15 @@ exports[`execute interfaces no extends 1`] = ` edges: number[][]; nested: number[][][]; supernested: string[][][][][][]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.updateEdges = this.updateEdges.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.arrays-ref.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.arrays-ref.test.ts.snap index 7a2f67f1..4d2d60a7 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.arrays-ref.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.arrays-ref.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute classes array types 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -30,7 +30,7 @@ exports[`execute classes array types 1`] = ` }: { amount: number; creditor: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_edge: { amount, @@ -46,7 +46,7 @@ exports[`execute classes array types 1`] = ` amount: number; creditor: Addr; edgeId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { edit_edge: { amount, @@ -59,7 +59,7 @@ exports[`execute classes array types 1`] = ` edgeId }: { edgeId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_edge: { edge_id: edgeId @@ -70,7 +70,7 @@ exports[`execute classes array types 1`] = ` graph }: { graph: Edge[]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph: { graph @@ -83,7 +83,7 @@ exports[`execute classes array types 1`] = ` }: { graph: Addr[][]; graphId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph_simplified: { graph, @@ -97,7 +97,7 @@ exports[`execute classes array types 1`] = ` }: { graph: Addr[][]; graphId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { edit_graph_simplified: { graph, @@ -109,7 +109,7 @@ exports[`execute classes array types 1`] = ` graphId }: { graphId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_graph: { graph_id: graphId @@ -120,14 +120,14 @@ exports[`execute classes array types 1`] = ` edges }: { edges: number[][]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_edges: { edges } }, fee_, memo_, funds_); }; - findSavings = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + findSavings = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { find_savings: {} }, fee_, memo_, funds_); @@ -136,14 +136,14 @@ exports[`execute classes array types 1`] = ` graphId }: { graphId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { find_savings_in_a_graph: { graph_id: graphId } }, fee_, memo_, funds_); }; - reset = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + reset = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { reset: {} }, fee_, memo_, funds_); @@ -152,7 +152,7 @@ exports[`execute classes array types 1`] = ` filepath }: { filepath: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { save_network_to_file: { filepath @@ -163,7 +163,7 @@ exports[`execute classes array types 1`] = ` filepath }: { filepath: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph_from_file: { filepath @@ -174,7 +174,7 @@ exports[`execute classes array types 1`] = ` filepath }: { filepath: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { apply_set_off_from_file: { filepath @@ -194,7 +194,7 @@ exports[`execute interfaces no extends 1`] = ` }: { amount: number; creditor: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; editEdge: ({ amount, creditor, @@ -203,63 +203,63 @@ exports[`execute interfaces no extends 1`] = ` amount: number; creditor: Addr; edgeId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeEdge: ({ edgeId }: { edgeId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; createGraph: ({ graph }: { graph: Edge[]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; createGraphSimplified: ({ graph, graphId }: { graph: Addr[][]; graphId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; editGraphSimplified: ({ graph, graphId }: { graph: Addr[][]; graphId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeGraph: ({ graphId }: { graphId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateEdges: ({ edges }: { edges: number[][]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - findSavings: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + findSavings: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; findSavingsInAGraph: ({ graphId }: { graphId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - reset: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + reset: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; saveNetworkToFile: ({ filepath }: { filepath: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; createGraphFromFile: ({ filepath }: { filepath: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; applySetOffFromFile: ({ filepath }: { filepath: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -267,9 +267,9 @@ exports[`execute_msg_for__empty 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.createEdge = this.createEdge.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.arrays.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.arrays.test.ts.snap index 1d09dfc0..fd0fa17e 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.arrays.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.arrays.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute classes array types 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -23,7 +23,7 @@ exports[`execute classes array types 1`] = ` edges: number[][]; nested: number[][][]; supernested: string[][][][][][]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_edges: { edges3, @@ -53,7 +53,7 @@ exports[`execute interfaces no extends 1`] = ` edges: number[][]; nested: number[][][]; supernested: string[][][][][][]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -63,9 +63,9 @@ exports[`getPropertyType 1`] = `"number[][][]"`; exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.updateEdges = this.updateEdges.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.cw-named-groups.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.cw-named-groups.test.ts.snap index a0feec9b..b3ec8eb0 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.cw-named-groups.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.cw-named-groups.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute classes array types 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -21,7 +21,7 @@ exports[`execute classes array types 1`] = ` addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update: { addresses_to_add: addressesToAdd, @@ -34,7 +34,7 @@ exports[`execute classes array types 1`] = ` group }: { group: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_group: { group @@ -45,7 +45,7 @@ exports[`execute classes array types 1`] = ` owner }: { owner: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_owner: { owner @@ -67,17 +67,17 @@ exports[`execute interfaces no extends 1`] = ` addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeGroup: ({ group }: { group: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateOwner: ({ owner }: { owner: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -85,9 +85,9 @@ exports[`execute_msg 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.update = this.update.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.cw-proposal-single.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.cw-proposal-single.test.ts.snap index ce732cdd..779d022c 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.cw-proposal-single.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.cw-proposal-single.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute classes array types 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -27,7 +27,7 @@ exports[`execute classes array types 1`] = ` description: string; msgs: CosmosMsg_for_Empty[]; title: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose: { description, @@ -42,7 +42,7 @@ exports[`execute classes array types 1`] = ` }: { proposalId: number; vote: Vote; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { vote: { proposal_id: proposalId, @@ -54,7 +54,7 @@ exports[`execute classes array types 1`] = ` proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { proposal_id: proposalId @@ -65,7 +65,7 @@ exports[`execute classes array types 1`] = ` proposalId }: { proposalId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { close: { proposal_id: proposalId @@ -88,7 +88,7 @@ exports[`execute classes array types 1`] = ` minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { allow_revoting: allowRevoting, @@ -105,7 +105,7 @@ exports[`execute classes array types 1`] = ` address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_proposal_hook: { address @@ -116,7 +116,7 @@ exports[`execute classes array types 1`] = ` address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_proposal_hook: { address @@ -127,7 +127,7 @@ exports[`execute classes array types 1`] = ` address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_vote_hook: { address @@ -138,7 +138,7 @@ exports[`execute classes array types 1`] = ` address }: { address: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_vote_hook: { address @@ -160,24 +160,24 @@ exports[`execute interfaces no extends 1`] = ` description: string; msgs: CosmosMsg_for_Empty[]; title: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; vote: ({ proposalId, vote }: { proposalId: number; vote: Vote; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; execute: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; close: ({ proposalId }: { proposalId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ allowRevoting, dao, @@ -194,27 +194,27 @@ exports[`execute interfaces no extends 1`] = ` minVotingPeriod?: Duration; onlyMembersExecute: boolean; threshold: Threshold; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeProposalHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeVoteHook: ({ address }: { address: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -222,9 +222,9 @@ exports[`execute_msg_for 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.config = this.config.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.declare.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.declare.test.ts.snap index 46a8ff22..25305335 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.declare.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.declare.test.ts.snap @@ -2,10 +2,10 @@ exports[`noDeclare, execExtends, ExtendsClass 1`] = ` "export class SG721Client extends ExtendsClassName implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -25,7 +25,7 @@ exports[`noDeclare, execExtends, ExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -41,7 +41,7 @@ exports[`noDeclare, execExtends, ExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -58,7 +58,7 @@ exports[`noDeclare, execExtends, ExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -73,7 +73,7 @@ exports[`noDeclare, execExtends, ExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -87,7 +87,7 @@ exports[`noDeclare, execExtends, ExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -99,7 +99,7 @@ exports[`noDeclare, execExtends, ExtendsClass 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -116,7 +116,7 @@ exports[`noDeclare, execExtends, ExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -130,7 +130,7 @@ exports[`noDeclare, execExtends, ExtendsClass 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -142,10 +142,10 @@ exports[`noDeclare, execExtends, ExtendsClass 1`] = ` exports[`noDeclare, execExtends, noExtendsClass 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -164,7 +164,7 @@ exports[`noDeclare, execExtends, noExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -180,7 +180,7 @@ exports[`noDeclare, execExtends, noExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -197,7 +197,7 @@ exports[`noDeclare, execExtends, noExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -212,7 +212,7 @@ exports[`noDeclare, execExtends, noExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -226,7 +226,7 @@ exports[`noDeclare, execExtends, noExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -238,7 +238,7 @@ exports[`noDeclare, execExtends, noExtendsClass 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -255,7 +255,7 @@ exports[`noDeclare, execExtends, noExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -269,7 +269,7 @@ exports[`noDeclare, execExtends, noExtendsClass 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -281,10 +281,10 @@ exports[`noDeclare, execExtends, noExtendsClass 1`] = ` exports[`useDeclare, execExtends, ExtendsClass 1`] = ` "export class SG721Client extends ExtendsClassName implements SG721Instance { - declare client: SigningCosmWasmClient; + declare client: ISigningCosmWasmClient; sender: string; declare contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -304,7 +304,7 @@ exports[`useDeclare, execExtends, ExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -320,7 +320,7 @@ exports[`useDeclare, execExtends, ExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -337,7 +337,7 @@ exports[`useDeclare, execExtends, ExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -352,7 +352,7 @@ exports[`useDeclare, execExtends, ExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -366,7 +366,7 @@ exports[`useDeclare, execExtends, ExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -378,7 +378,7 @@ exports[`useDeclare, execExtends, ExtendsClass 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -395,7 +395,7 @@ exports[`useDeclare, execExtends, ExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -409,7 +409,7 @@ exports[`useDeclare, execExtends, ExtendsClass 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -421,10 +421,10 @@ exports[`useDeclare, execExtends, ExtendsClass 1`] = ` exports[`useDeclare, noExecExtends, ExtendsClass 1`] = ` "export class SG721Client extends ExtendsClassName implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -444,7 +444,7 @@ exports[`useDeclare, noExecExtends, ExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -460,7 +460,7 @@ exports[`useDeclare, noExecExtends, ExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -477,7 +477,7 @@ exports[`useDeclare, noExecExtends, ExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -492,7 +492,7 @@ exports[`useDeclare, noExecExtends, ExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -506,7 +506,7 @@ exports[`useDeclare, noExecExtends, ExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -518,7 +518,7 @@ exports[`useDeclare, noExecExtends, ExtendsClass 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -535,7 +535,7 @@ exports[`useDeclare, noExecExtends, ExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -549,7 +549,7 @@ exports[`useDeclare, noExecExtends, ExtendsClass 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -561,10 +561,10 @@ exports[`useDeclare, noExecExtends, ExtendsClass 1`] = ` exports[`useDeclare, noExecExtends, noExtendsClass 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -583,7 +583,7 @@ exports[`useDeclare, noExecExtends, noExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -599,7 +599,7 @@ exports[`useDeclare, noExecExtends, noExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -616,7 +616,7 @@ exports[`useDeclare, noExecExtends, noExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -631,7 +631,7 @@ exports[`useDeclare, noExecExtends, noExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -645,7 +645,7 @@ exports[`useDeclare, noExecExtends, noExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -657,7 +657,7 @@ exports[`useDeclare, noExecExtends, noExtendsClass 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -674,7 +674,7 @@ exports[`useDeclare, noExecExtends, noExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -688,7 +688,7 @@ exports[`useDeclare, noExecExtends, noExtendsClass 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.empty-enums.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.empty-enums.test.ts.snap index 9eb8ebee..2f01ac87 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.empty-enums.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.empty-enums.test.ts.snap @@ -2,9 +2,9 @@ exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.issue-101.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.issue-101.test.ts.snap index 17b77dd3..e22a310b 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.issue-101.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.issue-101.test.ts.snap @@ -8,17 +8,17 @@ exports[`execute interfaces no extends 1`] = ` newFactory }: { newFactory: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - updateOwnership: (action: Action, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + updateOwnership: (action: Action, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; exports[`ownership client with tuple 1`] = ` "export class OwnershipClient implements OwnershipInstance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -29,14 +29,14 @@ exports[`ownership client with tuple 1`] = ` newFactory }: { newFactory: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_factory: { new_factory: newFactory } }, fee_, memo_, funds_); }; - updateOwnership = async (action: Action, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + updateOwnership = async (action: Action, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_ownership: action }, fee_, memo_, funds_); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.issue-103.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.issue-103.test.ts.snap index 3e03cdbc..520583ba 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.issue-103.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.issue-103.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute execute classes array types 1`] = ` "export class Client implements Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -24,9 +24,9 @@ exports[`execute execute_msg_for__empty 1`] = `"export type ExecuteMsg = Execute exports[`execute query classes 1`] = ` "export class QueryClient implements ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -37,10 +37,10 @@ exports[`execute query classes response 1`] = `"export type QueryMsg = QueryMsg; exports[`query execute classes array types 1`] = ` "export class Client implements Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -59,9 +59,9 @@ exports[`query execute_msg_for__empty 1`] = `"export type QueryMsg = QueryMsg;"` exports[`query query classes 1`] = ` "export class QueryClient implements ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.issue-71.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.issue-71.test.ts.snap index b4f43503..c0cbdd39 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.issue-71.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.issue-71.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute class /execute_msg.json 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -28,7 +28,7 @@ exports[`execute class /execute_msg.json 1`] = ` amount: Uint128; msg: Binary; sender: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { receive: { amount, @@ -45,7 +45,7 @@ exports[`execute class /execute_msg.json 1`] = ` feeCollector?: string; generatorAddress?: string; lpTokenCodeId?: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { fee_collector: feeCollector, @@ -62,7 +62,7 @@ exports[`execute class /execute_msg.json 1`] = ` isDisabled?: boolean; newFeeInfo?: FeeInfo; poolType: PoolType; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_pool_config: { is_disabled: isDisabled, @@ -75,7 +75,7 @@ exports[`execute class /execute_msg.json 1`] = ` newPoolConfig }: { newPoolConfig: PoolConfig; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_to_registery: { new_pool_config: newPoolConfig @@ -94,7 +94,7 @@ exports[`execute class /execute_msg.json 1`] = ` lpTokenName?: string; lpTokenSymbol?: string; poolType: PoolType; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_pool_instance: { asset_infos: assetInfos, @@ -119,7 +119,7 @@ exports[`execute class /execute_msg.json 1`] = ` poolId: Uint128; recipient?: string; slippageTolerance?: Decimal; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { join_pool: { assets, @@ -137,7 +137,7 @@ exports[`execute class /execute_msg.json 1`] = ` }: { recipient?: string; swapRequest: SingleSwapRequest; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { swap: { recipient, @@ -151,7 +151,7 @@ exports[`execute class /execute_msg.json 1`] = ` }: { expiresIn: number; owner: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { propose_new_owner: { expires_in: expiresIn, @@ -159,12 +159,12 @@ exports[`execute class /execute_msg.json 1`] = ` } }, fee_, memo_, funds_); }; - dropOwnershipProposal = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + dropOwnershipProposal = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { drop_ownership_proposal: {} }, fee_, memo_, funds_); }; - claimOwnership = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + claimOwnership = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { claim_ownership: {} }, fee_, memo_, funds_); @@ -184,7 +184,7 @@ exports[`execute interface /execute_msg.json 1`] = ` amount: Uint128; msg: Binary; sender: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateConfig: ({ feeCollector, generatorAddress, @@ -193,7 +193,7 @@ exports[`execute interface /execute_msg.json 1`] = ` feeCollector?: string; generatorAddress?: string; lpTokenCodeId?: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updatePoolConfig: ({ isDisabled, newFeeInfo, @@ -202,12 +202,12 @@ exports[`execute interface /execute_msg.json 1`] = ` isDisabled?: boolean; newFeeInfo?: FeeInfo; poolType: PoolType; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addToRegistery: ({ newPoolConfig }: { newPoolConfig: PoolConfig; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; createPoolInstance: ({ assetInfos, initParams, @@ -220,7 +220,7 @@ exports[`execute interface /execute_msg.json 1`] = ` lpTokenName?: string; lpTokenSymbol?: string; poolType: PoolType; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; joinPool: ({ assets, autoStake, @@ -235,23 +235,23 @@ exports[`execute interface /execute_msg.json 1`] = ` poolId: Uint128; recipient?: string; slippageTolerance?: Decimal; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; swap: ({ recipient, swapRequest }: { recipient?: string; swapRequest: SingleSwapRequest; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; proposeNewOwner: ({ expiresIn, owner }: { expiresIn: number; owner: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - dropOwnershipProposal: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - claimOwnership: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + dropOwnershipProposal: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + claimOwnership: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -259,9 +259,9 @@ exports[`execute_msg_for__empty /execute_msg.json 1`] = `"export type ExecuteMsg exports[`query classes /execute_msg.json 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.receive = this.receive.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.issue-98.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.issue-98.test.ts.snap index 145bc3fe..7032ad09 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.issue-98.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.issue-98.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute classes array types 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -13,7 +13,7 @@ exports[`execute classes array types 1`] = ` this.getPlugins = this.getPlugins.bind(this); this.getPluginById = this.getPluginById.bind(this); } - getConfig = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + getConfig = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_config: {} }, fee_, memo_, funds_); @@ -24,7 +24,7 @@ exports[`execute classes array types 1`] = ` }: { limit?: number; startAfter?: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_plugins: { limit, @@ -36,7 +36,7 @@ exports[`execute classes array types 1`] = ` id }: { id: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_plugin_by_id: { id @@ -50,19 +50,19 @@ exports[`execute interfaces no extends 1`] = ` "export interface SG721Instance { contractAddress: string; sender: string; - getConfig: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + getConfig: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; getPlugins: ({ limit, startAfter }: { limit?: number; startAfter?: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; getPluginById: ({ id }: { id: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -70,9 +70,9 @@ exports[`execute_msg_for__empty 1`] = `"export type QueryMsg = QueryMsg;"`; exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.getConfig = this.getConfig.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.issues.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.issues.test.ts.snap index 5921cea1..f0212564 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.issues.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.issues.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute class /batch.json 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -15,10 +15,10 @@ exports[`execute class /batch.json 1`] = ` exports[`execute class /denom_response.json 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -28,10 +28,10 @@ exports[`execute class /denom_response.json 1`] = ` exports[`execute class /edge.json 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -41,10 +41,10 @@ exports[`execute class /edge.json 1`] = ` exports[`execute class /execute_msg.json 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -69,7 +69,7 @@ exports[`execute class /execute_msg.json 1`] = ` }: { amount: number; creditor: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_edge: { amount, @@ -85,7 +85,7 @@ exports[`execute class /execute_msg.json 1`] = ` amount: number; creditor: Addr; edgeId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { edit_edge: { amount, @@ -98,7 +98,7 @@ exports[`execute class /execute_msg.json 1`] = ` edgeId }: { edgeId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_edge: { edge_id: edgeId @@ -109,7 +109,7 @@ exports[`execute class /execute_msg.json 1`] = ` graph }: { graph: Edge[]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph: { graph @@ -122,7 +122,7 @@ exports[`execute class /execute_msg.json 1`] = ` }: { graph: Addr[][]; graphId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph_simplified: { graph, @@ -136,7 +136,7 @@ exports[`execute class /execute_msg.json 1`] = ` }: { graph: Addr[][]; graphId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { edit_graph_simplified: { graph, @@ -148,7 +148,7 @@ exports[`execute class /execute_msg.json 1`] = ` graphId }: { graphId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_graph: { graph_id: graphId @@ -159,14 +159,14 @@ exports[`execute class /execute_msg.json 1`] = ` edges }: { edges: number[][]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_edges: { edges } }, fee_, memo_, funds_); }; - findSavings = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + findSavings = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { find_savings: {} }, fee_, memo_, funds_); @@ -175,14 +175,14 @@ exports[`execute class /execute_msg.json 1`] = ` graphId }: { graphId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { find_savings_in_a_graph: { graph_id: graphId } }, fee_, memo_, funds_); }; - reset = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + reset = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { reset: {} }, fee_, memo_, funds_); @@ -191,7 +191,7 @@ exports[`execute class /execute_msg.json 1`] = ` filepath }: { filepath: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { save_network_to_file: { filepath @@ -202,7 +202,7 @@ exports[`execute class /execute_msg.json 1`] = ` filepath }: { filepath: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { create_graph_from_file: { filepath @@ -213,7 +213,7 @@ exports[`execute class /execute_msg.json 1`] = ` filepath }: { filepath: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { apply_set_off_from_file: { filepath @@ -225,10 +225,10 @@ exports[`execute class /execute_msg.json 1`] = ` exports[`execute class /instantiate_msg.json 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -238,10 +238,10 @@ exports[`execute class /instantiate_msg.json 1`] = ` exports[`execute class /network.json 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -251,10 +251,10 @@ exports[`execute class /network.json 1`] = ` exports[`execute class /query_msg.json 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -271,17 +271,17 @@ exports[`execute class /query_msg.json 1`] = ` this.getTotalDebtByGraph = this.getTotalDebtByGraph.bind(this); this.getTotalDebt = this.getTotalDebt.bind(this); } - getDenom = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + getDenom = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_denom: {} }, fee_, memo_, funds_); }; - getOwner = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + getOwner = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_owner: {} }, fee_, memo_, funds_); }; - allEdges = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + allEdges = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { all_edges: {} }, fee_, memo_, funds_); @@ -290,7 +290,7 @@ exports[`execute class /query_msg.json 1`] = ` edgeId }: { edgeId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { one_edge: { edge_id: edgeId @@ -301,7 +301,7 @@ exports[`execute class /query_msg.json 1`] = ` batchId }: { batchId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { one_batch: { batch_id: batchId @@ -312,7 +312,7 @@ exports[`execute class /query_msg.json 1`] = ` graphId }: { graphId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { one_graph: { graph_id: graphId @@ -323,7 +323,7 @@ exports[`execute class /query_msg.json 1`] = ` address }: { address: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_edges_by_address: { address @@ -334,7 +334,7 @@ exports[`execute class /query_msg.json 1`] = ` address }: { address: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_edges_as_counterparty: { address @@ -345,7 +345,7 @@ exports[`execute class /query_msg.json 1`] = ` address }: { address: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_total_debt_per_address: { address @@ -356,7 +356,7 @@ exports[`execute class /query_msg.json 1`] = ` address }: { address: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_total_credit_per_address: { address @@ -367,14 +367,14 @@ exports[`execute class /query_msg.json 1`] = ` graphId }: { graphId: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_total_debt_by_graph: { graph_id: graphId } }, fee_, memo_, funds_); }; - getTotalDebt = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + getTotalDebt = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { get_total_debt: {} }, fee_, memo_, funds_); @@ -413,7 +413,7 @@ exports[`execute interface /execute_msg.json 1`] = ` }: { amount: number; creditor: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; editEdge: ({ amount, creditor, @@ -422,63 +422,63 @@ exports[`execute interface /execute_msg.json 1`] = ` amount: number; creditor: Addr; edgeId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeEdge: ({ edgeId }: { edgeId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; createGraph: ({ graph }: { graph: Edge[]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; createGraphSimplified: ({ graph, graphId }: { graph: Addr[][]; graphId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; editGraphSimplified: ({ graph, graphId }: { graph: Addr[][]; graphId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeGraph: ({ graphId }: { graphId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateEdges: ({ edges }: { edges: number[][]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - findSavings: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + findSavings: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; findSavingsInAGraph: ({ graphId }: { graphId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - reset: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + reset: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; saveNetworkToFile: ({ filepath }: { filepath: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; createGraphFromFile: ({ filepath }: { filepath: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; applySetOffFromFile: ({ filepath }: { filepath: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -500,50 +500,50 @@ exports[`execute interface /query_msg.json 1`] = ` "export interface SG721Instance { contractAddress: string; sender: string; - getDenom: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - getOwner: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - allEdges: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + getDenom: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + getOwner: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + allEdges: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; oneEdge: ({ edgeId }: { edgeId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; oneBatch: ({ batchId }: { batchId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; oneGraph: ({ graphId }: { graphId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; getEdgesByAddress: ({ address }: { address: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; getEdgesAsCounterparty: ({ address }: { address: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; getTotalDebtPerAddress: ({ address }: { address: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; getTotalCreditPerAddress: ({ address }: { address: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; getTotalDebtByGraph: ({ graphId }: { graphId: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - getTotalDebt: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + getTotalDebt: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -589,9 +589,9 @@ exports[`execute_msg_for__empty /query_msg.json 1`] = `"export type QueryMsg = Q exports[`query classes /batch.json 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -600,9 +600,9 @@ exports[`query classes /batch.json 1`] = ` exports[`query classes /denom_response.json 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -611,9 +611,9 @@ exports[`query classes /denom_response.json 1`] = ` exports[`query classes /edge.json 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -622,9 +622,9 @@ exports[`query classes /edge.json 1`] = ` exports[`query classes /execute_msg.json 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.createEdge = this.createEdge.bind(this); @@ -804,9 +804,9 @@ exports[`query classes /execute_msg.json 1`] = ` exports[`query classes /instantiate_msg.json 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -815,9 +815,9 @@ exports[`query classes /instantiate_msg.json 1`] = ` exports[`query classes /network.json 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; } @@ -826,9 +826,9 @@ exports[`query classes /network.json 1`] = ` exports[`query classes /query_msg.json 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.getDenom = this.getDenom.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.overrides.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.overrides.test.ts.snap index f257838c..19a5f2f8 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.overrides.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.overrides.test.ts.snap @@ -2,10 +2,10 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` "export class SG721Client extends ExtendsClassName implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -25,7 +25,7 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -41,7 +41,7 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -58,7 +58,7 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -73,7 +73,7 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -87,7 +87,7 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -99,7 +99,7 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -116,7 +116,7 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -130,7 +130,7 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -142,10 +142,10 @@ exports[`Impl, execExtends, ExtendsClass 1`] = ` exports[`Impl, execExtends, noExtendsClass 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -164,7 +164,7 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -180,7 +180,7 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -197,7 +197,7 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -212,7 +212,7 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -226,7 +226,7 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -238,7 +238,7 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -255,7 +255,7 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -269,7 +269,7 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -281,10 +281,10 @@ exports[`Impl, execExtends, noExtendsClass 1`] = ` exports[`noImpl, execExtends, ExtendsClass 1`] = ` "export class SG721Client extends ExtendsClassName implements SG721Instance { - override client: SigningCosmWasmClient; + override client: ISigningCosmWasmClient; sender: string; override contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -304,7 +304,7 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -320,7 +320,7 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -337,7 +337,7 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -352,7 +352,7 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -366,7 +366,7 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -378,7 +378,7 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -395,7 +395,7 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -409,7 +409,7 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -421,10 +421,10 @@ exports[`noImpl, execExtends, ExtendsClass 1`] = ` exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` "export class SG721Client extends ExtendsClassName implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -444,7 +444,7 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -460,7 +460,7 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -477,7 +477,7 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -492,7 +492,7 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -506,7 +506,7 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -518,7 +518,7 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -535,7 +535,7 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -549,7 +549,7 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -561,10 +561,10 @@ exports[`noImpl, noExecExtends, ExtendsClass 1`] = ` exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -583,7 +583,7 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -599,7 +599,7 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -616,7 +616,7 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -631,7 +631,7 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -645,7 +645,7 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -657,7 +657,7 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -674,7 +674,7 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -688,7 +688,7 @@ exports[`noImpl, noExecExtends, noExtendsClass 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.sg721.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.sg721.test.ts.snap index aa3287ee..18b2a6d0 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.sg721.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.sg721.test.ts.snap @@ -2,10 +2,10 @@ exports[`execute classes array types 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -24,7 +24,7 @@ exports[`execute classes array types 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -40,7 +40,7 @@ exports[`execute classes array types 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -57,7 +57,7 @@ exports[`execute classes array types 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -72,7 +72,7 @@ exports[`execute classes array types 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -86,7 +86,7 @@ exports[`execute classes array types 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -98,7 +98,7 @@ exports[`execute classes array types 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -115,7 +115,7 @@ exports[`execute classes array types 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -129,7 +129,7 @@ exports[`execute classes array types 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -149,7 +149,7 @@ exports[`execute interfaces no extends 1`] = ` }: { recipient: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; sendNft: ({ contract, msg, @@ -158,7 +158,7 @@ exports[`execute interfaces no extends 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approve: ({ expires, spender, @@ -167,26 +167,26 @@ exports[`execute interfaces no extends 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; revokeAll: ({ operator }: { operator: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mint: ({ extension, owner, @@ -197,12 +197,12 @@ exports[`execute interfaces no extends 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; burn: ({ tokenId }: { tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -210,9 +210,9 @@ exports[`execute_msg_for__empty 1`] = `"export type ExecuteMsg_for_Empty = Execu exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.transferNft = this.transferNft.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.test.ts.snap index 8627a35d..55828da9 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.test.ts.snap @@ -38,10 +38,10 @@ exports[`contract_info_response 1`] = ` exports[`execute classes 1`] = ` "export class SG721Client extends SG721QueryClient implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { super(client, contractAddress); this.client = client; this.sender = sender; @@ -61,7 +61,7 @@ exports[`execute classes 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -77,7 +77,7 @@ exports[`execute classes 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -94,7 +94,7 @@ exports[`execute classes 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -109,7 +109,7 @@ exports[`execute classes 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -123,7 +123,7 @@ exports[`execute classes 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -135,7 +135,7 @@ exports[`execute classes 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -152,7 +152,7 @@ exports[`execute classes 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -166,7 +166,7 @@ exports[`execute classes 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -178,10 +178,10 @@ exports[`execute classes 1`] = ` exports[`execute classes array types 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -197,7 +197,7 @@ exports[`execute classes array types 1`] = ` addressesToAdd?: string[]; addressesToRemove?: string[]; group: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update: { addresses_to_add: addressesToAdd, @@ -210,7 +210,7 @@ exports[`execute classes array types 1`] = ` group }: { group: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_group: { group @@ -221,7 +221,7 @@ exports[`execute classes array types 1`] = ` owner }: { owner: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_owner: { owner @@ -233,10 +233,10 @@ exports[`execute classes array types 1`] = ` exports[`execute classes no extends 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -255,7 +255,7 @@ exports[`execute classes no extends 1`] = ` }: { recipient: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { transfer_nft: { recipient, @@ -271,7 +271,7 @@ exports[`execute classes no extends 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { send_nft: { contract, @@ -288,7 +288,7 @@ exports[`execute classes no extends 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve: { expires, @@ -303,7 +303,7 @@ exports[`execute classes no extends 1`] = ` }: { spender: string; tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke: { spender, @@ -317,7 +317,7 @@ exports[`execute classes no extends 1`] = ` }: { expires?: Expiration; operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { approve_all: { expires, @@ -329,7 +329,7 @@ exports[`execute classes no extends 1`] = ` operator }: { operator: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revoke_all: { operator @@ -346,7 +346,7 @@ exports[`execute classes no extends 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { mint: { extension, @@ -360,7 +360,7 @@ exports[`execute classes no extends 1`] = ` tokenId }: { tokenId: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { burn: { token_id: tokenId @@ -380,7 +380,7 @@ exports[`execute interfaces no extends 1`] = ` }: { recipient: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; sendNft: ({ contract, msg, @@ -389,7 +389,7 @@ exports[`execute interfaces no extends 1`] = ` contract: string; msg: Binary; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approve: ({ expires, spender, @@ -398,26 +398,26 @@ exports[`execute interfaces no extends 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; revokeAll: ({ operator }: { operator: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; mint: ({ extension, owner, @@ -428,12 +428,12 @@ exports[`execute interfaces no extends 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; burn: ({ tokenId }: { tokenId: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -474,9 +474,9 @@ exports[`owner_of_response 1`] = ` exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.ownerOf = this.ownerOf.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.vectis.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.vectis.test.ts.snap index 51c69a9f..9edf40b8 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.vectis.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.vectis.test.ts.snap @@ -10,10 +10,10 @@ exports[`cosmos_msg_for__empty 1`] = `"export type CosmosMsg_for_Empty = CosmosM exports[`execute classes array types 1`] = ` "export class SG721Client implements SG721Instance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -30,14 +30,14 @@ exports[`execute classes array types 1`] = ` msgs }: { msgs: CosmosMsg_for_Empty[]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { execute: { msgs } }, fee_, memo_, funds_); }; - revertFreezeStatus = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + revertFreezeStatus = async (fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { revert_freeze_status: {} }, fee_, memo_, funds_); @@ -46,7 +46,7 @@ exports[`execute classes array types 1`] = ` transaction }: { transaction: RelayTransaction; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { relay: { transaction @@ -57,7 +57,7 @@ exports[`execute classes array types 1`] = ` newUserAddress }: { newUserAddress: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { rotate_user_key: { new_user_address: newUserAddress @@ -68,7 +68,7 @@ exports[`execute classes array types 1`] = ` newRelayerAddress }: { newRelayerAddress: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { add_relayer: { new_relayer_address: newRelayerAddress @@ -79,7 +79,7 @@ exports[`execute classes array types 1`] = ` relayerAddress }: { relayerAddress: Addr; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { remove_relayer: { relayer_address: relayerAddress @@ -92,7 +92,7 @@ exports[`execute classes array types 1`] = ` }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_guardians: { guardians, @@ -104,7 +104,7 @@ exports[`execute classes array types 1`] = ` newLabel }: { newLabel: string; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_label: { new_label: newLabel @@ -122,40 +122,40 @@ exports[`execute interfaces no extends 1`] = ` msgs }: { msgs: CosmosMsg_for_Empty[]; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; - revertFreezeStatus: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + revertFreezeStatus: (fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; relay: ({ transaction }: { transaction: RelayTransaction; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; rotateUserKey: ({ newUserAddress }: { newUserAddress: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; addRelayer: ({ newRelayerAddress }: { newRelayerAddress: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; removeRelayer: ({ relayerAddress }: { relayerAddress: Addr; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateGuardians: ({ guardians, newMultisigCodeId }: { guardians: Guardians; newMultisigCodeId?: number; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; updateLabel: ({ newLabel }: { newLabel: string; - }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; + }, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise; }" `; @@ -178,9 +178,9 @@ exports[`info_response 1`] = ` exports[`query classes 1`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.bank = this.bank.bind(this); @@ -219,9 +219,9 @@ exports[`query classes 1`] = ` exports[`query classes 2`] = ` "export class SG721QueryClient implements SG721ReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.execute = this.execute.bind(this); diff --git a/packages/ast/__tests__/client/__snapshots__/ts-client.wager.test.ts.snap b/packages/ast/__tests__/client/__snapshots__/ts-client.wager.test.ts.snap index 89679054..60b88560 100644 --- a/packages/ast/__tests__/client/__snapshots__/ts-client.wager.test.ts.snap +++ b/packages/ast/__tests__/client/__snapshots__/ts-client.wager.test.ts.snap @@ -4,10 +4,10 @@ exports[`execute 1`] = `"export type ExecuteMsg = ExecuteMsg;"`; exports[`execute classes 1`] = ` "export class WagerClient implements WagerInstance { - client: SigningCosmWasmClient; + client: ISigningCosmWasmClient; sender: string; contractAddress: string; - constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + constructor(client: ISigningCosmWasmClient, sender: string, contractAddress: string) { this.client = client; this.sender = sender; this.contractAddress = contractAddress; @@ -20,7 +20,7 @@ exports[`execute classes 1`] = ` params }: { params: ParamInfo; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_config: { params @@ -35,7 +35,7 @@ exports[`execute classes 1`] = ` currentPrices: number[][]; prevPrices: number[][]; wagerKey: Addr[][]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { set_winner: { current_prices: currentPrices, @@ -54,7 +54,7 @@ exports[`execute classes 1`] = ` currency: Currency; expiry: number; token: Addr[][]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { wager: { against_currencies: againstCurrencies, @@ -68,7 +68,7 @@ exports[`execute classes 1`] = ` token }: { token: Addr[][]; - }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { + }, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { cancel: { token @@ -82,9 +82,9 @@ exports[`query 1`] = `"export type QueryMsg = QueryMsg;"`; exports[`query classes 1`] = ` "export class WagerQueryClient implements WagerReadOnlyInstance { - client: CosmWasmClient; + client: ICosmWasmClient; contractAddress: string; - constructor(client: CosmWasmClient, contractAddress: string) { + constructor(client: ICosmWasmClient, contractAddress: string) { this.client = client; this.contractAddress = contractAddress; this.wagers = this.wagers.bind(this); diff --git a/packages/ast/__tests__/message-composer/__snapshots__/message-composer.test.ts.snap b/packages/ast/__tests__/message-composer/__snapshots__/message-composer.test.ts.snap index 1707104a..27834354 100644 --- a/packages/ast/__tests__/message-composer/__snapshots__/message-composer.test.ts.snap +++ b/packages/ast/__tests__/message-composer/__snapshots__/message-composer.test.ts.snap @@ -10,7 +10,7 @@ exports[`createMessageComposerInterface 1`] = ` }: { recipient: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; sendNft: ({ contract, msg, @@ -19,7 +19,7 @@ exports[`createMessageComposerInterface 1`] = ` contract: string; msg: Binary; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; approve: ({ expires, spender, @@ -28,26 +28,26 @@ exports[`createMessageComposerInterface 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; revoke: ({ spender, tokenId }: { spender: string; tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; approveAll: ({ expires, operator }: { expires?: Expiration; operator: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; revokeAll: ({ operator }: { operator: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; mint: ({ extension, owner, @@ -58,12 +58,12 @@ exports[`createMessageComposerInterface 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; burn: ({ tokenId }: { tokenId: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; }" `; @@ -89,7 +89,7 @@ exports[`execute classes 1`] = ` }: { recipient: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -113,7 +113,7 @@ exports[`execute classes 1`] = ` contract: string; msg: Binary; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -138,7 +138,7 @@ exports[`execute classes 1`] = ` expires?: Expiration; spender: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -161,7 +161,7 @@ exports[`execute classes 1`] = ` }: { spender: string; tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -183,7 +183,7 @@ exports[`execute classes 1`] = ` }: { expires?: Expiration; operator: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -203,7 +203,7 @@ exports[`execute classes 1`] = ` operator }: { operator: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -228,7 +228,7 @@ exports[`execute classes 1`] = ` owner: string; tokenId: string; tokenUri?: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -250,7 +250,7 @@ exports[`execute classes 1`] = ` tokenId }: { tokenId: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -282,7 +282,7 @@ exports[`ownershipClass 1`] = ` newFactory }: { newFactory: string; - }, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + }, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -297,7 +297,7 @@ exports[`ownershipClass 1`] = ` }) }; }; - updateOwnership = (action: Action, funds_?: Coin[]): MsgExecuteContractEncodeObject => { + updateOwnership = (action: Action, funds_?: Coin[]): EncodeObject => { return { typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract", value: MsgExecuteContract.fromPartial({ @@ -321,7 +321,7 @@ exports[`ownershipInterface 1`] = ` newFactory }: { newFactory: string; - }, funds_?: Coin[]) => MsgExecuteContractEncodeObject; - updateOwnership: (action: Action, funds_?: Coin[]) => MsgExecuteContractEncodeObject; + }, funds_?: Coin[]) => EncodeObject; + updateOwnership: (action: Action, funds_?: Coin[]) => EncodeObject; }" `; diff --git a/packages/ast/__tests__/provider/__snapshots__/provider.test.ts.snap b/packages/ast/__tests__/provider/__snapshots__/provider.test.ts.snap index 3fb0645c..4ccd5266 100644 --- a/packages/ast/__tests__/provider/__snapshots__/provider.test.ts.snap +++ b/packages/ast/__tests__/provider/__snapshots__/provider.test.ts.snap @@ -8,7 +8,7 @@ exports[`create IContractsContext 1`] = ` `; exports[`create getProviders 1`] = ` -"export const getProviders = (address?: string, cosmWasmClient?: CosmWasmClient, signingCosmWasmClient?: SigningCosmWasmClient) => ({ +"export const getProviders = (address?: string, cosmWasmClient?: ICosmWasmClient, signingCosmWasmClient?: ISigningCosmWasmClient) => ({ whitelist: new Whitelist({ address, cosmWasmClient, diff --git a/packages/ast/__tests__/react-query/__snapshots__/react-query.test.ts.snap b/packages/ast/__tests__/react-query/__snapshots__/react-query.test.ts.snap index 533964cd..c832dfad 100644 --- a/packages/ast/__tests__/react-query/__snapshots__/react-query.test.ts.snap +++ b/packages/ast/__tests__/react-query/__snapshots__/react-query.test.ts.snap @@ -1185,8 +1185,8 @@ exports[`createReactQueryHooks 6`] = ` funds?: Coin[]; }; } -export function useSg721BurnMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useSg721BurnMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -1210,8 +1210,8 @@ export interface Sg721MintMutation { funds?: Coin[]; }; } -export function useSg721MintMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useSg721MintMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -1232,8 +1232,8 @@ export interface Sg721RevokeAllMutation { funds?: Coin[]; }; } -export function useSg721RevokeAllMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useSg721RevokeAllMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -1255,8 +1255,8 @@ export interface Sg721ApproveAllMutation { funds?: Coin[]; }; } -export function useSg721ApproveAllMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useSg721ApproveAllMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -1278,8 +1278,8 @@ export interface Sg721RevokeMutation { funds?: Coin[]; }; } -export function useSg721RevokeMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useSg721RevokeMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -1302,8 +1302,8 @@ export interface Sg721ApproveMutation { funds?: Coin[]; }; } -export function useSg721ApproveMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useSg721ApproveMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -1326,8 +1326,8 @@ export interface Sg721SendNftMutation { funds?: Coin[]; }; } -export function useSg721SendNftMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useSg721SendNftMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -1349,8 +1349,8 @@ export interface Sg721TransferNftMutation { funds?: Coin[]; }; } -export function useSg721TransferNftMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useSg721TransferNftMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -1372,8 +1372,8 @@ exports[`ownership 1`] = ` funds?: Coin[]; }; } -export function useOwnershipUpdateOwnershipMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useOwnershipUpdateOwnershipMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { @@ -1394,8 +1394,8 @@ export interface OwnershipSetFactoryMutation { funds?: Coin[]; }; } -export function useOwnershipSetFactoryMutation(options?: Omit, "mutationFn">) { - return useMutation(({ +export function useOwnershipSetFactoryMutation(options?: Omit, "mutationFn">) { + return useMutation(({ client, msg, args: { diff --git a/packages/ast/src/client/client.ts b/packages/ast/src/client/client.ts index 59dad222..8478b156 100644 --- a/packages/ast/src/client/client.ts +++ b/packages/ast/src/client/client.ts @@ -107,7 +107,7 @@ export const createQueryClass = ( implementsClassName: string, queryMsg: QueryMsg ) => { - context.addUtil('CosmWasmClient'); + context.addUtil('ICosmWasmClient'); const propertyNames = getMessageProperties(queryMsg) .map((method) => Object.keys(method.properties)?.[0]) @@ -126,7 +126,7 @@ export const createQueryClass = ( // client classProperty( 'client', - t.tsTypeAnnotation(t.tsTypeReference(t.identifier('CosmWasmClient'))) + t.tsTypeAnnotation(t.tsTypeReference(t.identifier('ICosmWasmClient'))) ), // contractAddress @@ -143,7 +143,7 @@ export const createQueryClass = ( typedIdentifier( 'client', t.tsTypeAnnotation( - t.tsTypeReference(t.identifier('CosmWasmClient')) + t.tsTypeReference(t.identifier('ICosmWasmClient')) ) ), typedIdentifier( @@ -218,7 +218,7 @@ export const createWasmExecMethod = ( context: RenderContext, jsonschema: JSONSchema ) => { - context.addUtil('ExecuteResult'); + context.addUtil('DeliverTxResponse'); context.addUtil('StdFee'); context.addUtil('Coin'); @@ -280,7 +280,7 @@ export const createWasmExecMethod = ( t.tsTypeReference( t.identifier('Promise'), t.tsTypeParameterInstantiation([ - t.tSTypeReference(t.identifier('ExecuteResult')), + t.tSTypeReference(t.identifier('DeliverTxResponse')), ]) ) ), @@ -296,7 +296,7 @@ export const createExecuteClass = ( extendsClassName: string | null, execMsg: ExecuteMsg ) => { - context.addUtil('SigningCosmWasmClient'); + context.addUtil('ISigningCosmWasmClient'); const propertyNames = getMessageProperties(execMsg) .map((method) => Object.keys(method.properties)?.[0]) @@ -371,7 +371,7 @@ export const createExecuteClass = ( classProperty( 'client', t.tsTypeAnnotation( - t.tsTypeReference(t.identifier('SigningCosmWasmClient')) + t.tsTypeReference(t.identifier('ISigningCosmWasmClient')) ), false, false, @@ -400,7 +400,7 @@ export const createExecuteClass = ( typedIdentifier( 'client', t.tsTypeAnnotation( - t.tsTypeReference(t.identifier('SigningCosmWasmClient')) + t.tsTypeReference(t.identifier('ISigningCosmWasmClient')) ) ), typedIdentifier('sender', t.tsTypeAnnotation(t.tsStringKeyword())), @@ -431,7 +431,7 @@ export const createExecuteInterface = ( return createPropertyFunctionWithObjectParamsForExec( context, methodName, - 'ExecuteResult', + 'DeliverTxResponse', jsonschema.properties[underscoreName] ); }); diff --git a/packages/ast/src/context/imports.ts b/packages/ast/src/context/imports.ts index 3459c391..9e726785 100644 --- a/packages/ast/src/context/imports.ts +++ b/packages/ast/src/context/imports.ts @@ -3,7 +3,6 @@ import { dirname, extname, relative } from 'path'; import { importAs, importStmt } from '../utils'; import { RenderContext } from './context'; - export interface ImportObj { type: 'import' | 'default' | 'namespace'; name: string; @@ -40,14 +39,19 @@ const makeReactQuerySwitch = (varName: string) => { export const UTILS = { selectorFamily: 'recoil', - MsgExecuteContract: 'cosmjs-types/cosmwasm/wasm/v1/tx', - MsgExecuteContractEncodeObject: '@cosmjs/cosmwasm-stargate', - Coin: '@cosmjs/amino', - toUtf8: '@cosmjs/encoding', - StdFee: '@cosmjs/amino', - CosmWasmClient: '@cosmjs/cosmwasm-stargate', - ExecuteResult: '@cosmjs/cosmwasm-stargate', - SigningCosmWasmClient: '@cosmjs/cosmwasm-stargate', + MsgExecuteContract: 'interchainjs/cosmwasm/wasm/v1/tx', + EncodeObject: '@interchainjs/cosmos-types', + Coin: '@interchainjs/types', + toUtf8: '@interchainjs/encoding', + StdFee: '@interchainjs/types', + ICosmWasmClient: '__baseClient__', + DeliverTxResponse: '@interchainjs/types', + ISigningCosmWasmClient: '__baseClient__', + getCosmWasmClient: '__baseClient__', + getSigningCosmWasmClient: '__baseClient__', + IQueryClientProvider: '__contractContextBase__', + ISigningClientProvider: '__contractContextBase__', + IMessageComposerProvider: '__contractContextBase__', // react-query useQuery: makeReactQuerySwitch('useQuery'), @@ -56,7 +60,7 @@ export const UTILS = { UseMutationOptions: makeReactQuerySwitch('UseMutationOptions'), }; -export const UTIL_HELPERS = ['__contractContextBase__']; +export const UTIL_HELPERS = ['__contractContextBase__', '__baseClient__']; export const convertUtilsToImportList = ( context: RenderContext, diff --git a/packages/ast/src/message-composer/message-composer.ts b/packages/ast/src/message-composer/message-composer.ts index 6e63fe95..bcf7ffbf 100644 --- a/packages/ast/src/message-composer/message-composer.ts +++ b/packages/ast/src/message-composer/message-composer.ts @@ -21,7 +21,7 @@ const createWasmExecMethodMessageComposer = ( jsonschema: any ) => { context.addUtil('Coin'); - context.addUtil('MsgExecuteContractEncodeObject'); + context.addUtil('EncodeObject'); context.addUtil('MsgExecuteContract'); context.addUtil('toUtf8'); @@ -117,9 +117,7 @@ const createWasmExecMethodMessageComposer = ( ), ]), // return type - t.tsTypeAnnotation( - t.tsTypeReference(t.identifier('MsgExecuteContractEncodeObject')) - ), + t.tsTypeAnnotation(t.tsTypeReference(t.identifier('EncodeObject'))), false ) ); @@ -211,7 +209,7 @@ export const createMessageComposerInterface = ( return createPropertyFunctionWithObjectParamsForMessageComposer( context, methodName, - 'MsgExecuteContractEncodeObject', + 'EncodeObject', jsonschema.properties[underscoreName] ); }); diff --git a/packages/ast/src/provider/provider.ts b/packages/ast/src/provider/provider.ts index 91c51b71..43425b99 100644 --- a/packages/ast/src/provider/provider.ts +++ b/packages/ast/src/provider/provider.ts @@ -224,13 +224,13 @@ export const createGettingProviders = (providerInfos: { identifier( 'cosmWasmClient?', t.tsTypeAnnotation( - t.tsTypeReference(t.identifier('CosmWasmClient')) + t.tsTypeReference(t.identifier('ICosmWasmClient')) ) ), identifier( 'signingCosmWasmClient?', t.tsTypeAnnotation( - t.tsTypeReference(t.identifier('SigningCosmWasmClient')) + t.tsTypeReference(t.identifier('ISigningCosmWasmClient')) ) ), ], diff --git a/packages/ast/src/react-query/react-query.ts b/packages/ast/src/react-query/react-query.ts index cd6588a5..f0353e0b 100644 --- a/packages/ast/src/react-query/react-query.ts +++ b/packages/ast/src/react-query/react-query.ts @@ -490,7 +490,7 @@ export const createReactQueryMutationHooks = ({ // TODO: there should be a better way to do this const hasMsg = !!(Object.keys(properties)?.length || jsonschema?.$ref); - // + // const useMutationTypeParameter = generateMutationTypeParameter( context, mutationHookParamsTypeName @@ -524,11 +524,11 @@ const generateMutationTypeParameter = ( context: RenderContext, mutationHookParamsTypeName: string ) => { - context.addUtil('ExecuteResult'); + context.addUtil('DeliverTxResponse'); return t.tsTypeParameterInstantiation([ // Data - t.tSTypeReference(t.identifier('ExecuteResult')), + t.tSTypeReference(t.identifier('DeliverTxResponse')), // Error t.tsTypeReference(t.identifier('Error')), // Variables @@ -550,7 +550,7 @@ interface ReactQueryMutationHook { * Example: ``` export const useCw4UpdateMembersMutation = ({ client, options }: Omit) => - useMutation>( + useMutation>( ({ args }) => client.updateMembers(args), options ) diff --git a/packages/ast/src/utils/babel.ts b/packages/ast/src/utils/babel.ts index 097eadbe..053b95fb 100644 --- a/packages/ast/src/utils/babel.ts +++ b/packages/ast/src/utils/babel.ts @@ -266,7 +266,7 @@ export const importAs = ( }; export const importAminoMsg = (): t.ImportDeclaration => { - return importStmt(['AminoMsg'], '@cosmjs/amino'); + return importStmt(['AminoMsg'], '@interchainjs/amino'); }; export const getFieldDimensionality = (field: Field) => { diff --git a/packages/ts-codegen/README.md b/packages/ts-codegen/README.md index a59212fa..de480ad5 100644 --- a/packages/ts-codegen/README.md +++ b/packages/ts-codegen/README.md @@ -126,6 +126,44 @@ Typescript types and interfaces are generated in separate files so they can be i | `types.aliasExecuteMsg` | generate a type alias based on the contract name | | `types.aliasEntryPoints` | generate type aliases for the entry points based on the contract name | +### BaseClient +The `baseClient.ts` will be generated as dependency for most files. It includes the base client for interchainjs. + +#### Gas Configuration + +The generated client provides flexible gas fee configuration options to handle different blockchain networks and fee settings. + +##### Default Gas Settings + +By default, the client uses a gas limit of `200000` for all transactions. You can customize this behavior through the `setDefaultGasAmount`. + +##### ChainConfig Options + +The `ChainConfig` interface supports two approaches for gas configuration: + +1. Chain Registry Integration (Recommended) + +When you provide chain information, the client automatically fetches gas prices from the chain registry: + +```typescript +import { useChain } from '@interchain-kit/react'; + +const { chain } = useChain('osmosistestnet'); +const chainConfig: ChainConfig = { chain: chain }; +``` + +2. Manual Gas Price Configuration +You can explicitly set gas prices for more control: + +```typescript +const chainConfig: ChainConfig = { + gasPrice: { + denom: 'uosmo', + amount: '0.025' + } +}; +``` + ### Client The `client` plugin will generate TS client classes for your contracts. This option generates a `QueryClient` for queries as well as a `Client` for queries and mutations. @@ -173,7 +211,7 @@ Generate [recoil](https://recoiljs.org/) bindings for your contracts with the `r ### Message Composer -Generate pure message objects with the proper `utf8` encoding and `typeUrl` configured that you can broadcast yourself via `cosmjs` with the `message-composer` command. +Generate pure message objects with the proper `utf8` encoding and `typeUrl` configured that you can broadcast yourself via `interchainjs` with the `message-composer` command. [see example output code](https://github.com/hyperweb-io/ts-codegen/blob/main/__output__/sg721/Sg721.message-composer.ts) diff --git a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap index 517f6db3..1c213f22 100644 --- a/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap +++ b/packages/ts-codegen/__tests__/__snapshots__/builder.test.ts.snap @@ -420,11 +420,13 @@ TSBuilder { "useShorthandCtor": true, }, "utils": { - "CosmWasmClient": "@cosmjs/cosmwasm-stargate", + "ICosmWasmClient": "__baseClient__", "IMessageComposerProvider": "__contractContextBase__", "IQueryClientProvider": "__contractContextBase__", "ISigningClientProvider": "__contractContextBase__", - "SigningCosmWasmClient": "@cosmjs/cosmwasm-stargate", + "ISigningCosmWasmClient": "__baseClient__", + "getCosmWasmClient": "__baseClient__", + "getSigningCosmWasmClient": "__baseClient__", }, }, ], @@ -851,11 +853,13 @@ TSBuilder { "useShorthandCtor": true, }, "utils": { - "CosmWasmClient": "@cosmjs/cosmwasm-stargate", + "ICosmWasmClient": "__baseClient__", "IMessageComposerProvider": "__contractContextBase__", "IQueryClientProvider": "__contractContextBase__", "ISigningClientProvider": "__contractContextBase__", - "SigningCosmWasmClient": "@cosmjs/cosmwasm-stargate", + "ISigningCosmWasmClient": "__baseClient__", + "getCosmWasmClient": "__baseClient__", + "getSigningCosmWasmClient": "__baseClient__", }, }, ], diff --git a/packages/ts-codegen/package.json b/packages/ts-codegen/package.json index 4131528d..36f1ae0f 100644 --- a/packages/ts-codegen/package.json +++ b/packages/ts-codegen/package.json @@ -36,15 +36,18 @@ "bugs": { "url": "https://github.com/hyperweb-io/ts-codegen/issues" }, - "devDependencies": { - "@cosmjs/cosmwasm-stargate": "0.32.3" - }, "dependencies": { "@babel/generator": "7.24.4", "@babel/traverse": "7.24.1", "@babel/types": "7.24.0", - "@cosmwasm/ts-codegen-ast": "^1.9.0", - "@cosmwasm/ts-codegen-types": "^1.4.0", + "@chain-registry/types": "^0.17.1", + "@chain-registry/utils": "^1.51.71", + "@chain-registry/v2": "^1.71.229", + "@cosmwasm/ts-codegen-ast": "^1.8.1", + "@cosmwasm/ts-codegen-types": "^1.3.1", + "@interchainjs/amino": "^1.11.18", + "@interchainjs/cosmos": "^1.11.18", + "@interchainjs/types": "^1.11.18", "@pyramation/json-schema-to-typescript": " 11.0.4", "@types/rimraf": "3.0.2", "@types/shelljs": "0.8.15", @@ -54,6 +57,7 @@ "fuzzy": "0.1.3", "glob": "^10", "inquirerer": "0.1.3", + "interchainjs": "^1.11.18", "minimist": "1.2.6", "mkdirp": "1.0.4", "nested-obj": "0.0.1", diff --git a/packages/ts-codegen/src/helpers/baseClient.ts b/packages/ts-codegen/src/helpers/baseClient.ts new file mode 100644 index 00000000..ad78d9d2 --- /dev/null +++ b/packages/ts-codegen/src/helpers/baseClient.ts @@ -0,0 +1,184 @@ +export const baseClient = ` +import { StdFee, Coin, DeliverTxResponse } from '@interchainjs/types'; +import { SigningClient } from '@interchainjs/cosmos/signing-client'; +import { getSmartContractState } from 'interchainjs/cosmwasm/wasm/v1/query.rpc.func'; +import { executeContract } from 'interchainjs/cosmwasm/wasm/v1/tx.rpc.func'; +import { QuerySmartContractStateRequest, QuerySmartContractStateResponse } from 'interchainjs/cosmwasm/wasm/v1/query'; +import { MsgExecuteContract } from 'interchainjs/cosmwasm/wasm/v1/tx'; +import { Chain } from '@chain-registry/v2-types'; + +// Encoding utility functions +const fromUint8Array = (uint8Array: Uint8Array): T => { + const text = new TextDecoder().decode(uint8Array); + return JSON.parse(text); +}; + +const toUint8Array = (obj: any): Uint8Array => { + const text = JSON.stringify(obj); + return new TextEncoder().encode(text); +}; + +// Chain registry configuration +// The amount under gasPrice represents gas price per unit +export interface ChainConfig { + chain?: Chain; + gasPrice?: { + denom: string; + amount: string; + }; +} + +// Gas fee calculation utilities +export const calculateGasFromChain = (chain: Chain, gasAmount: string): StdFee => { + try { + const feeTokens = chain.fees?.feeTokens; + + if (feeTokens && feeTokens.length > 0) { + const primaryToken = feeTokens[0]; + // v2 chain-registry uses camelCase: averageGasPrice, lowGasPrice, fixedMinGasPrice + const gasPrice = primaryToken.averageGasPrice || primaryToken.lowGasPrice || primaryToken.fixedMinGasPrice || 0.025; + const gasAmountNum = parseInt(gasAmount); + const feeAmount = Math.ceil(gasAmountNum * gasPrice).toString(); + + return { + amount: [{ + denom: primaryToken.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + } catch (error) { + console.warn('Failed to calculate gas from chain registry:', error); + } + + // Fallback to default + return { amount: [], gas: gasAmount }; +}; + +// Default gas amount - users can easily change this +export let DEFAULT_GAS_AMOUNT = '200000'; + +// Allow users to set their preferred default gas amount +export const setDefaultGasAmount = (gasAmount: string): void => { + DEFAULT_GAS_AMOUNT = gasAmount; +}; + +// Get current default gas amount +export const getDefaultGasAmount = (): string => DEFAULT_GAS_AMOUNT; + +export const getAutoGasFee = (chainConfig?: ChainConfig): StdFee => { + const gasAmount = DEFAULT_GAS_AMOUNT; + + if (chainConfig?.chain) { + return calculateGasFromChain(chainConfig.chain, gasAmount); + } + + if (chainConfig?.gasPrice) { + const gasAmountNum = parseInt(gasAmount); + const gasPriceNum = parseFloat(chainConfig.gasPrice.amount); + const feeAmount = Math.ceil(gasAmountNum * gasPriceNum).toString(); + + return { + amount: [{ + denom: chainConfig.gasPrice.denom, + amount: feeAmount + }], + gas: gasAmount + }; + } + + // Fallback: no fee tokens, just gas amount + return { amount: [], gas: gasAmount }; +}; + +// InterchainJS interfaces for CosmWasm clients +export interface ICosmWasmClient { + queryContractSmart(contractAddr: string, query: any): Promise; +} + +export interface ISigningCosmWasmClient { + execute( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ): Promise; +} + +export interface ISigningClient { + signAndBroadcast( + signerAddress: string, + messages: any[], + fee: number | StdFee | "auto", + memo?: string + ): Promise; +} + +// Helper functions to create InterchainJS clients +export function getCosmWasmClient(rpcEndpoint: string): ICosmWasmClient { + return { + queryContractSmart: async (contractAddr: string, query: any) => { + // Create the request object + const request: QuerySmartContractStateRequest = { + address: contractAddr, + queryData: toUint8Array(query) + }; + + // Execute the query using InterchainJS + const response: QuerySmartContractStateResponse = await getSmartContractState(rpcEndpoint, request); + + // Parse and return the result + return fromUint8Array(response.data); + }, + }; +} + +export function getSigningCosmWasmClient(signingClient: SigningClient): ISigningCosmWasmClient { + return { + execute: async ( + sender: string, + contractAddress: string, + msg: any, + fee?: number | StdFee | "auto", + memo?: string, + funds?: Coin[], + chainConfig?: ChainConfig + ) => { + // Handle fee conversion + let finalFee: StdFee; + if (typeof fee === 'number') { + finalFee = { amount: [], gas: fee.toString() }; + } else if (fee === 'auto') { + finalFee = getAutoGasFee(chainConfig); + } else if (fee) { + finalFee = fee; + } else { + finalFee = getAutoGasFee(chainConfig); + } + + // Create the message object + const message: MsgExecuteContract = { + sender, + contract: contractAddress, + msg: toUint8Array(msg), + funds: funds || [] + }; + + // Execute the transaction using InterchainJS + const result = await executeContract( + signingClient as any, + sender, + message, + finalFee, + memo || '' + ); + + return result; + }, + }; +} +`; diff --git a/packages/ts-codegen/src/helpers/contractContextBase.ts b/packages/ts-codegen/src/helpers/contractContextBase.ts index 8a575845..09e7ce03 100644 --- a/packages/ts-codegen/src/helpers/contractContextBase.ts +++ b/packages/ts-codegen/src/helpers/contractContextBase.ts @@ -1,13 +1,15 @@ export const contractContextBase = ` import { - CosmWasmClient, - SigningCosmWasmClient, -} from '@cosmjs/cosmwasm-stargate'; + ICosmWasmClient, + ISigningCosmWasmClient, + getCosmWasmClient, + getSigningCosmWasmClient, +} from './baseClient'; export interface IContractConstructor { address: string | undefined; - cosmWasmClient: CosmWasmClient | undefined; - signingCosmWasmClient: SigningCosmWasmClient | undefined; + cosmWasmClient: ICosmWasmClient | undefined; + signingCosmWasmClient: ISigningCosmWasmClient | undefined; } export const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected'; @@ -49,15 +51,15 @@ export class ContractBase< > { address: string | undefined; - cosmWasmClient: CosmWasmClient | undefined; - signingCosmWasmClient: SigningCosmWasmClient | undefined; + cosmWasmClient: ICosmWasmClient | undefined; + signingCosmWasmClient: ISigningCosmWasmClient | undefined; TSign?: new ( - client: SigningCosmWasmClient, + client: ISigningCosmWasmClient, sender: string, contractAddress: string ) => TSign; TQuery?: new ( - client: CosmWasmClient, + client: ICosmWasmClient, contractAddress: string ) => TQuery; TMsgComposer?: new ( @@ -67,15 +69,15 @@ export class ContractBase< constructor( address: string | undefined, - cosmWasmClient: CosmWasmClient | undefined, - signingCosmWasmClient: SigningCosmWasmClient | undefined, + cosmWasmClient: ICosmWasmClient | undefined, + signingCosmWasmClient: ISigningCosmWasmClient | undefined, TSign?: new ( - client: SigningCosmWasmClient, + client: ISigningCosmWasmClient, sender: string, contractAddress: string ) => TSign, TQuery?: new ( - client: CosmWasmClient, + client: ICosmWasmClient, contractAddress: string ) => TQuery, TMsgComposer?: new ( diff --git a/packages/ts-codegen/src/helpers/contractContextBaseShortHandCtor.ts b/packages/ts-codegen/src/helpers/contractContextBaseShortHandCtor.ts index 844aeadc..56efad2f 100644 --- a/packages/ts-codegen/src/helpers/contractContextBaseShortHandCtor.ts +++ b/packages/ts-codegen/src/helpers/contractContextBaseShortHandCtor.ts @@ -1,13 +1,15 @@ export const contractContextBaseShortHandCtor = ` import { - CosmWasmClient, - SigningCosmWasmClient, -} from '@cosmjs/cosmwasm-stargate'; + ICosmWasmClient, + ISigningCosmWasmClient, + getCosmWasmClient, + getSigningCosmWasmClient, +} from './baseClient'; export interface IContractConstructor { address: string | undefined; - cosmWasmClient: CosmWasmClient | undefined; - signingCosmWasmClient: SigningCosmWasmClient | undefined; + cosmWasmClient: ICosmWasmClient | undefined; + signingCosmWasmClient: ISigningCosmWasmClient | undefined; } export const NO_SINGING_ERROR_MESSAGE = 'signingCosmWasmClient not connected'; @@ -49,15 +51,15 @@ export class ContractBase< > { constructor( protected address: string | undefined, - protected cosmWasmClient: CosmWasmClient | undefined, - protected signingCosmWasmClient: SigningCosmWasmClient | undefined, + protected cosmWasmClient: ICosmWasmClient | undefined, + protected signingCosmWasmClient: ISigningCosmWasmClient | undefined, private TSign?: new ( - client: SigningCosmWasmClient, + client: ISigningCosmWasmClient, sender: string, contractAddress: string ) => TSign, private TQuery?: new ( - client: CosmWasmClient, + client: ICosmWasmClient, contractAddress: string ) => TQuery, private TMsgComposer?: new ( diff --git a/packages/ts-codegen/src/helpers/contractsContextTSX.ts b/packages/ts-codegen/src/helpers/contractsContextTSX.ts index a247f243..ed405681 100644 --- a/packages/ts-codegen/src/helpers/contractsContextTSX.ts +++ b/packages/ts-codegen/src/helpers/contractsContextTSX.ts @@ -1,16 +1,16 @@ export const contractsContextTSX = ` import React, { useEffect, useMemo, useRef, useState, useContext } from 'react'; import { - CosmWasmClient, - SigningCosmWasmClient, -} from '@cosmjs/cosmwasm-stargate'; + ICosmWasmClient, + ISigningCosmWasmClient, +} from './baseClient'; import { IContractsContext, getProviders } from './contractContextProviders'; export interface ContractsConfig { address: string | undefined; - getCosmWasmClient: () => Promise; - getSigningCosmWasmClient: () => Promise; + getCosmWasmClient: () => Promise; + getSigningCosmWasmClient: () => Promise; } const ContractsContext = React.createContext(null); @@ -22,9 +22,9 @@ export const ContractsProvider = ({ children: React.ReactNode; contractsConfig: ContractsConfig; }) => { - const [cosmWasmClient, setCosmWasmClient] = useState(); + const [cosmWasmClient, setCosmWasmClient] = useState(); const [signingCosmWasmClient, setSigningCosmWasmClient] = - useState(); + useState(); const { address, getCosmWasmClient, getSigningCosmWasmClient } = contractsConfig; diff --git a/packages/ts-codegen/src/helpers/create-helpers.ts b/packages/ts-codegen/src/helpers/create-helpers.ts index 1e7e9fe8..4db9e8db 100644 --- a/packages/ts-codegen/src/helpers/create-helpers.ts +++ b/packages/ts-codegen/src/helpers/create-helpers.ts @@ -7,6 +7,7 @@ import { contractContextBase, contractContextBaseShortHandCtor, contractsContextTSX, + baseClient, } from '../helpers'; import { writeContentToFile } from '../utils/files'; import { header } from '../utils/header'; @@ -36,6 +37,9 @@ export const createHelpers = ( ): BuilderFile[] => { const files: BuilderFile[] = []; + // Always generate baseClient.ts since InterchainJS interfaces are needed by all clients + files.push(write(input.outPath, 'baseClient.ts', baseClient)); + if ( input.options?.useContractsHook?.enabled && Object.keys(builderContext.providers)?.length diff --git a/packages/ts-codegen/src/helpers/index.ts b/packages/ts-codegen/src/helpers/index.ts index de7142d8..87878c72 100644 --- a/packages/ts-codegen/src/helpers/index.ts +++ b/packages/ts-codegen/src/helpers/index.ts @@ -1,3 +1,4 @@ export * from './contractContextBase'; export * from './contractContextBaseShortHandCtor'; +export * from './baseClient'; export * from './contractsContextTSX'; diff --git a/packages/ts-codegen/src/plugins/provider-bundle.ts b/packages/ts-codegen/src/plugins/provider-bundle.ts index 00f5c127..ac80e75b 100644 --- a/packages/ts-codegen/src/plugins/provider-bundle.ts +++ b/packages/ts-codegen/src/plugins/provider-bundle.ts @@ -19,8 +19,10 @@ export class ContractsProviderBundlePlugin extends BuilderPluginBase=13.7.0": - version "24.0.4" - resolved "https://registry.yarnpkg.com/@types/node/-/node-24.0.4.tgz#dbae889912bda33a7f57669fb8587c1a56bc0c1f" - integrity sha512-ulyqAkrhnuNq9pB76DRBTkcS6YsmDALy6Ua63V8OhrOBgbcYt6IOdzpw5P1+dyRIyMerzLkeYWBeOXPpA9GMAA== +"@types/node@*": + version "24.2.0" + resolved "https://registry.yarnpkg.com/@types/node/-/node-24.2.0.tgz#cde712f88c5190006d6b069232582ecd1f94a760" + integrity sha512-3xyG3pMCq3oYCNg7/ZP+E1ooTaGB4cG8JWRsqqOYQdbWNY4zbaV0Ennrd7stjiJEFZCaybcIgpTjJWHRfBSIDw== dependencies: - undici-types "~7.8.0" + undici-types "~7.10.0" "@types/node@^20.12.7": - version "20.19.1" - resolved "https://registry.yarnpkg.com/@types/node/-/node-20.19.1.tgz#cef8bc04aaae86824b5bbe2570769358592bcc59" - integrity sha512-jJD50LtlD2dodAEO653i3YF04NWak6jN3ky+Ri3Em3mGR39/glWiboM/IePaRbgwSfqM1TpGXfAg8ohn/4dTgA== + version "20.19.9" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.19.9.tgz#ca9a58193fec361cc6e859d88b52261853f1f0d3" + integrity sha512-cuVNgarYWZqxRJDQHEB58GEONhOK79QVR/qYx4S7kcUObQvUwvFnYxJuuHUKm2aieN9X3yZB4LZsuYNU1Qphsw== dependencies: undici-types "~6.21.0" @@ -1881,77 +2058,78 @@ "@types/yargs-parser" "*" "@typescript-eslint/eslint-plugin@^8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.35.0.tgz#515170100ff867445fe0a17ce05c14fc5fd9ca63" - integrity sha512-ijItUYaiWuce0N1SoSMrEd0b6b6lYkYt99pqCPfybd+HKVXtEvYhICfLdwp42MhiI5mp0oq7PKEL+g1cNiz/Eg== + version "8.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.39.0.tgz#c9afec1866ee1a6ea3d768b5f8e92201efbbba06" + integrity sha512-bhEz6OZeUR+O/6yx9Jk6ohX6H9JSFTaiY0v9/PuKT3oGK0rn0jNplLmyFUGV+a9gfYnVNwGDwS/UkLIuXNb2Rw== dependencies: "@eslint-community/regexpp" "^4.10.0" - "@typescript-eslint/scope-manager" "8.35.0" - "@typescript-eslint/type-utils" "8.35.0" - "@typescript-eslint/utils" "8.35.0" - "@typescript-eslint/visitor-keys" "8.35.0" + "@typescript-eslint/scope-manager" "8.39.0" + "@typescript-eslint/type-utils" "8.39.0" + "@typescript-eslint/utils" "8.39.0" + "@typescript-eslint/visitor-keys" "8.39.0" graphemer "^1.4.0" ignore "^7.0.0" natural-compare "^1.4.0" ts-api-utils "^2.1.0" "@typescript-eslint/parser@^8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.35.0.tgz#20a0e17778a329a6072722f5ac418d4376b767d2" - integrity sha512-6sMvZePQrnZH2/cJkwRpkT7DxoAWh+g6+GFRK6bV3YQo7ogi3SX5rgF6099r5Q53Ma5qeT7LGmOmuIutF4t3lA== - dependencies: - "@typescript-eslint/scope-manager" "8.35.0" - "@typescript-eslint/types" "8.35.0" - "@typescript-eslint/typescript-estree" "8.35.0" - "@typescript-eslint/visitor-keys" "8.35.0" + version "8.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.39.0.tgz#c4b895d7a47f4cd5ee6ee77ea30e61d58b802008" + integrity sha512-g3WpVQHngx0aLXn6kfIYCZxM6rRJlWzEkVpqEFLT3SgEDsp9cpCbxxgwnE504q4H+ruSDh/VGS6nqZIDynP+vg== + dependencies: + "@typescript-eslint/scope-manager" "8.39.0" + "@typescript-eslint/types" "8.39.0" + "@typescript-eslint/typescript-estree" "8.39.0" + "@typescript-eslint/visitor-keys" "8.39.0" debug "^4.3.4" -"@typescript-eslint/project-service@8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.35.0.tgz#00bd77e6845fbdb5684c6ab2d8a400a58dcfb07b" - integrity sha512-41xatqRwWZuhUMF/aZm2fcUsOFKNcG28xqRSS6ZVr9BVJtGExosLAm5A1OxTjRMagx8nJqva+P5zNIGt8RIgbQ== +"@typescript-eslint/project-service@8.39.0": + version "8.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.39.0.tgz#71cb29c3f8139f99a905b8705127bffc2ae84759" + integrity sha512-CTzJqaSq30V/Z2Og9jogzZt8lJRR5TKlAdXmWgdu4hgcC9Kww5flQ+xFvMxIBWVNdxJO7OifgdOK4PokMIWPew== dependencies: - "@typescript-eslint/tsconfig-utils" "^8.35.0" - "@typescript-eslint/types" "^8.35.0" + "@typescript-eslint/tsconfig-utils" "^8.39.0" + "@typescript-eslint/types" "^8.39.0" debug "^4.3.4" -"@typescript-eslint/scope-manager@8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.35.0.tgz#8ccb2ab63383544fab98fc4b542d8d141259ff4f" - integrity sha512-+AgL5+mcoLxl1vGjwNfiWq5fLDZM1TmTPYs2UkyHfFhgERxBbqHlNjRzhThJqz+ktBqTChRYY6zwbMwy0591AA== +"@typescript-eslint/scope-manager@8.39.0": + version "8.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.39.0.tgz#ba4bf6d8257bbc172c298febf16bc22df4856570" + integrity sha512-8QOzff9UKxOh6npZQ/4FQu4mjdOCGSdO3p44ww0hk8Vu+IGbg0tB/H1LcTARRDzGCC8pDGbh2rissBuuoPgH8A== dependencies: - "@typescript-eslint/types" "8.35.0" - "@typescript-eslint/visitor-keys" "8.35.0" + "@typescript-eslint/types" "8.39.0" + "@typescript-eslint/visitor-keys" "8.39.0" -"@typescript-eslint/tsconfig-utils@8.35.0", "@typescript-eslint/tsconfig-utils@^8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.35.0.tgz#6e05aeb999999e31d562ceb4fe144f3cbfbd670e" - integrity sha512-04k/7247kZzFraweuEirmvUj+W3bJLI9fX6fbo1Qm2YykuBvEhRTPl8tcxlYO8kZZW+HIXfkZNoasVb8EV4jpA== +"@typescript-eslint/tsconfig-utils@8.39.0", "@typescript-eslint/tsconfig-utils@^8.39.0": + version "8.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.39.0.tgz#b2e87fef41a3067c570533b722f6af47be213f13" + integrity sha512-Fd3/QjmFV2sKmvv3Mrj8r6N8CryYiCS8Wdb/6/rgOXAWGcFuc+VkQuG28uk/4kVNVZBQuuDHEDUpo/pQ32zsIQ== -"@typescript-eslint/type-utils@8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.35.0.tgz#0201eae9d83ffcc3451ef8c94f53ecfbf2319ecc" - integrity sha512-ceNNttjfmSEoM9PW87bWLDEIaLAyR+E6BoYJQ5PfaDau37UGca9Nyq3lBk8Bw2ad0AKvYabz6wxc7DMTO2jnNA== +"@typescript-eslint/type-utils@8.39.0": + version "8.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.39.0.tgz#310ec781ae5e7bb0f5940bfd652573587f22786b" + integrity sha512-6B3z0c1DXVT2vYA9+z9axjtc09rqKUPRmijD5m9iv8iQpHBRYRMBcgxSiKTZKm6FwWw1/cI4v6em35OsKCiN5Q== dependencies: - "@typescript-eslint/typescript-estree" "8.35.0" - "@typescript-eslint/utils" "8.35.0" + "@typescript-eslint/types" "8.39.0" + "@typescript-eslint/typescript-estree" "8.39.0" + "@typescript-eslint/utils" "8.39.0" debug "^4.3.4" ts-api-utils "^2.1.0" -"@typescript-eslint/types@8.35.0", "@typescript-eslint/types@^8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.35.0.tgz#e60d062907930e30008d796de5c4170f02618a93" - integrity sha512-0mYH3emanku0vHw2aRLNGqe7EXh9WHEhi7kZzscrMDf6IIRUQ5Jk4wp1QrledE/36KtdZrVfKnE32eZCf/vaVQ== +"@typescript-eslint/types@8.39.0", "@typescript-eslint/types@^8.39.0": + version "8.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.39.0.tgz#80f010b7169d434a91cd0529d70a528dbc9c99c6" + integrity sha512-ArDdaOllnCj3yn/lzKn9s0pBQYmmyme/v1HbGIGB0GB/knFI3fWMHloC+oYTJW46tVbYnGKTMDK4ah1sC2v0Kg== -"@typescript-eslint/typescript-estree@8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.35.0.tgz#86141e6c55b75bc1eaecc0781bd39704de14e52a" - integrity sha512-F+BhnaBemgu1Qf8oHrxyw14wq6vbL8xwWKKMwTMwYIRmFFY/1n/9T/jpbobZL8vp7QyEUcC6xGrnAO4ua8Kp7w== +"@typescript-eslint/typescript-estree@8.39.0": + version "8.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.39.0.tgz#b9477a5c47a0feceffe91adf553ad9a3cd4cb3d6" + integrity sha512-ndWdiflRMvfIgQRpckQQLiB5qAKQ7w++V4LlCHwp62eym1HLB/kw7D9f2e8ytONls/jt89TEasgvb+VwnRprsw== dependencies: - "@typescript-eslint/project-service" "8.35.0" - "@typescript-eslint/tsconfig-utils" "8.35.0" - "@typescript-eslint/types" "8.35.0" - "@typescript-eslint/visitor-keys" "8.35.0" + "@typescript-eslint/project-service" "8.39.0" + "@typescript-eslint/tsconfig-utils" "8.39.0" + "@typescript-eslint/types" "8.39.0" + "@typescript-eslint/visitor-keys" "8.39.0" debug "^4.3.4" fast-glob "^3.3.2" is-glob "^4.0.3" @@ -1959,22 +2137,22 @@ semver "^7.6.0" ts-api-utils "^2.1.0" -"@typescript-eslint/utils@8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.35.0.tgz#aaf0afab5ab51ea2f1897002907eacd9834606d5" - integrity sha512-nqoMu7WWM7ki5tPgLVsmPM8CkqtoPUG6xXGeefM5t4x3XumOEKMoUZPdi+7F+/EotukN4R9OWdmDxN80fqoZeg== +"@typescript-eslint/utils@8.39.0": + version "8.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.39.0.tgz#dfea42f3c7ec85f9f3e994ff0bba8f3b2f09e220" + integrity sha512-4GVSvNA0Vx1Ktwvf4sFE+exxJ3QGUorQG1/A5mRfRNZtkBT2xrA/BCO2H0eALx/PnvCS6/vmYwRdDA41EoffkQ== dependencies: "@eslint-community/eslint-utils" "^4.7.0" - "@typescript-eslint/scope-manager" "8.35.0" - "@typescript-eslint/types" "8.35.0" - "@typescript-eslint/typescript-estree" "8.35.0" + "@typescript-eslint/scope-manager" "8.39.0" + "@typescript-eslint/types" "8.39.0" + "@typescript-eslint/typescript-estree" "8.39.0" -"@typescript-eslint/visitor-keys@8.35.0": - version "8.35.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.35.0.tgz#93e905e7f1e94d26a79771d1b1eb0024cb159dbf" - integrity sha512-zTh2+1Y8ZpmeQaQVIc/ZZxsx8UzgKJyNg1PTvjzC7WMhPSVS8bfDX34k1SrwOf016qd5RU3az2UxUNue3IfQ5g== +"@typescript-eslint/visitor-keys@8.39.0": + version "8.39.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.39.0.tgz#5d619a6e810cdd3fd1913632719cbccab08bf875" + integrity sha512-ldgiJ+VAhQCfIjeOgu8Kj5nSxds0ktPOSO9p4+0VDH2R2pLvQraaM5Oen2d7NxzMCm+Sn/vJT+mv2H5u6b/3fA== dependencies: - "@typescript-eslint/types" "8.35.0" + "@typescript-eslint/types" "8.39.0" eslint-visitor-keys "^4.2.1" "@yarnpkg/lockfile@^1.1.0": @@ -2152,9 +2330,9 @@ anymatch@^3.0.3: picomatch "^2.0.4" "aproba@^1.0.3 || ^2.0.0", aproba@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.0.0.tgz#52520b8ae5b569215b354efc0caa3fe1e45a8adc" - integrity sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ== + version "2.1.0" + resolved "https://registry.yarnpkg.com/aproba/-/aproba-2.1.0.tgz#75500a190313d95c64e871e7e4284c6ac219f0b1" + integrity sha512-tLIEcj5GuR2RSTnxNKdkK0dJ/GrC7P38sUkiDmDuHfsHmbagTFAxDVIBltoklXEVIQ/f14IL8IMJ5pn9Hez1Ew== are-we-there-yet@^3.0.0: version "3.0.1" @@ -2211,7 +2389,7 @@ ast-stringify@0.2.1: resolved "https://registry.yarnpkg.com/ast-stringify/-/ast-stringify-0.2.1.tgz#5a90823699f51e338da4da039219aefc092398a3" integrity sha512-wS/5cTSysM/IL1NVAwI2/xhFDI08UEw4PpLsbpDfc1KEPc2ABo94pjvB5p/tIF+Qu7oFOdxx8TdlGhyu4ZOb3A== -async@^3.2.3: +async@^3.2.6: version "3.2.6" resolved "https://registry.yarnpkg.com/async/-/async-3.2.6.tgz#1b0728e14929d51b85b449b7f06e27c1145e38ce" integrity sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA== @@ -2226,13 +2404,20 @@ at-least-node@^1.0.0: resolved "https://registry.yarnpkg.com/at-least-node/-/at-least-node-1.0.0.tgz#602cd4b46e844ad4effc92a8011a3c46e0238dc2" integrity sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg== -axios@^1.0.0, axios@^1.6.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/axios/-/axios-1.10.0.tgz#af320aee8632eaf2a400b6a1979fa75856f38d54" - integrity sha512-/1xYAC4MP/HEG+3duIhFr4ZQXR4sQXOIe+o6sdqzeykGLx6Upp/1p8MHqhINOvGeP7xyNHe7tsiJByc4SSVUxw== +available-typed-arrays@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz#a5cc375d6a03c2efc87a553f3e0b1522def14846" + integrity sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ== + dependencies: + possible-typed-array-names "^1.0.0" + +axios@^1.0.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.11.0.tgz#c2ec219e35e414c025b2095e8b8280278478fdb6" + integrity sha512-1Lx3WLFQWm3ooKDYZD1eXmoGO9fxYQjrycfHFC8P0sCfQVXyROp0p9PFWBehewBOdCwHc+f/b8I0fMto5eSfwA== dependencies: follow-redirects "^1.15.6" - form-data "^4.0.0" + form-data "^4.0.4" proxy-from-env "^1.1.0" babel-jest@^29.7.0: @@ -2270,9 +2455,9 @@ babel-plugin-jest-hoist@^29.6.3: "@types/babel__traverse" "^7.0.6" babel-preset-current-node-syntax@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.1.0.tgz#9a929eafece419612ef4ae4f60b1862ebad8ef30" - integrity sha512-ldYss8SbBlWva1bs28q78Ju5Zq1F+8BrqBZZ0VFhLBvhh6lCpC2o3gDJi/5DRLs9FgYZCnmPYIVFU4lRXCkyUw== + version "1.2.0" + resolved "https://registry.yarnpkg.com/babel-preset-current-node-syntax/-/babel-preset-current-node-syntax-1.2.0.tgz#20730d6cdc7dda5d89401cab10ac6a32067acde6" + integrity sha512-E/VlAEzRrsLEb2+dv8yp3bo4scof3l9nR4lrld+Iy5NyVqgVYUJnDAmunkhPMisRI32Qc4iRiz425d8vM++2fg== dependencies: "@babel/plugin-syntax-async-generators" "^7.8.4" "@babel/plugin-syntax-bigint" "^7.8.3" @@ -2313,11 +2498,21 @@ bech32@^1.1.4: resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== +bech32@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-2.0.0.tgz#078d3686535075c8c79709f054b1b226a133b355" + integrity sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg== + before-after-hook@^2.2.0: version "2.2.3" resolved "https://registry.yarnpkg.com/before-after-hook/-/before-after-hook-2.2.3.tgz#c51e809c81a4e354084422b9b26bad88249c517c" integrity sha512-NzUnlZexiaH/46WDhANlyR2bXRopNg4F/zuSA3OpZnllCUgRaOF2znDioDWrmbNVsuZk6l9pMquQB38cfBZwkQ== +bignumber.js@9.1.2: + version "9.1.2" + resolved "https://registry.yarnpkg.com/bignumber.js/-/bignumber.js-9.1.2.tgz#b7c4242259c008903b13707983b5f4bbd31eda0c" + integrity sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug== + bin-links@^4.0.1: version "4.0.4" resolved "https://registry.yarnpkg.com/bin-links/-/bin-links-4.0.4.tgz#c3565832b8e287c85f109a02a17027d152a58a63" @@ -2328,6 +2523,13 @@ bin-links@^4.0.1: read-cmd-shim "^4.0.0" write-file-atomic "^5.0.0" +bip39@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.1.0.tgz#c55a418deaf48826a6ceb34ac55b3ee1577e18a3" + integrity sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A== + dependencies: + "@noble/hashes" "^1.2.0" + bl@^4.0.3, bl@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" @@ -2342,7 +2544,7 @@ bn.js@^4.11.9: resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.2.tgz#3d8fed6796c24e177737f7cc5172ee04ef39ec99" integrity sha512-n4DSx829VRTRByMRGdjQ9iqsN0Bh4OolPsFnaZBLcbi8iXcB+kJ9s7EnRt4wILZNV3kPLHkRVfOc/HvhC3ovDw== -bn.js@^5.2.0: +bn.js@^5.2.0, bn.js@^5.2.1: version "5.2.2" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.2.tgz#82c09f9ebbb17107cd72cb7fd39bd1f9d0aaa566" integrity sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw== @@ -2470,7 +2672,7 @@ cacache@^17.0.0, cacache@^17.0.4: tar "^6.1.11" unique-filename "^3.0.0" -call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: +call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz#4b5428c222be985d79c3d82657479dbe0b59b2d6" integrity sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ== @@ -2478,6 +2680,24 @@ call-bind-apply-helpers@^1.0.1, call-bind-apply-helpers@^1.0.2: es-errors "^1.3.0" function-bind "^1.1.2" +call-bind@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" + integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== + dependencies: + call-bind-apply-helpers "^1.0.0" + es-define-property "^1.0.0" + get-intrinsic "^1.2.4" + set-function-length "^1.2.2" + +call-bound@^1.0.3, call-bound@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/call-bound/-/call-bound-1.0.4.tgz#238de935d2a2a692928c538c7ccfa91067fd062a" + integrity sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg== + dependencies: + call-bind-apply-helpers "^1.0.2" + get-intrinsic "^1.3.0" + call-me-maybe@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" @@ -2508,9 +2728,9 @@ camelcase@^6.2.0: integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== caniuse-lite@^1.0.30001726: - version "1.0.30001726" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001726.tgz#a15bd87d5a4bf01f6b6f70ae7c97fdfd28b5ae47" - integrity sha512-VQAUIUzBiZ/UnlM28fSp2CRF3ivUn1BWEvxMcVTNwpw91Py1pGbPIyIKtd+tzct9C3ouceCVdGAXxZOpZAsgdw== + version "1.0.30001731" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001731.tgz#277c07416ea4613ec564e5b0ffb47e7b60f32e2f" + integrity sha512-lDdp2/wrOmTRWuoB5DpfNkC0rJDU8DqRa6nYL6HK6sytw70QMopt/NIc/9SM7ylItlBWfACXk0tEn37UWM/+mg== case@1.6.3: version "1.6.3" @@ -2525,7 +2745,7 @@ chalk@4.1.0: ansi-styles "^4.1.0" supports-color "^7.1.0" -chalk@4.1.2, chalk@^4.0.0, chalk@^4.0.2, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: +chalk@4.1.2, chalk@^4.0.0, chalk@^4.1.0, chalk@^4.1.1, chalk@^4.1.2: version "4.1.2" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== @@ -2584,9 +2804,9 @@ ci-info@^3.2.0, ci-info@^3.6.1: integrity sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ== ci-info@^4.2.0: - version "4.2.0" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-4.2.0.tgz#cbd21386152ebfe1d56f280a3b5feccbd96764c7" - integrity sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg== + version "4.3.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-4.3.0.tgz#c39b1013f8fdbd28cd78e62318357d02da160cd7" + integrity sha512-l+2bNRMiQgcfILUi33labAZYIWlH1kWDp+ecNo5iisRKrbm0xcRyCww71/YU0Fkw0mAFpz9bJayXPjey6vkmaQ== cjs-module-lexer@^1.0.0: version "1.4.3" @@ -2903,11 +3123,6 @@ cosmiconfig@7.0.0: path-type "^4.0.0" yaml "^1.10.0" -cosmjs-types@^0.9.0: - version "0.9.0" - resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.9.0.tgz#c3bc482d28c7dfa25d1445093fdb2d9da1f6cfcc" - integrity sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ== - create-jest@^29.7.0: version "29.7.0" resolved "https://registry.yarnpkg.com/create-jest/-/create-jest-29.7.0.tgz#a355c5b3cb1e1af02ba177fe7afd7feee49a5320" @@ -2978,6 +3193,11 @@ decamelize@^1.1.0: resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA== +decimal.js@^10.4.3: + version "10.6.0" + resolved "https://registry.yarnpkg.com/decimal.js/-/decimal.js-10.6.0.tgz#e649a43e3ab953a72192ff5983865e509f37ed9a" + integrity sha512-YpgQiITW3JXGntzdUmyUR1V812Hn8T1YVXhCu+wO3OpS4eU9l4YdD3qjyiKdV6mvV29zapkMeD390UVEf2lkUg== + dedent@0.7.0, dedent@^0.7.0: version "0.7.0" resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" @@ -3010,7 +3230,7 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -define-data-property@^1.0.1: +define-data-property@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/define-data-property/-/define-data-property-1.1.4.tgz#894dc141bb7d3060ae4366f6a0107e68fbe48c5e" integrity sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A== @@ -3024,15 +3244,6 @@ define-lazy-prop@^2.0.0: resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== -define-properties@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.1.tgz#10781cc616eb951a80a034bafcaa7377f6af2b6c" - integrity sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg== - dependencies: - define-data-property "^1.0.1" - has-property-descriptors "^1.0.0" - object-keys "^1.1.1" - del@^6.0.0: version "6.1.1" resolved "https://registry.yarnpkg.com/del/-/del-6.1.1.tgz#3b70314f1ec0aa325c6b14eb36b95786671edb7a" @@ -3122,7 +3333,7 @@ eastasianwidth@^0.2.0: resolved "https://registry.yarnpkg.com/eastasianwidth/-/eastasianwidth-0.2.0.tgz#696ce2ec0aa0e6ea93a397ffcf24aa7840c827cb" integrity sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA== -ejs@^3.1.10, ejs@^3.1.7: +ejs@^3.1.7: version "3.1.10" resolved "https://registry.yarnpkg.com/ejs/-/ejs-3.1.10.tgz#69ab8358b14e896f80cc39e62087b88500c3ac3b" integrity sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA== @@ -3130,11 +3341,11 @@ ejs@^3.1.10, ejs@^3.1.7: jake "^10.8.5" electron-to-chromium@^1.5.173: - version "1.5.173" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.173.tgz#1aeba57204fe19425921a29946ef543653f5e896" - integrity sha512-2bFhXP2zqSfQHugjqJIDFVwa+qIxyNApenmXTp9EjaKtdPrES5Qcn9/aSFy/NaP2E+fWG/zxKu/LBvY36p5VNQ== + version "1.5.196" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.196.tgz#bb9bfe456d03328f3aaf6d2723e052e70396c376" + integrity sha512-FnnXV0dXANe7YNtKl/Af1raw+sBBUPuwcNEWfLOJyumXBvfQEBsnc0Gn+yEnVscq4x3makTtrlf4TjAo7lcXTQ== -elliptic@^6.5.4: +elliptic@6.6.1, elliptic@^6.5.4: version "6.6.1" resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.6.1.tgz#3b8ffb02670bf69e382c7f65bf524c97c5405c06" integrity sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g== @@ -3270,35 +3481,36 @@ es6-weak-map@^2.0.3: es6-symbol "^3.1.1" esbuild@~0.25.0: - version "0.25.5" - resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.5.tgz#71075054993fdfae76c66586f9b9c1f8d7edd430" - integrity sha512-P8OtKZRv/5J5hhz0cUAdu/cLuPIKXpQl1R9pZtvmHWQvrAUVd0UNIPT4IB4W3rNOqVO0rlqHmCIbSwxh/c9yUQ== + version "0.25.8" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.25.8.tgz#482d42198b427c9c2f3a81b63d7663aecb1dda07" + integrity sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q== optionalDependencies: - "@esbuild/aix-ppc64" "0.25.5" - "@esbuild/android-arm" "0.25.5" - "@esbuild/android-arm64" "0.25.5" - "@esbuild/android-x64" "0.25.5" - "@esbuild/darwin-arm64" "0.25.5" - "@esbuild/darwin-x64" "0.25.5" - "@esbuild/freebsd-arm64" "0.25.5" - "@esbuild/freebsd-x64" "0.25.5" - "@esbuild/linux-arm" "0.25.5" - "@esbuild/linux-arm64" "0.25.5" - "@esbuild/linux-ia32" "0.25.5" - "@esbuild/linux-loong64" "0.25.5" - "@esbuild/linux-mips64el" "0.25.5" - "@esbuild/linux-ppc64" "0.25.5" - "@esbuild/linux-riscv64" "0.25.5" - "@esbuild/linux-s390x" "0.25.5" - "@esbuild/linux-x64" "0.25.5" - "@esbuild/netbsd-arm64" "0.25.5" - "@esbuild/netbsd-x64" "0.25.5" - "@esbuild/openbsd-arm64" "0.25.5" - "@esbuild/openbsd-x64" "0.25.5" - "@esbuild/sunos-x64" "0.25.5" - "@esbuild/win32-arm64" "0.25.5" - "@esbuild/win32-ia32" "0.25.5" - "@esbuild/win32-x64" "0.25.5" + "@esbuild/aix-ppc64" "0.25.8" + "@esbuild/android-arm" "0.25.8" + "@esbuild/android-arm64" "0.25.8" + "@esbuild/android-x64" "0.25.8" + "@esbuild/darwin-arm64" "0.25.8" + "@esbuild/darwin-x64" "0.25.8" + "@esbuild/freebsd-arm64" "0.25.8" + "@esbuild/freebsd-x64" "0.25.8" + "@esbuild/linux-arm" "0.25.8" + "@esbuild/linux-arm64" "0.25.8" + "@esbuild/linux-ia32" "0.25.8" + "@esbuild/linux-loong64" "0.25.8" + "@esbuild/linux-mips64el" "0.25.8" + "@esbuild/linux-ppc64" "0.25.8" + "@esbuild/linux-riscv64" "0.25.8" + "@esbuild/linux-s390x" "0.25.8" + "@esbuild/linux-x64" "0.25.8" + "@esbuild/netbsd-arm64" "0.25.8" + "@esbuild/netbsd-x64" "0.25.8" + "@esbuild/openbsd-arm64" "0.25.8" + "@esbuild/openbsd-x64" "0.25.8" + "@esbuild/openharmony-arm64" "0.25.8" + "@esbuild/sunos-x64" "0.25.8" + "@esbuild/win32-arm64" "0.25.8" + "@esbuild/win32-ia32" "0.25.8" + "@esbuild/win32-x64" "0.25.8" escalade@^3.1.1, escalade@^3.2.0: version "3.2.0" @@ -3321,9 +3533,9 @@ escape-string-regexp@^4.0.0: integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== eslint-config-prettier@^10.1.5: - version "10.1.5" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.5.tgz#00c18d7225043b6fbce6a665697377998d453782" - integrity sha512-zc1UmCpNltmVY34vuLRV61r1K27sWuX39E+uyUnY8xS2Bex88VV9cugG+UZbRSRGtGyFboj+D8JODyme1plMpw== + version "10.1.8" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz#15734ce4af8c2778cc32f0b01b37b0b5cd1ecb97" + integrity sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w== eslint-plugin-simple-import-sort@^12.1.0: version "12.1.1" @@ -3354,18 +3566,18 @@ eslint-visitor-keys@^4.2.1: integrity sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ== eslint@^9.30.0: - version "9.30.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.30.0.tgz#fb0c655f5e28fc1b2f4050c28efa1876d78034fc" - integrity sha512-iN/SiPxmQu6EVkf+m1qpBxzUhE12YqFLOSySuOyVLJLEF9nzTf+h/1AJYc1JWzCnktggeNrjvQGLngDzXirU6g== + version "9.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-9.32.0.tgz#4ea28df4a8dbc454e1251e0f3aed4bcf4ce50a47" + integrity sha512-LSehfdpgMeWcTZkWZVIJl+tkZ2nuSkyyB9C27MZqFWXuph7DvaowgcTvKqxvpLW1JZIk8PN7hFY3Rj9LQ7m7lg== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.12.1" "@eslint/config-array" "^0.21.0" "@eslint/config-helpers" "^0.3.0" - "@eslint/core" "^0.14.0" + "@eslint/core" "^0.15.0" "@eslint/eslintrc" "^3.3.1" - "@eslint/js" "9.30.0" - "@eslint/plugin-kit" "^0.3.1" + "@eslint/js" "9.32.0" + "@eslint/plugin-kit" "^0.3.4" "@humanfs/node" "^0.16.6" "@humanwhocodes/module-importer" "^1.0.1" "@humanwhocodes/retry" "^0.4.2" @@ -3442,6 +3654,17 @@ esutils@^2.0.2: resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== +ethereum-cryptography@^3.1.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ethereum-cryptography/-/ethereum-cryptography-3.2.0.tgz#42a04b57834bf536e552b50a70b9ee5057c71dc6" + integrity sha512-Urr5YVsalH+Jo0sYkTkv1MyI9bLYZwW8BENZCeE1QYaTHETEYx0Nv/SVsWkSqpYrzweg6d8KMY1wTjH/1m/BIg== + dependencies: + "@noble/ciphers" "1.3.0" + "@noble/curves" "1.9.0" + "@noble/hashes" "1.8.0" + "@scure/bip32" "1.7.0" + "@scure/bip39" "1.6.0" + event-emitter@^0.3.5: version "0.3.5" resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" @@ -3502,16 +3725,16 @@ expect@^29.0.0, expect@^29.7.0: jest-util "^29.7.0" expect@^30.0.0: - version "30.0.3" - resolved "https://registry.yarnpkg.com/expect/-/expect-30.0.3.tgz#8bf31a67514f78c5e4ac8d67774192ab95d5ec25" - integrity sha512-HXg6NvK35/cSYZCUKAtmlgCFyqKM4frEPbzrav5hRqb0GMz0E0lS5hfzYjSaiaE5ysnp/qI2aeZkeyeIAOeXzQ== + version "30.0.5" + resolved "https://registry.yarnpkg.com/expect/-/expect-30.0.5.tgz#c23bf193c5e422a742bfd2990ad990811de41a5a" + integrity sha512-P0te2pt+hHI5qLJkIR+iMvS+lYUZml8rKKsohVHAGY+uClp9XVbdyYNJOIjSRpHVp8s8YqxJCiHUkSYZGr8rtQ== dependencies: - "@jest/expect-utils" "30.0.3" + "@jest/expect-utils" "30.0.5" "@jest/get-type" "30.0.1" - jest-matcher-utils "30.0.3" - jest-message-util "30.0.2" - jest-mock "30.0.2" - jest-util "30.0.2" + jest-matcher-utils "30.0.5" + jest-message-util "30.0.5" + jest-mock "30.0.5" + jest-util "30.0.5" exponential-backoff@^3.1.1: version "3.1.2" @@ -3676,11 +3899,18 @@ flatted@^3.2.9: integrity sha512-GX+ysw4PBCz0PzosHDepZGANEuFCMLrnRTiEy9McGjmkCQYwRq4A/X786G/fjM/+OjsWSU1ZrY5qyARZmO/uwg== follow-redirects@^1.15.6: - version "1.15.9" - resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.9.tgz#a604fa10e443bf98ca94228d9eebcc2e8a2c8ee1" - integrity sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ== + version "1.15.11" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.11.tgz#777d73d72a92f8ec4d2e410eb47352a56b8e8340" + integrity sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ== + +for-each@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.5.tgz#d650688027826920feeb0af747ee7b9421a41d47" + integrity sha512-dKx12eRCVIzqCxFGplyFKJMPvLEWgmNtUrpTiJIR5u97zEhRG8ySrtboPHZXx7daLxQVrl643cTzbab2tkQjxg== + dependencies: + is-callable "^1.2.7" -foreground-child@^3.1.0: +foreground-child@^3.1.0, foreground-child@^3.3.1: version "3.3.1" resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-3.3.1.tgz#32e8e9ed1b68a3497befb9ac2b6adf92a638576f" integrity sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw== @@ -3688,10 +3918,10 @@ foreground-child@^3.1.0: cross-spawn "^7.0.6" signal-exit "^4.0.1" -form-data@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.3.tgz#608b1b3f3e28be0fccf5901fc85fb3641e5cf0ae" - integrity sha512-qsITQPfmvMOSAdeyZ+12I1c+CKSstAFAwu+97zrnWAbIr5u8wfsExUzCesVLC8NgHuRUqNN4Zy6UPWUTRGslcA== +form-data@^4.0.4: + version "4.0.4" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.4.tgz#784cdcce0669a9d68e94d11ac4eea98088edd2c4" + integrity sha512-KrGhL9Q4zjj0kiUt5OO4Mr/A/jlI2jDYs5eHBpYHPcBEVSiipAvn2Ko2HnPe20rmcuuvMHNdZFp+4IlGTMF0Ow== dependencies: asynckit "^0.4.0" combined-stream "^1.0.8" @@ -3715,9 +3945,9 @@ fs-extra@9.1.0, fs-extra@^9.1.0: universalify "^2.0.0" fs-extra@^11.1.0: - version "11.3.0" - resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.0.tgz#0daced136bbaf65a555a326719af931adc7a314d" - integrity sha512-Z4XaCL6dUDHfP/jT25jJKMmtxvuwbkrD1vNSMFlo9lNLY2c5FHYSQgHPRZUjAB26TpDEoW9HCOgplrdbaPV/ew== + version "11.3.1" + resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-11.3.1.tgz#ba7a1f97a85f94c6db2e52ff69570db3671d5a74" + integrity sha512-eXvGGwZ5CL17ZSwHWd3bbgk7UUpF6IFHtP57NYYakPvHOs8GDgDe5KJI36jIJzDkJ6eJjuzRA8eBQb6SkKue0g== dependencies: graceful-fs "^4.2.0" jsonfile "^6.0.1" @@ -3795,7 +4025,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.2.6: +get-intrinsic@^1.2.4, get-intrinsic@^1.2.6, get-intrinsic@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== @@ -3931,6 +4161,18 @@ glob-promise@^4.2.2: dependencies: "@types/glob" "^7.1.3" +glob@*: + version "11.0.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-11.0.3.tgz#9d8087e6d72ddb3c4707b1d2778f80ea3eaefcd6" + integrity sha512-2Nim7dha1KVkaiF4q6Dj+ngPPMdfvLJEOpZk/jKiUAkqKebpGAWQXAq9z1xu9HKu5lWfqw/FASuccEjyznjPaA== + dependencies: + foreground-child "^3.3.1" + jackspeak "^4.1.1" + minimatch "^10.0.3" + minipass "^7.1.2" + package-json-from-dist "^1.0.0" + path-scurry "^2.0.0" + glob@7.1.4: version "7.1.4" resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.4.tgz#aa608a2f6c577ad357e1ae5a5c26d9a8d1969255" @@ -3999,17 +4241,9 @@ globals@^14.0.0: integrity sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ== globals@^16.2.0: - version "16.2.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-16.2.0.tgz#19efcd1ddde2bd5efce128e5c2e441df1abc6f7c" - integrity sha512-O+7l9tPdHCU320IigZZPj5zmRCFG9xHmx9cU8FqU2Rp+JN714seHV+2S9+JslCpY4gJwU2vOGox0wzgae/MCEg== - -globalthis@^1.0.1: - version "1.0.4" - resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.4.tgz#7430ed3a975d97bfb59bcce41f5cabbafa651236" - integrity sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ== - dependencies: - define-properties "^1.2.1" - gopd "^1.0.1" + version "16.3.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-16.3.0.tgz#66118e765ddaf9e2d880f7e17658543f93f1f667" + integrity sha512-bqWEnJ1Nt3neqx2q5SFfGS8r/ahumIakg3HcwtNlrVlwXIeNumWn/c7Pn/wKzGhf6SaW6H6uWXLqC30STCMchQ== globby@11.1.0, globby@^11.0.1: version "11.1.0" @@ -4043,7 +4277,7 @@ graphemer@^1.4.0: resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" integrity sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag== -handlebars@^4.7.7: +handlebars@^4.7.7, handlebars@^4.7.8: version "4.7.8" resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.7.8.tgz#41c42c18b1be2365439188c77c6afae71c0cd9e9" integrity sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ== @@ -4077,7 +4311,7 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== -has-property-descriptors@^1.0.0: +has-property-descriptors@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz#963ed7d071dc7bf5f084c5bfbe0d1b6222586854" integrity sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg== @@ -4101,7 +4335,7 @@ has-unicode@2.0.1, has-unicode@^2.0.1: resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9" integrity sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ== -hash.js@^1.0.0, hash.js@^1.0.3: +hash.js@1.1.7, hash.js@^1.0.0, hash.js@^1.0.3: version "1.1.7" resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== @@ -4410,6 +4644,22 @@ inquirerer@0.1.3: inquirer "^6.0.0" inquirer-autocomplete-prompt "^0.11.1" +interchainjs@^1.11.18: + version "1.12.1" + resolved "https://registry.yarnpkg.com/interchainjs/-/interchainjs-1.12.1.tgz#ef6a0e7d1eaec0b668b372cde6e79578232536bf" + integrity sha512-0XlqcYA7W+Mbdf8oCn4FTg4U1wMcQFmwKHEYF58XxmPD5Ak7hUWVk9reaTI0usGGeTFit4xvvoCnbUr6JatS2g== + dependencies: + "@interchainjs/cosmos" "1.12.1" + "@interchainjs/cosmos-types" "1.12.1" + "@interchainjs/encoding" "1.12.1" + "@interchainjs/ethereum" "1.12.1" + "@interchainjs/math" "1.12.1" + "@interchainjs/pubkey" "1.12.1" + "@interchainjs/types" "1.12.1" + "@interchainjs/utils" "1.12.1" + "@noble/hashes" "^1.3.1" + decimal.js "^10.4.3" + interpret@^1.0.0: version "1.4.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" @@ -4428,6 +4678,11 @@ is-arrayish@^0.2.1: resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== +is-callable@^1.2.7: + version "1.2.7" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.2.7.tgz#3bc2a85ea742d9e36205dcacdd72ca1fdc51b055" + integrity sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA== + is-ci@2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -4550,6 +4805,13 @@ is-text-path@^1.0.1: dependencies: text-extensions "^1.0.0" +is-typed-array@^1.1.14: + version "1.1.15" + resolved "https://registry.yarnpkg.com/is-typed-array/-/is-typed-array-1.1.15.tgz#4bfb4a45b61cee83a5a46fba778e4e8d59c0ce0b" + integrity sha512-p3EcsicXjit7SaskXHs1hA91QxgTw46Fv6EFKKGS5DRFLD8yKnohjF3hxoju94b/OcMZoQukzpPpBE9uLVKzgQ== + dependencies: + which-typed-array "^1.1.16" + is-unicode-supported@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7" @@ -4567,6 +4829,11 @@ isarray@0.0.1: resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" integrity sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ== +isarray@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/isarray/-/isarray-2.0.5.tgz#8af1e4c1221244cc62459faf38940d4e644a5723" + integrity sha512-xHjhDr3cNBK0BzdUJSPXZntQUx/mwMS5Rw4A7lPJ90XGAO6ISP/ePDNuo0vhqOZU+UD5JoodwCAAoZQd3FeAKw== + isarray@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" @@ -4582,11 +4849,6 @@ isobject@^3.0.1: resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df" integrity sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg== -isomorphic-ws@^4.0.1: - version "4.0.1" - resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" - integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== - istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0: version "3.2.2" resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756" @@ -4649,15 +4911,21 @@ jackspeak@^3.1.2: optionalDependencies: "@pkgjs/parseargs" "^0.11.0" +jackspeak@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/jackspeak/-/jackspeak-4.1.1.tgz#96876030f450502047fc7e8c7fcf8ce8124e43ae" + integrity sha512-zptv57P3GpL+O0I7VdMJNBZCu+BPHVQUk55Ft8/QCJjTVxrnJHuVuX/0Bl2A6/+2oyR/ZMEuFKwmzqqZ/U5nPQ== + dependencies: + "@isaacs/cliui" "^8.0.2" + jake@^10.8.5: - version "10.9.2" - resolved "https://registry.yarnpkg.com/jake/-/jake-10.9.2.tgz#6ae487e6a69afec3a5e167628996b59f35ae2b7f" - integrity sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA== + version "10.9.4" + resolved "https://registry.yarnpkg.com/jake/-/jake-10.9.4.tgz#d626da108c63d5cfb00ab5c25fadc7e0084af8e6" + integrity sha512-wpHYzhxiVQL+IV05BLE2Xn34zW1S223hvjtqk0+gsPrwd/8JNLXJgZZM/iPFsYc1xyphF+6M6EvdE5E9MBGkDA== dependencies: - async "^3.2.3" - chalk "^4.0.2" + async "^3.2.6" filelist "^1.0.4" - minimatch "^3.1.2" + picocolors "^1.1.1" jest-changed-files@^29.7.0: version "29.7.0" @@ -4739,15 +5007,15 @@ jest-config@^29.7.0: slash "^3.0.0" strip-json-comments "^3.1.1" -jest-diff@30.0.3: - version "30.0.3" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-30.0.3.tgz#50ac056b90fe9151d6266b18a27adeb064c30235" - integrity sha512-Q1TAV0cUcBTic57SVnk/mug0/ASyAqtSIOkr7RAlxx97llRYsM74+E8N5WdGJUlwCKwgxPAkVjKh653h1+HA9A== +jest-diff@30.0.5: + version "30.0.5" + resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-30.0.5.tgz#b40f81e0c0d13e5b81c4d62b0d0dfa6a524ee0fd" + integrity sha512-1UIqE9PoEKaHcIKvq2vbibrCog4Y8G0zmOxgQUVEiTqwR5hJVMCoDsN1vFvI5JvwD37hjueZ1C4l2FyGnfpE0A== dependencies: "@jest/diff-sequences" "30.0.1" "@jest/get-type" "30.0.1" chalk "^4.1.2" - pretty-format "30.0.2" + pretty-format "30.0.5" jest-diff@^29.7.0: version "29.7.0" @@ -4826,15 +5094,15 @@ jest-leak-detector@^29.7.0: jest-get-type "^29.6.3" pretty-format "^29.7.0" -jest-matcher-utils@30.0.3: - version "30.0.3" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-30.0.3.tgz#e07e4776bade71a3a7948a9bf8aeede311c5013a" - integrity sha512-hMpVFGFOhYmIIRGJ0HgM9htC5qUiJ00famcc9sRFchJJiLZbbVKrAztcgE6VnXLRxA3XZ0bvNA7hQWh3oHXo/A== +jest-matcher-utils@30.0.5: + version "30.0.5" + resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-30.0.5.tgz#dff3334be58faea4a5e1becc228656fbbfc2467d" + integrity sha512-uQgGWt7GOrRLP1P7IwNWwK1WAQbq+m//ZY0yXygyfWp0rJlksMSLQAA4wYQC3b6wl3zfnchyTx+k3HZ5aPtCbQ== dependencies: "@jest/get-type" "30.0.1" chalk "^4.1.2" - jest-diff "30.0.3" - pretty-format "30.0.2" + jest-diff "30.0.5" + pretty-format "30.0.5" jest-matcher-utils@^29.7.0: version "29.7.0" @@ -4846,18 +5114,18 @@ jest-matcher-utils@^29.7.0: jest-get-type "^29.6.3" pretty-format "^29.7.0" -jest-message-util@30.0.2: - version "30.0.2" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-30.0.2.tgz#9dfdc37570d172f0ffdc42a0318036ff4008837f" - integrity sha512-vXywcxmr0SsKXF/bAD7t7nMamRvPuJkras00gqYeB1V0WllxZrbZ0paRr3XqpFU2sYYjD0qAaG2fRyn/CGZ0aw== +jest-message-util@30.0.5: + version "30.0.5" + resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-30.0.5.tgz#dd12ffec91dd3fa6a59cbd538a513d8e239e070c" + integrity sha512-NAiDOhsK3V7RU0Aa/HnrQo+E4JlbarbmI3q6Pi4KcxicdtjV82gcIUrejOtczChtVQR4kddu1E1EJlW6EN9IyA== dependencies: "@babel/code-frame" "^7.27.1" - "@jest/types" "30.0.1" + "@jest/types" "30.0.5" "@types/stack-utils" "^2.0.3" chalk "^4.1.2" graceful-fs "^4.2.11" micromatch "^4.0.8" - pretty-format "30.0.2" + pretty-format "30.0.5" slash "^3.0.0" stack-utils "^2.0.6" @@ -4876,14 +5144,14 @@ jest-message-util@^29.7.0: slash "^3.0.0" stack-utils "^2.0.3" -jest-mock@30.0.2: - version "30.0.2" - resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-30.0.2.tgz#5e4245f25f6f9532714906cab10a2b9e39eb2183" - integrity sha512-PnZOHmqup/9cT/y+pXIVbbi8ID6U1XHRmbvR7MvUy4SLqhCbwpkmXhLbsWbGewHrV5x/1bF7YDjs+x24/QSvFA== +jest-mock@30.0.5: + version "30.0.5" + resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-30.0.5.tgz#ef437e89212560dd395198115550085038570bdd" + integrity sha512-Od7TyasAAQX/6S+QCbN6vZoWOMwlTtzzGuxJku1GhGanAjz9y+QsQkpScDmETvdc9aSXyJ/Op4rhpMYBWW91wQ== dependencies: - "@jest/types" "30.0.1" + "@jest/types" "30.0.5" "@types/node" "*" - jest-util "30.0.2" + jest-util "30.0.5" jest-mock@^29.7.0: version "29.7.0" @@ -5013,12 +5281,12 @@ jest-snapshot@^29.7.0: pretty-format "^29.7.0" semver "^7.5.3" -jest-util@30.0.2: - version "30.0.2" - resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-30.0.2.tgz#1bd8411f81e6f5e2ca8b31bb2534ebcd7cbac065" - integrity sha512-8IyqfKS4MqprBuUpZNlFB5l+WFehc8bfCe1HSZFHzft2mOuND8Cvi9r1musli+u6F3TqanCZ/Ik4H4pXUolZIg== +jest-util@30.0.5: + version "30.0.5" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-30.0.5.tgz#035d380c660ad5f1748dff71c4105338e05f8669" + integrity sha512-pvyPWssDZR0FlfMxCBoc0tvM8iUEskaRFALUtGQYzVEAqisAztmy+R8LnU14KT4XA0H/a5HMVTXat1jLne010g== dependencies: - "@jest/types" "30.0.1" + "@jest/types" "30.0.5" "@types/node" "*" chalk "^4.1.2" ci-info "^4.2.0" @@ -5083,6 +5351,11 @@ jest@^29.6.2: import-local "^3.0.2" jest-cli "^29.7.0" +js-sha3@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840" + integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q== + js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" @@ -5420,16 +5693,16 @@ log-symbols@^4.1.0: chalk "^4.1.0" is-unicode-supported "^0.1.0" -long@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" - integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== - lru-cache@^10.2.0: version "10.4.3" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-10.4.3.tgz#410fc8a17b70e598013df257c2446b7f3383f119" integrity sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ== +lru-cache@^11.0.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-11.1.0.tgz#afafb060607108132dbc1cf8ae661afb69486117" + integrity sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -5634,6 +5907,13 @@ minimalistic-crypto-utils@^1.0.1: resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== +minimatch@*, minimatch@^10.0.3: + version "10.0.3" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-10.0.3.tgz#cf7a0314a16c4d9ab73a7730a0e8e3c3502d47aa" + integrity sha512-IPZ167aShDZZUMdRk66cyQAW3qr0WzbHkPdMYa8bzZhlHhO3jALbKdxcaak7W9FfT2rZNpQuUu4Od7ILEpXSaw== + dependencies: + "@isaacs/brace-expansion" "^5.0.0" + minimatch@3.0.5: version "3.0.5" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.5.tgz#4da8f1290ee0f0f8e83d60ca69f8f134068604a3" @@ -6204,11 +6484,6 @@ object-assign@^4.0.1: resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== -object-keys@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" - integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== - once@^1.3.0, once@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -6425,11 +6700,6 @@ pacote@^15.0.0, pacote@^15.0.8: ssri "^10.0.0" tar "^6.1.11" -pako@^2.0.2: - version "2.1.0" - resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" - integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== - parent-module@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" @@ -6516,6 +6786,14 @@ path-scurry@^1.11.1, path-scurry@^1.6.1: lru-cache "^10.2.0" minipass "^5.0.0 || ^6.0.2 || ^7.0.0" +path-scurry@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/path-scurry/-/path-scurry-2.0.0.tgz#9f052289f23ad8bf9397a2a0425e7b8615c58580" + integrity sha512-ypGJsmGtdXUOeM5u93TyeIEfEhM6s+ljAhrk5vAvSx8uyY/02OvrZnA0YNGUrPXfpJMgI1ODd3nwz8Npx4O4cg== + dependencies: + lru-cache "^11.0.0" + minipass "^7.1.2" + path-type@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-type/-/path-type-3.0.0.tgz#cef31dc8e0a1a3bb0d105c0cd97cf3bf47f4e36f" @@ -6539,9 +6817,9 @@ picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== picomatch@^4.0.2: - version "4.0.2" - resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.2.tgz#77c742931e8f3b8820946c76cd0c1f13730d1dab" - integrity sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg== + version "4.0.3" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-4.0.3.tgz#796c76136d1eead715db1e7bad785dedd695a042" + integrity sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q== pify@5.0.0, pify@^5.0.0: version "5.0.0" @@ -6575,6 +6853,11 @@ pkg-dir@^4.2.0: dependencies: find-up "^4.0.0" +possible-typed-array-names@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/possible-typed-array-names/-/possible-typed-array-names-1.1.0.tgz#93e3582bc0e5426586d9d07b79ee40fc841de4ae" + integrity sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg== + postcss-selector-parser@^6.0.10: version "6.1.2" resolved "https://registry.yarnpkg.com/postcss-selector-parser/-/postcss-selector-parser-6.1.2.tgz#27ecb41fb0e3b6ba7a1ec84fff347f734c7929de" @@ -6594,9 +6877,9 @@ prettier@^2.6.2: integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== prettier@^3.6.0: - version "3.6.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.1.tgz#cc3bce21c09a477b1e987b76ce9663925d86ae44" - integrity sha512-5xGWRa90Sp2+x1dQtNpIpeOQpTDBs9cZDmA/qs2vDNN2i18PdapqY7CmBeyLlMuGqXJRIOPaCaVZTLNQRWUH/A== + version "3.6.2" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.6.2.tgz#ccda02a1003ebbb2bfda6f83a074978f608b9393" + integrity sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ== pretty-format@29.4.3: version "29.4.3" @@ -6607,12 +6890,12 @@ pretty-format@29.4.3: ansi-styles "^5.0.0" react-is "^18.0.0" -pretty-format@30.0.2, pretty-format@^30.0.0: - version "30.0.2" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-30.0.2.tgz#54717b6aa2b4357a2e6d83868e10a2ea8dd647c7" - integrity sha512-yC5/EBSOrTtqhCKfLHqoUIAXVRZnukHPwWBJWR7h84Q3Be1DRQZLncwcfLoPA5RPQ65qfiCMqgYwdUuQ//eVpg== +pretty-format@30.0.5, pretty-format@^30.0.0: + version "30.0.5" + resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-30.0.5.tgz#e001649d472800396c1209684483e18a4d250360" + integrity sha512-D1tKtYvByrBkFLe2wHJl2bwMJIiT8rW+XA+TiataH79/FszLQMrpGEvzUVkzPau7OCO0Qnrhpe87PqtOAIB8Yw== dependencies: - "@jest/schemas" "30.0.1" + "@jest/schemas" "30.0.5" ansi-styles "^5.2.0" react-is "^18.3.1" @@ -6683,25 +6966,6 @@ proto-list@~1.2.1: resolved "https://registry.yarnpkg.com/proto-list/-/proto-list-1.2.4.tgz#212d5bfe1318306a420f6402b8e26ff39647a849" integrity sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA== -protobufjs@^6.8.8: - version "6.11.4" - resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa" - integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw== - dependencies: - "@protobufjs/aspromise" "^1.1.2" - "@protobufjs/base64" "^1.1.2" - "@protobufjs/codegen" "^2.0.4" - "@protobufjs/eventemitter" "^1.1.0" - "@protobufjs/fetch" "^1.1.0" - "@protobufjs/float" "^1.0.2" - "@protobufjs/inquire" "^1.1.0" - "@protobufjs/path" "^1.1.2" - "@protobufjs/pool" "^1.1.0" - "@protobufjs/utf8" "^1.1.0" - "@types/long" "^4.0.1" - "@types/node" ">=13.7.0" - long "^4.0.0" - protocols@^2.0.0, protocols@^2.0.1: version "2.0.2" resolved "https://registry.yarnpkg.com/protocols/-/protocols-2.0.2.tgz#822e8fcdcb3df5356538b3e91bfd890b067fd0a4" @@ -6981,6 +7245,11 @@ rimraf@5.0.0: dependencies: glob "^10.0.0" +rlp@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/rlp/-/rlp-3.0.0.tgz#5a60725ca4314a3a165feecca1836e4f2c1e2343" + integrity sha512-PD6U2PGk6Vq2spfgiWZdomLvRGDreBLxi5jv5M8EpRo3pU6VEm31KO+HFxE18Q3vgqfDrQ9pZA3FP95rkijNKw== + run-async@^2.2.0, run-async@^2.3.0, run-async@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" @@ -7019,16 +7288,16 @@ rxjs@^7.5.5: dependencies: tslib "^2.1.0" +safe-buffer@^5.2.1, safe-buffer@~5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" + integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== + safe-buffer@~5.1.0, safe-buffer@~5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== -safe-buffer@~5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6" - integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ== - "safer-buffer@>= 2.1.2 < 3", "safer-buffer@>= 2.1.2 < 3.0.0": version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" @@ -7068,6 +7337,27 @@ set-blocking@^2.0.0: resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw== +set-function-length@^1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/set-function-length/-/set-function-length-1.2.2.tgz#aac72314198eaed975cf77b2c3b6b880695e5449" + integrity sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg== + dependencies: + define-data-property "^1.1.4" + es-errors "^1.3.0" + function-bind "^1.1.2" + get-intrinsic "^1.2.4" + gopd "^1.0.1" + has-property-descriptors "^1.0.2" + +sha.js@^2.4.11: + version "2.4.12" + resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.12.tgz#eb8b568bf383dfd1867a32c3f2b74eb52bdbf23f" + integrity sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w== + dependencies: + inherits "^2.0.4" + safe-buffer "^5.2.1" + to-buffer "^1.2.0" + shallow-clone@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/shallow-clone/-/shallow-clone-3.0.1.tgz#8f2981ad92531f55035b01fb230769a40e02efa3" @@ -7142,9 +7432,9 @@ socks-proxy-agent@^7.0.0: socks "^2.6.2" socks@^2.6.2: - version "2.8.5" - resolved "https://registry.yarnpkg.com/socks/-/socks-2.8.5.tgz#bfe18f5ead1efc93f5ec90c79fa8bdccbcee2e64" - integrity sha512-iF+tNDQla22geJdTyJB1wM/qrX9DMRwWrciEPwWLPRWAUEM8sQiyxgckLxWT1f7+9VabJS0jTGGr4QgBuvi6Ww== + version "2.8.6" + resolved "https://registry.yarnpkg.com/socks/-/socks-2.8.6.tgz#e335486a2552f34f932f0c27d8dbb93f2be867aa" + integrity sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA== dependencies: ip-address "^9.0.5" smart-buffer "^4.2.0" @@ -7411,11 +7701,6 @@ supports-preserve-symlinks-flag@^1.0.0: resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== -symbol-observable@^2.0.3: - version "2.0.3" - resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-2.0.3.tgz#5b521d3d07a43c351055fa43b8355b62d33fd16a" - integrity sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA== - symlink-workspace@^1.9.0: version "1.11.0" resolved "https://registry.yarnpkg.com/symlink-workspace/-/symlink-workspace-1.11.0.tgz#d130e930ec573a1ac807caf206132c71cfe91467" @@ -7556,6 +7841,15 @@ tmpl@1.0.5: resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== +to-buffer@^1.2.0: + version "1.2.1" + resolved "https://registry.yarnpkg.com/to-buffer/-/to-buffer-1.2.1.tgz#2ce650cdb262e9112a18e65dc29dcb513c8155e0" + integrity sha512-tB82LpAIWjhLYbqjx3X4zEeHN6M8CiuOEy2JY8SEQVdYRe3CCHOFaqrBW1doLDrfpWhplcW7BL+bO3/6S3pcDQ== + dependencies: + isarray "^2.0.5" + safe-buffer "^5.2.1" + typed-array-buffer "^1.0.3" + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" @@ -7589,13 +7883,13 @@ ts-api-utils@^2.1.0: integrity sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ== ts-jest@^29.1.1: - version "29.4.0" - resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.0.tgz#bef0ee98d94c83670af7462a1617bf2367a83740" - integrity sha512-d423TJMnJGu80/eSgfQ5w/R+0zFJvdtTxwtF9KzFFunOpSeD+79lHJQIiAhluJoyGRbvj9NZJsl9WjCUo0ND7Q== + version "29.4.1" + resolved "https://registry.yarnpkg.com/ts-jest/-/ts-jest-29.4.1.tgz#42d33beb74657751d315efb9a871fe99e3b9b519" + integrity sha512-SaeUtjfpg9Uqu8IbeDKtdaS0g8lS6FT6OzM3ezrDfErPJPHNDo/Ey+VFGP1bQIDfagYDLyRpd7O15XpG1Es2Uw== dependencies: bs-logger "^0.2.6" - ejs "^3.1.10" fast-json-stable-stringify "^2.1.0" + handlebars "^4.7.8" json5 "^2.2.3" lodash.memoize "^4.1.2" make-error "^1.3.6" @@ -7693,6 +7987,15 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.3.tgz#436981652129285cc3ba94f392886c2637ea0486" integrity sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ== +typed-array-buffer@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/typed-array-buffer/-/typed-array-buffer-1.0.3.tgz#a72395450a4869ec033fd549371b47af3a2ee536" + integrity sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw== + dependencies: + call-bound "^1.0.3" + es-errors "^1.3.0" + is-typed-array "^1.1.14" + typedarray@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" @@ -7704,9 +8007,9 @@ typedarray@^0.0.6: integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g== typescript@^5.1.6: - version "5.8.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.8.3.tgz#92f8a3e5e3cf497356f4178c34cd65a7f5e8440e" - integrity sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ== + version "5.9.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.2.tgz#d93450cddec5154a2d5cabe3b8102b83316fb2a6" + integrity sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A== uglify-js@^3.1.4: version "3.19.3" @@ -7718,10 +8021,10 @@ undici-types@~6.21.0: resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== -undici-types@~7.8.0: - version "7.8.0" - resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.8.0.tgz#de00b85b710c54122e44fbfd911f8d70174cd294" - integrity sha512-9UJ2xGDvQ43tYyVMpuHlsgApydB8ZKfVYTsLDhXkFL/6gfkp+U8xTGdh8pMJv1SpZna0zxG1DwsKZsreLbXBxw== +undici-types@~7.10.0: + version "7.10.0" + resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-7.10.0.tgz#4ac2e058ce56b462b056e629cc6a02393d3ff350" + integrity sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag== unique-filename@^2.0.0: version "2.0.1" @@ -7883,6 +8186,19 @@ whatwg-url@^5.0.0: tr46 "~0.0.3" webidl-conversions "^3.0.0" +which-typed-array@^1.1.16: + version "1.1.19" + resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.19.tgz#df03842e870b6b88e117524a4b364b6fc689f956" + integrity sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw== + dependencies: + available-typed-arrays "^1.0.7" + call-bind "^1.0.8" + call-bound "^1.0.4" + for-each "^0.3.5" + get-proto "^1.0.1" + gopd "^1.2.0" + has-tostringtag "^1.0.2" + which@^2.0.1, which@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" @@ -8009,19 +8325,6 @@ write-pkg@4.0.0: type-fest "^0.4.1" write-json-file "^3.2.0" -ws@^7: - version "7.5.10" - resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.10.tgz#58b5c20dc281633f6c19113f39b349bd8bd558d9" - integrity sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ== - -xstream@^11.14.0: - version "11.14.0" - resolved "https://registry.yarnpkg.com/xstream/-/xstream-11.14.0.tgz#2c071d26b18310523b6877e86b4e54df068a9ae5" - integrity sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw== - dependencies: - globalthis "^1.0.1" - symbol-observable "^2.0.3" - xtend@~4.0.1: version "4.0.2" resolved "https://registry.yarnpkg.com/xtend/-/xtend-4.0.2.tgz#bb72779f5fa465186b1f438f674fa347fdb5db54"