diff --git a/.changeset/blue-geese-change.md b/.changeset/blue-geese-change.md new file mode 100644 index 0000000..287d0e9 --- /dev/null +++ b/.changeset/blue-geese-change.md @@ -0,0 +1,6 @@ +--- +"@andromedaprotocol/adocodegen": patch +"@andromedaprotocol/andromeda.js": patch +--- + +Fix: Ether wallet now apply Bech32 prefix properly diff --git a/.changeset/pre.json b/.changeset/pre.json index b2bdbc8..d910b17 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -8,6 +8,7 @@ "@andromedaprotocol/gql": "1.0.0" }, "changesets": [ + "blue-geese-change", "shaggy-carrots-serve" ] } diff --git a/packages/adocodegen/CHANGELOG.md b/packages/adocodegen/CHANGELOG.md index fc2e57c..185e269 100644 --- a/packages/adocodegen/CHANGELOG.md +++ b/packages/adocodegen/CHANGELOG.md @@ -1,5 +1,11 @@ # @andromedaprotocol/adocodegen +## 1.0.1-beta.0 + +### Patch Changes + +- Fix: Ether wallet now apply Bech32 prefix properly + ## 1.0.0 ### Major Changes diff --git a/packages/adocodegen/package.json b/packages/adocodegen/package.json index cdee3ae..7c429af 100644 --- a/packages/adocodegen/package.json +++ b/packages/adocodegen/package.json @@ -1,6 +1,6 @@ { "name": "@andromedaprotocol/adocodegen", - "version": "1.0.0", + "version": "1.0.1-beta.0", "repository": { "type": "git", "url": "git+https://github.com/andromedaprotocol/andromeda-cli.git" diff --git a/packages/adocodegen/src/address-list/0.2.1/AddressListContractTs.client.ts b/packages/adocodegen/src/address-list/0.2.1/AddressListContractTs.client.ts new file mode 100644 index 0000000..57fc80c --- /dev/null +++ b/packages/adocodegen/src/address-list/0.2.1/AddressListContractTs.client.ts @@ -0,0 +1,366 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, AndromedaHook, Funds, Cw20Coin, BalanceResponse, BlockHeightResponse, IncludesAddressResponse, Boolean, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./AddressListContractTs.types"; +export interface AddressListContractTsReadOnlyInterface { + contractAddress: string; + includesAddress: ({ + address + }: { + address: string; + }) => Promise; + isInclusive: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + andrHook: (andromedaHook: AndromedaHook) => Promise; +} +export class AddressListContractTsQueryClient implements AddressListContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.includesAddress = this.includesAddress.bind(this); + this.isInclusive = this.isInclusive.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.andrHook = this.andrHook.bind(this); + } + + includesAddress = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + includes_address: { + address + } + }); + }; + isInclusive = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_inclusive: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + andrHook = async (andromedaHook: AndromedaHook): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + andr_hook: andromedaHook + }); + }; +} +export interface AddressListContractTsInterface { + contractAddress: string; + sender: string; + addAddress: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeAddress: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addAddresses: ({ + addresses + }: { + addresses: string[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AddressListContractTsClient implements AddressListContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addAddress = this.addAddress.bind(this); + this.removeAddress = this.removeAddress.bind(this); + this.addAddresses = this.addAddresses.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + addAddress = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_address: { + address + } + }, fee, memo, _funds); + }; + removeAddress = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_address: { + address + } + }, fee, memo, _funds); + }; + addAddresses = async ({ + addresses + }: { + addresses: string[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_addresses: { + addresses + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/0.2.1/AddressListContractTs.message-builder.ts b/packages/adocodegen/src/address-list/0.2.1/AddressListContractTs.message-builder.ts new file mode 100644 index 0000000..9189209 --- /dev/null +++ b/packages/adocodegen/src/address-list/0.2.1/AddressListContractTs.message-builder.ts @@ -0,0 +1,222 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, AndromedaHook, Funds, Cw20Coin, BalanceResponse, BlockHeightResponse, IncludesAddressResponse, Boolean, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./AddressListContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AddressListContractTsExecuteMsgBuilder { + static addAddress = ({ + address + }: CamelCasedProperties["add_address"]>): ExecuteMsg => { + return { + add_address: ({ + address + } as const) + }; + }; + static removeAddress = ({ + address + }: CamelCasedProperties["remove_address"]>): ExecuteMsg => { + return { + remove_address: ({ + address + } as const) + }; + }; + static addAddresses = ({ + addresses + }: CamelCasedProperties["add_addresses"]>): ExecuteMsg => { + return { + add_addresses: ({ + addresses + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class AddressListContractTsQueryMsgBuilder { + static includesAddress = ({ + address + }: CamelCasedProperties["includes_address"]>): QueryMsg => { + return { + includes_address: ({ + address + } as const) + }; + }; + static isInclusive = (): QueryMsg => { + return { + is_inclusive: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static andrHook = (andromedaHook: AndromedaHook): QueryMsg => { + return { + andr_hook: andromedaHook + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/0.2.1/AddressListContractTs.types.ts b/packages/adocodegen/src/address-list/0.2.1/AddressListContractTs.types.ts new file mode 100644 index 0000000..4388a12 --- /dev/null +++ b/packages/adocodegen/src/address-list/0.2.1/AddressListContractTs.types.ts @@ -0,0 +1,222 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + is_inclusive: boolean; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + add_address: { + address: string; + }; +} | { + remove_address: { + address: string; + }; +} | { + add_addresses: { + addresses: string[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + includes_address: { + address: string; + }; +} | { + is_inclusive: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + andr_hook: AndromedaHook; +}; +export type AndromedaHook = { + on_execute: { + payload: Binary; + sender: string; + }; +} | { + on_funds_transfer: { + amount: Funds; + payload: Binary; + sender: string; + }; +} | { + on_token_transfer: { + recipient: string; + sender: string; + token_id: string; + }; +}; +export type Funds = { + native: Coin; +} | { + cw20: Cw20Coin; +}; +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IncludesAddressResponse { + included: boolean; +} +export type Boolean = boolean; +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AddressListContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/0.2.16/AddressListContractTs.client.ts b/packages/adocodegen/src/address-list/0.2.16/AddressListContractTs.client.ts new file mode 100644 index 0000000..16e25fe --- /dev/null +++ b/packages/adocodegen/src/address-list/0.2.16/AddressListContractTs.client.ts @@ -0,0 +1,307 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, AndromedaHook, Funds, Cw20Coin, BalanceResponse, BlockHeightResponse, IncludesAddressResponse, Boolean, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./AddressListContractTs.types"; +export interface AddressListContractTsReadOnlyInterface { + contractAddress: string; + includesAddress: ({ + address + }: { + address: string; + }) => Promise; + isInclusive: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + andrHook: (andromedaHook: AndromedaHook) => Promise; +} +export class AddressListContractTsQueryClient implements AddressListContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.includesAddress = this.includesAddress.bind(this); + this.isInclusive = this.isInclusive.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.andrHook = this.andrHook.bind(this); + } + + includesAddress = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + includes_address: { + address + } + }); + }; + isInclusive = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_inclusive: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + andrHook = async (andromedaHook: AndromedaHook): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + andr_hook: andromedaHook + }); + }; +} +export interface AddressListContractTsInterface { + contractAddress: string; + sender: string; + addAddress: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeAddress: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addAddresses: ({ + addresses + }: { + addresses: string[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AddressListContractTsClient implements AddressListContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addAddress = this.addAddress.bind(this); + this.removeAddress = this.removeAddress.bind(this); + this.addAddresses = this.addAddresses.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + addAddress = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_address: { + address + } + }, fee, memo, _funds); + }; + removeAddress = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_address: { + address + } + }, fee, memo, _funds); + }; + addAddresses = async ({ + addresses + }: { + addresses: string[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_addresses: { + addresses + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/0.2.16/AddressListContractTs.message-builder.ts b/packages/adocodegen/src/address-list/0.2.16/AddressListContractTs.message-builder.ts new file mode 100644 index 0000000..ee9a1c8 --- /dev/null +++ b/packages/adocodegen/src/address-list/0.2.16/AddressListContractTs.message-builder.ts @@ -0,0 +1,188 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, AndromedaHook, Funds, Cw20Coin, BalanceResponse, BlockHeightResponse, IncludesAddressResponse, Boolean, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./AddressListContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AddressListContractTsExecuteMsgBuilder { + static addAddress = ({ + address + }: CamelCasedProperties["add_address"]>): ExecuteMsg => { + return { + add_address: ({ + address + } as const) + }; + }; + static removeAddress = ({ + address + }: CamelCasedProperties["remove_address"]>): ExecuteMsg => { + return { + remove_address: ({ + address + } as const) + }; + }; + static addAddresses = ({ + addresses + }: CamelCasedProperties["add_addresses"]>): ExecuteMsg => { + return { + add_addresses: ({ + addresses + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class AddressListContractTsQueryMsgBuilder { + static includesAddress = ({ + address + }: CamelCasedProperties["includes_address"]>): QueryMsg => { + return { + includes_address: ({ + address + } as const) + }; + }; + static isInclusive = (): QueryMsg => { + return { + is_inclusive: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static andrHook = (andromedaHook: AndromedaHook): QueryMsg => { + return { + andr_hook: andromedaHook + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/0.2.16/AddressListContractTs.types.ts b/packages/adocodegen/src/address-list/0.2.16/AddressListContractTs.types.ts new file mode 100644 index 0000000..cfe9c2e --- /dev/null +++ b/packages/adocodegen/src/address-list/0.2.16/AddressListContractTs.types.ts @@ -0,0 +1,229 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + is_inclusive: boolean; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + add_address: { + address: string; + }; +} | { + remove_address: { + address: string; + }; +} | { + add_addresses: { + addresses: string[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + includes_address: { + address: string; + }; +} | { + is_inclusive: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + andr_hook: AndromedaHook; +}; +export type AndromedaHook = { + on_execute: { + payload: Binary; + sender: string; + }; +} | { + on_funds_transfer: { + amount: Funds; + payload: Binary; + sender: string; + }; +} | { + on_token_transfer: { + recipient: string; + sender: string; + token_id: string; + }; +}; +export type Funds = { + native: Coin; +} | { + cw20: Cw20Coin; +}; +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IncludesAddressResponse { + included: boolean; +} +export type Boolean = boolean; +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AddressListContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/2.0.0/AddressListContractTs.client.ts b/packages/adocodegen/src/address-list/2.0.0/AddressListContractTs.client.ts new file mode 100644 index 0000000..b68bb38 --- /dev/null +++ b/packages/adocodegen/src/address-list/2.0.0/AddressListContractTs.client.ts @@ -0,0 +1,309 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Addr, LocalPermission, Expiry, Milliseconds, InstantiateMsg, ActorPermission, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, PermissioningMessage, Permission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ActorPermissionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, IncludesActorResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AddressListContractTs.types"; +export interface AddressListContractTsReadOnlyInterface { + contractAddress: string; + includesActor: ({ + actor + }: { + actor: Addr; + }) => Promise; + actorPermission: ({ + actor + }: { + actor: Addr; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class AddressListContractTsQueryClient implements AddressListContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.includesActor = this.includesActor.bind(this); + this.actorPermission = this.actorPermission.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + includesActor = async ({ + actor + }: { + actor: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + includes_actor: { + actor + } + }); + }; + actorPermission = async ({ + actor + }: { + actor: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + actor_permission: { + actor + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface AddressListContractTsInterface { + contractAddress: string; + sender: string; + addActorPermission: ({ + actor, + permission + }: { + actor: Addr; + permission: LocalPermission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeActorPermission: ({ + actor + }: { + actor: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AddressListContractTsClient implements AddressListContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addActorPermission = this.addActorPermission.bind(this); + this.removeActorPermission = this.removeActorPermission.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + addActorPermission = async ({ + actor, + permission + }: { + actor: Addr; + permission: LocalPermission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_actor_permission: { + actor, + permission + } + }, fee, memo, _funds); + }; + removeActorPermission = async ({ + actor + }: { + actor: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_actor_permission: { + actor + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/2.0.0/AddressListContractTs.message-builder.ts b/packages/adocodegen/src/address-list/2.0.0/AddressListContractTs.message-builder.ts new file mode 100644 index 0000000..4fcbd85 --- /dev/null +++ b/packages/adocodegen/src/address-list/2.0.0/AddressListContractTs.message-builder.ts @@ -0,0 +1,189 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, LocalPermission, Expiry, Milliseconds, InstantiateMsg, ActorPermission, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, PermissioningMessage, Permission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ActorPermissionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, IncludesActorResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AddressListContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AddressListContractTsExecuteMsgBuilder { + static addActorPermission = ({ + actor, + permission + }: CamelCasedProperties["add_actor_permission"]>): ExecuteMsg => { + return { + add_actor_permission: ({ + actor, + permission + } as const) + }; + }; + static removeActorPermission = ({ + actor + }: CamelCasedProperties["remove_actor_permission"]>): ExecuteMsg => { + return { + remove_actor_permission: ({ + actor + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class AddressListContractTsQueryMsgBuilder { + static includesActor = ({ + actor + }: CamelCasedProperties["includes_actor"]>): QueryMsg => { + return { + includes_actor: ({ + actor + } as const) + }; + }; + static actorPermission = ({ + actor + }: CamelCasedProperties["actor_permission"]>): QueryMsg => { + return { + actor_permission: ({ + actor + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/2.0.0/AddressListContractTs.types.ts b/packages/adocodegen/src/address-list/2.0.0/AddressListContractTs.types.ts new file mode 100644 index 0000000..adab4ee --- /dev/null +++ b/packages/adocodegen/src/address-list/2.0.0/AddressListContractTs.types.ts @@ -0,0 +1,247 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Addr = string; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export interface InstantiateMsg { + actor_permission?: ActorPermission | null; + kernel_address: string; + owner?: string | null; +} +export interface ActorPermission { + actor: Addr; + permission: LocalPermission; +} +export type ExecuteMsg = { + add_actor_permission: { + actor: Addr; + permission: LocalPermission; + }; +} | { + remove_actor_permission: { + actor: Addr; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + includes_actor: { + actor: Addr; + }; +} | { + actor_permission: { + actor: Addr; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface ActorPermissionResponse { + permission: LocalPermission; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IncludesActorResponse { + included: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AddressListContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/2.0.2-beta.1/AddressListContractTs.client.ts b/packages/adocodegen/src/address-list/2.0.2-beta.1/AddressListContractTs.client.ts new file mode 100644 index 0000000..c992897 --- /dev/null +++ b/packages/adocodegen/src/address-list/2.0.2-beta.1/AddressListContractTs.client.ts @@ -0,0 +1,309 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, LocalPermission, Expiry, Milliseconds, InstantiateMsg, ActorPermission, ExecuteMsg, ReplyOn, Uint128, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ActorPermissionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, IncludesActorResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AddressListContractTs.types"; +export interface AddressListContractTsReadOnlyInterface { + contractAddress: string; + includesActor: ({ + actor + }: { + actor: Addr; + }) => Promise; + actorPermission: ({ + actor + }: { + actor: Addr; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class AddressListContractTsQueryClient implements AddressListContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.includesActor = this.includesActor.bind(this); + this.actorPermission = this.actorPermission.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + includesActor = async ({ + actor + }: { + actor: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + includes_actor: { + actor + } + }); + }; + actorPermission = async ({ + actor + }: { + actor: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + actor_permission: { + actor + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface AddressListContractTsInterface { + contractAddress: string; + sender: string; + permissionActors: ({ + actors, + permission + }: { + actors: AndrAddr[]; + permission: LocalPermission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermissions: ({ + actors + }: { + actors: AndrAddr[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AddressListContractTsClient implements AddressListContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.permissionActors = this.permissionActors.bind(this); + this.removePermissions = this.removePermissions.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + permissionActors = async ({ + actors, + permission + }: { + actors: AndrAddr[]; + permission: LocalPermission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_actors: { + actors, + permission + } + }, fee, memo, _funds); + }; + removePermissions = async ({ + actors + }: { + actors: AndrAddr[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permissions: { + actors + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/2.0.2-beta.1/AddressListContractTs.message-builder.ts b/packages/adocodegen/src/address-list/2.0.2-beta.1/AddressListContractTs.message-builder.ts new file mode 100644 index 0000000..a387055 --- /dev/null +++ b/packages/adocodegen/src/address-list/2.0.2-beta.1/AddressListContractTs.message-builder.ts @@ -0,0 +1,189 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, LocalPermission, Expiry, Milliseconds, InstantiateMsg, ActorPermission, ExecuteMsg, ReplyOn, Uint128, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ActorPermissionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, IncludesActorResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AddressListContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AddressListContractTsExecuteMsgBuilder { + static permissionActors = ({ + actors, + permission + }: CamelCasedProperties["permission_actors"]>): ExecuteMsg => { + return { + permission_actors: ({ + actors, + permission + } as const) + }; + }; + static removePermissions = ({ + actors + }: CamelCasedProperties["remove_permissions"]>): ExecuteMsg => { + return { + remove_permissions: ({ + actors + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class AddressListContractTsQueryMsgBuilder { + static includesActor = ({ + actor + }: CamelCasedProperties["includes_actor"]>): QueryMsg => { + return { + includes_actor: ({ + actor + } as const) + }; + }; + static actorPermission = ({ + actor + }: CamelCasedProperties["actor_permission"]>): QueryMsg => { + return { + actor_permission: ({ + actor + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/2.0.2-beta.1/AddressListContractTs.types.ts b/packages/adocodegen/src/address-list/2.0.2-beta.1/AddressListContractTs.types.ts new file mode 100644 index 0000000..0b0dea4 --- /dev/null +++ b/packages/adocodegen/src/address-list/2.0.2-beta.1/AddressListContractTs.types.ts @@ -0,0 +1,247 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export interface InstantiateMsg { + actor_permission?: ActorPermission | null; + kernel_address: string; + owner?: string | null; +} +export interface ActorPermission { + actors: AndrAddr[]; + permission: LocalPermission; +} +export type ExecuteMsg = { + permission_actors: { + actors: AndrAddr[]; + permission: LocalPermission; + }; +} | { + remove_permissions: { + actors: AndrAddr[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + includes_actor: { + actor: Addr; + }; +} | { + actor_permission: { + actor: Addr; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface ActorPermissionResponse { + permission: LocalPermission; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IncludesActorResponse { + included: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AddressListContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/2.0.2/AddressListContractTs.client.ts b/packages/adocodegen/src/address-list/2.0.2/AddressListContractTs.client.ts new file mode 100644 index 0000000..c992897 --- /dev/null +++ b/packages/adocodegen/src/address-list/2.0.2/AddressListContractTs.client.ts @@ -0,0 +1,309 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, LocalPermission, Expiry, Milliseconds, InstantiateMsg, ActorPermission, ExecuteMsg, ReplyOn, Uint128, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ActorPermissionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, IncludesActorResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AddressListContractTs.types"; +export interface AddressListContractTsReadOnlyInterface { + contractAddress: string; + includesActor: ({ + actor + }: { + actor: Addr; + }) => Promise; + actorPermission: ({ + actor + }: { + actor: Addr; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class AddressListContractTsQueryClient implements AddressListContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.includesActor = this.includesActor.bind(this); + this.actorPermission = this.actorPermission.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + includesActor = async ({ + actor + }: { + actor: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + includes_actor: { + actor + } + }); + }; + actorPermission = async ({ + actor + }: { + actor: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + actor_permission: { + actor + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface AddressListContractTsInterface { + contractAddress: string; + sender: string; + permissionActors: ({ + actors, + permission + }: { + actors: AndrAddr[]; + permission: LocalPermission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermissions: ({ + actors + }: { + actors: AndrAddr[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AddressListContractTsClient implements AddressListContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.permissionActors = this.permissionActors.bind(this); + this.removePermissions = this.removePermissions.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + permissionActors = async ({ + actors, + permission + }: { + actors: AndrAddr[]; + permission: LocalPermission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_actors: { + actors, + permission + } + }, fee, memo, _funds); + }; + removePermissions = async ({ + actors + }: { + actors: AndrAddr[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permissions: { + actors + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/2.0.2/AddressListContractTs.message-builder.ts b/packages/adocodegen/src/address-list/2.0.2/AddressListContractTs.message-builder.ts new file mode 100644 index 0000000..a387055 --- /dev/null +++ b/packages/adocodegen/src/address-list/2.0.2/AddressListContractTs.message-builder.ts @@ -0,0 +1,189 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, LocalPermission, Expiry, Milliseconds, InstantiateMsg, ActorPermission, ExecuteMsg, ReplyOn, Uint128, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ActorPermissionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, IncludesActorResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AddressListContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AddressListContractTsExecuteMsgBuilder { + static permissionActors = ({ + actors, + permission + }: CamelCasedProperties["permission_actors"]>): ExecuteMsg => { + return { + permission_actors: ({ + actors, + permission + } as const) + }; + }; + static removePermissions = ({ + actors + }: CamelCasedProperties["remove_permissions"]>): ExecuteMsg => { + return { + remove_permissions: ({ + actors + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class AddressListContractTsQueryMsgBuilder { + static includesActor = ({ + actor + }: CamelCasedProperties["includes_actor"]>): QueryMsg => { + return { + includes_actor: ({ + actor + } as const) + }; + }; + static actorPermission = ({ + actor + }: CamelCasedProperties["actor_permission"]>): QueryMsg => { + return { + actor_permission: ({ + actor + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/address-list/2.0.2/AddressListContractTs.types.ts b/packages/adocodegen/src/address-list/2.0.2/AddressListContractTs.types.ts new file mode 100644 index 0000000..0b0dea4 --- /dev/null +++ b/packages/adocodegen/src/address-list/2.0.2/AddressListContractTs.types.ts @@ -0,0 +1,247 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export interface InstantiateMsg { + actor_permission?: ActorPermission | null; + kernel_address: string; + owner?: string | null; +} +export interface ActorPermission { + actors: AndrAddr[]; + permission: LocalPermission; +} +export type ExecuteMsg = { + permission_actors: { + actors: AndrAddr[]; + permission: LocalPermission; + }; +} | { + remove_permissions: { + actors: AndrAddr[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + includes_actor: { + actor: Addr; + }; +} | { + actor_permission: { + actor: Addr; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface ActorPermissionResponse { + permission: LocalPermission; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IncludesActorResponse { + included: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AddressListContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/adodb/0.2.1/AdodbContractTs.client.ts b/packages/adocodegen/src/adodb/0.2.1/AdodbContractTs.client.ts new file mode 100644 index 0000000..afac6eb --- /dev/null +++ b/packages/adocodegen/src/adodb/0.2.1/AdodbContractTs.client.ts @@ -0,0 +1,285 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, Uint128, Addr, ActionFee, QueryMsg, NullableADOMetadata, ADOMetadata, NullableString, ArrayOfString, NullableActionFee, Uint64 } from "./AdodbContractTs.types"; +export interface AdodbContractTsReadOnlyInterface { + contractAddress: string; + codeId: ({ + key + }: { + key: string; + }) => Promise; + adoType: ({ + codeId + }: { + codeId: number; + }) => Promise; + allAdoTypes: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise>; + adoVersions: ({ + adoType, + limit, + startAfter + }: { + adoType: string; + limit?: number; + startAfter?: string; + }) => Promise; + adoMetadata: ({ + adoType + }: { + adoType: string; + }) => Promise; + actionFee: ({ + action, + adoType + }: { + action: string; + adoType: string; + }) => Promise; + actionFeeByCodeId: ({ + action, + codeId + }: { + action: string; + codeId: number; + }) => Promise; +} +export class AdodbContractTsQueryClient implements AdodbContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.codeId = this.codeId.bind(this); + this.adoType = this.adoType.bind(this); + this.allAdoTypes = this.allAdoTypes.bind(this); + this.adoVersions = this.adoVersions.bind(this); + this.adoMetadata = this.adoMetadata.bind(this); + this.actionFee = this.actionFee.bind(this); + this.actionFeeByCodeId = this.actionFeeByCodeId.bind(this); + } + + codeId = async ({ + key + }: { + key: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + code_id: { + key + } + }); + }; + adoType = async ({ + codeId + }: { + codeId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ado_type: { + code_id: codeId + } + }); + }; + allAdoTypes = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise> => { + return this.client.queryContractSmart(this.contractAddress, { + all_ado_types: { + limit, + start_after: startAfter + } + }); + }; + adoVersions = async ({ + adoType, + limit, + startAfter + }: { + adoType: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ado_versions: { + ado_type: adoType, + limit, + start_after: startAfter + } + }); + }; + adoMetadata = async ({ + adoType + }: { + adoType: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ado_metadata: { + ado_type: adoType + } + }); + }; + actionFee = async ({ + action, + adoType + }: { + action: string; + adoType: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + action_fee: { + action, + ado_type: adoType + } + }); + }; + actionFeeByCodeId = async ({ + action, + codeId + }: { + action: string; + codeId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + action_fee_by_code_id: { + action, + code_id: codeId + } + }); + }; +} +export interface AdodbContractTsInterface { + contractAddress: string; + sender: string; + publish: ({ + actionFees, + adoType, + codeId, + publisher, + version + }: { + actionFees?: ActionFee[]; + adoType: string; + codeId: number; + publisher?: string; + version: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateActionFees: ({ + actionFees, + adoType + }: { + actionFees: ActionFee[]; + adoType: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeActionFees: ({ + actions, + adoType + }: { + actions: string[]; + adoType: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updatePublisher: ({ + adoType, + publisher + }: { + adoType: string; + publisher: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AdodbContractTsClient implements AdodbContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.publish = this.publish.bind(this); + this.updateActionFees = this.updateActionFees.bind(this); + this.removeActionFees = this.removeActionFees.bind(this); + this.updatePublisher = this.updatePublisher.bind(this); + } + + publish = async ({ + actionFees, + adoType, + codeId, + publisher, + version + }: { + actionFees?: ActionFee[]; + adoType: string; + codeId: number; + publisher?: string; + version: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + publish: { + action_fees: actionFees, + ado_type: adoType, + code_id: codeId, + publisher, + version + } + }, fee, memo, _funds); + }; + updateActionFees = async ({ + actionFees, + adoType + }: { + actionFees: ActionFee[]; + adoType: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_action_fees: { + action_fees: actionFees, + ado_type: adoType + } + }, fee, memo, _funds); + }; + removeActionFees = async ({ + actions, + adoType + }: { + actions: string[]; + adoType: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_action_fees: { + actions, + ado_type: adoType + } + }, fee, memo, _funds); + }; + updatePublisher = async ({ + adoType, + publisher + }: { + adoType: string; + publisher: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_publisher: { + ado_type: adoType, + publisher + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/adodb/0.2.1/AdodbContractTs.message-builder.ts b/packages/adocodegen/src/adodb/0.2.1/AdodbContractTs.message-builder.ts new file mode 100644 index 0000000..e9c9f65 --- /dev/null +++ b/packages/adocodegen/src/adodb/0.2.1/AdodbContractTs.message-builder.ts @@ -0,0 +1,157 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, Uint128, Addr, ActionFee, QueryMsg, NullableADOMetadata, ADOMetadata, NullableString, ArrayOfString, NullableActionFee, Uint64 } from "./AdodbContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AdodbContractTsExecuteMsgBuilder { + static publish = ({ + actionFees, + adoType, + codeId, + publisher, + version + }: CamelCasedProperties["publish"]>): ExecuteMsg => { + return { + publish: ({ + action_fees: actionFees, + ado_type: adoType, + code_id: codeId, + publisher, + version + } as const) + }; + }; + static updateActionFees = ({ + actionFees, + adoType + }: CamelCasedProperties["update_action_fees"]>): ExecuteMsg => { + return { + update_action_fees: ({ + action_fees: actionFees, + ado_type: adoType + } as const) + }; + }; + static removeActionFees = ({ + actions, + adoType + }: CamelCasedProperties["remove_action_fees"]>): ExecuteMsg => { + return { + remove_action_fees: ({ + actions, + ado_type: adoType + } as const) + }; + }; + static updatePublisher = ({ + adoType, + publisher + }: CamelCasedProperties["update_publisher"]>): ExecuteMsg => { + return { + update_publisher: ({ + ado_type: adoType, + publisher + } as const) + }; + }; +} +export abstract class AdodbContractTsQueryMsgBuilder { + static codeId = ({ + key + }: CamelCasedProperties["code_id"]>): QueryMsg => { + return { + code_id: ({ + key + } as const) + }; + }; + static adoType = ({ + codeId + }: CamelCasedProperties["ado_type"]>): QueryMsg => { + return { + ado_type: ({ + code_id: codeId + } as const) + }; + }; + static allAdoTypes = ({ + limit, + startAfter + }: CamelCasedProperties["all_ado_types"]>): QueryMsg => { + return { + all_ado_types: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static adoVersions = ({ + adoType, + limit, + startAfter + }: CamelCasedProperties["ado_versions"]>): QueryMsg => { + return { + ado_versions: ({ + ado_type: adoType, + limit, + start_after: startAfter + } as const) + }; + }; + static adoMetadata = ({ + adoType + }: CamelCasedProperties["ado_metadata"]>): QueryMsg => { + return { + ado_metadata: ({ + ado_type: adoType + } as const) + }; + }; + static actionFee = ({ + action, + adoType + }: CamelCasedProperties["action_fee"]>): QueryMsg => { + return { + action_fee: ({ + action, + ado_type: adoType + } as const) + }; + }; + static actionFeeByCodeId = ({ + action, + codeId + }: CamelCasedProperties["action_fee_by_code_id"]>): QueryMsg => { + return { + action_fee_by_code_id: ({ + action, + code_id: codeId + } as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/adodb/0.2.1/AdodbContractTs.types.ts b/packages/adocodegen/src/adodb/0.2.1/AdodbContractTs.types.ts new file mode 100644 index 0000000..fe2eeca --- /dev/null +++ b/packages/adocodegen/src/adodb/0.2.1/AdodbContractTs.types.ts @@ -0,0 +1,86 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + publish: { + action_fees?: ActionFee[] | null; + ado_type: string; + code_id: number; + publisher?: string | null; + version: string; + }; +} | { + update_action_fees: { + action_fees: ActionFee[]; + ado_type: string; + }; +} | { + remove_action_fees: { + actions: string[]; + ado_type: string; + }; +} | { + update_publisher: { + ado_type: string; + publisher: string; + }; +}; +export type Uint128 = string; +export type Addr = string; +export interface ActionFee { + action: string; + amount: Uint128; + asset: string; + receiver?: Addr | null; +} +export type QueryMsg = { + code_id: { + key: string; + }; +} | { + ado_type: { + code_id: number; + }; +} | { + all_ado_types: { + limit?: number | null; + start_after?: string | null; + }; +} | { + ado_versions: { + ado_type: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + ado_metadata: { + ado_type: string; + }; +} | { + action_fee: { + action: string; + ado_type: string; + }; +} | { + action_fee_by_code_id: { + action: string; + code_id: number; + }; +}; +export type NullableADOMetadata = ADOMetadata | null; +export interface ADOMetadata { + latest_version: string; + publisher: string; +} +export type NullableString = string | null; +export type ArrayOfString = string[]; +export type NullableActionFee = ActionFee | null; +export type Uint64 = number; +export type AdodbContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/adodb/0.2.16/AdodbContractTs.client.ts b/packages/adocodegen/src/adodb/0.2.16/AdodbContractTs.client.ts new file mode 100644 index 0000000..86f9e5b --- /dev/null +++ b/packages/adocodegen/src/adodb/0.2.16/AdodbContractTs.client.ts @@ -0,0 +1,352 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, Uint128, Addr, ActionFee, QueryMsg, NullableADOMetadata, ADOMetadata, NullableString, ArrayOfString, NullableActionFee, Uint64, IsUnpublishedCodeIdResponse, KernelAddressResponse, ContractOwnerResponse, TypeResponse, VersionResponse } from "./AdodbContractTs.types"; +export interface AdodbContractTsReadOnlyInterface { + contractAddress: string; + codeId: ({ + key + }: { + key: string; + }) => Promise; + isUnpublishedCodeId: ({ + codeId + }: { + codeId: number; + }) => Promise; + adoType: ({ + codeId + }: { + codeId: number; + }) => Promise; + allAdoTypes: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise>; + adoVersions: ({ + adoType, + limit, + startAfter + }: { + adoType: string; + limit?: number; + startAfter?: string; + }) => Promise; + adoMetadata: ({ + adoType + }: { + adoType: string; + }) => Promise; + actionFee: ({ + action, + adoType + }: { + action: string; + adoType: string; + }) => Promise; + actionFeeByCodeId: ({ + action, + codeId + }: { + action: string; + codeId: number; + }) => Promise; + version: () => Promise; + type: () => Promise; + owner: () => Promise; + kernelAddress: () => Promise; +} +export class AdodbContractTsQueryClient implements AdodbContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.codeId = this.codeId.bind(this); + this.isUnpublishedCodeId = this.isUnpublishedCodeId.bind(this); + this.adoType = this.adoType.bind(this); + this.allAdoTypes = this.allAdoTypes.bind(this); + this.adoVersions = this.adoVersions.bind(this); + this.adoMetadata = this.adoMetadata.bind(this); + this.actionFee = this.actionFee.bind(this); + this.actionFeeByCodeId = this.actionFeeByCodeId.bind(this); + this.version = this.version.bind(this); + this.type = this.type.bind(this); + this.owner = this.owner.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + } + + codeId = async ({ + key + }: { + key: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + code_id: { + key + } + }); + }; + isUnpublishedCodeId = async ({ + codeId + }: { + codeId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_unpublished_code_id: { + code_id: codeId + } + }); + }; + adoType = async ({ + codeId + }: { + codeId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ado_type: { + code_id: codeId + } + }); + }; + allAdoTypes = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise> => { + return this.client.queryContractSmart(this.contractAddress, { + all_ado_types: { + limit, + start_after: startAfter + } + }); + }; + adoVersions = async ({ + adoType, + limit, + startAfter + }: { + adoType: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ado_versions: { + ado_type: adoType, + limit, + start_after: startAfter + } + }); + }; + adoMetadata = async ({ + adoType + }: { + adoType: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ado_metadata: { + ado_type: adoType + } + }); + }; + actionFee = async ({ + action, + adoType + }: { + action: string; + adoType: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + action_fee: { + action, + ado_type: adoType + } + }); + }; + actionFeeByCodeId = async ({ + action, + codeId + }: { + action: string; + codeId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + action_fee_by_code_id: { + action, + code_id: codeId + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; +} +export interface AdodbContractTsInterface { + contractAddress: string; + sender: string; + publish: ({ + actionFees, + adoType, + codeId, + publisher, + version + }: { + actionFees?: ActionFee[]; + adoType: string; + codeId: number; + publisher?: string; + version: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unpublish: ({ + adoType, + version + }: { + adoType: string; + version: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateActionFees: ({ + actionFees, + adoType + }: { + actionFees: ActionFee[]; + adoType: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeActionFees: ({ + actions, + adoType + }: { + actions: string[]; + adoType: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updatePublisher: ({ + adoType, + publisher + }: { + adoType: string; + publisher: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AdodbContractTsClient implements AdodbContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.publish = this.publish.bind(this); + this.unpublish = this.unpublish.bind(this); + this.updateActionFees = this.updateActionFees.bind(this); + this.removeActionFees = this.removeActionFees.bind(this); + this.updatePublisher = this.updatePublisher.bind(this); + } + + publish = async ({ + actionFees, + adoType, + codeId, + publisher, + version + }: { + actionFees?: ActionFee[]; + adoType: string; + codeId: number; + publisher?: string; + version: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + publish: { + action_fees: actionFees, + ado_type: adoType, + code_id: codeId, + publisher, + version + } + }, fee, memo, _funds); + }; + unpublish = async ({ + adoType, + version + }: { + adoType: string; + version: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unpublish: { + ado_type: adoType, + version + } + }, fee, memo, _funds); + }; + updateActionFees = async ({ + actionFees, + adoType + }: { + actionFees: ActionFee[]; + adoType: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_action_fees: { + action_fees: actionFees, + ado_type: adoType + } + }, fee, memo, _funds); + }; + removeActionFees = async ({ + actions, + adoType + }: { + actions: string[]; + adoType: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_action_fees: { + actions, + ado_type: adoType + } + }, fee, memo, _funds); + }; + updatePublisher = async ({ + adoType, + publisher + }: { + adoType: string; + publisher: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_publisher: { + ado_type: adoType, + publisher + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/adodb/0.2.16/AdodbContractTs.message-builder.ts b/packages/adocodegen/src/adodb/0.2.16/AdodbContractTs.message-builder.ts new file mode 100644 index 0000000..160731e --- /dev/null +++ b/packages/adocodegen/src/adodb/0.2.16/AdodbContractTs.message-builder.ts @@ -0,0 +1,201 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, Uint128, Addr, ActionFee, QueryMsg, NullableADOMetadata, ADOMetadata, NullableString, ArrayOfString, NullableActionFee, Uint64, IsUnpublishedCodeIdResponse, KernelAddressResponse, ContractOwnerResponse, TypeResponse, VersionResponse } from "./AdodbContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AdodbContractTsExecuteMsgBuilder { + static publish = ({ + actionFees, + adoType, + codeId, + publisher, + version + }: CamelCasedProperties["publish"]>): ExecuteMsg => { + return { + publish: ({ + action_fees: actionFees, + ado_type: adoType, + code_id: codeId, + publisher, + version + } as const) + }; + }; + static unpublish = ({ + adoType, + version + }: CamelCasedProperties["unpublish"]>): ExecuteMsg => { + return { + unpublish: ({ + ado_type: adoType, + version + } as const) + }; + }; + static updateActionFees = ({ + actionFees, + adoType + }: CamelCasedProperties["update_action_fees"]>): ExecuteMsg => { + return { + update_action_fees: ({ + action_fees: actionFees, + ado_type: adoType + } as const) + }; + }; + static removeActionFees = ({ + actions, + adoType + }: CamelCasedProperties["remove_action_fees"]>): ExecuteMsg => { + return { + remove_action_fees: ({ + actions, + ado_type: adoType + } as const) + }; + }; + static updatePublisher = ({ + adoType, + publisher + }: CamelCasedProperties["update_publisher"]>): ExecuteMsg => { + return { + update_publisher: ({ + ado_type: adoType, + publisher + } as const) + }; + }; +} +export abstract class AdodbContractTsQueryMsgBuilder { + static codeId = ({ + key + }: CamelCasedProperties["code_id"]>): QueryMsg => { + return { + code_id: ({ + key + } as const) + }; + }; + static isUnpublishedCodeId = ({ + codeId + }: CamelCasedProperties["is_unpublished_code_id"]>): QueryMsg => { + return { + is_unpublished_code_id: ({ + code_id: codeId + } as const) + }; + }; + static adoType = ({ + codeId + }: CamelCasedProperties["ado_type"]>): QueryMsg => { + return { + ado_type: ({ + code_id: codeId + } as const) + }; + }; + static allAdoTypes = ({ + limit, + startAfter + }: CamelCasedProperties["all_ado_types"]>): QueryMsg => { + return { + all_ado_types: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static adoVersions = ({ + adoType, + limit, + startAfter + }: CamelCasedProperties["ado_versions"]>): QueryMsg => { + return { + ado_versions: ({ + ado_type: adoType, + limit, + start_after: startAfter + } as const) + }; + }; + static adoMetadata = ({ + adoType + }: CamelCasedProperties["ado_metadata"]>): QueryMsg => { + return { + ado_metadata: ({ + ado_type: adoType + } as const) + }; + }; + static actionFee = ({ + action, + adoType + }: CamelCasedProperties["action_fee"]>): QueryMsg => { + return { + action_fee: ({ + action, + ado_type: adoType + } as const) + }; + }; + static actionFeeByCodeId = ({ + action, + codeId + }: CamelCasedProperties["action_fee_by_code_id"]>): QueryMsg => { + return { + action_fee_by_code_id: ({ + action, + code_id: codeId + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/adodb/0.2.16/AdodbContractTs.types.ts b/packages/adocodegen/src/adodb/0.2.16/AdodbContractTs.types.ts new file mode 100644 index 0000000..bef89c3 --- /dev/null +++ b/packages/adocodegen/src/adodb/0.2.16/AdodbContractTs.types.ts @@ -0,0 +1,118 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + publish: { + action_fees?: ActionFee[] | null; + ado_type: string; + code_id: number; + publisher?: string | null; + version: string; + }; +} | { + unpublish: { + ado_type: string; + version: string; + }; +} | { + update_action_fees: { + action_fees: ActionFee[]; + ado_type: string; + }; +} | { + remove_action_fees: { + actions: string[]; + ado_type: string; + }; +} | { + update_publisher: { + ado_type: string; + publisher: string; + }; +}; +export type Uint128 = string; +export type Addr = string; +export interface ActionFee { + action: string; + amount: Uint128; + asset: string; + receiver?: Addr | null; +} +export type QueryMsg = { + code_id: { + key: string; + }; +} | { + is_unpublished_code_id: { + code_id: number; + }; +} | { + ado_type: { + code_id: number; + }; +} | { + all_ado_types: { + limit?: number | null; + start_after?: string | null; + }; +} | { + ado_versions: { + ado_type: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + ado_metadata: { + ado_type: string; + }; +} | { + action_fee: { + action: string; + ado_type: string; + }; +} | { + action_fee_by_code_id: { + action: string; + code_id: number; + }; +} | { + version: {}; +} | { + type: {}; +} | { + owner: {}; +} | { + kernel_address: {}; +}; +export type NullableADOMetadata = ADOMetadata | null; +export interface ADOMetadata { + latest_version: string; + publisher: string; +} +export type NullableString = string | null; +export type ArrayOfString = string[]; +export type NullableActionFee = ActionFee | null; +export type Uint64 = number; +export interface IsUnpublishedCodeIdResponse { + is_unpublished_code_id: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AdodbContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/adodb/1.0.0/AdodbContractTs.client.ts b/packages/adocodegen/src/adodb/1.0.0/AdodbContractTs.client.ts index 6a0936f..796730b 100644 --- a/packages/adocodegen/src/adodb/1.0.0/AdodbContractTs.client.ts +++ b/packages/adocodegen/src/adodb/1.0.0/AdodbContractTs.client.ts @@ -23,7 +23,7 @@ export interface AdodbContractTsReadOnlyInterface { codeId }: { codeId: number; - }) => Promise; + }) => Promise; allAdoTypes: ({ limit, startAfter @@ -44,7 +44,7 @@ export interface AdodbContractTsReadOnlyInterface { adoType }: { adoType: string; - }) => Promise; + }) => Promise; actionFee: ({ action, adoType @@ -111,7 +111,7 @@ export class AdodbContractTsQueryClient implements AdodbContractTsReadOnlyInterf codeId }: { codeId: number; - }): Promise => { + }): Promise => { return this.client.queryContractSmart(this.contractAddress, { ado_type: { code_id: codeId @@ -124,7 +124,7 @@ export class AdodbContractTsQueryClient implements AdodbContractTsReadOnlyInterf }: { limit?: number; startAfter?: string; - }): Promise => { + }): Promise => { return this.client.queryContractSmart(this.contractAddress, { all_ado_types: { limit, @@ -140,7 +140,7 @@ export class AdodbContractTsQueryClient implements AdodbContractTsReadOnlyInterf adoType: string; limit?: number; startAfter?: string; - }): Promise => { + }): Promise => { return this.client.queryContractSmart(this.contractAddress, { ado_versions: { ado_type: adoType, @@ -153,7 +153,7 @@ export class AdodbContractTsQueryClient implements AdodbContractTsReadOnlyInterf adoType }: { adoType: string; - }): Promise => { + }): Promise => { return this.client.queryContractSmart(this.contractAddress, { ado_metadata: { ado_type: adoType diff --git a/packages/adocodegen/src/adodb/1.1.2/AdodbContractTs.client.ts b/packages/adocodegen/src/adodb/1.1.2/AdodbContractTs.client.ts new file mode 100644 index 0000000..6cb06e7 --- /dev/null +++ b/packages/adocodegen/src/adodb/1.1.2/AdodbContractTs.client.ts @@ -0,0 +1,359 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, Uint128, Addr, OwnershipMessage, Expiry, Milliseconds, ActionFee, QueryMsg, NullableADOMetadata, ADOMetadata, NullableString, ArrayOfString, NullableActionFee, Uint64, IsUnpublishedCodeIdResponse, KernelAddressResponse, ContractOwnerResponse, TypeResponse, VersionResponse } from "./AdodbContractTs.types"; +export interface AdodbContractTsReadOnlyInterface { + contractAddress: string; + codeId: ({ + key + }: { + key: string; + }) => Promise; + isUnpublishedCodeId: ({ + codeId + }: { + codeId: number; + }) => Promise; + adoType: ({ + codeId + }: { + codeId: number; + }) => Promise; + allAdoTypes: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + adoVersions: ({ + adoType, + limit, + startAfter + }: { + adoType: string; + limit?: number; + startAfter?: string; + }) => Promise; + adoMetadata: ({ + adoType + }: { + adoType: string; + }) => Promise; + actionFee: ({ + action, + adoType + }: { + action: string; + adoType: string; + }) => Promise; + actionFeeByCodeId: ({ + action, + codeId + }: { + action: string; + codeId: number; + }) => Promise; + version: () => Promise; + type: () => Promise; + owner: () => Promise; + kernelAddress: () => Promise; +} +export class AdodbContractTsQueryClient implements AdodbContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.codeId = this.codeId.bind(this); + this.isUnpublishedCodeId = this.isUnpublishedCodeId.bind(this); + this.adoType = this.adoType.bind(this); + this.allAdoTypes = this.allAdoTypes.bind(this); + this.adoVersions = this.adoVersions.bind(this); + this.adoMetadata = this.adoMetadata.bind(this); + this.actionFee = this.actionFee.bind(this); + this.actionFeeByCodeId = this.actionFeeByCodeId.bind(this); + this.version = this.version.bind(this); + this.type = this.type.bind(this); + this.owner = this.owner.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + } + + codeId = async ({ + key + }: { + key: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + code_id: { + key + } + }); + }; + isUnpublishedCodeId = async ({ + codeId + }: { + codeId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_unpublished_code_id: { + code_id: codeId + } + }); + }; + adoType = async ({ + codeId + }: { + codeId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ado_type: { + code_id: codeId + } + }); + }; + allAdoTypes = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_ado_types: { + limit, + start_after: startAfter + } + }); + }; + adoVersions = async ({ + adoType, + limit, + startAfter + }: { + adoType: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ado_versions: { + ado_type: adoType, + limit, + start_after: startAfter + } + }); + }; + adoMetadata = async ({ + adoType + }: { + adoType: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ado_metadata: { + ado_type: adoType + } + }); + }; + actionFee = async ({ + action, + adoType + }: { + action: string; + adoType: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + action_fee: { + action, + ado_type: adoType + } + }); + }; + actionFeeByCodeId = async ({ + action, + codeId + }: { + action: string; + codeId: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + action_fee_by_code_id: { + action, + code_id: codeId + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; +} +export interface AdodbContractTsInterface { + contractAddress: string; + sender: string; + publish: ({ + actionFees, + adoType, + codeId, + publisher, + version + }: { + actionFees?: ActionFee[]; + adoType: string; + codeId: number; + publisher?: string; + version: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unpublish: ({ + adoType, + version + }: { + adoType: string; + version: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateActionFees: ({ + actionFees, + adoType + }: { + actionFees: ActionFee[]; + adoType: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeActionFees: ({ + actions, + adoType + }: { + actions: string[]; + adoType: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updatePublisher: ({ + adoType, + publisher + }: { + adoType: string; + publisher: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AdodbContractTsClient implements AdodbContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.publish = this.publish.bind(this); + this.unpublish = this.unpublish.bind(this); + this.updateActionFees = this.updateActionFees.bind(this); + this.removeActionFees = this.removeActionFees.bind(this); + this.updatePublisher = this.updatePublisher.bind(this); + this.ownership = this.ownership.bind(this); + } + + publish = async ({ + actionFees, + adoType, + codeId, + publisher, + version + }: { + actionFees?: ActionFee[]; + adoType: string; + codeId: number; + publisher?: string; + version: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + publish: { + action_fees: actionFees, + ado_type: adoType, + code_id: codeId, + publisher, + version + } + }, fee, memo, _funds); + }; + unpublish = async ({ + adoType, + version + }: { + adoType: string; + version: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unpublish: { + ado_type: adoType, + version + } + }, fee, memo, _funds); + }; + updateActionFees = async ({ + actionFees, + adoType + }: { + actionFees: ActionFee[]; + adoType: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_action_fees: { + action_fees: actionFees, + ado_type: adoType + } + }, fee, memo, _funds); + }; + removeActionFees = async ({ + actions, + adoType + }: { + actions: string[]; + adoType: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_action_fees: { + actions, + ado_type: adoType + } + }, fee, memo, _funds); + }; + updatePublisher = async ({ + adoType, + publisher + }: { + adoType: string; + publisher: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_publisher: { + ado_type: adoType, + publisher + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/adodb/1.1.2/AdodbContractTs.message-builder.ts b/packages/adocodegen/src/adodb/1.1.2/AdodbContractTs.message-builder.ts new file mode 100644 index 0000000..0f4483c --- /dev/null +++ b/packages/adocodegen/src/adodb/1.1.2/AdodbContractTs.message-builder.ts @@ -0,0 +1,206 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, Uint128, Addr, OwnershipMessage, Expiry, Milliseconds, ActionFee, QueryMsg, NullableADOMetadata, ADOMetadata, NullableString, ArrayOfString, NullableActionFee, Uint64, IsUnpublishedCodeIdResponse, KernelAddressResponse, ContractOwnerResponse, TypeResponse, VersionResponse } from "./AdodbContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AdodbContractTsExecuteMsgBuilder { + static publish = ({ + actionFees, + adoType, + codeId, + publisher, + version + }: CamelCasedProperties["publish"]>): ExecuteMsg => { + return { + publish: ({ + action_fees: actionFees, + ado_type: adoType, + code_id: codeId, + publisher, + version + } as const) + }; + }; + static unpublish = ({ + adoType, + version + }: CamelCasedProperties["unpublish"]>): ExecuteMsg => { + return { + unpublish: ({ + ado_type: adoType, + version + } as const) + }; + }; + static updateActionFees = ({ + actionFees, + adoType + }: CamelCasedProperties["update_action_fees"]>): ExecuteMsg => { + return { + update_action_fees: ({ + action_fees: actionFees, + ado_type: adoType + } as const) + }; + }; + static removeActionFees = ({ + actions, + adoType + }: CamelCasedProperties["remove_action_fees"]>): ExecuteMsg => { + return { + remove_action_fees: ({ + actions, + ado_type: adoType + } as const) + }; + }; + static updatePublisher = ({ + adoType, + publisher + }: CamelCasedProperties["update_publisher"]>): ExecuteMsg => { + return { + update_publisher: ({ + ado_type: adoType, + publisher + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; +} +export abstract class AdodbContractTsQueryMsgBuilder { + static codeId = ({ + key + }: CamelCasedProperties["code_id"]>): QueryMsg => { + return { + code_id: ({ + key + } as const) + }; + }; + static isUnpublishedCodeId = ({ + codeId + }: CamelCasedProperties["is_unpublished_code_id"]>): QueryMsg => { + return { + is_unpublished_code_id: ({ + code_id: codeId + } as const) + }; + }; + static adoType = ({ + codeId + }: CamelCasedProperties["ado_type"]>): QueryMsg => { + return { + ado_type: ({ + code_id: codeId + } as const) + }; + }; + static allAdoTypes = ({ + limit, + startAfter + }: CamelCasedProperties["all_ado_types"]>): QueryMsg => { + return { + all_ado_types: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static adoVersions = ({ + adoType, + limit, + startAfter + }: CamelCasedProperties["ado_versions"]>): QueryMsg => { + return { + ado_versions: ({ + ado_type: adoType, + limit, + start_after: startAfter + } as const) + }; + }; + static adoMetadata = ({ + adoType + }: CamelCasedProperties["ado_metadata"]>): QueryMsg => { + return { + ado_metadata: ({ + ado_type: adoType + } as const) + }; + }; + static actionFee = ({ + action, + adoType + }: CamelCasedProperties["action_fee"]>): QueryMsg => { + return { + action_fee: ({ + action, + ado_type: adoType + } as const) + }; + }; + static actionFeeByCodeId = ({ + action, + codeId + }: CamelCasedProperties["action_fee_by_code_id"]>): QueryMsg => { + return { + action_fee_by_code_id: ({ + action, + code_id: codeId + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/adodb/1.1.2/AdodbContractTs.types.ts b/packages/adocodegen/src/adodb/1.1.2/AdodbContractTs.types.ts new file mode 100644 index 0000000..965257f --- /dev/null +++ b/packages/adocodegen/src/adodb/1.1.2/AdodbContractTs.types.ts @@ -0,0 +1,132 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + publish: { + action_fees?: ActionFee[] | null; + ado_type: string; + code_id: number; + publisher?: string | null; + version: string; + }; +} | { + unpublish: { + ado_type: string; + version: string; + }; +} | { + update_action_fees: { + action_fees: ActionFee[]; + ado_type: string; + }; +} | { + remove_action_fees: { + actions: string[]; + ado_type: string; + }; +} | { + update_publisher: { + ado_type: string; + publisher: string; + }; +} | { + ownership: OwnershipMessage; +}; +export type Uint128 = string; +export type Addr = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export interface ActionFee { + action: string; + amount: Uint128; + asset: string; + receiver?: Addr | null; +} +export type QueryMsg = { + code_id: { + key: string; + }; +} | { + is_unpublished_code_id: { + code_id: number; + }; +} | { + ado_type: { + code_id: number; + }; +} | { + all_ado_types: { + limit?: number | null; + start_after?: string | null; + }; +} | { + ado_versions: { + ado_type: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + ado_metadata: { + ado_type: string; + }; +} | { + action_fee: { + action: string; + ado_type: string; + }; +} | { + action_fee_by_code_id: { + action: string; + code_id: number; + }; +} | { + version: {}; +} | { + type: {}; +} | { + owner: {}; +} | { + kernel_address: {}; +}; +export type NullableADOMetadata = ADOMetadata | null; +export interface ADOMetadata { + latest_version: string; + publisher: string; +} +export type NullableString = string | null; +export type ArrayOfString = string[]; +export type NullableActionFee = ActionFee | null; +export type Uint64 = number; +export interface IsUnpublishedCodeIdResponse { + is_unpublished_code_id: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AdodbContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/app-contract/0.2.1/AppContractContractTs.client.ts b/packages/adocodegen/src/app-contract/0.2.1/AppContractContractTs.client.ts new file mode 100644 index 0000000..0de5d65 --- /dev/null +++ b/packages/adocodegen/src/app-contract/0.2.1/AppContractContractTs.client.ts @@ -0,0 +1,429 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { ComponentType, Binary, AndrAddr, InstantiateMsg, AppComponent, CrossChainComponent, ChainInfo, ExecuteMsg, Addr, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, Boolean, ConfigResponse, String, ArrayOfAppComponent, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./AppContractContractTs.types"; +export interface AppContractContractTsReadOnlyInterface { + contractAddress: string; + getAddress: ({ + name + }: { + name: string; + }) => Promise; + getComponents: () => Promise; + componentExists: ({ + name + }: { + name: string; + }) => Promise; + getAddressesWithNames: () => Promise; + config: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class AppContractContractTsQueryClient implements AppContractContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getAddress = this.getAddress.bind(this); + this.getComponents = this.getComponents.bind(this); + this.componentExists = this.componentExists.bind(this); + this.getAddressesWithNames = this.getAddressesWithNames.bind(this); + this.config = this.config.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getAddress = async ({ + name + }: { + name: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_address: { + name + } + }); + }; + getComponents = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_components: {} + }); + }; + componentExists = async ({ + name + }: { + name: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + component_exists: { + name + } + }); + }; + getAddressesWithNames = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_addresses_with_names: {} + }); + }; + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface AppContractContractTsInterface { + contractAddress: string; + sender: string; + addAppComponent: ({ + component + }: { + component: AppComponent; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimOwnership: ({ + name, + newOwner + }: { + name?: string; + newOwner?: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + proxyMessage: ({ + msg, + name + }: { + msg: Binary; + name: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAddress: ({ + addr, + name + }: { + addr: string; + name: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + assignAppToComponents: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AppContractContractTsClient implements AppContractContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addAppComponent = this.addAppComponent.bind(this); + this.claimOwnership = this.claimOwnership.bind(this); + this.proxyMessage = this.proxyMessage.bind(this); + this.updateAddress = this.updateAddress.bind(this); + this.assignAppToComponents = this.assignAppToComponents.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + addAppComponent = async ({ + component + }: { + component: AppComponent; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_app_component: { + component + } + }, fee, memo, _funds); + }; + claimOwnership = async ({ + name, + newOwner + }: { + name?: string; + newOwner?: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_ownership: { + name, + new_owner: newOwner + } + }, fee, memo, _funds); + }; + proxyMessage = async ({ + msg, + name + }: { + msg: Binary; + name: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + proxy_message: { + msg, + name + } + }, fee, memo, _funds); + }; + updateAddress = async ({ + addr, + name + }: { + addr: string; + name: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_address: { + addr, + name + } + }, fee, memo, _funds); + }; + assignAppToComponents = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + assign_app_to_components: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/app-contract/0.2.1/AppContractContractTs.message-builder.ts b/packages/adocodegen/src/app-contract/0.2.1/AppContractContractTs.message-builder.ts new file mode 100644 index 0000000..dc006d6 --- /dev/null +++ b/packages/adocodegen/src/app-contract/0.2.1/AppContractContractTs.message-builder.ts @@ -0,0 +1,260 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ComponentType, Binary, AndrAddr, InstantiateMsg, AppComponent, CrossChainComponent, ChainInfo, ExecuteMsg, Addr, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, Boolean, ConfigResponse, String, ArrayOfAppComponent, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./AppContractContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AppContractContractTsExecuteMsgBuilder { + static addAppComponent = ({ + component + }: CamelCasedProperties["add_app_component"]>): ExecuteMsg => { + return { + add_app_component: ({ + component + } as const) + }; + }; + static claimOwnership = ({ + name, + newOwner + }: CamelCasedProperties["claim_ownership"]>): ExecuteMsg => { + return { + claim_ownership: ({ + name, + new_owner: newOwner + } as const) + }; + }; + static proxyMessage = ({ + msg, + name + }: CamelCasedProperties["proxy_message"]>): ExecuteMsg => { + return { + proxy_message: ({ + msg, + name + } as const) + }; + }; + static updateAddress = ({ + addr, + name + }: CamelCasedProperties["update_address"]>): ExecuteMsg => { + return { + update_address: ({ + addr, + name + } as const) + }; + }; + static assignAppToComponents = (): ExecuteMsg => { + return { + assign_app_to_components: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class AppContractContractTsQueryMsgBuilder { + static getAddress = ({ + name + }: CamelCasedProperties["get_address"]>): QueryMsg => { + return { + get_address: ({ + name + } as const) + }; + }; + static getComponents = (): QueryMsg => { + return { + get_components: ({} as const) + }; + }; + static componentExists = ({ + name + }: CamelCasedProperties["component_exists"]>): QueryMsg => { + return { + component_exists: ({ + name + } as const) + }; + }; + static getAddressesWithNames = (): QueryMsg => { + return { + get_addresses_with_names: ({} as const) + }; + }; + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/app-contract/0.2.1/AppContractContractTs.types.ts b/packages/adocodegen/src/app-contract/0.2.1/AppContractContractTs.types.ts new file mode 100644 index 0000000..c3de6a8 --- /dev/null +++ b/packages/adocodegen/src/app-contract/0.2.1/AppContractContractTs.types.ts @@ -0,0 +1,235 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type ComponentType = { + new: Binary; +} | { + symlink: AndrAddr; +} | { + cross_chain: CrossChainComponent; +}; +export type Binary = string; +export type AndrAddr = string; +export interface InstantiateMsg { + app_components: AppComponent[]; + chain_info?: ChainInfo[] | null; + kernel_address: string; + name: string; + owner?: string | null; +} +export interface AppComponent { + ado_type: string; + component_type: ComponentType; + name: string; +} +export interface CrossChainComponent { + chain: string; + instantiate_msg: Binary; +} +export interface ChainInfo { + chain_name: string; + owner: string; +} +export type ExecuteMsg = { + add_app_component: { + component: AppComponent; + }; +} | { + claim_ownership: { + name?: string | null; + new_owner?: Addr | null; + }; +} | { + proxy_message: { + msg: Binary; + name: string; + }; +} | { + update_address: { + addr: string; + name: string; + }; +} | { + assign_app_to_components: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type Addr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_address: { + name: string; + }; +} | { + get_components: {}; +} | { + component_exists: { + name: string; + }; +} | { + get_addresses_with_names: {}; +} | { + config: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export type Boolean = boolean; +export interface ConfigResponse { + name: string; + owner: string; +} +export type String = string; +export type ArrayOfAppComponent = AppComponent[]; +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AppContractContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/app-contract/0.2.16/AppContractContractTs.client.ts b/packages/adocodegen/src/app-contract/0.2.16/AppContractContractTs.client.ts new file mode 100644 index 0000000..83291d1 --- /dev/null +++ b/packages/adocodegen/src/app-contract/0.2.16/AppContractContractTs.client.ts @@ -0,0 +1,370 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { ComponentType, Binary, AndrAddr, InstantiateMsg, AppComponent, CrossChainComponent, ChainInfo, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, Boolean, ConfigResponse, String, ArrayOfAppComponent, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./AppContractContractTs.types"; +export interface AppContractContractTsReadOnlyInterface { + contractAddress: string; + getAddress: ({ + name + }: { + name: string; + }) => Promise; + getComponents: () => Promise; + componentExists: ({ + name + }: { + name: string; + }) => Promise; + getAddressesWithNames: () => Promise; + config: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class AppContractContractTsQueryClient implements AppContractContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getAddress = this.getAddress.bind(this); + this.getComponents = this.getComponents.bind(this); + this.componentExists = this.componentExists.bind(this); + this.getAddressesWithNames = this.getAddressesWithNames.bind(this); + this.config = this.config.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getAddress = async ({ + name + }: { + name: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_address: { + name + } + }); + }; + getComponents = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_components: {} + }); + }; + componentExists = async ({ + name + }: { + name: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + component_exists: { + name + } + }); + }; + getAddressesWithNames = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_addresses_with_names: {} + }); + }; + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface AppContractContractTsInterface { + contractAddress: string; + sender: string; + addAppComponent: ({ + component + }: { + component: AppComponent; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimOwnership: ({ + name, + newOwner + }: { + name?: string; + newOwner?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + proxyMessage: ({ + msg, + name + }: { + msg: Binary; + name: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAddress: ({ + addr, + name + }: { + addr: string; + name: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + assignAppToComponents: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AppContractContractTsClient implements AppContractContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addAppComponent = this.addAppComponent.bind(this); + this.claimOwnership = this.claimOwnership.bind(this); + this.proxyMessage = this.proxyMessage.bind(this); + this.updateAddress = this.updateAddress.bind(this); + this.assignAppToComponents = this.assignAppToComponents.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + addAppComponent = async ({ + component + }: { + component: AppComponent; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_app_component: { + component + } + }, fee, memo, _funds); + }; + claimOwnership = async ({ + name, + newOwner + }: { + name?: string; + newOwner?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_ownership: { + name, + new_owner: newOwner + } + }, fee, memo, _funds); + }; + proxyMessage = async ({ + msg, + name + }: { + msg: Binary; + name: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + proxy_message: { + msg, + name + } + }, fee, memo, _funds); + }; + updateAddress = async ({ + addr, + name + }: { + addr: string; + name: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_address: { + addr, + name + } + }, fee, memo, _funds); + }; + assignAppToComponents = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + assign_app_to_components: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/app-contract/0.2.16/AppContractContractTs.message-builder.ts b/packages/adocodegen/src/app-contract/0.2.16/AppContractContractTs.message-builder.ts new file mode 100644 index 0000000..7f11501 --- /dev/null +++ b/packages/adocodegen/src/app-contract/0.2.16/AppContractContractTs.message-builder.ts @@ -0,0 +1,226 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ComponentType, Binary, AndrAddr, InstantiateMsg, AppComponent, CrossChainComponent, ChainInfo, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, Boolean, ConfigResponse, String, ArrayOfAppComponent, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./AppContractContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AppContractContractTsExecuteMsgBuilder { + static addAppComponent = ({ + component + }: CamelCasedProperties["add_app_component"]>): ExecuteMsg => { + return { + add_app_component: ({ + component + } as const) + }; + }; + static claimOwnership = ({ + name, + newOwner + }: CamelCasedProperties["claim_ownership"]>): ExecuteMsg => { + return { + claim_ownership: ({ + name, + new_owner: newOwner + } as const) + }; + }; + static proxyMessage = ({ + msg, + name + }: CamelCasedProperties["proxy_message"]>): ExecuteMsg => { + return { + proxy_message: ({ + msg, + name + } as const) + }; + }; + static updateAddress = ({ + addr, + name + }: CamelCasedProperties["update_address"]>): ExecuteMsg => { + return { + update_address: ({ + addr, + name + } as const) + }; + }; + static assignAppToComponents = (): ExecuteMsg => { + return { + assign_app_to_components: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class AppContractContractTsQueryMsgBuilder { + static getAddress = ({ + name + }: CamelCasedProperties["get_address"]>): QueryMsg => { + return { + get_address: ({ + name + } as const) + }; + }; + static getComponents = (): QueryMsg => { + return { + get_components: ({} as const) + }; + }; + static componentExists = ({ + name + }: CamelCasedProperties["component_exists"]>): QueryMsg => { + return { + component_exists: ({ + name + } as const) + }; + }; + static getAddressesWithNames = (): QueryMsg => { + return { + get_addresses_with_names: ({} as const) + }; + }; + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/app-contract/0.2.16/AppContractContractTs.types.ts b/packages/adocodegen/src/app-contract/0.2.16/AppContractContractTs.types.ts new file mode 100644 index 0000000..c503151 --- /dev/null +++ b/packages/adocodegen/src/app-contract/0.2.16/AppContractContractTs.types.ts @@ -0,0 +1,242 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type ComponentType = { + new: Binary; +} | { + symlink: AndrAddr; +} | { + cross_chain: CrossChainComponent; +}; +export type Binary = string; +export type AndrAddr = string; +export interface InstantiateMsg { + app_components: AppComponent[]; + chain_info?: ChainInfo[] | null; + kernel_address: string; + name: string; + owner?: string | null; +} +export interface AppComponent { + ado_type: string; + component_type: ComponentType; + name: string; +} +export interface CrossChainComponent { + chain: string; + instantiate_msg: Binary; +} +export interface ChainInfo { + chain_name: string; + owner: string; +} +export type ExecuteMsg = { + add_app_component: { + component: AppComponent; + }; +} | { + claim_ownership: { + name?: string | null; + new_owner?: AndrAddr | null; + }; +} | { + proxy_message: { + msg: Binary; + name: string; + }; +} | { + update_address: { + addr: string; + name: string; + }; +} | { + assign_app_to_components: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_address: { + name: string; + }; +} | { + get_components: {}; +} | { + component_exists: { + name: string; + }; +} | { + get_addresses_with_names: {}; +} | { + config: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export type Boolean = boolean; +export interface ConfigResponse { + name: string; + owner: string; +} +export type String = string; +export type ArrayOfAppComponent = AppComponent[]; +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AppContractContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/app-contract/1.1.1-beta.1/AppContractContractTs.client.ts b/packages/adocodegen/src/app-contract/1.1.1-beta.1/AppContractContractTs.client.ts new file mode 100644 index 0000000..e654784 --- /dev/null +++ b/packages/adocodegen/src/app-contract/1.1.1-beta.1/AppContractContractTs.client.ts @@ -0,0 +1,350 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { ComponentType, Binary, AndrAddr, InstantiateMsg, AppComponent, ChainInfo, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, ComponentExistsResponse, ConfigResponse, String, ArrayOfAppComponent, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./AppContractContractTs.types"; +export interface AppContractContractTsReadOnlyInterface { + contractAddress: string; + getAddress: ({ + name + }: { + name: string; + }) => Promise; + getComponents: () => Promise; + componentExists: ({ + name + }: { + name: string; + }) => Promise; + getAddressesWithNames: () => Promise; + config: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class AppContractContractTsQueryClient implements AppContractContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getAddress = this.getAddress.bind(this); + this.getComponents = this.getComponents.bind(this); + this.componentExists = this.componentExists.bind(this); + this.getAddressesWithNames = this.getAddressesWithNames.bind(this); + this.config = this.config.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getAddress = async ({ + name + }: { + name: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_address: { + name + } + }); + }; + getComponents = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_components: {} + }); + }; + componentExists = async ({ + name + }: { + name: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + component_exists: { + name + } + }); + }; + getAddressesWithNames = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_addresses_with_names: {} + }); + }; + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface AppContractContractTsInterface { + contractAddress: string; + sender: string; + addAppComponent: ({ + component + }: { + component: AppComponent; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimOwnership: ({ + name, + newOwner + }: { + name?: string; + newOwner?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + proxyMessage: ({ + msg, + name + }: { + msg: Binary; + name: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAddress: ({ + addr, + name + }: { + addr: string; + name: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + assignAppToComponents: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AppContractContractTsClient implements AppContractContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addAppComponent = this.addAppComponent.bind(this); + this.claimOwnership = this.claimOwnership.bind(this); + this.proxyMessage = this.proxyMessage.bind(this); + this.updateAddress = this.updateAddress.bind(this); + this.assignAppToComponents = this.assignAppToComponents.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + addAppComponent = async ({ + component + }: { + component: AppComponent; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_app_component: { + component + } + }, fee, memo, _funds); + }; + claimOwnership = async ({ + name, + newOwner + }: { + name?: string; + newOwner?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_ownership: { + name, + new_owner: newOwner + } + }, fee, memo, _funds); + }; + proxyMessage = async ({ + msg, + name + }: { + msg: Binary; + name: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + proxy_message: { + msg, + name + } + }, fee, memo, _funds); + }; + updateAddress = async ({ + addr, + name + }: { + addr: string; + name: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_address: { + addr, + name + } + }, fee, memo, _funds); + }; + assignAppToComponents = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + assign_app_to_components: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/app-contract/1.1.1-beta.1/AppContractContractTs.message-builder.ts b/packages/adocodegen/src/app-contract/1.1.1-beta.1/AppContractContractTs.message-builder.ts new file mode 100644 index 0000000..5249160 --- /dev/null +++ b/packages/adocodegen/src/app-contract/1.1.1-beta.1/AppContractContractTs.message-builder.ts @@ -0,0 +1,214 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { ComponentType, Binary, AndrAddr, InstantiateMsg, AppComponent, ChainInfo, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, ComponentExistsResponse, ConfigResponse, String, ArrayOfAppComponent, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./AppContractContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AppContractContractTsExecuteMsgBuilder { + static addAppComponent = ({ + component + }: CamelCasedProperties["add_app_component"]>): ExecuteMsg => { + return { + add_app_component: ({ + component + } as const) + }; + }; + static claimOwnership = ({ + name, + newOwner + }: CamelCasedProperties["claim_ownership"]>): ExecuteMsg => { + return { + claim_ownership: ({ + name, + new_owner: newOwner + } as const) + }; + }; + static proxyMessage = ({ + msg, + name + }: CamelCasedProperties["proxy_message"]>): ExecuteMsg => { + return { + proxy_message: ({ + msg, + name + } as const) + }; + }; + static updateAddress = ({ + addr, + name + }: CamelCasedProperties["update_address"]>): ExecuteMsg => { + return { + update_address: ({ + addr, + name + } as const) + }; + }; + static assignAppToComponents = (): ExecuteMsg => { + return { + assign_app_to_components: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class AppContractContractTsQueryMsgBuilder { + static getAddress = ({ + name + }: CamelCasedProperties["get_address"]>): QueryMsg => { + return { + get_address: ({ + name + } as const) + }; + }; + static getComponents = (): QueryMsg => { + return { + get_components: ({} as const) + }; + }; + static componentExists = ({ + name + }: CamelCasedProperties["component_exists"]>): QueryMsg => { + return { + component_exists: ({ + name + } as const) + }; + }; + static getAddressesWithNames = (): QueryMsg => { + return { + get_addresses_with_names: ({} as const) + }; + }; + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/app-contract/1.1.1-beta.1/AppContractContractTs.types.ts b/packages/adocodegen/src/app-contract/1.1.1-beta.1/AppContractContractTs.types.ts new file mode 100644 index 0000000..af89190 --- /dev/null +++ b/packages/adocodegen/src/app-contract/1.1.1-beta.1/AppContractContractTs.types.ts @@ -0,0 +1,232 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type ComponentType = { + new: Binary; +} | { + symlink: AndrAddr; +}; +export type Binary = string; +export type AndrAddr = string; +export interface InstantiateMsg { + app_components: AppComponent[]; + chain_info?: ChainInfo[] | null; + kernel_address: string; + name: string; + owner?: string | null; +} +export interface AppComponent { + ado_type: string; + component_type: ComponentType; + name: string; +} +export interface ChainInfo { + chain_name: string; + owner: string; +} +export type ExecuteMsg = { + add_app_component: { + component: AppComponent; + }; +} | { + claim_ownership: { + name?: string | null; + new_owner?: AndrAddr | null; + }; +} | { + proxy_message: { + msg: Binary; + name: string; + }; +} | { + update_address: { + addr: string; + name: string; + }; +} | { + assign_app_to_components: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_address: { + name: string; + }; +} | { + get_components: {}; +} | { + component_exists: { + name: string; + }; +} | { + get_addresses_with_names: {}; +} | { + config: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ComponentExistsResponse { + component_exists: boolean; +} +export interface ConfigResponse { + name: string; + owner: string; +} +export type String = string; +export type ArrayOfAppComponent = AppComponent[]; +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AppContractContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.0/AuctionContractTs.client.ts b/packages/adocodegen/src/auction/2.0.0/AuctionContractTs.client.ts new file mode 100644 index 0000000..b1cfddc --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.0/AuctionContractTs.client.ts @@ -0,0 +1,648 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, Expiry, Milliseconds, Addr, ReplyOn, OwnershipMessage, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, RatesQueryMessage, ADOBaseVersionResponse, AppContractResponse, AuctionIdsResponse, AuctionInfo, Expiration, Timestamp, Uint64, AuctionStateResponse, AuthorizedAddressesResponse, BidsResponse, Bid, BlockHeightResponse, IsCancelledResponse, IsClaimedResponse, IsClosedResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AuctionContractTs.types"; +export interface AuctionContractTsReadOnlyInterface { + contractAddress: string; + latestAuctionState: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + auctionState: ({ + auctionId + }: { + auctionId: Uint128; + }) => Promise; + auctionIds: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + auctionInfosForAddress: ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }) => Promise; + authorizedAddresses: ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: string; + }) => Promise; + bids: ({ + auctionId, + limit, + orderBy, + startAfter + }: { + auctionId: Uint128; + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }) => Promise; + isCancelled: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + isClosed: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + isClaimed: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: (ratesQueryMessage: RatesQueryMessage) => Promise; +} +export class AuctionContractTsQueryClient implements AuctionContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.latestAuctionState = this.latestAuctionState.bind(this); + this.auctionState = this.auctionState.bind(this); + this.auctionIds = this.auctionIds.bind(this); + this.auctionInfosForAddress = this.auctionInfosForAddress.bind(this); + this.authorizedAddresses = this.authorizedAddresses.bind(this); + this.bids = this.bids.bind(this); + this.isCancelled = this.isCancelled.bind(this); + this.isClosed = this.isClosed.bind(this); + this.isClaimed = this.isClaimed.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + } + + latestAuctionState = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_auction_state: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + auctionState = async ({ + auctionId + }: { + auctionId: Uint128; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_state: { + auction_id: auctionId + } + }); + }; + auctionIds = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_ids: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + auctionInfosForAddress = async ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_infos_for_address: { + limit, + start_after: startAfter, + token_address: tokenAddress + } + }); + }; + authorizedAddresses = async ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + authorized_addresses: { + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + bids = async ({ + auctionId, + limit, + orderBy, + startAfter + }: { + auctionId: Uint128; + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + bids: { + auction_id: auctionId, + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + isCancelled = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_cancelled: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + isClosed = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_closed: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + isClaimed = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_claimed: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async (ratesQueryMessage: RatesQueryMessage): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: ratesQueryMessage + }); + }; +} +export interface AuctionContractTsInterface { + contractAddress: string; + sender: string; + receiveNft: ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + placeBid: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAuction: ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: { + coinDenom: Asset; + endTime: Expiry; + minBid?: Uint128; + minRaise?: Uint128; + recipient?: Recipient; + startTime?: Expiry; + tokenAddress: string; + tokenId: string; + whitelist?: Addr[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + cancelAuction: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + authorizeTokenContract: ({ + addr, + expiration + }: { + addr: AndrAddr; + expiration?: Expiry; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deauthorizeTokenContract: ({ + addr + }: { + addr: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AuctionContractTsClient implements AuctionContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receiveNft = this.receiveNft.bind(this); + this.receive = this.receive.bind(this); + this.placeBid = this.placeBid.bind(this); + this.claim = this.claim.bind(this); + this.updateAuction = this.updateAuction.bind(this); + this.cancelAuction = this.cancelAuction.bind(this); + this.authorizeTokenContract = this.authorizeTokenContract.bind(this); + this.deauthorizeTokenContract = this.deauthorizeTokenContract.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receiveNft = async ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive_nft: { + msg, + sender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + placeBid = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + place_bid: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + claim = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + updateAuction = async ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: { + coinDenom: Asset; + endTime: Expiry; + minBid?: Uint128; + minRaise?: Uint128; + recipient?: Recipient; + startTime?: Expiry; + tokenAddress: string; + tokenId: string; + whitelist?: Addr[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_auction: { + coin_denom: coinDenom, + end_time: endTime, + min_bid: minBid, + min_raise: minRaise, + recipient, + start_time: startTime, + token_address: tokenAddress, + token_id: tokenId, + whitelist + } + }, fee, memo, _funds); + }; + cancelAuction = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_auction: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + authorizeTokenContract = async ({ + addr, + expiration + }: { + addr: AndrAddr; + expiration?: Expiry; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + authorize_token_contract: { + addr, + expiration + } + }, fee, memo, _funds); + }; + deauthorizeTokenContract = async ({ + addr + }: { + addr: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deauthorize_token_contract: { + addr + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.0/AuctionContractTs.message-builder.ts b/packages/adocodegen/src/auction/2.0.0/AuctionContractTs.message-builder.ts new file mode 100644 index 0000000..2880f66 --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.0/AuctionContractTs.message-builder.ts @@ -0,0 +1,375 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, Expiry, Milliseconds, Addr, ReplyOn, OwnershipMessage, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, RatesQueryMessage, ADOBaseVersionResponse, AppContractResponse, AuctionIdsResponse, AuctionInfo, Expiration, Timestamp, Uint64, AuctionStateResponse, AuthorizedAddressesResponse, BidsResponse, Bid, BlockHeightResponse, IsCancelledResponse, IsClaimedResponse, IsClosedResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AuctionContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AuctionContractTsExecuteMsgBuilder { + static receiveNft = ({ + msg, + sender, + tokenId + }: CamelCasedProperties["receive_nft"]>): ExecuteMsg => { + return { + receive_nft: ({ + msg, + sender, + token_id: tokenId + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static placeBid = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["place_bid"]>): ExecuteMsg => { + return { + place_bid: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static claim = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static updateAuction = ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: CamelCasedProperties["update_auction"]>): ExecuteMsg => { + return { + update_auction: ({ + coin_denom: coinDenom, + end_time: endTime, + min_bid: minBid, + min_raise: minRaise, + recipient, + start_time: startTime, + token_address: tokenAddress, + token_id: tokenId, + whitelist + } as const) + }; + }; + static cancelAuction = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["cancel_auction"]>): ExecuteMsg => { + return { + cancel_auction: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static authorizeTokenContract = ({ + addr, + expiration + }: CamelCasedProperties["authorize_token_contract"]>): ExecuteMsg => { + return { + authorize_token_contract: ({ + addr, + expiration + } as const) + }; + }; + static deauthorizeTokenContract = ({ + addr + }: CamelCasedProperties["deauthorize_token_contract"]>): ExecuteMsg => { + return { + deauthorize_token_contract: ({ + addr + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class AuctionContractTsQueryMsgBuilder { + static latestAuctionState = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["latest_auction_state"]>): QueryMsg => { + return { + latest_auction_state: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static auctionState = ({ + auctionId + }: CamelCasedProperties["auction_state"]>): QueryMsg => { + return { + auction_state: ({ + auction_id: auctionId + } as const) + }; + }; + static auctionIds = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["auction_ids"]>): QueryMsg => { + return { + auction_ids: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static auctionInfosForAddress = ({ + limit, + startAfter, + tokenAddress + }: CamelCasedProperties["auction_infos_for_address"]>): QueryMsg => { + return { + auction_infos_for_address: ({ + limit, + start_after: startAfter, + token_address: tokenAddress + } as const) + }; + }; + static authorizedAddresses = ({ + limit, + orderBy, + startAfter + }: CamelCasedProperties["authorized_addresses"]>): QueryMsg => { + return { + authorized_addresses: ({ + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static bids = ({ + auctionId, + limit, + orderBy, + startAfter + }: CamelCasedProperties["bids"]>): QueryMsg => { + return { + bids: ({ + auction_id: auctionId, + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static isCancelled = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_cancelled"]>): QueryMsg => { + return { + is_cancelled: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static isClosed = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_closed"]>): QueryMsg => { + return { + is_closed: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static isClaimed = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_claimed"]>): QueryMsg => { + return { + is_claimed: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = (ratesQueryMessage: RatesQueryMessage): QueryMsg => { + return { + rates: ratesQueryMessage + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.0/AuctionContractTs.types.ts b/packages/adocodegen/src/auction/2.0.0/AuctionContractTs.types.ts new file mode 100644 index 0000000..205637a --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.0/AuctionContractTs.types.ts @@ -0,0 +1,375 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + authorized_cw20_address?: AndrAddr | null; + authorized_token_addresses?: AndrAddr[] | null; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + receive_nft: Cw721ReceiveMsg; +} | { + receive: Cw20ReceiveMsg; +} | { + place_bid: { + token_address: string; + token_id: string; + }; +} | { + claim: { + token_address: string; + token_id: string; + }; +} | { + update_auction: { + coin_denom: Asset; + end_time: Expiry; + min_bid?: Uint128 | null; + min_raise?: Uint128 | null; + recipient?: Recipient | null; + start_time?: Expiry | null; + token_address: string; + token_id: string; + whitelist?: Addr[] | null; + }; +} | { + cancel_auction: { + token_address: string; + token_id: string; + }; +} | { + authorize_token_contract: { + addr: AndrAddr; + expiration?: Expiry | null; + }; +} | { + deauthorize_token_contract: { + addr: AndrAddr; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Uint128 = string; +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw721ReceiveMsg { + msg: Binary; + sender: string; + token_id: string; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + latest_auction_state: { + token_address: string; + token_id: string; + }; +} | { + auction_state: { + auction_id: Uint128; + }; +} | { + auction_ids: { + token_address: string; + token_id: string; + }; +} | { + auction_infos_for_address: { + limit?: number | null; + start_after?: string | null; + token_address: string; + }; +} | { + authorized_addresses: { + limit?: number | null; + order_by?: OrderBy | null; + start_after?: string | null; + }; +} | { + bids: { + auction_id: Uint128; + limit?: number | null; + order_by?: OrderBy | null; + start_after?: number | null; + }; +} | { + is_cancelled: { + token_address: string; + token_id: string; + }; +} | { + is_closed: { + token_address: string; + token_id: string; + }; +} | { + is_claimed: { + token_address: string; + token_id: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: RatesQueryMessage; +}; +export type OrderBy = "asc" | "desc"; +export type RatesQueryMessage = { + get_rate: { + action: string; + }; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface AuctionIdsResponse { + auction_ids: Uint128[]; +} +export interface AuctionInfo { + auction_ids: Uint128[]; + token_address: string; + token_id: string; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface AuctionStateResponse { + auction_id: Uint128; + coin_denom: string; + end_time: Expiration; + high_bidder_addr: string; + high_bidder_amount: Uint128; + is_cancelled: boolean; + min_bid?: Uint128 | null; + min_raise?: Uint128 | null; + owner: string; + recipient?: Recipient | null; + start_time: Expiration; + uses_cw20: boolean; + whitelist?: Addr[] | null; +} +export interface AuthorizedAddressesResponse { + addresses: string[]; +} +export interface BidsResponse { + bids: Bid[]; +} +export interface Bid { + amount: Uint128; + bidder: string; + timestamp: Milliseconds; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IsCancelledResponse { + is_cancelled: boolean; +} +export interface IsClaimedResponse { + is_claimed: boolean; +} +export interface IsClosedResponse { + is_closed: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AuctionContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.1/AuctionContractTs.client.ts b/packages/adocodegen/src/auction/2.0.1/AuctionContractTs.client.ts new file mode 100644 index 0000000..7af50ef --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.1/AuctionContractTs.client.ts @@ -0,0 +1,665 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, Expiry, Milliseconds, Addr, ReplyOn, OwnershipMessage, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, AuctionIdsResponse, AuctionInfo, Expiration, Timestamp, Uint64, AuctionStateResponse, AuthorizedAddressesResponse, BidsResponse, Bid, BlockHeightResponse, IsCancelledResponse, IsClaimedResponse, IsClosedResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AuctionContractTs.types"; +export interface AuctionContractTsReadOnlyInterface { + contractAddress: string; + latestAuctionState: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + auctionState: ({ + auctionId + }: { + auctionId: Uint128; + }) => Promise; + auctionIds: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + auctionInfosForAddress: ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }) => Promise; + authorizedAddresses: ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: string; + }) => Promise; + bids: ({ + auctionId, + limit, + orderBy, + startAfter + }: { + auctionId: Uint128; + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }) => Promise; + isCancelled: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + isClosed: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + isClaimed: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class AuctionContractTsQueryClient implements AuctionContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.latestAuctionState = this.latestAuctionState.bind(this); + this.auctionState = this.auctionState.bind(this); + this.auctionIds = this.auctionIds.bind(this); + this.auctionInfosForAddress = this.auctionInfosForAddress.bind(this); + this.authorizedAddresses = this.authorizedAddresses.bind(this); + this.bids = this.bids.bind(this); + this.isCancelled = this.isCancelled.bind(this); + this.isClosed = this.isClosed.bind(this); + this.isClaimed = this.isClaimed.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + latestAuctionState = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_auction_state: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + auctionState = async ({ + auctionId + }: { + auctionId: Uint128; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_state: { + auction_id: auctionId + } + }); + }; + auctionIds = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_ids: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + auctionInfosForAddress = async ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_infos_for_address: { + limit, + start_after: startAfter, + token_address: tokenAddress + } + }); + }; + authorizedAddresses = async ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + authorized_addresses: { + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + bids = async ({ + auctionId, + limit, + orderBy, + startAfter + }: { + auctionId: Uint128; + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + bids: { + auction_id: auctionId, + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + isCancelled = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_cancelled: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + isClosed = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_closed: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + isClaimed = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_claimed: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface AuctionContractTsInterface { + contractAddress: string; + sender: string; + receiveNft: ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + placeBid: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAuction: ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: { + coinDenom: Asset; + endTime: Expiry; + minBid?: Uint128; + minRaise?: Uint128; + recipient?: Recipient; + startTime?: Expiry; + tokenAddress: string; + tokenId: string; + whitelist?: Addr[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + cancelAuction: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + authorizeTokenContract: ({ + addr, + expiration + }: { + addr: AndrAddr; + expiration?: Expiry; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deauthorizeTokenContract: ({ + addr + }: { + addr: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AuctionContractTsClient implements AuctionContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receiveNft = this.receiveNft.bind(this); + this.receive = this.receive.bind(this); + this.placeBid = this.placeBid.bind(this); + this.claim = this.claim.bind(this); + this.updateAuction = this.updateAuction.bind(this); + this.cancelAuction = this.cancelAuction.bind(this); + this.authorizeTokenContract = this.authorizeTokenContract.bind(this); + this.deauthorizeTokenContract = this.deauthorizeTokenContract.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receiveNft = async ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive_nft: { + msg, + sender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + placeBid = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + place_bid: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + claim = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + updateAuction = async ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: { + coinDenom: Asset; + endTime: Expiry; + minBid?: Uint128; + minRaise?: Uint128; + recipient?: Recipient; + startTime?: Expiry; + tokenAddress: string; + tokenId: string; + whitelist?: Addr[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_auction: { + coin_denom: coinDenom, + end_time: endTime, + min_bid: minBid, + min_raise: minRaise, + recipient, + start_time: startTime, + token_address: tokenAddress, + token_id: tokenId, + whitelist + } + }, fee, memo, _funds); + }; + cancelAuction = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_auction: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + authorizeTokenContract = async ({ + addr, + expiration + }: { + addr: AndrAddr; + expiration?: Expiry; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + authorize_token_contract: { + addr, + expiration + } + }, fee, memo, _funds); + }; + deauthorizeTokenContract = async ({ + addr + }: { + addr: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deauthorize_token_contract: { + addr + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.1/AuctionContractTs.message-builder.ts b/packages/adocodegen/src/auction/2.0.1/AuctionContractTs.message-builder.ts new file mode 100644 index 0000000..d2b8db9 --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.1/AuctionContractTs.message-builder.ts @@ -0,0 +1,386 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, Expiry, Milliseconds, Addr, ReplyOn, OwnershipMessage, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, AuctionIdsResponse, AuctionInfo, Expiration, Timestamp, Uint64, AuctionStateResponse, AuthorizedAddressesResponse, BidsResponse, Bid, BlockHeightResponse, IsCancelledResponse, IsClaimedResponse, IsClosedResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AuctionContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AuctionContractTsExecuteMsgBuilder { + static receiveNft = ({ + msg, + sender, + tokenId + }: CamelCasedProperties["receive_nft"]>): ExecuteMsg => { + return { + receive_nft: ({ + msg, + sender, + token_id: tokenId + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static placeBid = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["place_bid"]>): ExecuteMsg => { + return { + place_bid: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static claim = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static updateAuction = ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: CamelCasedProperties["update_auction"]>): ExecuteMsg => { + return { + update_auction: ({ + coin_denom: coinDenom, + end_time: endTime, + min_bid: minBid, + min_raise: minRaise, + recipient, + start_time: startTime, + token_address: tokenAddress, + token_id: tokenId, + whitelist + } as const) + }; + }; + static cancelAuction = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["cancel_auction"]>): ExecuteMsg => { + return { + cancel_auction: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static authorizeTokenContract = ({ + addr, + expiration + }: CamelCasedProperties["authorize_token_contract"]>): ExecuteMsg => { + return { + authorize_token_contract: ({ + addr, + expiration + } as const) + }; + }; + static deauthorizeTokenContract = ({ + addr + }: CamelCasedProperties["deauthorize_token_contract"]>): ExecuteMsg => { + return { + deauthorize_token_contract: ({ + addr + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class AuctionContractTsQueryMsgBuilder { + static latestAuctionState = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["latest_auction_state"]>): QueryMsg => { + return { + latest_auction_state: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static auctionState = ({ + auctionId + }: CamelCasedProperties["auction_state"]>): QueryMsg => { + return { + auction_state: ({ + auction_id: auctionId + } as const) + }; + }; + static auctionIds = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["auction_ids"]>): QueryMsg => { + return { + auction_ids: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static auctionInfosForAddress = ({ + limit, + startAfter, + tokenAddress + }: CamelCasedProperties["auction_infos_for_address"]>): QueryMsg => { + return { + auction_infos_for_address: ({ + limit, + start_after: startAfter, + token_address: tokenAddress + } as const) + }; + }; + static authorizedAddresses = ({ + limit, + orderBy, + startAfter + }: CamelCasedProperties["authorized_addresses"]>): QueryMsg => { + return { + authorized_addresses: ({ + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static bids = ({ + auctionId, + limit, + orderBy, + startAfter + }: CamelCasedProperties["bids"]>): QueryMsg => { + return { + bids: ({ + auction_id: auctionId, + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static isCancelled = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_cancelled"]>): QueryMsg => { + return { + is_cancelled: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static isClosed = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_closed"]>): QueryMsg => { + return { + is_closed: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static isClaimed = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_claimed"]>): QueryMsg => { + return { + is_claimed: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.1/AuctionContractTs.types.ts b/packages/adocodegen/src/auction/2.0.1/AuctionContractTs.types.ts new file mode 100644 index 0000000..6e694a1 --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.1/AuctionContractTs.types.ts @@ -0,0 +1,377 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + authorized_cw20_address?: AndrAddr | null; + authorized_token_addresses?: AndrAddr[] | null; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + receive_nft: Cw721ReceiveMsg; +} | { + receive: Cw20ReceiveMsg; +} | { + place_bid: { + token_address: string; + token_id: string; + }; +} | { + claim: { + token_address: string; + token_id: string; + }; +} | { + update_auction: { + coin_denom: Asset; + end_time: Expiry; + min_bid?: Uint128 | null; + min_raise?: Uint128 | null; + recipient?: Recipient | null; + start_time?: Expiry | null; + token_address: string; + token_id: string; + whitelist?: Addr[] | null; + }; +} | { + cancel_auction: { + token_address: string; + token_id: string; + }; +} | { + authorize_token_contract: { + addr: AndrAddr; + expiration?: Expiry | null; + }; +} | { + deauthorize_token_contract: { + addr: AndrAddr; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Uint128 = string; +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw721ReceiveMsg { + msg: Binary; + sender: string; + token_id: string; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + latest_auction_state: { + token_address: string; + token_id: string; + }; +} | { + auction_state: { + auction_id: Uint128; + }; +} | { + auction_ids: { + token_address: string; + token_id: string; + }; +} | { + auction_infos_for_address: { + limit?: number | null; + start_after?: string | null; + token_address: string; + }; +} | { + authorized_addresses: { + limit?: number | null; + order_by?: OrderBy | null; + start_after?: string | null; + }; +} | { + bids: { + auction_id: Uint128; + limit?: number | null; + order_by?: OrderBy | null; + start_after?: number | null; + }; +} | { + is_cancelled: { + token_address: string; + token_id: string; + }; +} | { + is_closed: { + token_address: string; + token_id: string; + }; +} | { + is_claimed: { + token_address: string; + token_id: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type OrderBy = "asc" | "desc"; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface AuctionIdsResponse { + auction_ids: Uint128[]; +} +export interface AuctionInfo { + auction_ids: Uint128[]; + token_address: string; + token_id: string; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface AuctionStateResponse { + auction_id: Uint128; + coin_denom: string; + end_time: Expiration; + high_bidder_addr: string; + high_bidder_amount: Uint128; + is_cancelled: boolean; + min_bid?: Uint128 | null; + min_raise?: Uint128 | null; + owner: string; + recipient?: Recipient | null; + start_time: Expiration; + uses_cw20: boolean; + whitelist?: Addr[] | null; +} +export interface AuthorizedAddressesResponse { + addresses: string[]; +} +export interface BidsResponse { + bids: Bid[]; +} +export interface Bid { + amount: Uint128; + bidder: string; + timestamp: Milliseconds; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IsCancelledResponse { + is_cancelled: boolean; +} +export interface IsClaimedResponse { + is_claimed: boolean; +} +export interface IsClosedResponse { + is_closed: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AuctionContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.2-beta.1/AuctionContractTs.client.ts b/packages/adocodegen/src/auction/2.0.2-beta.1/AuctionContractTs.client.ts new file mode 100644 index 0000000..7af50ef --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.2-beta.1/AuctionContractTs.client.ts @@ -0,0 +1,665 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, Expiry, Milliseconds, Addr, ReplyOn, OwnershipMessage, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, AuctionIdsResponse, AuctionInfo, Expiration, Timestamp, Uint64, AuctionStateResponse, AuthorizedAddressesResponse, BidsResponse, Bid, BlockHeightResponse, IsCancelledResponse, IsClaimedResponse, IsClosedResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AuctionContractTs.types"; +export interface AuctionContractTsReadOnlyInterface { + contractAddress: string; + latestAuctionState: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + auctionState: ({ + auctionId + }: { + auctionId: Uint128; + }) => Promise; + auctionIds: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + auctionInfosForAddress: ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }) => Promise; + authorizedAddresses: ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: string; + }) => Promise; + bids: ({ + auctionId, + limit, + orderBy, + startAfter + }: { + auctionId: Uint128; + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }) => Promise; + isCancelled: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + isClosed: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + isClaimed: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class AuctionContractTsQueryClient implements AuctionContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.latestAuctionState = this.latestAuctionState.bind(this); + this.auctionState = this.auctionState.bind(this); + this.auctionIds = this.auctionIds.bind(this); + this.auctionInfosForAddress = this.auctionInfosForAddress.bind(this); + this.authorizedAddresses = this.authorizedAddresses.bind(this); + this.bids = this.bids.bind(this); + this.isCancelled = this.isCancelled.bind(this); + this.isClosed = this.isClosed.bind(this); + this.isClaimed = this.isClaimed.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + latestAuctionState = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_auction_state: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + auctionState = async ({ + auctionId + }: { + auctionId: Uint128; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_state: { + auction_id: auctionId + } + }); + }; + auctionIds = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_ids: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + auctionInfosForAddress = async ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_infos_for_address: { + limit, + start_after: startAfter, + token_address: tokenAddress + } + }); + }; + authorizedAddresses = async ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + authorized_addresses: { + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + bids = async ({ + auctionId, + limit, + orderBy, + startAfter + }: { + auctionId: Uint128; + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + bids: { + auction_id: auctionId, + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + isCancelled = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_cancelled: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + isClosed = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_closed: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + isClaimed = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_claimed: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface AuctionContractTsInterface { + contractAddress: string; + sender: string; + receiveNft: ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + placeBid: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAuction: ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: { + coinDenom: Asset; + endTime: Expiry; + minBid?: Uint128; + minRaise?: Uint128; + recipient?: Recipient; + startTime?: Expiry; + tokenAddress: string; + tokenId: string; + whitelist?: Addr[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + cancelAuction: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + authorizeTokenContract: ({ + addr, + expiration + }: { + addr: AndrAddr; + expiration?: Expiry; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deauthorizeTokenContract: ({ + addr + }: { + addr: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AuctionContractTsClient implements AuctionContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receiveNft = this.receiveNft.bind(this); + this.receive = this.receive.bind(this); + this.placeBid = this.placeBid.bind(this); + this.claim = this.claim.bind(this); + this.updateAuction = this.updateAuction.bind(this); + this.cancelAuction = this.cancelAuction.bind(this); + this.authorizeTokenContract = this.authorizeTokenContract.bind(this); + this.deauthorizeTokenContract = this.deauthorizeTokenContract.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receiveNft = async ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive_nft: { + msg, + sender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + placeBid = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + place_bid: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + claim = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + updateAuction = async ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: { + coinDenom: Asset; + endTime: Expiry; + minBid?: Uint128; + minRaise?: Uint128; + recipient?: Recipient; + startTime?: Expiry; + tokenAddress: string; + tokenId: string; + whitelist?: Addr[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_auction: { + coin_denom: coinDenom, + end_time: endTime, + min_bid: minBid, + min_raise: minRaise, + recipient, + start_time: startTime, + token_address: tokenAddress, + token_id: tokenId, + whitelist + } + }, fee, memo, _funds); + }; + cancelAuction = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_auction: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + authorizeTokenContract = async ({ + addr, + expiration + }: { + addr: AndrAddr; + expiration?: Expiry; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + authorize_token_contract: { + addr, + expiration + } + }, fee, memo, _funds); + }; + deauthorizeTokenContract = async ({ + addr + }: { + addr: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deauthorize_token_contract: { + addr + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.2-beta.1/AuctionContractTs.message-builder.ts b/packages/adocodegen/src/auction/2.0.2-beta.1/AuctionContractTs.message-builder.ts new file mode 100644 index 0000000..d2b8db9 --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.2-beta.1/AuctionContractTs.message-builder.ts @@ -0,0 +1,386 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, Expiry, Milliseconds, Addr, ReplyOn, OwnershipMessage, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, AuctionIdsResponse, AuctionInfo, Expiration, Timestamp, Uint64, AuctionStateResponse, AuthorizedAddressesResponse, BidsResponse, Bid, BlockHeightResponse, IsCancelledResponse, IsClaimedResponse, IsClosedResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AuctionContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AuctionContractTsExecuteMsgBuilder { + static receiveNft = ({ + msg, + sender, + tokenId + }: CamelCasedProperties["receive_nft"]>): ExecuteMsg => { + return { + receive_nft: ({ + msg, + sender, + token_id: tokenId + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static placeBid = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["place_bid"]>): ExecuteMsg => { + return { + place_bid: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static claim = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static updateAuction = ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: CamelCasedProperties["update_auction"]>): ExecuteMsg => { + return { + update_auction: ({ + coin_denom: coinDenom, + end_time: endTime, + min_bid: minBid, + min_raise: minRaise, + recipient, + start_time: startTime, + token_address: tokenAddress, + token_id: tokenId, + whitelist + } as const) + }; + }; + static cancelAuction = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["cancel_auction"]>): ExecuteMsg => { + return { + cancel_auction: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static authorizeTokenContract = ({ + addr, + expiration + }: CamelCasedProperties["authorize_token_contract"]>): ExecuteMsg => { + return { + authorize_token_contract: ({ + addr, + expiration + } as const) + }; + }; + static deauthorizeTokenContract = ({ + addr + }: CamelCasedProperties["deauthorize_token_contract"]>): ExecuteMsg => { + return { + deauthorize_token_contract: ({ + addr + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class AuctionContractTsQueryMsgBuilder { + static latestAuctionState = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["latest_auction_state"]>): QueryMsg => { + return { + latest_auction_state: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static auctionState = ({ + auctionId + }: CamelCasedProperties["auction_state"]>): QueryMsg => { + return { + auction_state: ({ + auction_id: auctionId + } as const) + }; + }; + static auctionIds = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["auction_ids"]>): QueryMsg => { + return { + auction_ids: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static auctionInfosForAddress = ({ + limit, + startAfter, + tokenAddress + }: CamelCasedProperties["auction_infos_for_address"]>): QueryMsg => { + return { + auction_infos_for_address: ({ + limit, + start_after: startAfter, + token_address: tokenAddress + } as const) + }; + }; + static authorizedAddresses = ({ + limit, + orderBy, + startAfter + }: CamelCasedProperties["authorized_addresses"]>): QueryMsg => { + return { + authorized_addresses: ({ + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static bids = ({ + auctionId, + limit, + orderBy, + startAfter + }: CamelCasedProperties["bids"]>): QueryMsg => { + return { + bids: ({ + auction_id: auctionId, + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static isCancelled = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_cancelled"]>): QueryMsg => { + return { + is_cancelled: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static isClosed = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_closed"]>): QueryMsg => { + return { + is_closed: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static isClaimed = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_claimed"]>): QueryMsg => { + return { + is_claimed: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.2-beta.1/AuctionContractTs.types.ts b/packages/adocodegen/src/auction/2.0.2-beta.1/AuctionContractTs.types.ts new file mode 100644 index 0000000..2134eb1 --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.2-beta.1/AuctionContractTs.types.ts @@ -0,0 +1,377 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + authorized_cw20_address?: AndrAddr | null; + authorized_token_addresses?: AndrAddr[] | null; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + receive_nft: Cw721ReceiveMsg; +} | { + receive: Cw20ReceiveMsg; +} | { + place_bid: { + token_address: string; + token_id: string; + }; +} | { + claim: { + token_address: string; + token_id: string; + }; +} | { + update_auction: { + coin_denom: Asset; + end_time: Expiry; + min_bid?: Uint128 | null; + min_raise?: Uint128 | null; + recipient?: Recipient | null; + start_time?: Expiry | null; + token_address: string; + token_id: string; + whitelist?: Addr[] | null; + }; +} | { + cancel_auction: { + token_address: string; + token_id: string; + }; +} | { + authorize_token_contract: { + addr: AndrAddr; + expiration?: Expiry | null; + }; +} | { + deauthorize_token_contract: { + addr: AndrAddr; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Uint128 = string; +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw721ReceiveMsg { + msg: Binary; + sender: string; + token_id: string; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + latest_auction_state: { + token_address: string; + token_id: string; + }; +} | { + auction_state: { + auction_id: Uint128; + }; +} | { + auction_ids: { + token_address: string; + token_id: string; + }; +} | { + auction_infos_for_address: { + limit?: number | null; + start_after?: string | null; + token_address: string; + }; +} | { + authorized_addresses: { + limit?: number | null; + order_by?: OrderBy | null; + start_after?: string | null; + }; +} | { + bids: { + auction_id: Uint128; + limit?: number | null; + order_by?: OrderBy | null; + start_after?: number | null; + }; +} | { + is_cancelled: { + token_address: string; + token_id: string; + }; +} | { + is_closed: { + token_address: string; + token_id: string; + }; +} | { + is_claimed: { + token_address: string; + token_id: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type OrderBy = "asc" | "desc"; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface AuctionIdsResponse { + auction_ids: Uint128[]; +} +export interface AuctionInfo { + auction_ids: Uint128[]; + token_address: string; + token_id: string; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface AuctionStateResponse { + auction_id: Uint128; + coin_denom: string; + end_time: Expiration; + high_bidder_addr: string; + high_bidder_amount: Uint128; + is_cancelled: boolean; + min_bid?: Uint128 | null; + min_raise?: Uint128 | null; + owner: string; + recipient?: Recipient | null; + start_time: Expiration; + uses_cw20: boolean; + whitelist?: Addr[] | null; +} +export interface AuthorizedAddressesResponse { + addresses: string[]; +} +export interface BidsResponse { + bids: Bid[]; +} +export interface Bid { + amount: Uint128; + bidder: string; + timestamp: Milliseconds; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IsCancelledResponse { + is_cancelled: boolean; +} +export interface IsClaimedResponse { + is_claimed: boolean; +} +export interface IsClosedResponse { + is_closed: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AuctionContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.2/AuctionContractTs.client.ts b/packages/adocodegen/src/auction/2.0.2/AuctionContractTs.client.ts new file mode 100644 index 0000000..7af50ef --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.2/AuctionContractTs.client.ts @@ -0,0 +1,665 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, Expiry, Milliseconds, Addr, ReplyOn, OwnershipMessage, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, AuctionIdsResponse, AuctionInfo, Expiration, Timestamp, Uint64, AuctionStateResponse, AuthorizedAddressesResponse, BidsResponse, Bid, BlockHeightResponse, IsCancelledResponse, IsClaimedResponse, IsClosedResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AuctionContractTs.types"; +export interface AuctionContractTsReadOnlyInterface { + contractAddress: string; + latestAuctionState: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + auctionState: ({ + auctionId + }: { + auctionId: Uint128; + }) => Promise; + auctionIds: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + auctionInfosForAddress: ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }) => Promise; + authorizedAddresses: ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: string; + }) => Promise; + bids: ({ + auctionId, + limit, + orderBy, + startAfter + }: { + auctionId: Uint128; + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }) => Promise; + isCancelled: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + isClosed: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + isClaimed: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class AuctionContractTsQueryClient implements AuctionContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.latestAuctionState = this.latestAuctionState.bind(this); + this.auctionState = this.auctionState.bind(this); + this.auctionIds = this.auctionIds.bind(this); + this.auctionInfosForAddress = this.auctionInfosForAddress.bind(this); + this.authorizedAddresses = this.authorizedAddresses.bind(this); + this.bids = this.bids.bind(this); + this.isCancelled = this.isCancelled.bind(this); + this.isClosed = this.isClosed.bind(this); + this.isClaimed = this.isClaimed.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + latestAuctionState = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_auction_state: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + auctionState = async ({ + auctionId + }: { + auctionId: Uint128; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_state: { + auction_id: auctionId + } + }); + }; + auctionIds = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_ids: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + auctionInfosForAddress = async ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + auction_infos_for_address: { + limit, + start_after: startAfter, + token_address: tokenAddress + } + }); + }; + authorizedAddresses = async ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + authorized_addresses: { + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + bids = async ({ + auctionId, + limit, + orderBy, + startAfter + }: { + auctionId: Uint128; + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + bids: { + auction_id: auctionId, + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + isCancelled = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_cancelled: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + isClosed = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_closed: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + isClaimed = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_claimed: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface AuctionContractTsInterface { + contractAddress: string; + sender: string; + receiveNft: ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + placeBid: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAuction: ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: { + coinDenom: Asset; + endTime: Expiry; + minBid?: Uint128; + minRaise?: Uint128; + recipient?: Recipient; + startTime?: Expiry; + tokenAddress: string; + tokenId: string; + whitelist?: Addr[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + cancelAuction: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + authorizeTokenContract: ({ + addr, + expiration + }: { + addr: AndrAddr; + expiration?: Expiry; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deauthorizeTokenContract: ({ + addr + }: { + addr: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class AuctionContractTsClient implements AuctionContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receiveNft = this.receiveNft.bind(this); + this.receive = this.receive.bind(this); + this.placeBid = this.placeBid.bind(this); + this.claim = this.claim.bind(this); + this.updateAuction = this.updateAuction.bind(this); + this.cancelAuction = this.cancelAuction.bind(this); + this.authorizeTokenContract = this.authorizeTokenContract.bind(this); + this.deauthorizeTokenContract = this.deauthorizeTokenContract.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receiveNft = async ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive_nft: { + msg, + sender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + placeBid = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + place_bid: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + claim = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + updateAuction = async ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: { + coinDenom: Asset; + endTime: Expiry; + minBid?: Uint128; + minRaise?: Uint128; + recipient?: Recipient; + startTime?: Expiry; + tokenAddress: string; + tokenId: string; + whitelist?: Addr[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_auction: { + coin_denom: coinDenom, + end_time: endTime, + min_bid: minBid, + min_raise: minRaise, + recipient, + start_time: startTime, + token_address: tokenAddress, + token_id: tokenId, + whitelist + } + }, fee, memo, _funds); + }; + cancelAuction = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_auction: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + authorizeTokenContract = async ({ + addr, + expiration + }: { + addr: AndrAddr; + expiration?: Expiry; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + authorize_token_contract: { + addr, + expiration + } + }, fee, memo, _funds); + }; + deauthorizeTokenContract = async ({ + addr + }: { + addr: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deauthorize_token_contract: { + addr + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.2/AuctionContractTs.message-builder.ts b/packages/adocodegen/src/auction/2.0.2/AuctionContractTs.message-builder.ts new file mode 100644 index 0000000..d2b8db9 --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.2/AuctionContractTs.message-builder.ts @@ -0,0 +1,386 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, Expiry, Milliseconds, Addr, ReplyOn, OwnershipMessage, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, AuctionIdsResponse, AuctionInfo, Expiration, Timestamp, Uint64, AuctionStateResponse, AuthorizedAddressesResponse, BidsResponse, Bid, BlockHeightResponse, IsCancelledResponse, IsClaimedResponse, IsClosedResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./AuctionContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class AuctionContractTsExecuteMsgBuilder { + static receiveNft = ({ + msg, + sender, + tokenId + }: CamelCasedProperties["receive_nft"]>): ExecuteMsg => { + return { + receive_nft: ({ + msg, + sender, + token_id: tokenId + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static placeBid = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["place_bid"]>): ExecuteMsg => { + return { + place_bid: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static claim = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static updateAuction = ({ + coinDenom, + endTime, + minBid, + minRaise, + recipient, + startTime, + tokenAddress, + tokenId, + whitelist + }: CamelCasedProperties["update_auction"]>): ExecuteMsg => { + return { + update_auction: ({ + coin_denom: coinDenom, + end_time: endTime, + min_bid: minBid, + min_raise: minRaise, + recipient, + start_time: startTime, + token_address: tokenAddress, + token_id: tokenId, + whitelist + } as const) + }; + }; + static cancelAuction = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["cancel_auction"]>): ExecuteMsg => { + return { + cancel_auction: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static authorizeTokenContract = ({ + addr, + expiration + }: CamelCasedProperties["authorize_token_contract"]>): ExecuteMsg => { + return { + authorize_token_contract: ({ + addr, + expiration + } as const) + }; + }; + static deauthorizeTokenContract = ({ + addr + }: CamelCasedProperties["deauthorize_token_contract"]>): ExecuteMsg => { + return { + deauthorize_token_contract: ({ + addr + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class AuctionContractTsQueryMsgBuilder { + static latestAuctionState = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["latest_auction_state"]>): QueryMsg => { + return { + latest_auction_state: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static auctionState = ({ + auctionId + }: CamelCasedProperties["auction_state"]>): QueryMsg => { + return { + auction_state: ({ + auction_id: auctionId + } as const) + }; + }; + static auctionIds = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["auction_ids"]>): QueryMsg => { + return { + auction_ids: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static auctionInfosForAddress = ({ + limit, + startAfter, + tokenAddress + }: CamelCasedProperties["auction_infos_for_address"]>): QueryMsg => { + return { + auction_infos_for_address: ({ + limit, + start_after: startAfter, + token_address: tokenAddress + } as const) + }; + }; + static authorizedAddresses = ({ + limit, + orderBy, + startAfter + }: CamelCasedProperties["authorized_addresses"]>): QueryMsg => { + return { + authorized_addresses: ({ + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static bids = ({ + auctionId, + limit, + orderBy, + startAfter + }: CamelCasedProperties["bids"]>): QueryMsg => { + return { + bids: ({ + auction_id: auctionId, + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static isCancelled = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_cancelled"]>): QueryMsg => { + return { + is_cancelled: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static isClosed = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_closed"]>): QueryMsg => { + return { + is_closed: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static isClaimed = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["is_claimed"]>): QueryMsg => { + return { + is_claimed: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/auction/2.0.2/AuctionContractTs.types.ts b/packages/adocodegen/src/auction/2.0.2/AuctionContractTs.types.ts new file mode 100644 index 0000000..2134eb1 --- /dev/null +++ b/packages/adocodegen/src/auction/2.0.2/AuctionContractTs.types.ts @@ -0,0 +1,377 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + authorized_cw20_address?: AndrAddr | null; + authorized_token_addresses?: AndrAddr[] | null; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + receive_nft: Cw721ReceiveMsg; +} | { + receive: Cw20ReceiveMsg; +} | { + place_bid: { + token_address: string; + token_id: string; + }; +} | { + claim: { + token_address: string; + token_id: string; + }; +} | { + update_auction: { + coin_denom: Asset; + end_time: Expiry; + min_bid?: Uint128 | null; + min_raise?: Uint128 | null; + recipient?: Recipient | null; + start_time?: Expiry | null; + token_address: string; + token_id: string; + whitelist?: Addr[] | null; + }; +} | { + cancel_auction: { + token_address: string; + token_id: string; + }; +} | { + authorize_token_contract: { + addr: AndrAddr; + expiration?: Expiry | null; + }; +} | { + deauthorize_token_contract: { + addr: AndrAddr; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Uint128 = string; +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw721ReceiveMsg { + msg: Binary; + sender: string; + token_id: string; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + latest_auction_state: { + token_address: string; + token_id: string; + }; +} | { + auction_state: { + auction_id: Uint128; + }; +} | { + auction_ids: { + token_address: string; + token_id: string; + }; +} | { + auction_infos_for_address: { + limit?: number | null; + start_after?: string | null; + token_address: string; + }; +} | { + authorized_addresses: { + limit?: number | null; + order_by?: OrderBy | null; + start_after?: string | null; + }; +} | { + bids: { + auction_id: Uint128; + limit?: number | null; + order_by?: OrderBy | null; + start_after?: number | null; + }; +} | { + is_cancelled: { + token_address: string; + token_id: string; + }; +} | { + is_closed: { + token_address: string; + token_id: string; + }; +} | { + is_claimed: { + token_address: string; + token_id: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type OrderBy = "asc" | "desc"; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface AuctionIdsResponse { + auction_ids: Uint128[]; +} +export interface AuctionInfo { + auction_ids: Uint128[]; + token_address: string; + token_id: string; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface AuctionStateResponse { + auction_id: Uint128; + coin_denom: string; + end_time: Expiration; + high_bidder_addr: string; + high_bidder_amount: Uint128; + is_cancelled: boolean; + min_bid?: Uint128 | null; + min_raise?: Uint128 | null; + owner: string; + recipient?: Recipient | null; + start_time: Expiration; + uses_cw20: boolean; + whitelist?: Addr[] | null; +} +export interface AuthorizedAddressesResponse { + addresses: string[]; +} +export interface BidsResponse { + bids: Bid[]; +} +export interface Bid { + amount: Uint128; + bidder: string; + timestamp: Milliseconds; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IsCancelledResponse { + is_cancelled: boolean; +} +export interface IsClaimedResponse { + is_claimed: boolean; +} +export interface IsClosedResponse { + is_closed: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type AuctionContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/boolean/2.0.1-beta.1/BooleanContractTs.client.ts b/packages/adocodegen/src/boolean/2.0.1-beta.1/BooleanContractTs.client.ts new file mode 100644 index 0000000..2f820a6 --- /dev/null +++ b/packages/adocodegen/src/boolean/2.0.1-beta.1/BooleanContractTs.client.ts @@ -0,0 +1,291 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { BooleanRestriction, InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDataOwnerResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./BooleanContractTs.types"; +export interface BooleanContractTsReadOnlyInterface { + contractAddress: string; + getValue: () => Promise; + getDataOwner: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class BooleanContractTsQueryClient implements BooleanContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getValue = this.getValue.bind(this); + this.getDataOwner = this.getDataOwner.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getValue = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_value: {} + }); + }; + getDataOwner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_data_owner: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface BooleanContractTsInterface { + contractAddress: string; + sender: string; + setValue: ({ + value + }: { + value: boolean; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deleteValue: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: BooleanRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class BooleanContractTsClient implements BooleanContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setValue = this.setValue.bind(this); + this.deleteValue = this.deleteValue.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setValue = async ({ + value + }: { + value: boolean; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_value: { + value + } + }, fee, memo, _funds); + }; + deleteValue = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delete_value: {} + }, fee, memo, _funds); + }; + updateRestriction = async ({ + restriction + }: { + restriction: BooleanRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/boolean/2.0.1-beta.1/BooleanContractTs.message-builder.ts b/packages/adocodegen/src/boolean/2.0.1-beta.1/BooleanContractTs.message-builder.ts new file mode 100644 index 0000000..d9b0f38 --- /dev/null +++ b/packages/adocodegen/src/boolean/2.0.1-beta.1/BooleanContractTs.message-builder.ts @@ -0,0 +1,180 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { BooleanRestriction, InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDataOwnerResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./BooleanContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class BooleanContractTsExecuteMsgBuilder { + static setValue = ({ + value + }: CamelCasedProperties["set_value"]>): ExecuteMsg => { + return { + set_value: ({ + value + } as const) + }; + }; + static deleteValue = (): ExecuteMsg => { + return { + delete_value: ({} as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class BooleanContractTsQueryMsgBuilder { + static getValue = (): QueryMsg => { + return { + get_value: ({} as const) + }; + }; + static getDataOwner = (): QueryMsg => { + return { + get_data_owner: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/boolean/2.0.1-beta.1/BooleanContractTs.types.ts b/packages/adocodegen/src/boolean/2.0.1-beta.1/BooleanContractTs.types.ts new file mode 100644 index 0000000..ba7d29e --- /dev/null +++ b/packages/adocodegen/src/boolean/2.0.1-beta.1/BooleanContractTs.types.ts @@ -0,0 +1,241 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type BooleanRestriction = "private" | "public" | "restricted"; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + restriction: BooleanRestriction; +} +export type ExecuteMsg = { + set_value: { + value: boolean; + }; +} | { + delete_value: {}; +} | { + update_restriction: { + restriction: BooleanRestriction; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_value: {}; +} | { + get_data_owner: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetDataOwnerResponse { + owner: AndrAddr; +} +export interface GetValueResponse { + value: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type BooleanContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/boolean/2.0.1/BooleanContractTs.client.ts b/packages/adocodegen/src/boolean/2.0.1/BooleanContractTs.client.ts new file mode 100644 index 0000000..2f820a6 --- /dev/null +++ b/packages/adocodegen/src/boolean/2.0.1/BooleanContractTs.client.ts @@ -0,0 +1,291 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { BooleanRestriction, InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDataOwnerResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./BooleanContractTs.types"; +export interface BooleanContractTsReadOnlyInterface { + contractAddress: string; + getValue: () => Promise; + getDataOwner: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class BooleanContractTsQueryClient implements BooleanContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getValue = this.getValue.bind(this); + this.getDataOwner = this.getDataOwner.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getValue = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_value: {} + }); + }; + getDataOwner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_data_owner: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface BooleanContractTsInterface { + contractAddress: string; + sender: string; + setValue: ({ + value + }: { + value: boolean; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deleteValue: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: BooleanRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class BooleanContractTsClient implements BooleanContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setValue = this.setValue.bind(this); + this.deleteValue = this.deleteValue.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setValue = async ({ + value + }: { + value: boolean; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_value: { + value + } + }, fee, memo, _funds); + }; + deleteValue = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delete_value: {} + }, fee, memo, _funds); + }; + updateRestriction = async ({ + restriction + }: { + restriction: BooleanRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/boolean/2.0.1/BooleanContractTs.message-builder.ts b/packages/adocodegen/src/boolean/2.0.1/BooleanContractTs.message-builder.ts new file mode 100644 index 0000000..d9b0f38 --- /dev/null +++ b/packages/adocodegen/src/boolean/2.0.1/BooleanContractTs.message-builder.ts @@ -0,0 +1,180 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { BooleanRestriction, InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDataOwnerResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./BooleanContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class BooleanContractTsExecuteMsgBuilder { + static setValue = ({ + value + }: CamelCasedProperties["set_value"]>): ExecuteMsg => { + return { + set_value: ({ + value + } as const) + }; + }; + static deleteValue = (): ExecuteMsg => { + return { + delete_value: ({} as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class BooleanContractTsQueryMsgBuilder { + static getValue = (): QueryMsg => { + return { + get_value: ({} as const) + }; + }; + static getDataOwner = (): QueryMsg => { + return { + get_data_owner: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/boolean/2.0.1/BooleanContractTs.types.ts b/packages/adocodegen/src/boolean/2.0.1/BooleanContractTs.types.ts new file mode 100644 index 0000000..ba7d29e --- /dev/null +++ b/packages/adocodegen/src/boolean/2.0.1/BooleanContractTs.types.ts @@ -0,0 +1,241 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type BooleanRestriction = "private" | "public" | "restricted"; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + restriction: BooleanRestriction; +} +export type ExecuteMsg = { + set_value: { + value: boolean; + }; +} | { + delete_value: {}; +} | { + update_restriction: { + restriction: BooleanRestriction; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_value: {}; +} | { + get_data_owner: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetDataOwnerResponse { + owner: AndrAddr; +} +export interface GetValueResponse { + value: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type BooleanContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/conditional-splitter/1.2.1-beta.1/ConditionalSplitterContractTs.client.ts b/packages/adocodegen/src/conditional-splitter/1.2.1-beta.1/ConditionalSplitterContractTs.client.ts new file mode 100644 index 0000000..65186aa --- /dev/null +++ b/packages/adocodegen/src/conditional-splitter/1.2.1-beta.1/ConditionalSplitterContractTs.client.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, Uint128, InstantiateMsg, Threshold, AddressPercent, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetConditionalSplitterConfigResponse, ConditionalSplitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./ConditionalSplitterContractTs.types"; +export interface ConditionalSplitterContractTsReadOnlyInterface { + contractAddress: string; + getConditionalSplitterConfig: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class ConditionalSplitterContractTsQueryClient implements ConditionalSplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getConditionalSplitterConfig = this.getConditionalSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getConditionalSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_conditional_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface ConditionalSplitterContractTsInterface { + contractAddress: string; + sender: string; + updateThresholds: ({ + thresholds + }: { + thresholds: Threshold[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class ConditionalSplitterContractTsClient implements ConditionalSplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateThresholds = this.updateThresholds.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateThresholds = async ({ + thresholds + }: { + thresholds: Threshold[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_thresholds: { + thresholds + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/conditional-splitter/1.2.1-beta.1/ConditionalSplitterContractTs.message-builder.ts b/packages/adocodegen/src/conditional-splitter/1.2.1-beta.1/ConditionalSplitterContractTs.message-builder.ts new file mode 100644 index 0000000..4ff8c27 --- /dev/null +++ b/packages/adocodegen/src/conditional-splitter/1.2.1-beta.1/ConditionalSplitterContractTs.message-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, Uint128, InstantiateMsg, Threshold, AddressPercent, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetConditionalSplitterConfigResponse, ConditionalSplitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./ConditionalSplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class ConditionalSplitterContractTsExecuteMsgBuilder { + static updateThresholds = ({ + thresholds + }: CamelCasedProperties["update_thresholds"]>): ExecuteMsg => { + return { + update_thresholds: ({ + thresholds + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class ConditionalSplitterContractTsQueryMsgBuilder { + static getConditionalSplitterConfig = (): QueryMsg => { + return { + get_conditional_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/conditional-splitter/1.2.1-beta.1/ConditionalSplitterContractTs.types.ts b/packages/adocodegen/src/conditional-splitter/1.2.1-beta.1/ConditionalSplitterContractTs.types.ts new file mode 100644 index 0000000..6f6f6bb --- /dev/null +++ b/packages/adocodegen/src/conditional-splitter/1.2.1-beta.1/ConditionalSplitterContractTs.types.ts @@ -0,0 +1,206 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export type Uint128 = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: Expiry | null; + owner?: string | null; + thresholds: Threshold[]; +} +export interface Threshold { + address_percent: AddressPercent[]; + min: Uint128; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_thresholds: { + thresholds: Threshold[]; + }; +} | { + update_lock: { + lock_time: Milliseconds; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_conditional_splitter_config: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetConditionalSplitterConfigResponse { + config: ConditionalSplitter; +} +export interface ConditionalSplitter { + lock_time: Milliseconds; + thresholds: Threshold[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type ConditionalSplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/conditional-splitter/1.2.1/ConditionalSplitterContractTs.client.ts b/packages/adocodegen/src/conditional-splitter/1.2.1/ConditionalSplitterContractTs.client.ts new file mode 100644 index 0000000..65186aa --- /dev/null +++ b/packages/adocodegen/src/conditional-splitter/1.2.1/ConditionalSplitterContractTs.client.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, Uint128, InstantiateMsg, Threshold, AddressPercent, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetConditionalSplitterConfigResponse, ConditionalSplitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./ConditionalSplitterContractTs.types"; +export interface ConditionalSplitterContractTsReadOnlyInterface { + contractAddress: string; + getConditionalSplitterConfig: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class ConditionalSplitterContractTsQueryClient implements ConditionalSplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getConditionalSplitterConfig = this.getConditionalSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getConditionalSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_conditional_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface ConditionalSplitterContractTsInterface { + contractAddress: string; + sender: string; + updateThresholds: ({ + thresholds + }: { + thresholds: Threshold[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class ConditionalSplitterContractTsClient implements ConditionalSplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateThresholds = this.updateThresholds.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateThresholds = async ({ + thresholds + }: { + thresholds: Threshold[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_thresholds: { + thresholds + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/conditional-splitter/1.2.1/ConditionalSplitterContractTs.message-builder.ts b/packages/adocodegen/src/conditional-splitter/1.2.1/ConditionalSplitterContractTs.message-builder.ts new file mode 100644 index 0000000..4ff8c27 --- /dev/null +++ b/packages/adocodegen/src/conditional-splitter/1.2.1/ConditionalSplitterContractTs.message-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, Uint128, InstantiateMsg, Threshold, AddressPercent, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetConditionalSplitterConfigResponse, ConditionalSplitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./ConditionalSplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class ConditionalSplitterContractTsExecuteMsgBuilder { + static updateThresholds = ({ + thresholds + }: CamelCasedProperties["update_thresholds"]>): ExecuteMsg => { + return { + update_thresholds: ({ + thresholds + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class ConditionalSplitterContractTsQueryMsgBuilder { + static getConditionalSplitterConfig = (): QueryMsg => { + return { + get_conditional_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/conditional-splitter/1.2.1/ConditionalSplitterContractTs.types.ts b/packages/adocodegen/src/conditional-splitter/1.2.1/ConditionalSplitterContractTs.types.ts new file mode 100644 index 0000000..6f6f6bb --- /dev/null +++ b/packages/adocodegen/src/conditional-splitter/1.2.1/ConditionalSplitterContractTs.types.ts @@ -0,0 +1,206 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export type Uint128 = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: Expiry | null; + owner?: string | null; + thresholds: Threshold[]; +} +export interface Threshold { + address_percent: AddressPercent[]; + min: Uint128; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_thresholds: { + thresholds: Threshold[]; + }; +} | { + update_lock: { + lock_time: Milliseconds; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_conditional_splitter_config: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetConditionalSplitterConfigResponse { + config: ConditionalSplitter; +} +export interface ConditionalSplitter { + lock_time: Milliseconds; + thresholds: Threshold[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type ConditionalSplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/counter/1.0.1-beta.1/CounterContractTs.client.ts b/packages/adocodegen/src/counter/1.0.1-beta.1/CounterContractTs.client.ts new file mode 100644 index 0000000..34303d7 --- /dev/null +++ b/packages/adocodegen/src/counter/1.0.1-beta.1/CounterContractTs.client.ts @@ -0,0 +1,343 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { CounterRestriction, InstantiateMsg, State, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetCurrentAmountResponse, GetDecreaseAmountResponse, GetIncreaseAmountResponse, GetInitialAmountResponse, GetRestrictionResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./CounterContractTs.types"; +export interface CounterContractTsReadOnlyInterface { + contractAddress: string; + getInitialAmount: () => Promise; + getCurrentAmount: () => Promise; + getIncreaseAmount: () => Promise; + getDecreaseAmount: () => Promise; + getRestriction: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class CounterContractTsQueryClient implements CounterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getInitialAmount = this.getInitialAmount.bind(this); + this.getCurrentAmount = this.getCurrentAmount.bind(this); + this.getIncreaseAmount = this.getIncreaseAmount.bind(this); + this.getDecreaseAmount = this.getDecreaseAmount.bind(this); + this.getRestriction = this.getRestriction.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getInitialAmount = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_initial_amount: {} + }); + }; + getCurrentAmount = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_current_amount: {} + }); + }; + getIncreaseAmount = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_increase_amount: {} + }); + }; + getDecreaseAmount = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_decrease_amount: {} + }); + }; + getRestriction = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_restriction: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface CounterContractTsInterface { + contractAddress: string; + sender: string; + increment: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + decrement: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + reset: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: CounterRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setIncreaseAmount: ({ + increaseAmount + }: { + increaseAmount: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setDecreaseAmount: ({ + decreaseAmount + }: { + decreaseAmount: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class CounterContractTsClient implements CounterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.increment = this.increment.bind(this); + this.decrement = this.decrement.bind(this); + this.reset = this.reset.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.setIncreaseAmount = this.setIncreaseAmount.bind(this); + this.setDecreaseAmount = this.setDecreaseAmount.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + increment = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + increment: {} + }, fee, memo, _funds); + }; + decrement = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + decrement: {} + }, fee, memo, _funds); + }; + 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); + }; + updateRestriction = async ({ + restriction + }: { + restriction: CounterRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + setIncreaseAmount = async ({ + increaseAmount + }: { + increaseAmount: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_increase_amount: { + increase_amount: increaseAmount + } + }, fee, memo, _funds); + }; + setDecreaseAmount = async ({ + decreaseAmount + }: { + decreaseAmount: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_decrease_amount: { + decrease_amount: decreaseAmount + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/counter/1.0.1-beta.1/CounterContractTs.message-builder.ts b/packages/adocodegen/src/counter/1.0.1-beta.1/CounterContractTs.message-builder.ts new file mode 100644 index 0000000..c4b0365 --- /dev/null +++ b/packages/adocodegen/src/counter/1.0.1-beta.1/CounterContractTs.message-builder.ts @@ -0,0 +1,216 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CounterRestriction, InstantiateMsg, State, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetCurrentAmountResponse, GetDecreaseAmountResponse, GetIncreaseAmountResponse, GetInitialAmountResponse, GetRestrictionResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./CounterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CounterContractTsExecuteMsgBuilder { + static increment = (): ExecuteMsg => { + return { + increment: ({} as const) + }; + }; + static decrement = (): ExecuteMsg => { + return { + decrement: ({} as const) + }; + }; + static reset = (): ExecuteMsg => { + return { + reset: ({} as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static setIncreaseAmount = ({ + increaseAmount + }: CamelCasedProperties["set_increase_amount"]>): ExecuteMsg => { + return { + set_increase_amount: ({ + increase_amount: increaseAmount + } as const) + }; + }; + static setDecreaseAmount = ({ + decreaseAmount + }: CamelCasedProperties["set_decrease_amount"]>): ExecuteMsg => { + return { + set_decrease_amount: ({ + decrease_amount: decreaseAmount + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class CounterContractTsQueryMsgBuilder { + static getInitialAmount = (): QueryMsg => { + return { + get_initial_amount: ({} as const) + }; + }; + static getCurrentAmount = (): QueryMsg => { + return { + get_current_amount: ({} as const) + }; + }; + static getIncreaseAmount = (): QueryMsg => { + return { + get_increase_amount: ({} as const) + }; + }; + static getDecreaseAmount = (): QueryMsg => { + return { + get_decrease_amount: ({} as const) + }; + }; + static getRestriction = (): QueryMsg => { + return { + get_restriction: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/counter/1.0.1-beta.1/CounterContractTs.types.ts b/packages/adocodegen/src/counter/1.0.1-beta.1/CounterContractTs.types.ts new file mode 100644 index 0000000..be8f79a --- /dev/null +++ b/packages/adocodegen/src/counter/1.0.1-beta.1/CounterContractTs.types.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type CounterRestriction = "private" | "public"; +export interface InstantiateMsg { + initial_state: State; + kernel_address: string; + owner?: string | null; + restriction: CounterRestriction; +} +export interface State { + decrease_amount?: number | null; + increase_amount?: number | null; + initial_amount?: number | null; +} +export type ExecuteMsg = { + increment: {}; +} | { + decrement: {}; +} | { + reset: {}; +} | { + update_restriction: { + restriction: CounterRestriction; + }; +} | { + set_increase_amount: { + increase_amount: number; + }; +} | { + set_decrease_amount: { + decrease_amount: number; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_initial_amount: {}; +} | { + get_current_amount: {}; +} | { + get_increase_amount: {}; +} | { + get_decrease_amount: {}; +} | { + get_restriction: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetCurrentAmountResponse { + current_amount: number; +} +export interface GetDecreaseAmountResponse { + decrease_amount: number; +} +export interface GetIncreaseAmountResponse { + increase_amount: number; +} +export interface GetInitialAmountResponse { + initial_amount: number; +} +export interface GetRestrictionResponse { + restriction: CounterRestriction; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type CounterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/counter/1.0.1/CounterContractTs.client.ts b/packages/adocodegen/src/counter/1.0.1/CounterContractTs.client.ts new file mode 100644 index 0000000..34303d7 --- /dev/null +++ b/packages/adocodegen/src/counter/1.0.1/CounterContractTs.client.ts @@ -0,0 +1,343 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { CounterRestriction, InstantiateMsg, State, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetCurrentAmountResponse, GetDecreaseAmountResponse, GetIncreaseAmountResponse, GetInitialAmountResponse, GetRestrictionResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./CounterContractTs.types"; +export interface CounterContractTsReadOnlyInterface { + contractAddress: string; + getInitialAmount: () => Promise; + getCurrentAmount: () => Promise; + getIncreaseAmount: () => Promise; + getDecreaseAmount: () => Promise; + getRestriction: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class CounterContractTsQueryClient implements CounterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getInitialAmount = this.getInitialAmount.bind(this); + this.getCurrentAmount = this.getCurrentAmount.bind(this); + this.getIncreaseAmount = this.getIncreaseAmount.bind(this); + this.getDecreaseAmount = this.getDecreaseAmount.bind(this); + this.getRestriction = this.getRestriction.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getInitialAmount = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_initial_amount: {} + }); + }; + getCurrentAmount = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_current_amount: {} + }); + }; + getIncreaseAmount = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_increase_amount: {} + }); + }; + getDecreaseAmount = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_decrease_amount: {} + }); + }; + getRestriction = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_restriction: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface CounterContractTsInterface { + contractAddress: string; + sender: string; + increment: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + decrement: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + reset: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: CounterRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setIncreaseAmount: ({ + increaseAmount + }: { + increaseAmount: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setDecreaseAmount: ({ + decreaseAmount + }: { + decreaseAmount: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class CounterContractTsClient implements CounterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.increment = this.increment.bind(this); + this.decrement = this.decrement.bind(this); + this.reset = this.reset.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.setIncreaseAmount = this.setIncreaseAmount.bind(this); + this.setDecreaseAmount = this.setDecreaseAmount.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + increment = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + increment: {} + }, fee, memo, _funds); + }; + decrement = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + decrement: {} + }, fee, memo, _funds); + }; + 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); + }; + updateRestriction = async ({ + restriction + }: { + restriction: CounterRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + setIncreaseAmount = async ({ + increaseAmount + }: { + increaseAmount: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_increase_amount: { + increase_amount: increaseAmount + } + }, fee, memo, _funds); + }; + setDecreaseAmount = async ({ + decreaseAmount + }: { + decreaseAmount: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_decrease_amount: { + decrease_amount: decreaseAmount + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/counter/1.0.1/CounterContractTs.message-builder.ts b/packages/adocodegen/src/counter/1.0.1/CounterContractTs.message-builder.ts new file mode 100644 index 0000000..c4b0365 --- /dev/null +++ b/packages/adocodegen/src/counter/1.0.1/CounterContractTs.message-builder.ts @@ -0,0 +1,216 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CounterRestriction, InstantiateMsg, State, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetCurrentAmountResponse, GetDecreaseAmountResponse, GetIncreaseAmountResponse, GetInitialAmountResponse, GetRestrictionResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./CounterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CounterContractTsExecuteMsgBuilder { + static increment = (): ExecuteMsg => { + return { + increment: ({} as const) + }; + }; + static decrement = (): ExecuteMsg => { + return { + decrement: ({} as const) + }; + }; + static reset = (): ExecuteMsg => { + return { + reset: ({} as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static setIncreaseAmount = ({ + increaseAmount + }: CamelCasedProperties["set_increase_amount"]>): ExecuteMsg => { + return { + set_increase_amount: ({ + increase_amount: increaseAmount + } as const) + }; + }; + static setDecreaseAmount = ({ + decreaseAmount + }: CamelCasedProperties["set_decrease_amount"]>): ExecuteMsg => { + return { + set_decrease_amount: ({ + decrease_amount: decreaseAmount + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class CounterContractTsQueryMsgBuilder { + static getInitialAmount = (): QueryMsg => { + return { + get_initial_amount: ({} as const) + }; + }; + static getCurrentAmount = (): QueryMsg => { + return { + get_current_amount: ({} as const) + }; + }; + static getIncreaseAmount = (): QueryMsg => { + return { + get_increase_amount: ({} as const) + }; + }; + static getDecreaseAmount = (): QueryMsg => { + return { + get_decrease_amount: ({} as const) + }; + }; + static getRestriction = (): QueryMsg => { + return { + get_restriction: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/counter/1.0.1/CounterContractTs.types.ts b/packages/adocodegen/src/counter/1.0.1/CounterContractTs.types.ts new file mode 100644 index 0000000..be8f79a --- /dev/null +++ b/packages/adocodegen/src/counter/1.0.1/CounterContractTs.types.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type CounterRestriction = "private" | "public"; +export interface InstantiateMsg { + initial_state: State; + kernel_address: string; + owner?: string | null; + restriction: CounterRestriction; +} +export interface State { + decrease_amount?: number | null; + increase_amount?: number | null; + initial_amount?: number | null; +} +export type ExecuteMsg = { + increment: {}; +} | { + decrement: {}; +} | { + reset: {}; +} | { + update_restriction: { + restriction: CounterRestriction; + }; +} | { + set_increase_amount: { + increase_amount: number; + }; +} | { + set_decrease_amount: { + decrease_amount: number; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_initial_amount: {}; +} | { + get_current_amount: {}; +} | { + get_increase_amount: {}; +} | { + get_decrease_amount: {}; +} | { + get_restriction: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetCurrentAmountResponse { + current_amount: number; +} +export interface GetDecreaseAmountResponse { + decrease_amount: number; +} +export interface GetIncreaseAmountResponse { + increase_amount: number; +} +export interface GetInitialAmountResponse { + initial_amount: number; +} +export interface GetRestrictionResponse { + restriction: CounterRestriction; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type CounterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cross-chain-swap/0.2.0/CrossChainSwapContractTs.client.ts b/packages/adocodegen/src/cross-chain-swap/0.2.0/CrossChainSwapContractTs.client.ts new file mode 100644 index 0000000..3bdff8f --- /dev/null +++ b/packages/adocodegen/src/cross-chain-swap/0.2.0/CrossChainSwapContractTs.client.ts @@ -0,0 +1,332 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./CrossChainSwapContractTs.types"; +export interface CrossChainSwapContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class CrossChainSwapContractTsQueryClient implements CrossChainSwapContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface CrossChainSwapContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class CrossChainSwapContractTsClient implements CrossChainSwapContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cross-chain-swap/0.2.0/CrossChainSwapContractTs.message-builder.ts b/packages/adocodegen/src/cross-chain-swap/0.2.0/CrossChainSwapContractTs.message-builder.ts new file mode 100644 index 0000000..9cc08a1 --- /dev/null +++ b/packages/adocodegen/src/cross-chain-swap/0.2.0/CrossChainSwapContractTs.message-builder.ts @@ -0,0 +1,200 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./CrossChainSwapContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CrossChainSwapContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class CrossChainSwapContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cross-chain-swap/0.2.0/CrossChainSwapContractTs.types.ts b/packages/adocodegen/src/cross-chain-swap/0.2.0/CrossChainSwapContractTs.types.ts new file mode 100644 index 0000000..fb37cc4 --- /dev/null +++ b/packages/adocodegen/src/cross-chain-swap/0.2.0/CrossChainSwapContractTs.types.ts @@ -0,0 +1,201 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressPercent[]; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type CrossChainSwapContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cross-chain-swap/0.2.16/CrossChainSwapContractTs.client.ts b/packages/adocodegen/src/cross-chain-swap/0.2.16/CrossChainSwapContractTs.client.ts new file mode 100644 index 0000000..522415b --- /dev/null +++ b/packages/adocodegen/src/cross-chain-swap/0.2.16/CrossChainSwapContractTs.client.ts @@ -0,0 +1,273 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./CrossChainSwapContractTs.types"; +export interface CrossChainSwapContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class CrossChainSwapContractTsQueryClient implements CrossChainSwapContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface CrossChainSwapContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class CrossChainSwapContractTsClient implements CrossChainSwapContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cross-chain-swap/0.2.16/CrossChainSwapContractTs.message-builder.ts b/packages/adocodegen/src/cross-chain-swap/0.2.16/CrossChainSwapContractTs.message-builder.ts new file mode 100644 index 0000000..646a7b9 --- /dev/null +++ b/packages/adocodegen/src/cross-chain-swap/0.2.16/CrossChainSwapContractTs.message-builder.ts @@ -0,0 +1,166 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./CrossChainSwapContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CrossChainSwapContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class CrossChainSwapContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cross-chain-swap/0.2.16/CrossChainSwapContractTs.types.ts b/packages/adocodegen/src/cross-chain-swap/0.2.16/CrossChainSwapContractTs.types.ts new file mode 100644 index 0000000..6b6ae23 --- /dev/null +++ b/packages/adocodegen/src/cross-chain-swap/0.2.16/CrossChainSwapContractTs.types.ts @@ -0,0 +1,208 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressPercent[]; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type CrossChainSwapContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cross-chain-swap/1.1.1-beta.1/CrossChainSwapContractTs.client.ts b/packages/adocodegen/src/cross-chain-swap/1.1.1-beta.1/CrossChainSwapContractTs.client.ts new file mode 100644 index 0000000..de51664 --- /dev/null +++ b/packages/adocodegen/src/cross-chain-swap/1.1.1-beta.1/CrossChainSwapContractTs.client.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./CrossChainSwapContractTs.types"; +export interface CrossChainSwapContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class CrossChainSwapContractTsQueryClient implements CrossChainSwapContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface CrossChainSwapContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class CrossChainSwapContractTsClient implements CrossChainSwapContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cross-chain-swap/1.1.1-beta.1/CrossChainSwapContractTs.message-builder.ts b/packages/adocodegen/src/cross-chain-swap/1.1.1-beta.1/CrossChainSwapContractTs.message-builder.ts new file mode 100644 index 0000000..f9fb113 --- /dev/null +++ b/packages/adocodegen/src/cross-chain-swap/1.1.1-beta.1/CrossChainSwapContractTs.message-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./CrossChainSwapContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CrossChainSwapContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class CrossChainSwapContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cross-chain-swap/1.1.1-beta.1/CrossChainSwapContractTs.types.ts b/packages/adocodegen/src/cross-chain-swap/1.1.1-beta.1/CrossChainSwapContractTs.types.ts new file mode 100644 index 0000000..48648e2 --- /dev/null +++ b/packages/adocodegen/src/cross-chain-swap/1.1.1-beta.1/CrossChainSwapContractTs.types.ts @@ -0,0 +1,202 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: Expiry | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: Milliseconds; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Milliseconds; + recipients: AddressPercent[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type CrossChainSwapContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/0.2.1/CrowdfundContractTs.client.ts b/packages/adocodegen/src/crowdfund/0.2.1/CrowdfundContractTs.client.ts new file mode 100644 index 0000000..4f6c3a2 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/0.2.1/CrowdfundContractTs.client.ts @@ -0,0 +1,536 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Expiration, Timestamp, Uint64, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, Permission, CrowdfundMintMsg, TokenExtension, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, ArrayOfString, BalanceResponse, BlockHeightResponse, Config, IsOperatorResponse, Boolean, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, State, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; +export interface CrowdfundContractTsReadOnlyInterface { + contractAddress: string; + state: () => Promise; + config: () => Promise; + availableTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + isTokenAvailable: ({ + id + }: { + id: string; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class CrowdfundContractTsQueryClient implements CrowdfundContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.state = this.state.bind(this); + this.config = this.config.bind(this); + this.availableTokens = this.availableTokens.bind(this); + this.isTokenAvailable = this.isTokenAvailable.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + availableTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + available_tokens: { + limit, + start_after: startAfter + } + }); + }; + isTokenAvailable = async ({ + id + }: { + id: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_token_available: { + id + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface CrowdfundContractTsInterface { + contractAddress: string; + sender: string; + mint: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + startSale: ({ + expiration, + maxAmountPerWallet, + minTokensSold, + price, + recipient + }: { + expiration: Expiration; + maxAmountPerWallet?: number; + minTokensSold: Uint128; + price: Coin; + recipient: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateTokenContract: ({ + address + }: { + address: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchase: ({ + numberOfTokens + }: { + numberOfTokens?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchaseByTokenId: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRefund: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + endSale: ({ + limit + }: { + limit?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class CrowdfundContractTsClient implements CrowdfundContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.startSale = this.startSale.bind(this); + this.updateTokenContract = this.updateTokenContract.bind(this); + this.purchase = this.purchase.bind(this); + this.purchaseByTokenId = this.purchaseByTokenId.bind(this); + this.claimRefund = this.claimRefund.bind(this); + this.endSale = this.endSale.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + 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); + }; + startSale = async ({ + expiration, + maxAmountPerWallet, + minTokensSold, + price, + recipient + }: { + expiration: Expiration; + maxAmountPerWallet?: number; + minTokensSold: Uint128; + price: Coin; + recipient: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + start_sale: { + expiration, + max_amount_per_wallet: maxAmountPerWallet, + min_tokens_sold: minTokensSold, + price, + recipient + } + }, fee, memo, _funds); + }; + updateTokenContract = async ({ + address + }: { + address: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_token_contract: { + address + } + }, fee, memo, _funds); + }; + purchase = async ({ + numberOfTokens + }: { + numberOfTokens?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase: { + number_of_tokens: numberOfTokens + } + }, fee, memo, _funds); + }; + purchaseByTokenId = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase_by_token_id: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + claimRefund = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_refund: {} + }, fee, memo, _funds); + }; + endSale = async ({ + limit + }: { + limit?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + end_sale: { + limit + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/0.2.1/CrowdfundContractTs.message-builder.ts b/packages/adocodegen/src/crowdfund/0.2.1/CrowdfundContractTs.message-builder.ts new file mode 100644 index 0000000..94bc0c8 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/0.2.1/CrowdfundContractTs.message-builder.ts @@ -0,0 +1,326 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Expiration, Timestamp, Uint64, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, Permission, CrowdfundMintMsg, TokenExtension, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, ArrayOfString, BalanceResponse, BlockHeightResponse, Config, IsOperatorResponse, Boolean, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, State, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CrowdfundContractTsExecuteMsgBuilder { + static mint = (items: CrowdfundMintMsg[]): ExecuteMsg => { + return { + mint: items + }; + }; + static startSale = ({ + expiration, + maxAmountPerWallet, + minTokensSold, + price, + recipient + }: CamelCasedProperties["start_sale"]>): ExecuteMsg => { + return { + start_sale: ({ + expiration, + max_amount_per_wallet: maxAmountPerWallet, + min_tokens_sold: minTokensSold, + price, + recipient + } as const) + }; + }; + static updateTokenContract = ({ + address + }: CamelCasedProperties["update_token_contract"]>): ExecuteMsg => { + return { + update_token_contract: ({ + address + } as const) + }; + }; + static purchase = ({ + numberOfTokens + }: CamelCasedProperties["purchase"]>): ExecuteMsg => { + return { + purchase: ({ + number_of_tokens: numberOfTokens + } as const) + }; + }; + static purchaseByTokenId = ({ + tokenId + }: CamelCasedProperties["purchase_by_token_id"]>): ExecuteMsg => { + return { + purchase_by_token_id: ({ + token_id: tokenId + } as const) + }; + }; + static claimRefund = (): ExecuteMsg => { + return { + claim_refund: ({} as const) + }; + }; + static endSale = ({ + limit + }: CamelCasedProperties["end_sale"]>): ExecuteMsg => { + return { + end_sale: ({ + limit + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class CrowdfundContractTsQueryMsgBuilder { + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static availableTokens = ({ + limit, + startAfter + }: CamelCasedProperties["available_tokens"]>): QueryMsg => { + return { + available_tokens: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static isTokenAvailable = ({ + id + }: CamelCasedProperties["is_token_available"]>): QueryMsg => { + return { + is_token_available: ({ + id + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/0.2.1/CrowdfundContractTs.types.ts b/packages/adocodegen/src/crowdfund/0.2.1/CrowdfundContractTs.types.ts new file mode 100644 index 0000000..5c79fa9 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/0.2.1/CrowdfundContractTs.types.ts @@ -0,0 +1,267 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + can_mint_after_sale: boolean; + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; + token_address: AndrAddr; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + mint: CrowdfundMintMsg[]; +} | { + start_sale: { + expiration: Expiration; + max_amount_per_wallet?: number | null; + min_tokens_sold: Uint128; + price: Coin; + recipient: Recipient; + }; +} | { + update_token_contract: { + address: AndrAddr; + }; +} | { + purchase: { + number_of_tokens?: number | null; + }; +} | { + purchase_by_token_id: { + token_id: string; + }; +} | { + claim_refund: {}; +} | { + end_sale: { + limit?: number | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface CrowdfundMintMsg { + extension: TokenExtension; + owner?: string | null; + token_id: string; + token_uri?: string | null; +} +export interface TokenExtension { + publisher: string; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + state: {}; +} | { + config: {}; +} | { + available_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + is_token_available: { + id: string; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export type ArrayOfString = string[]; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + can_mint_after_sale: boolean; + token_address: AndrAddr; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export type Boolean = boolean; +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface State { + amount_sold: Uint128; + amount_to_send: Uint128; + amount_transferred: Uint128; + expiration: Expiration; + max_amount_per_wallet: number; + min_tokens_sold: Uint128; + price: Coin; + recipient: Recipient; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type CrowdfundContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/0.2.16/CrowdfundContractTs.client.ts b/packages/adocodegen/src/crowdfund/0.2.16/CrowdfundContractTs.client.ts new file mode 100644 index 0000000..55d9a84 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/0.2.16/CrowdfundContractTs.client.ts @@ -0,0 +1,477 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Expiration, Timestamp, Uint64, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, CrowdfundMintMsg, TokenExtension, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, ArrayOfString, BalanceResponse, BlockHeightResponse, Config, IsOperatorResponse, Boolean, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, State, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; +export interface CrowdfundContractTsReadOnlyInterface { + contractAddress: string; + state: () => Promise; + config: () => Promise; + availableTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + isTokenAvailable: ({ + id + }: { + id: string; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class CrowdfundContractTsQueryClient implements CrowdfundContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.state = this.state.bind(this); + this.config = this.config.bind(this); + this.availableTokens = this.availableTokens.bind(this); + this.isTokenAvailable = this.isTokenAvailable.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + availableTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + available_tokens: { + limit, + start_after: startAfter + } + }); + }; + isTokenAvailable = async ({ + id + }: { + id: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_token_available: { + id + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface CrowdfundContractTsInterface { + contractAddress: string; + sender: string; + mint: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + startSale: ({ + expiration, + maxAmountPerWallet, + minTokensSold, + price, + recipient + }: { + expiration: Expiration; + maxAmountPerWallet?: number; + minTokensSold: Uint128; + price: Coin; + recipient: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateTokenContract: ({ + address + }: { + address: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchase: ({ + numberOfTokens + }: { + numberOfTokens?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchaseByTokenId: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRefund: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + endSale: ({ + limit + }: { + limit?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class CrowdfundContractTsClient implements CrowdfundContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.startSale = this.startSale.bind(this); + this.updateTokenContract = this.updateTokenContract.bind(this); + this.purchase = this.purchase.bind(this); + this.purchaseByTokenId = this.purchaseByTokenId.bind(this); + this.claimRefund = this.claimRefund.bind(this); + this.endSale = this.endSale.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + 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); + }; + startSale = async ({ + expiration, + maxAmountPerWallet, + minTokensSold, + price, + recipient + }: { + expiration: Expiration; + maxAmountPerWallet?: number; + minTokensSold: Uint128; + price: Coin; + recipient: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + start_sale: { + expiration, + max_amount_per_wallet: maxAmountPerWallet, + min_tokens_sold: minTokensSold, + price, + recipient + } + }, fee, memo, _funds); + }; + updateTokenContract = async ({ + address + }: { + address: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_token_contract: { + address + } + }, fee, memo, _funds); + }; + purchase = async ({ + numberOfTokens + }: { + numberOfTokens?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase: { + number_of_tokens: numberOfTokens + } + }, fee, memo, _funds); + }; + purchaseByTokenId = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase_by_token_id: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + claimRefund = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_refund: {} + }, fee, memo, _funds); + }; + endSale = async ({ + limit + }: { + limit?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + end_sale: { + limit + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/0.2.16/CrowdfundContractTs.message-builder.ts b/packages/adocodegen/src/crowdfund/0.2.16/CrowdfundContractTs.message-builder.ts new file mode 100644 index 0000000..8a1ef50 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/0.2.16/CrowdfundContractTs.message-builder.ts @@ -0,0 +1,292 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Expiration, Timestamp, Uint64, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, CrowdfundMintMsg, TokenExtension, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, ArrayOfString, BalanceResponse, BlockHeightResponse, Config, IsOperatorResponse, Boolean, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, State, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CrowdfundContractTsExecuteMsgBuilder { + static mint = (items: CrowdfundMintMsg[]): ExecuteMsg => { + return { + mint: items + }; + }; + static startSale = ({ + expiration, + maxAmountPerWallet, + minTokensSold, + price, + recipient + }: CamelCasedProperties["start_sale"]>): ExecuteMsg => { + return { + start_sale: ({ + expiration, + max_amount_per_wallet: maxAmountPerWallet, + min_tokens_sold: minTokensSold, + price, + recipient + } as const) + }; + }; + static updateTokenContract = ({ + address + }: CamelCasedProperties["update_token_contract"]>): ExecuteMsg => { + return { + update_token_contract: ({ + address + } as const) + }; + }; + static purchase = ({ + numberOfTokens + }: CamelCasedProperties["purchase"]>): ExecuteMsg => { + return { + purchase: ({ + number_of_tokens: numberOfTokens + } as const) + }; + }; + static purchaseByTokenId = ({ + tokenId + }: CamelCasedProperties["purchase_by_token_id"]>): ExecuteMsg => { + return { + purchase_by_token_id: ({ + token_id: tokenId + } as const) + }; + }; + static claimRefund = (): ExecuteMsg => { + return { + claim_refund: ({} as const) + }; + }; + static endSale = ({ + limit + }: CamelCasedProperties["end_sale"]>): ExecuteMsg => { + return { + end_sale: ({ + limit + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class CrowdfundContractTsQueryMsgBuilder { + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static availableTokens = ({ + limit, + startAfter + }: CamelCasedProperties["available_tokens"]>): QueryMsg => { + return { + available_tokens: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static isTokenAvailable = ({ + id + }: CamelCasedProperties["is_token_available"]>): QueryMsg => { + return { + is_token_available: ({ + id + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/0.2.16/CrowdfundContractTs.types.ts b/packages/adocodegen/src/crowdfund/0.2.16/CrowdfundContractTs.types.ts new file mode 100644 index 0000000..ed22f62 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/0.2.16/CrowdfundContractTs.types.ts @@ -0,0 +1,274 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + can_mint_after_sale: boolean; + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; + token_address: AndrAddr; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + mint: CrowdfundMintMsg[]; +} | { + start_sale: { + expiration: Expiration; + max_amount_per_wallet?: number | null; + min_tokens_sold: Uint128; + price: Coin; + recipient: Recipient; + }; +} | { + update_token_contract: { + address: AndrAddr; + }; +} | { + purchase: { + number_of_tokens?: number | null; + }; +} | { + purchase_by_token_id: { + token_id: string; + }; +} | { + claim_refund: {}; +} | { + end_sale: { + limit?: number | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface CrowdfundMintMsg { + extension: TokenExtension; + owner?: string | null; + token_id: string; + token_uri?: string | null; +} +export interface TokenExtension { + publisher: string; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + state: {}; +} | { + config: {}; +} | { + available_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + is_token_available: { + id: string; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export type ArrayOfString = string[]; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + can_mint_after_sale: boolean; + token_address: AndrAddr; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export type Boolean = boolean; +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface State { + amount_sold: Uint128; + amount_to_send: Uint128; + amount_transferred: Uint128; + expiration: Expiration; + max_amount_per_wallet: number; + min_tokens_sold: Uint128; + price: Coin; + recipient: Recipient; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type CrowdfundContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/1.0.0/CrowdfundContractTs.message-builder.ts b/packages/adocodegen/src/crowdfund/1.0.0/CrowdfundContractTs.message-builder.ts index f2ddee7..c11a34e 100644 --- a/packages/adocodegen/src/crowdfund/1.0.0/CrowdfundContractTs.message-builder.ts +++ b/packages/adocodegen/src/crowdfund/1.0.0/CrowdfundContractTs.message-builder.ts @@ -7,9 +7,9 @@ import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Milliseconds, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, Uint64, CrowdfundMintMsg, TokenExtension, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, AppContractResponse, ArrayOfString, BlockHeightResponse, Config, Boolean, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, Expiration, Timestamp, State, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; import { CamelCasedProperties } from "type-fest"; export abstract class CrowdfundContractTsExecuteMsgBuilder { - static mint = (msgs: CrowdfundMintMsg[]): ExecuteMsg => { + static mint = (msg: CrowdfundMintMsg[]): ExecuteMsg => { return { - mint: msgs + mint: msg }; }; static startSale = ({ diff --git a/packages/adocodegen/src/crowdfund/2.0.0/CrowdfundContractTs.client.ts b/packages/adocodegen/src/crowdfund/2.0.0/CrowdfundContractTs.client.ts new file mode 100644 index 0000000..aedc649 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/2.0.0/CrowdfundContractTs.client.ts @@ -0,0 +1,445 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Asset, AndrAddr, Uint128, Binary, Uint64, InstantiateMsg, CampaignConfig, Recipient, Tier, TierMetaData, TokenExtension, ExecuteMsg, Milliseconds, Addr, ReplyOn, OwnershipMessage, Expiry, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, PresaleTierOrder, SimpleTierOrder, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, CampaignSummaryResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TierOrdersResponse, TiersResponse, TierResponseItem, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; +export interface CrowdfundContractTsReadOnlyInterface { + contractAddress: string; + campaignSummary: () => Promise; + tierOrders: ({ + limit, + orderBy, + orderer, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + orderer: string; + startAfter?: number; + }) => Promise; + tiers: ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class CrowdfundContractTsQueryClient implements CrowdfundContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.campaignSummary = this.campaignSummary.bind(this); + this.tierOrders = this.tierOrders.bind(this); + this.tiers = this.tiers.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + campaignSummary = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + campaign_summary: {} + }); + }; + tierOrders = async ({ + limit, + orderBy, + orderer, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + orderer: string; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tier_orders: { + limit, + order_by: orderBy, + orderer, + start_after: startAfter + } + }); + }; + tiers = async ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tiers: { + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface CrowdfundContractTsInterface { + contractAddress: string; + sender: string; + addTier: ({ + tier + }: { + tier: Tier; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateTier: ({ + tier + }: { + tier: Tier; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeTier: ({ + level + }: { + level: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + startCampaign: ({ + endTime, + presale, + startTime + }: { + endTime: Milliseconds; + presale?: PresaleTierOrder[]; + startTime?: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchaseTiers: ({ + orders + }: { + orders: SimpleTierOrder[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + endCampaign: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + discardCampaign: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class CrowdfundContractTsClient implements CrowdfundContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addTier = this.addTier.bind(this); + this.updateTier = this.updateTier.bind(this); + this.removeTier = this.removeTier.bind(this); + this.startCampaign = this.startCampaign.bind(this); + this.purchaseTiers = this.purchaseTiers.bind(this); + this.receive = this.receive.bind(this); + this.endCampaign = this.endCampaign.bind(this); + this.claim = this.claim.bind(this); + this.discardCampaign = this.discardCampaign.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + addTier = async ({ + tier + }: { + tier: Tier; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_tier: { + tier + } + }, fee, memo, _funds); + }; + updateTier = async ({ + tier + }: { + tier: Tier; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_tier: { + tier + } + }, fee, memo, _funds); + }; + removeTier = async ({ + level + }: { + level: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_tier: { + level + } + }, fee, memo, _funds); + }; + startCampaign = async ({ + endTime, + presale, + startTime + }: { + endTime: Milliseconds; + presale?: PresaleTierOrder[]; + startTime?: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + start_campaign: { + end_time: endTime, + presale, + start_time: startTime + } + }, fee, memo, _funds); + }; + purchaseTiers = async ({ + orders + }: { + orders: SimpleTierOrder[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase_tiers: { + orders + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + endCampaign = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + end_campaign: {} + }, fee, memo, _funds); + }; + claim = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: {} + }, fee, memo, _funds); + }; + discardCampaign = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + discard_campaign: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/2.0.0/CrowdfundContractTs.message-builder.ts b/packages/adocodegen/src/crowdfund/2.0.0/CrowdfundContractTs.message-builder.ts new file mode 100644 index 0000000..06bcb0e --- /dev/null +++ b/packages/adocodegen/src/crowdfund/2.0.0/CrowdfundContractTs.message-builder.ts @@ -0,0 +1,269 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Asset, AndrAddr, Uint128, Binary, Uint64, InstantiateMsg, CampaignConfig, Recipient, Tier, TierMetaData, TokenExtension, ExecuteMsg, Milliseconds, Addr, ReplyOn, OwnershipMessage, Expiry, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, PresaleTierOrder, SimpleTierOrder, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, CampaignSummaryResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TierOrdersResponse, TiersResponse, TierResponseItem, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CrowdfundContractTsExecuteMsgBuilder { + static addTier = ({ + tier + }: CamelCasedProperties["add_tier"]>): ExecuteMsg => { + return { + add_tier: ({ + tier + } as const) + }; + }; + static updateTier = ({ + tier + }: CamelCasedProperties["update_tier"]>): ExecuteMsg => { + return { + update_tier: ({ + tier + } as const) + }; + }; + static removeTier = ({ + level + }: CamelCasedProperties["remove_tier"]>): ExecuteMsg => { + return { + remove_tier: ({ + level + } as const) + }; + }; + static startCampaign = ({ + endTime, + presale, + startTime + }: CamelCasedProperties["start_campaign"]>): ExecuteMsg => { + return { + start_campaign: ({ + end_time: endTime, + presale, + start_time: startTime + } as const) + }; + }; + static purchaseTiers = ({ + orders + }: CamelCasedProperties["purchase_tiers"]>): ExecuteMsg => { + return { + purchase_tiers: ({ + orders + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static endCampaign = (): ExecuteMsg => { + return { + end_campaign: ({} as const) + }; + }; + static claim = (): ExecuteMsg => { + return { + claim: ({} as const) + }; + }; + static discardCampaign = (): ExecuteMsg => { + return { + discard_campaign: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class CrowdfundContractTsQueryMsgBuilder { + static campaignSummary = (): QueryMsg => { + return { + campaign_summary: ({} as const) + }; + }; + static tierOrders = ({ + limit, + orderBy, + orderer, + startAfter + }: CamelCasedProperties["tier_orders"]>): QueryMsg => { + return { + tier_orders: ({ + limit, + order_by: orderBy, + orderer, + start_after: startAfter + } as const) + }; + }; + static tiers = ({ + limit, + orderBy, + startAfter + }: CamelCasedProperties["tiers"]>): QueryMsg => { + return { + tiers: ({ + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/2.0.0/CrowdfundContractTs.types.ts b/packages/adocodegen/src/crowdfund/2.0.0/CrowdfundContractTs.types.ts new file mode 100644 index 0000000..85ee714 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/2.0.0/CrowdfundContractTs.types.ts @@ -0,0 +1,337 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type AndrAddr = string; +export type Uint128 = string; +export type Binary = string; +export type Uint64 = string; +export interface InstantiateMsg { + campaign_config: CampaignConfig; + kernel_address: string; + owner?: string | null; + tiers: Tier[]; +} +export interface CampaignConfig { + banner: string; + denom: Asset; + description: string; + hard_cap?: Uint128 | null; + soft_cap?: Uint128 | null; + title: string; + token_address: AndrAddr; + url: string; + withdrawal_recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface Tier { + label: string; + level: Uint64; + limit?: Uint128 | null; + metadata: TierMetaData; + price: Uint128; +} +export interface TierMetaData { + extension: TokenExtension; + token_uri?: string | null; +} +export interface TokenExtension { + publisher: string; +} +export type ExecuteMsg = { + add_tier: { + tier: Tier; + }; +} | { + update_tier: { + tier: Tier; + }; +} | { + remove_tier: { + level: Uint64; + }; +} | { + start_campaign: { + end_time: Milliseconds; + presale?: PresaleTierOrder[] | null; + start_time?: Milliseconds | null; + }; +} | { + purchase_tiers: { + orders: SimpleTierOrder[]; + }; +} | { + receive: Cw20ReceiveMsg; +} | { + end_campaign: {}; +} | { + claim: {}; +} | { + discard_campaign: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Milliseconds = number; +export type Addr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface PresaleTierOrder { + amount: Uint128; + level: Uint64; + orderer: Addr; +} +export interface SimpleTierOrder { + amount: Uint128; + level: Uint64; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + campaign_summary: {}; +} | { + tier_orders: { + limit?: number | null; + order_by?: OrderBy | null; + orderer: string; + start_after?: number | null; + }; +} | { + tiers: { + limit?: number | null; + order_by?: OrderBy | null; + start_after?: number | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type OrderBy = "asc" | "desc"; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface CampaignSummaryResponse { + banner: string; + current_capital: number; + current_stage: string; + denom: Asset; + description: string; + end_time: Milliseconds; + hard_cap?: Uint128 | null; + soft_cap?: Uint128 | null; + start_time?: Milliseconds | null; + title: string; + token_address: AndrAddr; + url: string; + withdrawal_recipient: Recipient; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TierOrdersResponse { + orders: SimpleTierOrder[]; +} +export interface TiersResponse { + tiers: TierResponseItem[]; +} +export interface TierResponseItem { + sold_amount: Uint128; + tier: Tier; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type CrowdfundContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/2.0.2-beta.1/CrowdfundContractTs.client.ts b/packages/adocodegen/src/crowdfund/2.0.2-beta.1/CrowdfundContractTs.client.ts new file mode 100644 index 0000000..aedc649 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/2.0.2-beta.1/CrowdfundContractTs.client.ts @@ -0,0 +1,445 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Asset, AndrAddr, Uint128, Binary, Uint64, InstantiateMsg, CampaignConfig, Recipient, Tier, TierMetaData, TokenExtension, ExecuteMsg, Milliseconds, Addr, ReplyOn, OwnershipMessage, Expiry, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, PresaleTierOrder, SimpleTierOrder, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, CampaignSummaryResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TierOrdersResponse, TiersResponse, TierResponseItem, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; +export interface CrowdfundContractTsReadOnlyInterface { + contractAddress: string; + campaignSummary: () => Promise; + tierOrders: ({ + limit, + orderBy, + orderer, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + orderer: string; + startAfter?: number; + }) => Promise; + tiers: ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class CrowdfundContractTsQueryClient implements CrowdfundContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.campaignSummary = this.campaignSummary.bind(this); + this.tierOrders = this.tierOrders.bind(this); + this.tiers = this.tiers.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + campaignSummary = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + campaign_summary: {} + }); + }; + tierOrders = async ({ + limit, + orderBy, + orderer, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + orderer: string; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tier_orders: { + limit, + order_by: orderBy, + orderer, + start_after: startAfter + } + }); + }; + tiers = async ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tiers: { + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface CrowdfundContractTsInterface { + contractAddress: string; + sender: string; + addTier: ({ + tier + }: { + tier: Tier; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateTier: ({ + tier + }: { + tier: Tier; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeTier: ({ + level + }: { + level: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + startCampaign: ({ + endTime, + presale, + startTime + }: { + endTime: Milliseconds; + presale?: PresaleTierOrder[]; + startTime?: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchaseTiers: ({ + orders + }: { + orders: SimpleTierOrder[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + endCampaign: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + discardCampaign: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class CrowdfundContractTsClient implements CrowdfundContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addTier = this.addTier.bind(this); + this.updateTier = this.updateTier.bind(this); + this.removeTier = this.removeTier.bind(this); + this.startCampaign = this.startCampaign.bind(this); + this.purchaseTiers = this.purchaseTiers.bind(this); + this.receive = this.receive.bind(this); + this.endCampaign = this.endCampaign.bind(this); + this.claim = this.claim.bind(this); + this.discardCampaign = this.discardCampaign.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + addTier = async ({ + tier + }: { + tier: Tier; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_tier: { + tier + } + }, fee, memo, _funds); + }; + updateTier = async ({ + tier + }: { + tier: Tier; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_tier: { + tier + } + }, fee, memo, _funds); + }; + removeTier = async ({ + level + }: { + level: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_tier: { + level + } + }, fee, memo, _funds); + }; + startCampaign = async ({ + endTime, + presale, + startTime + }: { + endTime: Milliseconds; + presale?: PresaleTierOrder[]; + startTime?: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + start_campaign: { + end_time: endTime, + presale, + start_time: startTime + } + }, fee, memo, _funds); + }; + purchaseTiers = async ({ + orders + }: { + orders: SimpleTierOrder[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase_tiers: { + orders + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + endCampaign = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + end_campaign: {} + }, fee, memo, _funds); + }; + claim = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: {} + }, fee, memo, _funds); + }; + discardCampaign = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + discard_campaign: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/2.0.2-beta.1/CrowdfundContractTs.message-builder.ts b/packages/adocodegen/src/crowdfund/2.0.2-beta.1/CrowdfundContractTs.message-builder.ts new file mode 100644 index 0000000..06bcb0e --- /dev/null +++ b/packages/adocodegen/src/crowdfund/2.0.2-beta.1/CrowdfundContractTs.message-builder.ts @@ -0,0 +1,269 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Asset, AndrAddr, Uint128, Binary, Uint64, InstantiateMsg, CampaignConfig, Recipient, Tier, TierMetaData, TokenExtension, ExecuteMsg, Milliseconds, Addr, ReplyOn, OwnershipMessage, Expiry, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, PresaleTierOrder, SimpleTierOrder, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, CampaignSummaryResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TierOrdersResponse, TiersResponse, TierResponseItem, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CrowdfundContractTsExecuteMsgBuilder { + static addTier = ({ + tier + }: CamelCasedProperties["add_tier"]>): ExecuteMsg => { + return { + add_tier: ({ + tier + } as const) + }; + }; + static updateTier = ({ + tier + }: CamelCasedProperties["update_tier"]>): ExecuteMsg => { + return { + update_tier: ({ + tier + } as const) + }; + }; + static removeTier = ({ + level + }: CamelCasedProperties["remove_tier"]>): ExecuteMsg => { + return { + remove_tier: ({ + level + } as const) + }; + }; + static startCampaign = ({ + endTime, + presale, + startTime + }: CamelCasedProperties["start_campaign"]>): ExecuteMsg => { + return { + start_campaign: ({ + end_time: endTime, + presale, + start_time: startTime + } as const) + }; + }; + static purchaseTiers = ({ + orders + }: CamelCasedProperties["purchase_tiers"]>): ExecuteMsg => { + return { + purchase_tiers: ({ + orders + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static endCampaign = (): ExecuteMsg => { + return { + end_campaign: ({} as const) + }; + }; + static claim = (): ExecuteMsg => { + return { + claim: ({} as const) + }; + }; + static discardCampaign = (): ExecuteMsg => { + return { + discard_campaign: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class CrowdfundContractTsQueryMsgBuilder { + static campaignSummary = (): QueryMsg => { + return { + campaign_summary: ({} as const) + }; + }; + static tierOrders = ({ + limit, + orderBy, + orderer, + startAfter + }: CamelCasedProperties["tier_orders"]>): QueryMsg => { + return { + tier_orders: ({ + limit, + order_by: orderBy, + orderer, + start_after: startAfter + } as const) + }; + }; + static tiers = ({ + limit, + orderBy, + startAfter + }: CamelCasedProperties["tiers"]>): QueryMsg => { + return { + tiers: ({ + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/2.0.2-beta.1/CrowdfundContractTs.types.ts b/packages/adocodegen/src/crowdfund/2.0.2-beta.1/CrowdfundContractTs.types.ts new file mode 100644 index 0000000..483ce41 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/2.0.2-beta.1/CrowdfundContractTs.types.ts @@ -0,0 +1,337 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type AndrAddr = string; +export type Uint128 = string; +export type Binary = string; +export type Uint64 = string; +export interface InstantiateMsg { + campaign_config: CampaignConfig; + kernel_address: string; + owner?: string | null; + tiers: Tier[]; +} +export interface CampaignConfig { + banner?: string | null; + denom: Asset; + description?: string | null; + hard_cap?: Uint128 | null; + soft_cap?: Uint128 | null; + title?: string | null; + token_address: AndrAddr; + url?: string | null; + withdrawal_recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface Tier { + label: string; + level: Uint64; + limit?: Uint128 | null; + metadata: TierMetaData; + price: Uint128; +} +export interface TierMetaData { + extension: TokenExtension; + token_uri?: string | null; +} +export interface TokenExtension { + publisher: string; +} +export type ExecuteMsg = { + add_tier: { + tier: Tier; + }; +} | { + update_tier: { + tier: Tier; + }; +} | { + remove_tier: { + level: Uint64; + }; +} | { + start_campaign: { + end_time: Milliseconds; + presale?: PresaleTierOrder[] | null; + start_time?: Milliseconds | null; + }; +} | { + purchase_tiers: { + orders: SimpleTierOrder[]; + }; +} | { + receive: Cw20ReceiveMsg; +} | { + end_campaign: {}; +} | { + claim: {}; +} | { + discard_campaign: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Milliseconds = number; +export type Addr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface PresaleTierOrder { + amount: Uint128; + level: Uint64; + orderer: Addr; +} +export interface SimpleTierOrder { + amount: Uint128; + level: Uint64; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + campaign_summary: {}; +} | { + tier_orders: { + limit?: number | null; + order_by?: OrderBy | null; + orderer: string; + start_after?: number | null; + }; +} | { + tiers: { + limit?: number | null; + order_by?: OrderBy | null; + start_after?: number | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type OrderBy = "asc" | "desc"; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface CampaignSummaryResponse { + banner?: string | null; + current_capital: number; + current_stage: string; + denom: Asset; + description?: string | null; + end_time: Milliseconds; + hard_cap?: Uint128 | null; + soft_cap?: Uint128 | null; + start_time?: Milliseconds | null; + title?: string | null; + token_address: AndrAddr; + url?: string | null; + withdrawal_recipient: Recipient; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TierOrdersResponse { + orders: SimpleTierOrder[]; +} +export interface TiersResponse { + tiers: TierResponseItem[]; +} +export interface TierResponseItem { + sold_amount: Uint128; + tier: Tier; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type CrowdfundContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/2.0.2/CrowdfundContractTs.client.ts b/packages/adocodegen/src/crowdfund/2.0.2/CrowdfundContractTs.client.ts new file mode 100644 index 0000000..aedc649 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/2.0.2/CrowdfundContractTs.client.ts @@ -0,0 +1,445 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Asset, AndrAddr, Uint128, Binary, Uint64, InstantiateMsg, CampaignConfig, Recipient, Tier, TierMetaData, TokenExtension, ExecuteMsg, Milliseconds, Addr, ReplyOn, OwnershipMessage, Expiry, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, PresaleTierOrder, SimpleTierOrder, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, CampaignSummaryResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TierOrdersResponse, TiersResponse, TierResponseItem, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; +export interface CrowdfundContractTsReadOnlyInterface { + contractAddress: string; + campaignSummary: () => Promise; + tierOrders: ({ + limit, + orderBy, + orderer, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + orderer: string; + startAfter?: number; + }) => Promise; + tiers: ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class CrowdfundContractTsQueryClient implements CrowdfundContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.campaignSummary = this.campaignSummary.bind(this); + this.tierOrders = this.tierOrders.bind(this); + this.tiers = this.tiers.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + campaignSummary = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + campaign_summary: {} + }); + }; + tierOrders = async ({ + limit, + orderBy, + orderer, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + orderer: string; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tier_orders: { + limit, + order_by: orderBy, + orderer, + start_after: startAfter + } + }); + }; + tiers = async ({ + limit, + orderBy, + startAfter + }: { + limit?: number; + orderBy?: OrderBy; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tiers: { + limit, + order_by: orderBy, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface CrowdfundContractTsInterface { + contractAddress: string; + sender: string; + addTier: ({ + tier + }: { + tier: Tier; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateTier: ({ + tier + }: { + tier: Tier; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeTier: ({ + level + }: { + level: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + startCampaign: ({ + endTime, + presale, + startTime + }: { + endTime: Milliseconds; + presale?: PresaleTierOrder[]; + startTime?: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchaseTiers: ({ + orders + }: { + orders: SimpleTierOrder[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + endCampaign: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + discardCampaign: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class CrowdfundContractTsClient implements CrowdfundContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addTier = this.addTier.bind(this); + this.updateTier = this.updateTier.bind(this); + this.removeTier = this.removeTier.bind(this); + this.startCampaign = this.startCampaign.bind(this); + this.purchaseTiers = this.purchaseTiers.bind(this); + this.receive = this.receive.bind(this); + this.endCampaign = this.endCampaign.bind(this); + this.claim = this.claim.bind(this); + this.discardCampaign = this.discardCampaign.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + addTier = async ({ + tier + }: { + tier: Tier; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_tier: { + tier + } + }, fee, memo, _funds); + }; + updateTier = async ({ + tier + }: { + tier: Tier; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_tier: { + tier + } + }, fee, memo, _funds); + }; + removeTier = async ({ + level + }: { + level: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_tier: { + level + } + }, fee, memo, _funds); + }; + startCampaign = async ({ + endTime, + presale, + startTime + }: { + endTime: Milliseconds; + presale?: PresaleTierOrder[]; + startTime?: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + start_campaign: { + end_time: endTime, + presale, + start_time: startTime + } + }, fee, memo, _funds); + }; + purchaseTiers = async ({ + orders + }: { + orders: SimpleTierOrder[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase_tiers: { + orders + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + endCampaign = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + end_campaign: {} + }, fee, memo, _funds); + }; + claim = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: {} + }, fee, memo, _funds); + }; + discardCampaign = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + discard_campaign: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/2.0.2/CrowdfundContractTs.message-builder.ts b/packages/adocodegen/src/crowdfund/2.0.2/CrowdfundContractTs.message-builder.ts new file mode 100644 index 0000000..06bcb0e --- /dev/null +++ b/packages/adocodegen/src/crowdfund/2.0.2/CrowdfundContractTs.message-builder.ts @@ -0,0 +1,269 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Asset, AndrAddr, Uint128, Binary, Uint64, InstantiateMsg, CampaignConfig, Recipient, Tier, TierMetaData, TokenExtension, ExecuteMsg, Milliseconds, Addr, ReplyOn, OwnershipMessage, Expiry, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, PresaleTierOrder, SimpleTierOrder, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, OrderBy, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, CampaignSummaryResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TierOrdersResponse, TiersResponse, TierResponseItem, TypeResponse, VersionResponse } from "./CrowdfundContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class CrowdfundContractTsExecuteMsgBuilder { + static addTier = ({ + tier + }: CamelCasedProperties["add_tier"]>): ExecuteMsg => { + return { + add_tier: ({ + tier + } as const) + }; + }; + static updateTier = ({ + tier + }: CamelCasedProperties["update_tier"]>): ExecuteMsg => { + return { + update_tier: ({ + tier + } as const) + }; + }; + static removeTier = ({ + level + }: CamelCasedProperties["remove_tier"]>): ExecuteMsg => { + return { + remove_tier: ({ + level + } as const) + }; + }; + static startCampaign = ({ + endTime, + presale, + startTime + }: CamelCasedProperties["start_campaign"]>): ExecuteMsg => { + return { + start_campaign: ({ + end_time: endTime, + presale, + start_time: startTime + } as const) + }; + }; + static purchaseTiers = ({ + orders + }: CamelCasedProperties["purchase_tiers"]>): ExecuteMsg => { + return { + purchase_tiers: ({ + orders + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static endCampaign = (): ExecuteMsg => { + return { + end_campaign: ({} as const) + }; + }; + static claim = (): ExecuteMsg => { + return { + claim: ({} as const) + }; + }; + static discardCampaign = (): ExecuteMsg => { + return { + discard_campaign: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class CrowdfundContractTsQueryMsgBuilder { + static campaignSummary = (): QueryMsg => { + return { + campaign_summary: ({} as const) + }; + }; + static tierOrders = ({ + limit, + orderBy, + orderer, + startAfter + }: CamelCasedProperties["tier_orders"]>): QueryMsg => { + return { + tier_orders: ({ + limit, + order_by: orderBy, + orderer, + start_after: startAfter + } as const) + }; + }; + static tiers = ({ + limit, + orderBy, + startAfter + }: CamelCasedProperties["tiers"]>): QueryMsg => { + return { + tiers: ({ + limit, + order_by: orderBy, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/crowdfund/2.0.2/CrowdfundContractTs.types.ts b/packages/adocodegen/src/crowdfund/2.0.2/CrowdfundContractTs.types.ts new file mode 100644 index 0000000..483ce41 --- /dev/null +++ b/packages/adocodegen/src/crowdfund/2.0.2/CrowdfundContractTs.types.ts @@ -0,0 +1,337 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type AndrAddr = string; +export type Uint128 = string; +export type Binary = string; +export type Uint64 = string; +export interface InstantiateMsg { + campaign_config: CampaignConfig; + kernel_address: string; + owner?: string | null; + tiers: Tier[]; +} +export interface CampaignConfig { + banner?: string | null; + denom: Asset; + description?: string | null; + hard_cap?: Uint128 | null; + soft_cap?: Uint128 | null; + title?: string | null; + token_address: AndrAddr; + url?: string | null; + withdrawal_recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface Tier { + label: string; + level: Uint64; + limit?: Uint128 | null; + metadata: TierMetaData; + price: Uint128; +} +export interface TierMetaData { + extension: TokenExtension; + token_uri?: string | null; +} +export interface TokenExtension { + publisher: string; +} +export type ExecuteMsg = { + add_tier: { + tier: Tier; + }; +} | { + update_tier: { + tier: Tier; + }; +} | { + remove_tier: { + level: Uint64; + }; +} | { + start_campaign: { + end_time: Milliseconds; + presale?: PresaleTierOrder[] | null; + start_time?: Milliseconds | null; + }; +} | { + purchase_tiers: { + orders: SimpleTierOrder[]; + }; +} | { + receive: Cw20ReceiveMsg; +} | { + end_campaign: {}; +} | { + claim: {}; +} | { + discard_campaign: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Milliseconds = number; +export type Addr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface PresaleTierOrder { + amount: Uint128; + level: Uint64; + orderer: Addr; +} +export interface SimpleTierOrder { + amount: Uint128; + level: Uint64; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + campaign_summary: {}; +} | { + tier_orders: { + limit?: number | null; + order_by?: OrderBy | null; + orderer: string; + start_after?: number | null; + }; +} | { + tiers: { + limit?: number | null; + order_by?: OrderBy | null; + start_after?: number | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type OrderBy = "asc" | "desc"; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface CampaignSummaryResponse { + banner?: string | null; + current_capital: number; + current_stage: string; + denom: Asset; + description?: string | null; + end_time: Milliseconds; + hard_cap?: Uint128 | null; + soft_cap?: Uint128 | null; + start_time?: Milliseconds | null; + title?: string | null; + token_address: AndrAddr; + url?: string | null; + withdrawal_recipient: Recipient; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TierOrdersResponse { + orders: SimpleTierOrder[]; +} +export interface TiersResponse { + tiers: TierResponseItem[]; +} +export interface TierResponseItem { + sold_amount: Uint128; + tier: Tier; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type CrowdfundContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/0.2.2/Cw20ExchangeContractTs.client.ts b/packages/adocodegen/src/cw20-exchange/0.2.2/Cw20ExchangeContractTs.client.ts new file mode 100644 index 0000000..523d70e --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/0.2.2/Cw20ExchangeContractTs.client.ts @@ -0,0 +1,391 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, AssetInfoBaseForAddr, Addr, Uint128, Binary, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Permission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, SaleResponse, Sale, SaleAssetsResponse, TokenAddressResponse, TypeResponse, VersionResponse } from "./Cw20ExchangeContractTs.types"; +export interface Cw20ExchangeContractTsReadOnlyInterface { + contractAddress: string; + sale: ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }) => Promise; + tokenAddress: () => Promise; + saleAssets: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class Cw20ExchangeContractTsQueryClient implements Cw20ExchangeContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.sale = this.sale.bind(this); + this.tokenAddress = this.tokenAddress.bind(this); + this.saleAssets = this.saleAssets.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + sale = async ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale: { + asset + } + }); + }; + tokenAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_address: {} + }); + }; + saleAssets = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_assets: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface Cw20ExchangeContractTsInterface { + contractAddress: string; + sender: string; + cancelSale: ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchase: ({ + recipient + }: { + recipient?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20ExchangeContractTsClient implements Cw20ExchangeContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.cancelSale = this.cancelSale.bind(this); + this.purchase = this.purchase.bind(this); + this.receive = this.receive.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + cancelSale = async ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_sale: { + asset + } + }, fee, memo, _funds); + }; + purchase = async ({ + recipient + }: { + recipient?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase: { + recipient + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/0.2.2/Cw20ExchangeContractTs.message-builder.ts b/packages/adocodegen/src/cw20-exchange/0.2.2/Cw20ExchangeContractTs.message-builder.ts new file mode 100644 index 0000000..49c03fd --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/0.2.2/Cw20ExchangeContractTs.message-builder.ts @@ -0,0 +1,234 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, AssetInfoBaseForAddr, Addr, Uint128, Binary, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Permission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, SaleResponse, Sale, SaleAssetsResponse, TokenAddressResponse, TypeResponse, VersionResponse } from "./Cw20ExchangeContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20ExchangeContractTsExecuteMsgBuilder { + static cancelSale = ({ + asset + }: CamelCasedProperties["cancel_sale"]>): ExecuteMsg => { + return { + cancel_sale: ({ + asset + } as const) + }; + }; + static purchase = ({ + recipient + }: CamelCasedProperties["purchase"]>): ExecuteMsg => { + return { + purchase: ({ + recipient + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class Cw20ExchangeContractTsQueryMsgBuilder { + static sale = ({ + asset + }: CamelCasedProperties["sale"]>): QueryMsg => { + return { + sale: ({ + asset + } as const) + }; + }; + static tokenAddress = (): QueryMsg => { + return { + token_address: ({} as const) + }; + }; + static saleAssets = ({ + limit, + startAfter + }: CamelCasedProperties["sale_assets"]>): QueryMsg => { + return { + sale_assets: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/0.2.2/Cw20ExchangeContractTs.types.ts b/packages/adocodegen/src/cw20-exchange/0.2.2/Cw20ExchangeContractTs.types.ts new file mode 100644 index 0000000..809b806 --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/0.2.2/Cw20ExchangeContractTs.types.ts @@ -0,0 +1,222 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; + token_address: AndrAddr; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + cancel_sale: { + asset: AssetInfoBaseForAddr; + }; +} | { + purchase: { + recipient?: string | null; + }; +} | { + receive: Cw20ReceiveMsg; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type AssetInfoBaseForAddr = { + native: string; +} | { + cw20: Addr; +}; +export type Addr = string; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + sale: { + asset: AssetInfoBaseForAddr; + }; +} | { + token_address: {}; +} | { + sale_assets: { + limit?: number | null; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface SaleResponse { + sale?: Sale | null; +} +export interface Sale { + amount: Uint128; + exchange_rate: Uint128; + recipient: string; +} +export interface SaleAssetsResponse { + assets: string[]; +} +export interface TokenAddressResponse { + address: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20ExchangeContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/2.0.0/Cw20ExchangeContractTs.client.ts b/packages/adocodegen/src/cw20-exchange/2.0.0/Cw20ExchangeContractTs.client.ts new file mode 100644 index 0000000..8bdb0cc --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/2.0.0/Cw20ExchangeContractTs.client.ts @@ -0,0 +1,312 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, AssetInfoBaseForAddr, Addr, Uint128, Binary, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, Expiration, Timestamp, Uint64, SaleResponse, Sale, SaleAssetsResponse, TokenAddressResponse, TypeResponse, VersionResponse } from "./Cw20ExchangeContractTs.types"; +export interface Cw20ExchangeContractTsReadOnlyInterface { + contractAddress: string; + sale: ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }) => Promise; + tokenAddress: () => Promise; + saleAssets: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class Cw20ExchangeContractTsQueryClient implements Cw20ExchangeContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.sale = this.sale.bind(this); + this.tokenAddress = this.tokenAddress.bind(this); + this.saleAssets = this.saleAssets.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + sale = async ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale: { + asset + } + }); + }; + tokenAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_address: {} + }); + }; + saleAssets = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_assets: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface Cw20ExchangeContractTsInterface { + contractAddress: string; + sender: string; + cancelSale: ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchase: ({ + recipient + }: { + recipient?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20ExchangeContractTsClient implements Cw20ExchangeContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.cancelSale = this.cancelSale.bind(this); + this.purchase = this.purchase.bind(this); + this.receive = this.receive.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + cancelSale = async ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_sale: { + asset + } + }, fee, memo, _funds); + }; + purchase = async ({ + recipient + }: { + recipient?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase: { + recipient + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/2.0.0/Cw20ExchangeContractTs.message-builder.ts b/packages/adocodegen/src/cw20-exchange/2.0.0/Cw20ExchangeContractTs.message-builder.ts new file mode 100644 index 0000000..8316207 --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/2.0.0/Cw20ExchangeContractTs.message-builder.ts @@ -0,0 +1,188 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, AssetInfoBaseForAddr, Addr, Uint128, Binary, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, Expiration, Timestamp, Uint64, SaleResponse, Sale, SaleAssetsResponse, TokenAddressResponse, TypeResponse, VersionResponse } from "./Cw20ExchangeContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20ExchangeContractTsExecuteMsgBuilder { + static cancelSale = ({ + asset + }: CamelCasedProperties["cancel_sale"]>): ExecuteMsg => { + return { + cancel_sale: ({ + asset + } as const) + }; + }; + static purchase = ({ + recipient + }: CamelCasedProperties["purchase"]>): ExecuteMsg => { + return { + purchase: ({ + recipient + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class Cw20ExchangeContractTsQueryMsgBuilder { + static sale = ({ + asset + }: CamelCasedProperties["sale"]>): QueryMsg => { + return { + sale: ({ + asset + } as const) + }; + }; + static tokenAddress = (): QueryMsg => { + return { + token_address: ({} as const) + }; + }; + static saleAssets = ({ + limit, + startAfter + }: CamelCasedProperties["sale_assets"]>): QueryMsg => { + return { + sale_assets: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/2.0.0/Cw20ExchangeContractTs.types.ts b/packages/adocodegen/src/cw20-exchange/2.0.0/Cw20ExchangeContractTs.types.ts new file mode 100644 index 0000000..b9e500b --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/2.0.0/Cw20ExchangeContractTs.types.ts @@ -0,0 +1,229 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + token_address: AndrAddr; +} +export type ExecuteMsg = { + cancel_sale: { + asset: AssetInfoBaseForAddr; + }; +} | { + purchase: { + recipient?: string | null; + }; +} | { + receive: Cw20ReceiveMsg; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type AssetInfoBaseForAddr = { + native: string; +} | { + cw20: Addr; +}; +export type Addr = string; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + sale: { + asset: AssetInfoBaseForAddr; + }; +} | { + token_address: {}; +} | { + sale_assets: { + limit?: number | null; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface SaleResponse { + sale?: Sale | null; +} +export interface Sale { + amount: Uint128; + end_time: Expiration; + exchange_rate: Uint128; + recipient: string; + start_amount: Uint128; + start_time: Expiration; +} +export interface SaleAssetsResponse { + assets: string[]; +} +export interface TokenAddressResponse { + address: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20ExchangeContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/2.0.1-beta.1/Cw20ExchangeContractTs.client.ts b/packages/adocodegen/src/cw20-exchange/2.0.1-beta.1/Cw20ExchangeContractTs.client.ts new file mode 100644 index 0000000..8bdb0cc --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/2.0.1-beta.1/Cw20ExchangeContractTs.client.ts @@ -0,0 +1,312 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, AssetInfoBaseForAddr, Addr, Uint128, Binary, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, Expiration, Timestamp, Uint64, SaleResponse, Sale, SaleAssetsResponse, TokenAddressResponse, TypeResponse, VersionResponse } from "./Cw20ExchangeContractTs.types"; +export interface Cw20ExchangeContractTsReadOnlyInterface { + contractAddress: string; + sale: ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }) => Promise; + tokenAddress: () => Promise; + saleAssets: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class Cw20ExchangeContractTsQueryClient implements Cw20ExchangeContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.sale = this.sale.bind(this); + this.tokenAddress = this.tokenAddress.bind(this); + this.saleAssets = this.saleAssets.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + sale = async ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale: { + asset + } + }); + }; + tokenAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_address: {} + }); + }; + saleAssets = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_assets: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface Cw20ExchangeContractTsInterface { + contractAddress: string; + sender: string; + cancelSale: ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchase: ({ + recipient + }: { + recipient?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20ExchangeContractTsClient implements Cw20ExchangeContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.cancelSale = this.cancelSale.bind(this); + this.purchase = this.purchase.bind(this); + this.receive = this.receive.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + cancelSale = async ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_sale: { + asset + } + }, fee, memo, _funds); + }; + purchase = async ({ + recipient + }: { + recipient?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase: { + recipient + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/2.0.1-beta.1/Cw20ExchangeContractTs.message-builder.ts b/packages/adocodegen/src/cw20-exchange/2.0.1-beta.1/Cw20ExchangeContractTs.message-builder.ts new file mode 100644 index 0000000..8316207 --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/2.0.1-beta.1/Cw20ExchangeContractTs.message-builder.ts @@ -0,0 +1,188 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, AssetInfoBaseForAddr, Addr, Uint128, Binary, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, Expiration, Timestamp, Uint64, SaleResponse, Sale, SaleAssetsResponse, TokenAddressResponse, TypeResponse, VersionResponse } from "./Cw20ExchangeContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20ExchangeContractTsExecuteMsgBuilder { + static cancelSale = ({ + asset + }: CamelCasedProperties["cancel_sale"]>): ExecuteMsg => { + return { + cancel_sale: ({ + asset + } as const) + }; + }; + static purchase = ({ + recipient + }: CamelCasedProperties["purchase"]>): ExecuteMsg => { + return { + purchase: ({ + recipient + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class Cw20ExchangeContractTsQueryMsgBuilder { + static sale = ({ + asset + }: CamelCasedProperties["sale"]>): QueryMsg => { + return { + sale: ({ + asset + } as const) + }; + }; + static tokenAddress = (): QueryMsg => { + return { + token_address: ({} as const) + }; + }; + static saleAssets = ({ + limit, + startAfter + }: CamelCasedProperties["sale_assets"]>): QueryMsg => { + return { + sale_assets: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/2.0.1-beta.1/Cw20ExchangeContractTs.types.ts b/packages/adocodegen/src/cw20-exchange/2.0.1-beta.1/Cw20ExchangeContractTs.types.ts new file mode 100644 index 0000000..21f7bba --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/2.0.1-beta.1/Cw20ExchangeContractTs.types.ts @@ -0,0 +1,229 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + token_address: AndrAddr; +} +export type ExecuteMsg = { + cancel_sale: { + asset: AssetInfoBaseForAddr; + }; +} | { + purchase: { + recipient?: string | null; + }; +} | { + receive: Cw20ReceiveMsg; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type AssetInfoBaseForAddr = { + native: string; +} | { + cw20: Addr; +}; +export type Addr = string; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + sale: { + asset: AssetInfoBaseForAddr; + }; +} | { + token_address: {}; +} | { + sale_assets: { + limit?: number | null; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface SaleResponse { + sale?: Sale | null; +} +export interface Sale { + amount: Uint128; + end_time: Expiration; + exchange_rate: Uint128; + recipient: string; + start_amount: Uint128; + start_time: Expiration; +} +export interface SaleAssetsResponse { + assets: string[]; +} +export interface TokenAddressResponse { + address: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20ExchangeContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/2.0.1/Cw20ExchangeContractTs.client.ts b/packages/adocodegen/src/cw20-exchange/2.0.1/Cw20ExchangeContractTs.client.ts new file mode 100644 index 0000000..8bdb0cc --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/2.0.1/Cw20ExchangeContractTs.client.ts @@ -0,0 +1,312 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, AssetInfoBaseForAddr, Addr, Uint128, Binary, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, Expiration, Timestamp, Uint64, SaleResponse, Sale, SaleAssetsResponse, TokenAddressResponse, TypeResponse, VersionResponse } from "./Cw20ExchangeContractTs.types"; +export interface Cw20ExchangeContractTsReadOnlyInterface { + contractAddress: string; + sale: ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }) => Promise; + tokenAddress: () => Promise; + saleAssets: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class Cw20ExchangeContractTsQueryClient implements Cw20ExchangeContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.sale = this.sale.bind(this); + this.tokenAddress = this.tokenAddress.bind(this); + this.saleAssets = this.saleAssets.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + sale = async ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale: { + asset + } + }); + }; + tokenAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_address: {} + }); + }; + saleAssets = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_assets: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface Cw20ExchangeContractTsInterface { + contractAddress: string; + sender: string; + cancelSale: ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + purchase: ({ + recipient + }: { + recipient?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20ExchangeContractTsClient implements Cw20ExchangeContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.cancelSale = this.cancelSale.bind(this); + this.purchase = this.purchase.bind(this); + this.receive = this.receive.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + cancelSale = async ({ + asset + }: { + asset: AssetInfoBaseForAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_sale: { + asset + } + }, fee, memo, _funds); + }; + purchase = async ({ + recipient + }: { + recipient?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + purchase: { + recipient + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/2.0.1/Cw20ExchangeContractTs.message-builder.ts b/packages/adocodegen/src/cw20-exchange/2.0.1/Cw20ExchangeContractTs.message-builder.ts new file mode 100644 index 0000000..8316207 --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/2.0.1/Cw20ExchangeContractTs.message-builder.ts @@ -0,0 +1,188 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, AssetInfoBaseForAddr, Addr, Uint128, Binary, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, Expiration, Timestamp, Uint64, SaleResponse, Sale, SaleAssetsResponse, TokenAddressResponse, TypeResponse, VersionResponse } from "./Cw20ExchangeContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20ExchangeContractTsExecuteMsgBuilder { + static cancelSale = ({ + asset + }: CamelCasedProperties["cancel_sale"]>): ExecuteMsg => { + return { + cancel_sale: ({ + asset + } as const) + }; + }; + static purchase = ({ + recipient + }: CamelCasedProperties["purchase"]>): ExecuteMsg => { + return { + purchase: ({ + recipient + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class Cw20ExchangeContractTsQueryMsgBuilder { + static sale = ({ + asset + }: CamelCasedProperties["sale"]>): QueryMsg => { + return { + sale: ({ + asset + } as const) + }; + }; + static tokenAddress = (): QueryMsg => { + return { + token_address: ({} as const) + }; + }; + static saleAssets = ({ + limit, + startAfter + }: CamelCasedProperties["sale_assets"]>): QueryMsg => { + return { + sale_assets: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-exchange/2.0.1/Cw20ExchangeContractTs.types.ts b/packages/adocodegen/src/cw20-exchange/2.0.1/Cw20ExchangeContractTs.types.ts new file mode 100644 index 0000000..21f7bba --- /dev/null +++ b/packages/adocodegen/src/cw20-exchange/2.0.1/Cw20ExchangeContractTs.types.ts @@ -0,0 +1,229 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + token_address: AndrAddr; +} +export type ExecuteMsg = { + cancel_sale: { + asset: AssetInfoBaseForAddr; + }; +} | { + purchase: { + recipient?: string | null; + }; +} | { + receive: Cw20ReceiveMsg; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type AssetInfoBaseForAddr = { + native: string; +} | { + cw20: Addr; +}; +export type Addr = string; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + sale: { + asset: AssetInfoBaseForAddr; + }; +} | { + token_address: {}; +} | { + sale_assets: { + limit?: number | null; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface SaleResponse { + sale?: Sale | null; +} +export interface Sale { + amount: Uint128; + end_time: Expiration; + exchange_rate: Uint128; + recipient: string; + start_amount: Uint128; + start_time: Expiration; +} +export interface SaleAssetsResponse { + assets: string[]; +} +export interface TokenAddressResponse { + address: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20ExchangeContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/0.2.1/Cw20StakingContractTs.client.ts b/packages/adocodegen/src/cw20-staking/0.2.1/Cw20StakingContractTs.client.ts new file mode 100644 index 0000000..d8c216c --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/0.2.1/Cw20StakingContractTs.client.ts @@ -0,0 +1,509 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, Decimal, AssetInfoBaseForString, AndrAddr, InstantiateMsg, RewardTokenUnchecked, AllocationConfig, Module, ExecuteMsg, Binary, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, Config, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, StakerResponse, ArrayOfStakerResponse, State, TypeResponse, VersionResponse } from "./Cw20StakingContractTs.types"; +export interface Cw20StakingContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + staker: ({ + address + }: { + address: string; + }) => Promise; + stakers: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + timestamp: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class Cw20StakingContractTsQueryClient implements Cw20StakingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.staker = this.staker.bind(this); + this.stakers = this.stakers.bind(this); + this.timestamp = this.timestamp.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + staker = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staker: { + address + } + }); + }; + stakers = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + stakers: { + limit, + start_after: startAfter + } + }); + }; + timestamp = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + timestamp: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface Cw20StakingContractTsInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addRewardToken: ({ + rewardToken + }: { + rewardToken: RewardTokenUnchecked; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unstakeTokens: ({ + amount + }: { + amount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateGlobalIndexes: ({ + assetInfos + }: { + assetInfos?: AssetInfoBaseForString[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20StakingContractTsClient implements Cw20StakingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.addRewardToken = this.addRewardToken.bind(this); + this.unstakeTokens = this.unstakeTokens.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.updateGlobalIndexes = this.updateGlobalIndexes.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + addRewardToken = async ({ + rewardToken + }: { + rewardToken: RewardTokenUnchecked; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_reward_token: { + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + unstakeTokens = async ({ + amount + }: { + amount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unstake_tokens: { + amount + } + }, fee, memo, _funds); + }; + claimRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_rewards: {} + }, fee, memo, _funds); + }; + updateGlobalIndexes = async ({ + assetInfos + }: { + assetInfos?: AssetInfoBaseForString[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_global_indexes: { + asset_infos: assetInfos + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/0.2.1/Cw20StakingContractTs.message-builder.ts b/packages/adocodegen/src/cw20-staking/0.2.1/Cw20StakingContractTs.message-builder.ts new file mode 100644 index 0000000..673594f --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/0.2.1/Cw20StakingContractTs.message-builder.ts @@ -0,0 +1,311 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, Decimal, AssetInfoBaseForString, AndrAddr, InstantiateMsg, RewardTokenUnchecked, AllocationConfig, Module, ExecuteMsg, Binary, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, Config, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, StakerResponse, ArrayOfStakerResponse, State, TypeResponse, VersionResponse } from "./Cw20StakingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20StakingContractTsExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static addRewardToken = ({ + rewardToken + }: CamelCasedProperties["add_reward_token"]>): ExecuteMsg => { + return { + add_reward_token: ({ + reward_token: rewardToken + } as const) + }; + }; + static unstakeTokens = ({ + amount + }: CamelCasedProperties["unstake_tokens"]>): ExecuteMsg => { + return { + unstake_tokens: ({ + amount + } as const) + }; + }; + static claimRewards = (): ExecuteMsg => { + return { + claim_rewards: ({} as const) + }; + }; + static updateGlobalIndexes = ({ + assetInfos + }: CamelCasedProperties["update_global_indexes"]>): ExecuteMsg => { + return { + update_global_indexes: ({ + asset_infos: assetInfos + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class Cw20StakingContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static staker = ({ + address + }: CamelCasedProperties["staker"]>): QueryMsg => { + return { + staker: ({ + address + } as const) + }; + }; + static stakers = ({ + limit, + startAfter + }: CamelCasedProperties["stakers"]>): QueryMsg => { + return { + stakers: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static timestamp = (): QueryMsg => { + return { + timestamp: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/0.2.1/Cw20StakingContractTs.types.ts b/packages/adocodegen/src/cw20-staking/0.2.1/Cw20StakingContractTs.types.ts new file mode 100644 index 0000000..0b82e23 --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/0.2.1/Cw20StakingContractTs.types.ts @@ -0,0 +1,264 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type Decimal = string; +export type AssetInfoBaseForString = { + native: string; +} | { + cw20: string; +}; +export type AndrAddr = string; +export interface InstantiateMsg { + additional_rewards?: RewardTokenUnchecked[] | null; + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; + staking_token: AndrAddr; +} +export interface RewardTokenUnchecked { + allocation_config?: AllocationConfig | null; + asset_info: AssetInfoBaseForString; +} +export interface AllocationConfig { + cycle_duration: number; + cycle_rewards: Uint128; + init_timestamp: number; + reward_increase?: Decimal | null; + till_timestamp: number; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + add_reward_token: { + reward_token: RewardTokenUnchecked; + }; +} | { + unstake_tokens: { + amount?: Uint128 | null; + }; +} | { + claim_rewards: {}; +} | { + update_global_indexes: { + asset_infos?: AssetInfoBaseForString[] | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = number; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + staker: { + address: string; + }; +} | { + stakers: { + limit?: number | null; + start_after?: string | null; + }; +} | { + timestamp: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + number_of_reward_tokens: number; + staking_token: AndrAddr; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type ArrayOfString = string[]; +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface StakerResponse { + address: string; + balance: Uint128; + pending_rewards: [string, Uint128][]; + share: Uint128; +} +export type ArrayOfStakerResponse = StakerResponse[]; +export interface State { + total_share: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20StakingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/0.2.16/Cw20StakingContractTs.client.ts b/packages/adocodegen/src/cw20-staking/0.2.16/Cw20StakingContractTs.client.ts new file mode 100644 index 0000000..6162b71 --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/0.2.16/Cw20StakingContractTs.client.ts @@ -0,0 +1,450 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, Decimal, AssetInfoBaseForString, AndrAddr, InstantiateMsg, RewardTokenUnchecked, AllocationConfig, Module, ExecuteMsg, Binary, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, Config, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, StakerResponse, ArrayOfStakerResponse, State, TypeResponse, VersionResponse } from "./Cw20StakingContractTs.types"; +export interface Cw20StakingContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + staker: ({ + address + }: { + address: string; + }) => Promise; + stakers: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + timestamp: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class Cw20StakingContractTsQueryClient implements Cw20StakingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.staker = this.staker.bind(this); + this.stakers = this.stakers.bind(this); + this.timestamp = this.timestamp.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + staker = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staker: { + address + } + }); + }; + stakers = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + stakers: { + limit, + start_after: startAfter + } + }); + }; + timestamp = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + timestamp: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface Cw20StakingContractTsInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addRewardToken: ({ + rewardToken + }: { + rewardToken: RewardTokenUnchecked; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unstakeTokens: ({ + amount + }: { + amount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateGlobalIndexes: ({ + assetInfos + }: { + assetInfos?: AssetInfoBaseForString[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20StakingContractTsClient implements Cw20StakingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.addRewardToken = this.addRewardToken.bind(this); + this.unstakeTokens = this.unstakeTokens.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.updateGlobalIndexes = this.updateGlobalIndexes.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + addRewardToken = async ({ + rewardToken + }: { + rewardToken: RewardTokenUnchecked; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_reward_token: { + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + unstakeTokens = async ({ + amount + }: { + amount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unstake_tokens: { + amount + } + }, fee, memo, _funds); + }; + claimRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_rewards: {} + }, fee, memo, _funds); + }; + updateGlobalIndexes = async ({ + assetInfos + }: { + assetInfos?: AssetInfoBaseForString[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_global_indexes: { + asset_infos: assetInfos + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/0.2.16/Cw20StakingContractTs.message-builder.ts b/packages/adocodegen/src/cw20-staking/0.2.16/Cw20StakingContractTs.message-builder.ts new file mode 100644 index 0000000..03a4379 --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/0.2.16/Cw20StakingContractTs.message-builder.ts @@ -0,0 +1,277 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, Decimal, AssetInfoBaseForString, AndrAddr, InstantiateMsg, RewardTokenUnchecked, AllocationConfig, Module, ExecuteMsg, Binary, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, Config, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, StakerResponse, ArrayOfStakerResponse, State, TypeResponse, VersionResponse } from "./Cw20StakingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20StakingContractTsExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static addRewardToken = ({ + rewardToken + }: CamelCasedProperties["add_reward_token"]>): ExecuteMsg => { + return { + add_reward_token: ({ + reward_token: rewardToken + } as const) + }; + }; + static unstakeTokens = ({ + amount + }: CamelCasedProperties["unstake_tokens"]>): ExecuteMsg => { + return { + unstake_tokens: ({ + amount + } as const) + }; + }; + static claimRewards = (): ExecuteMsg => { + return { + claim_rewards: ({} as const) + }; + }; + static updateGlobalIndexes = ({ + assetInfos + }: CamelCasedProperties["update_global_indexes"]>): ExecuteMsg => { + return { + update_global_indexes: ({ + asset_infos: assetInfos + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class Cw20StakingContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static staker = ({ + address + }: CamelCasedProperties["staker"]>): QueryMsg => { + return { + staker: ({ + address + } as const) + }; + }; + static stakers = ({ + limit, + startAfter + }: CamelCasedProperties["stakers"]>): QueryMsg => { + return { + stakers: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static timestamp = (): QueryMsg => { + return { + timestamp: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/0.2.16/Cw20StakingContractTs.types.ts b/packages/adocodegen/src/cw20-staking/0.2.16/Cw20StakingContractTs.types.ts new file mode 100644 index 0000000..832b3ad --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/0.2.16/Cw20StakingContractTs.types.ts @@ -0,0 +1,271 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type Decimal = string; +export type AssetInfoBaseForString = { + native: string; +} | { + cw20: string; +}; +export type AndrAddr = string; +export interface InstantiateMsg { + additional_rewards?: RewardTokenUnchecked[] | null; + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; + staking_token: AndrAddr; +} +export interface RewardTokenUnchecked { + allocation_config?: AllocationConfig | null; + asset_info: AssetInfoBaseForString; +} +export interface AllocationConfig { + cycle_duration: number; + cycle_rewards: Uint128; + init_timestamp: number; + reward_increase?: Decimal | null; + till_timestamp: number; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + add_reward_token: { + reward_token: RewardTokenUnchecked; + }; +} | { + unstake_tokens: { + amount?: Uint128 | null; + }; +} | { + claim_rewards: {}; +} | { + update_global_indexes: { + asset_infos?: AssetInfoBaseForString[] | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + staker: { + address: string; + }; +} | { + stakers: { + limit?: number | null; + start_after?: string | null; + }; +} | { + timestamp: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + number_of_reward_tokens: number; + staking_token: AndrAddr; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type ArrayOfString = string[]; +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface StakerResponse { + address: string; + balance: Uint128; + pending_rewards: [string, Uint128][]; + share: Uint128; +} +export type ArrayOfStakerResponse = StakerResponse[]; +export interface State { + total_share: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20StakingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/2.0.0/Cw20StakingContractTs.client.ts b/packages/adocodegen/src/cw20-staking/2.0.0/Cw20StakingContractTs.client.ts new file mode 100644 index 0000000..d951f9a --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/2.0.0/Cw20StakingContractTs.client.ts @@ -0,0 +1,382 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Milliseconds, Uint128, Decimal, Expiry, AssetInfoBaseForString, AndrAddr, InstantiateMsg, RewardTokenUnchecked, AllocationConfig, ExecuteMsg, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, StakerResponse, ArrayOfStakerResponse, State, TypeResponse, VersionResponse } from "./Cw20StakingContractTs.types"; +export interface Cw20StakingContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + staker: ({ + address + }: { + address: string; + }) => Promise; + stakers: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class Cw20StakingContractTsQueryClient implements Cw20StakingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.staker = this.staker.bind(this); + this.stakers = this.stakers.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + staker = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staker: { + address + } + }); + }; + stakers = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + stakers: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface Cw20StakingContractTsInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addRewardToken: ({ + rewardToken + }: { + rewardToken: RewardTokenUnchecked; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRewardToken: ({ + rewardToken + }: { + rewardToken: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + replaceRewardToken: ({ + originRewardToken, + rewardToken + }: { + originRewardToken: string; + rewardToken: RewardTokenUnchecked; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unstakeTokens: ({ + amount + }: { + amount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateGlobalIndexes: ({ + assetInfos + }: { + assetInfos?: AssetInfoBaseForString[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20StakingContractTsClient implements Cw20StakingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.addRewardToken = this.addRewardToken.bind(this); + this.removeRewardToken = this.removeRewardToken.bind(this); + this.replaceRewardToken = this.replaceRewardToken.bind(this); + this.unstakeTokens = this.unstakeTokens.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.updateGlobalIndexes = this.updateGlobalIndexes.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + addRewardToken = async ({ + rewardToken + }: { + rewardToken: RewardTokenUnchecked; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_reward_token: { + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + removeRewardToken = async ({ + rewardToken + }: { + rewardToken: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_reward_token: { + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + replaceRewardToken = async ({ + originRewardToken, + rewardToken + }: { + originRewardToken: string; + rewardToken: RewardTokenUnchecked; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + replace_reward_token: { + origin_reward_token: originRewardToken, + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + unstakeTokens = async ({ + amount + }: { + amount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unstake_tokens: { + amount + } + }, fee, memo, _funds); + }; + claimRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_rewards: {} + }, fee, memo, _funds); + }; + updateGlobalIndexes = async ({ + assetInfos + }: { + assetInfos?: AssetInfoBaseForString[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_global_indexes: { + asset_infos: assetInfos + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/2.0.0/Cw20StakingContractTs.message-builder.ts b/packages/adocodegen/src/cw20-staking/2.0.0/Cw20StakingContractTs.message-builder.ts new file mode 100644 index 0000000..4702f83 --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/2.0.0/Cw20StakingContractTs.message-builder.ts @@ -0,0 +1,233 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Milliseconds, Uint128, Decimal, Expiry, AssetInfoBaseForString, AndrAddr, InstantiateMsg, RewardTokenUnchecked, AllocationConfig, ExecuteMsg, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, StakerResponse, ArrayOfStakerResponse, State, TypeResponse, VersionResponse } from "./Cw20StakingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20StakingContractTsExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static addRewardToken = ({ + rewardToken + }: CamelCasedProperties["add_reward_token"]>): ExecuteMsg => { + return { + add_reward_token: ({ + reward_token: rewardToken + } as const) + }; + }; + static removeRewardToken = ({ + rewardToken + }: CamelCasedProperties["remove_reward_token"]>): ExecuteMsg => { + return { + remove_reward_token: ({ + reward_token: rewardToken + } as const) + }; + }; + static replaceRewardToken = ({ + originRewardToken, + rewardToken + }: CamelCasedProperties["replace_reward_token"]>): ExecuteMsg => { + return { + replace_reward_token: ({ + origin_reward_token: originRewardToken, + reward_token: rewardToken + } as const) + }; + }; + static unstakeTokens = ({ + amount + }: CamelCasedProperties["unstake_tokens"]>): ExecuteMsg => { + return { + unstake_tokens: ({ + amount + } as const) + }; + }; + static claimRewards = (): ExecuteMsg => { + return { + claim_rewards: ({} as const) + }; + }; + static updateGlobalIndexes = ({ + assetInfos + }: CamelCasedProperties["update_global_indexes"]>): ExecuteMsg => { + return { + update_global_indexes: ({ + asset_infos: assetInfos + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class Cw20StakingContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static staker = ({ + address + }: CamelCasedProperties["staker"]>): QueryMsg => { + return { + staker: ({ + address + } as const) + }; + }; + static stakers = ({ + limit, + startAfter + }: CamelCasedProperties["stakers"]>): QueryMsg => { + return { + stakers: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/2.0.0/Cw20StakingContractTs.types.ts b/packages/adocodegen/src/cw20-staking/2.0.0/Cw20StakingContractTs.types.ts new file mode 100644 index 0000000..955e000 --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/2.0.0/Cw20StakingContractTs.types.ts @@ -0,0 +1,247 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Milliseconds = number; +export type Uint128 = string; +export type Decimal = string; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type AssetInfoBaseForString = { + native: string; +} | { + cw20: string; +}; +export type AndrAddr = string; +export interface InstantiateMsg { + additional_rewards?: RewardTokenUnchecked[] | null; + kernel_address: string; + owner?: string | null; + staking_token: AndrAddr; +} +export interface RewardTokenUnchecked { + allocation_config?: AllocationConfig | null; + asset_info: AssetInfoBaseForString; + init_timestamp: Expiry; +} +export interface AllocationConfig { + cycle_duration: Milliseconds; + cycle_rewards: Uint128; + reward_increase?: Decimal | null; + till_timestamp: Expiry; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + add_reward_token: { + reward_token: RewardTokenUnchecked; + }; +} | { + remove_reward_token: { + reward_token: string; + }; +} | { + replace_reward_token: { + origin_reward_token: string; + reward_token: RewardTokenUnchecked; + }; +} | { + unstake_tokens: { + amount?: Uint128 | null; + }; +} | { + claim_rewards: {}; +} | { + update_global_indexes: { + asset_infos?: AssetInfoBaseForString[] | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + staker: { + address: string; + }; +} | { + stakers: { + limit?: number | null; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + number_of_reward_tokens: number; + staking_token: AndrAddr; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface StakerResponse { + address: string; + balance: Uint128; + pending_rewards: [string, Uint128][]; + share: Uint128; +} +export type ArrayOfStakerResponse = StakerResponse[]; +export interface State { + total_share: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20StakingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/2.0.1-beta.1/Cw20StakingContractTs.client.ts b/packages/adocodegen/src/cw20-staking/2.0.1-beta.1/Cw20StakingContractTs.client.ts new file mode 100644 index 0000000..d951f9a --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/2.0.1-beta.1/Cw20StakingContractTs.client.ts @@ -0,0 +1,382 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Milliseconds, Uint128, Decimal, Expiry, AssetInfoBaseForString, AndrAddr, InstantiateMsg, RewardTokenUnchecked, AllocationConfig, ExecuteMsg, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, StakerResponse, ArrayOfStakerResponse, State, TypeResponse, VersionResponse } from "./Cw20StakingContractTs.types"; +export interface Cw20StakingContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + staker: ({ + address + }: { + address: string; + }) => Promise; + stakers: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class Cw20StakingContractTsQueryClient implements Cw20StakingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.staker = this.staker.bind(this); + this.stakers = this.stakers.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + staker = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staker: { + address + } + }); + }; + stakers = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + stakers: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface Cw20StakingContractTsInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addRewardToken: ({ + rewardToken + }: { + rewardToken: RewardTokenUnchecked; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRewardToken: ({ + rewardToken + }: { + rewardToken: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + replaceRewardToken: ({ + originRewardToken, + rewardToken + }: { + originRewardToken: string; + rewardToken: RewardTokenUnchecked; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unstakeTokens: ({ + amount + }: { + amount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateGlobalIndexes: ({ + assetInfos + }: { + assetInfos?: AssetInfoBaseForString[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20StakingContractTsClient implements Cw20StakingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.addRewardToken = this.addRewardToken.bind(this); + this.removeRewardToken = this.removeRewardToken.bind(this); + this.replaceRewardToken = this.replaceRewardToken.bind(this); + this.unstakeTokens = this.unstakeTokens.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.updateGlobalIndexes = this.updateGlobalIndexes.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + addRewardToken = async ({ + rewardToken + }: { + rewardToken: RewardTokenUnchecked; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_reward_token: { + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + removeRewardToken = async ({ + rewardToken + }: { + rewardToken: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_reward_token: { + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + replaceRewardToken = async ({ + originRewardToken, + rewardToken + }: { + originRewardToken: string; + rewardToken: RewardTokenUnchecked; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + replace_reward_token: { + origin_reward_token: originRewardToken, + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + unstakeTokens = async ({ + amount + }: { + amount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unstake_tokens: { + amount + } + }, fee, memo, _funds); + }; + claimRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_rewards: {} + }, fee, memo, _funds); + }; + updateGlobalIndexes = async ({ + assetInfos + }: { + assetInfos?: AssetInfoBaseForString[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_global_indexes: { + asset_infos: assetInfos + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/2.0.1-beta.1/Cw20StakingContractTs.message-builder.ts b/packages/adocodegen/src/cw20-staking/2.0.1-beta.1/Cw20StakingContractTs.message-builder.ts new file mode 100644 index 0000000..4702f83 --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/2.0.1-beta.1/Cw20StakingContractTs.message-builder.ts @@ -0,0 +1,233 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Milliseconds, Uint128, Decimal, Expiry, AssetInfoBaseForString, AndrAddr, InstantiateMsg, RewardTokenUnchecked, AllocationConfig, ExecuteMsg, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, StakerResponse, ArrayOfStakerResponse, State, TypeResponse, VersionResponse } from "./Cw20StakingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20StakingContractTsExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static addRewardToken = ({ + rewardToken + }: CamelCasedProperties["add_reward_token"]>): ExecuteMsg => { + return { + add_reward_token: ({ + reward_token: rewardToken + } as const) + }; + }; + static removeRewardToken = ({ + rewardToken + }: CamelCasedProperties["remove_reward_token"]>): ExecuteMsg => { + return { + remove_reward_token: ({ + reward_token: rewardToken + } as const) + }; + }; + static replaceRewardToken = ({ + originRewardToken, + rewardToken + }: CamelCasedProperties["replace_reward_token"]>): ExecuteMsg => { + return { + replace_reward_token: ({ + origin_reward_token: originRewardToken, + reward_token: rewardToken + } as const) + }; + }; + static unstakeTokens = ({ + amount + }: CamelCasedProperties["unstake_tokens"]>): ExecuteMsg => { + return { + unstake_tokens: ({ + amount + } as const) + }; + }; + static claimRewards = (): ExecuteMsg => { + return { + claim_rewards: ({} as const) + }; + }; + static updateGlobalIndexes = ({ + assetInfos + }: CamelCasedProperties["update_global_indexes"]>): ExecuteMsg => { + return { + update_global_indexes: ({ + asset_infos: assetInfos + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class Cw20StakingContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static staker = ({ + address + }: CamelCasedProperties["staker"]>): QueryMsg => { + return { + staker: ({ + address + } as const) + }; + }; + static stakers = ({ + limit, + startAfter + }: CamelCasedProperties["stakers"]>): QueryMsg => { + return { + stakers: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/2.0.1-beta.1/Cw20StakingContractTs.types.ts b/packages/adocodegen/src/cw20-staking/2.0.1-beta.1/Cw20StakingContractTs.types.ts new file mode 100644 index 0000000..cb9c947 --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/2.0.1-beta.1/Cw20StakingContractTs.types.ts @@ -0,0 +1,247 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Milliseconds = number; +export type Uint128 = string; +export type Decimal = string; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type AssetInfoBaseForString = { + native: string; +} | { + cw20: string; +}; +export type AndrAddr = string; +export interface InstantiateMsg { + additional_rewards?: RewardTokenUnchecked[] | null; + kernel_address: string; + owner?: string | null; + staking_token: AndrAddr; +} +export interface RewardTokenUnchecked { + allocation_config?: AllocationConfig | null; + asset_info: AssetInfoBaseForString; + init_timestamp: Expiry; +} +export interface AllocationConfig { + cycle_duration: Milliseconds; + cycle_rewards: Uint128; + reward_increase?: Decimal | null; + till_timestamp: Expiry; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + add_reward_token: { + reward_token: RewardTokenUnchecked; + }; +} | { + remove_reward_token: { + reward_token: string; + }; +} | { + replace_reward_token: { + origin_reward_token: string; + reward_token: RewardTokenUnchecked; + }; +} | { + unstake_tokens: { + amount?: Uint128 | null; + }; +} | { + claim_rewards: {}; +} | { + update_global_indexes: { + asset_infos?: AssetInfoBaseForString[] | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + staker: { + address: string; + }; +} | { + stakers: { + limit?: number | null; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + number_of_reward_tokens: number; + staking_token: AndrAddr; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface StakerResponse { + address: string; + balance: Uint128; + pending_rewards: [string, Uint128][]; + share: Uint128; +} +export type ArrayOfStakerResponse = StakerResponse[]; +export interface State { + total_share: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20StakingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/2.0.1/Cw20StakingContractTs.client.ts b/packages/adocodegen/src/cw20-staking/2.0.1/Cw20StakingContractTs.client.ts new file mode 100644 index 0000000..d951f9a --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/2.0.1/Cw20StakingContractTs.client.ts @@ -0,0 +1,382 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Milliseconds, Uint128, Decimal, Expiry, AssetInfoBaseForString, AndrAddr, InstantiateMsg, RewardTokenUnchecked, AllocationConfig, ExecuteMsg, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, StakerResponse, ArrayOfStakerResponse, State, TypeResponse, VersionResponse } from "./Cw20StakingContractTs.types"; +export interface Cw20StakingContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + staker: ({ + address + }: { + address: string; + }) => Promise; + stakers: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class Cw20StakingContractTsQueryClient implements Cw20StakingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.staker = this.staker.bind(this); + this.stakers = this.stakers.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + staker = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staker: { + address + } + }); + }; + stakers = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + stakers: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface Cw20StakingContractTsInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addRewardToken: ({ + rewardToken + }: { + rewardToken: RewardTokenUnchecked; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRewardToken: ({ + rewardToken + }: { + rewardToken: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + replaceRewardToken: ({ + originRewardToken, + rewardToken + }: { + originRewardToken: string; + rewardToken: RewardTokenUnchecked; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unstakeTokens: ({ + amount + }: { + amount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateGlobalIndexes: ({ + assetInfos + }: { + assetInfos?: AssetInfoBaseForString[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20StakingContractTsClient implements Cw20StakingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.addRewardToken = this.addRewardToken.bind(this); + this.removeRewardToken = this.removeRewardToken.bind(this); + this.replaceRewardToken = this.replaceRewardToken.bind(this); + this.unstakeTokens = this.unstakeTokens.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.updateGlobalIndexes = this.updateGlobalIndexes.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + addRewardToken = async ({ + rewardToken + }: { + rewardToken: RewardTokenUnchecked; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_reward_token: { + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + removeRewardToken = async ({ + rewardToken + }: { + rewardToken: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_reward_token: { + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + replaceRewardToken = async ({ + originRewardToken, + rewardToken + }: { + originRewardToken: string; + rewardToken: RewardTokenUnchecked; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + replace_reward_token: { + origin_reward_token: originRewardToken, + reward_token: rewardToken + } + }, fee, memo, _funds); + }; + unstakeTokens = async ({ + amount + }: { + amount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unstake_tokens: { + amount + } + }, fee, memo, _funds); + }; + claimRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_rewards: {} + }, fee, memo, _funds); + }; + updateGlobalIndexes = async ({ + assetInfos + }: { + assetInfos?: AssetInfoBaseForString[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_global_indexes: { + asset_infos: assetInfos + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/2.0.1/Cw20StakingContractTs.message-builder.ts b/packages/adocodegen/src/cw20-staking/2.0.1/Cw20StakingContractTs.message-builder.ts new file mode 100644 index 0000000..4702f83 --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/2.0.1/Cw20StakingContractTs.message-builder.ts @@ -0,0 +1,233 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Milliseconds, Uint128, Decimal, Expiry, AssetInfoBaseForString, AndrAddr, InstantiateMsg, RewardTokenUnchecked, AllocationConfig, ExecuteMsg, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, StakerResponse, ArrayOfStakerResponse, State, TypeResponse, VersionResponse } from "./Cw20StakingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20StakingContractTsExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static addRewardToken = ({ + rewardToken + }: CamelCasedProperties["add_reward_token"]>): ExecuteMsg => { + return { + add_reward_token: ({ + reward_token: rewardToken + } as const) + }; + }; + static removeRewardToken = ({ + rewardToken + }: CamelCasedProperties["remove_reward_token"]>): ExecuteMsg => { + return { + remove_reward_token: ({ + reward_token: rewardToken + } as const) + }; + }; + static replaceRewardToken = ({ + originRewardToken, + rewardToken + }: CamelCasedProperties["replace_reward_token"]>): ExecuteMsg => { + return { + replace_reward_token: ({ + origin_reward_token: originRewardToken, + reward_token: rewardToken + } as const) + }; + }; + static unstakeTokens = ({ + amount + }: CamelCasedProperties["unstake_tokens"]>): ExecuteMsg => { + return { + unstake_tokens: ({ + amount + } as const) + }; + }; + static claimRewards = (): ExecuteMsg => { + return { + claim_rewards: ({} as const) + }; + }; + static updateGlobalIndexes = ({ + assetInfos + }: CamelCasedProperties["update_global_indexes"]>): ExecuteMsg => { + return { + update_global_indexes: ({ + asset_infos: assetInfos + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class Cw20StakingContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static staker = ({ + address + }: CamelCasedProperties["staker"]>): QueryMsg => { + return { + staker: ({ + address + } as const) + }; + }; + static stakers = ({ + limit, + startAfter + }: CamelCasedProperties["stakers"]>): QueryMsg => { + return { + stakers: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20-staking/2.0.1/Cw20StakingContractTs.types.ts b/packages/adocodegen/src/cw20-staking/2.0.1/Cw20StakingContractTs.types.ts new file mode 100644 index 0000000..cb9c947 --- /dev/null +++ b/packages/adocodegen/src/cw20-staking/2.0.1/Cw20StakingContractTs.types.ts @@ -0,0 +1,247 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Milliseconds = number; +export type Uint128 = string; +export type Decimal = string; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type AssetInfoBaseForString = { + native: string; +} | { + cw20: string; +}; +export type AndrAddr = string; +export interface InstantiateMsg { + additional_rewards?: RewardTokenUnchecked[] | null; + kernel_address: string; + owner?: string | null; + staking_token: AndrAddr; +} +export interface RewardTokenUnchecked { + allocation_config?: AllocationConfig | null; + asset_info: AssetInfoBaseForString; + init_timestamp: Expiry; +} +export interface AllocationConfig { + cycle_duration: Milliseconds; + cycle_rewards: Uint128; + reward_increase?: Decimal | null; + till_timestamp: Expiry; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + add_reward_token: { + reward_token: RewardTokenUnchecked; + }; +} | { + remove_reward_token: { + reward_token: string; + }; +} | { + replace_reward_token: { + origin_reward_token: string; + reward_token: RewardTokenUnchecked; + }; +} | { + unstake_tokens: { + amount?: Uint128 | null; + }; +} | { + claim_rewards: {}; +} | { + update_global_indexes: { + asset_infos?: AssetInfoBaseForString[] | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + staker: { + address: string; + }; +} | { + stakers: { + limit?: number | null; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + number_of_reward_tokens: number; + staking_token: AndrAddr; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface StakerResponse { + address: string; + balance: Uint128; + pending_rewards: [string, Uint128][]; + share: Uint128; +} +export type ArrayOfStakerResponse = StakerResponse[]; +export interface State { + total_share: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20StakingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/0.2.1/Cw20ContractTs.client.ts b/packages/adocodegen/src/cw20/0.2.1/Cw20ContractTs.client.ts new file mode 100644 index 0000000..ada4f62 --- /dev/null +++ b/packages/adocodegen/src/cw20/0.2.1/Cw20ContractTs.client.ts @@ -0,0 +1,720 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, Logo, EmbeddedLogo, Binary, AndrAddr, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, Module, ExecuteMsg, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllowanceResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, IsOperatorResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +export interface Cw20ContractTsReadOnlyInterface { + contractAddress: string; + tokenInfo: () => Promise; + minter: () => Promise; + allowance: ({ + owner, + spender + }: { + owner: string; + spender: string; + }) => Promise; + allAllowances: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allAccounts: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + marketingInfo: () => Promise; + downloadLogo: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class Cw20ContractTsQueryClient implements Cw20ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.tokenInfo = this.tokenInfo.bind(this); + this.minter = this.minter.bind(this); + this.allowance = this.allowance.bind(this); + this.allAllowances = this.allAllowances.bind(this); + this.allAccounts = this.allAccounts.bind(this); + this.marketingInfo = this.marketingInfo.bind(this); + this.downloadLogo = this.downloadLogo.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + tokenInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_info: {} + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + allowance = async ({ + owner, + spender + }: { + owner: string; + spender: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + allowance: { + owner, + spender + } + }); + }; + allAllowances = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_allowances: { + limit, + owner, + start_after: startAfter + } + }); + }; + allAccounts = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_accounts: { + limit, + start_after: startAfter + } + }); + }; + marketingInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + marketing_info: {} + }); + }; + downloadLogo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + download_logo: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface Cw20ContractTsInterface { + contractAddress: string; + sender: string; + transfer: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: string; + msg: Binary; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + increaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + decreaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferFrom: ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendFrom: ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: string; + msg: Binary; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burnFrom: ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + mint: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateMarketing: ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + uploadLogo: (logo: Logo, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20ContractTsClient implements Cw20ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transfer = this.transfer.bind(this); + this.burn = this.burn.bind(this); + this.send = this.send.bind(this); + this.increaseAllowance = this.increaseAllowance.bind(this); + this.decreaseAllowance = this.decreaseAllowance.bind(this); + this.transferFrom = this.transferFrom.bind(this); + this.sendFrom = this.sendFrom.bind(this); + this.burnFrom = this.burnFrom.bind(this); + this.mint = this.mint.bind(this); + this.updateMarketing = this.updateMarketing.bind(this); + this.uploadLogo = this.uploadLogo.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + transfer = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer: { + amount, + recipient + } + }, fee, memo, _funds); + }; + burn = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + amount + } + }, fee, memo, _funds); + }; + send = async ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: string; + msg: Binary; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: { + amount, + contract, + msg + } + }, fee, memo, _funds); + }; + increaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + increase_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + decreaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + decrease_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + transferFrom = async ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_from: { + amount, + owner, + recipient + } + }, fee, memo, _funds); + }; + sendFrom = async ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: string; + msg: Binary; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_from: { + amount, + contract, + msg, + owner + } + }, fee, memo, _funds); + }; + burnFrom = async ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn_from: { + amount, + owner + } + }, fee, memo, _funds); + }; + mint = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + amount, + recipient + } + }, fee, memo, _funds); + }; + updateMarketing = async ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_marketing: { + description, + marketing, + project + } + }, fee, memo, _funds); + }; + uploadLogo = async (logo: Logo, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + upload_logo: logo + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/0.2.1/Cw20ContractTs.message-builder.ts b/packages/adocodegen/src/cw20/0.2.1/Cw20ContractTs.message-builder.ts new file mode 100644 index 0000000..a15df6d --- /dev/null +++ b/packages/adocodegen/src/cw20/0.2.1/Cw20ContractTs.message-builder.ts @@ -0,0 +1,427 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, Logo, EmbeddedLogo, Binary, AndrAddr, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, Module, ExecuteMsg, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllowanceResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, IsOperatorResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20ContractTsExecuteMsgBuilder { + static transfer = ({ + amount, + recipient + }: CamelCasedProperties["transfer"]>): ExecuteMsg => { + return { + transfer: ({ + amount, + recipient + } as const) + }; + }; + static burn = ({ + amount + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + amount + } as const) + }; + }; + static send = ({ + amount, + contract, + msg + }: CamelCasedProperties["send"]>): ExecuteMsg => { + return { + send: ({ + amount, + contract, + msg + } as const) + }; + }; + static increaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["increase_allowance"]>): ExecuteMsg => { + return { + increase_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static decreaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["decrease_allowance"]>): ExecuteMsg => { + return { + decrease_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static transferFrom = ({ + amount, + owner, + recipient + }: CamelCasedProperties["transfer_from"]>): ExecuteMsg => { + return { + transfer_from: ({ + amount, + owner, + recipient + } as const) + }; + }; + static sendFrom = ({ + amount, + contract, + msg, + owner + }: CamelCasedProperties["send_from"]>): ExecuteMsg => { + return { + send_from: ({ + amount, + contract, + msg, + owner + } as const) + }; + }; + static burnFrom = ({ + amount, + owner + }: CamelCasedProperties["burn_from"]>): ExecuteMsg => { + return { + burn_from: ({ + amount, + owner + } as const) + }; + }; + static mint = ({ + amount, + recipient + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + amount, + recipient + } as const) + }; + }; + static updateMarketing = ({ + description, + marketing, + project + }: CamelCasedProperties["update_marketing"]>): ExecuteMsg => { + return { + update_marketing: ({ + description, + marketing, + project + } as const) + }; + }; + static uploadLogo = (logo: Logo): ExecuteMsg => { + return { + upload_logo: logo + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class Cw20ContractTsQueryMsgBuilder { + static tokenInfo = (): QueryMsg => { + return { + token_info: ({} as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static allowance = ({ + owner, + spender + }: CamelCasedProperties["allowance"]>): QueryMsg => { + return { + allowance: ({ + owner, + spender + } as const) + }; + }; + static allAllowances = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["all_allowances"]>): QueryMsg => { + return { + all_allowances: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allAccounts = ({ + limit, + startAfter + }: CamelCasedProperties["all_accounts"]>): QueryMsg => { + return { + all_accounts: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static marketingInfo = (): QueryMsg => { + return { + marketing_info: ({} as const) + }; + }; + static downloadLogo = (): QueryMsg => { + return { + download_logo: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/0.2.1/Cw20ContractTs.types.ts b/packages/adocodegen/src/cw20/0.2.1/Cw20ContractTs.types.ts new file mode 100644 index 0000000..c0c1ae6 --- /dev/null +++ b/packages/adocodegen/src/cw20/0.2.1/Cw20ContractTs.types.ts @@ -0,0 +1,345 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type Logo = { + url: string; +} | { + embedded: EmbeddedLogo; +}; +export type EmbeddedLogo = { + svg: Binary; +} | { + png: Binary; +}; +export type Binary = string; +export type AndrAddr = string; +export interface InstantiateMsg { + decimals: number; + initial_balances: Cw20Coin[]; + kernel_address: string; + marketing?: InstantiateMarketingInfo | null; + mint?: MinterResponse | null; + modules?: Module[] | null; + name: string; + owner?: string | null; + symbol: string; +} +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export interface InstantiateMarketingInfo { + description?: string | null; + logo?: Logo | null; + marketing?: string | null; + project?: string | null; +} +export interface MinterResponse { + cap?: Uint128 | null; + minter: string; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + transfer: { + amount: Uint128; + recipient: string; + }; +} | { + burn: { + amount: Uint128; + }; +} | { + send: { + amount: Uint128; + contract: string; + msg: Binary; + }; +} | { + increase_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + decrease_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + transfer_from: { + amount: Uint128; + owner: string; + recipient: string; + }; +} | { + send_from: { + amount: Uint128; + contract: string; + msg: Binary; + owner: string; + }; +} | { + burn_from: { + amount: Uint128; + owner: string; + }; +} | { + mint: { + amount: Uint128; + recipient: string; + }; +} | { + update_marketing: { + description?: string | null; + marketing?: string | null; + project?: string | null; + }; +} | { + upload_logo: Logo; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + token_info: {}; +} | { + minter: {}; +} | { + allowance: { + owner: string; + spender: string; + }; +} | { + all_allowances: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_accounts: { + limit?: number | null; + start_after?: string | null; + }; +} | { + marketing_info: {}; +} | { + download_logo: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export interface AllAccountsResponse { + accounts: string[]; + [k: string]: unknown; +} +export interface AllAllowancesResponse { + allowances: AllowanceInfo[]; + [k: string]: unknown; +} +export interface AllowanceInfo { + allowance: Uint128; + expires: Expiration; + spender: string; +} +export interface AllowanceResponse { + allowance: Uint128; + expires: Expiration; + [k: string]: unknown; +} +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface DownloadLogoResponse { + data: Binary; + mime_type: string; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type LogoInfo = { + url: string; +} | "embedded"; +export interface MarketingInfoResponse { + description?: string | null; + logo?: LogoInfo | null; + marketing?: Addr | null; + project?: string | null; + [k: string]: unknown; +} +export type ArrayOfString = string[]; +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TokenInfoResponse { + decimals: number; + name: string; + symbol: string; + total_supply: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/0.2.16/Cw20ContractTs.client.ts b/packages/adocodegen/src/cw20/0.2.16/Cw20ContractTs.client.ts new file mode 100644 index 0000000..da6a693 --- /dev/null +++ b/packages/adocodegen/src/cw20/0.2.16/Cw20ContractTs.client.ts @@ -0,0 +1,661 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, Logo, EmbeddedLogo, Binary, AndrAddr, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, Module, ExecuteMsg, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllowanceResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, IsOperatorResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +export interface Cw20ContractTsReadOnlyInterface { + contractAddress: string; + tokenInfo: () => Promise; + minter: () => Promise; + allowance: ({ + owner, + spender + }: { + owner: string; + spender: string; + }) => Promise; + allAllowances: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allAccounts: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + marketingInfo: () => Promise; + downloadLogo: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class Cw20ContractTsQueryClient implements Cw20ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.tokenInfo = this.tokenInfo.bind(this); + this.minter = this.minter.bind(this); + this.allowance = this.allowance.bind(this); + this.allAllowances = this.allAllowances.bind(this); + this.allAccounts = this.allAccounts.bind(this); + this.marketingInfo = this.marketingInfo.bind(this); + this.downloadLogo = this.downloadLogo.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + tokenInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_info: {} + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + allowance = async ({ + owner, + spender + }: { + owner: string; + spender: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + allowance: { + owner, + spender + } + }); + }; + allAllowances = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_allowances: { + limit, + owner, + start_after: startAfter + } + }); + }; + allAccounts = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_accounts: { + limit, + start_after: startAfter + } + }); + }; + marketingInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + marketing_info: {} + }); + }; + downloadLogo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + download_logo: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface Cw20ContractTsInterface { + contractAddress: string; + sender: string; + transfer: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: string; + msg: Binary; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + increaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + decreaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferFrom: ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendFrom: ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: string; + msg: Binary; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burnFrom: ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + mint: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateMarketing: ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + uploadLogo: (logo: Logo, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20ContractTsClient implements Cw20ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transfer = this.transfer.bind(this); + this.burn = this.burn.bind(this); + this.send = this.send.bind(this); + this.increaseAllowance = this.increaseAllowance.bind(this); + this.decreaseAllowance = this.decreaseAllowance.bind(this); + this.transferFrom = this.transferFrom.bind(this); + this.sendFrom = this.sendFrom.bind(this); + this.burnFrom = this.burnFrom.bind(this); + this.mint = this.mint.bind(this); + this.updateMarketing = this.updateMarketing.bind(this); + this.uploadLogo = this.uploadLogo.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + transfer = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer: { + amount, + recipient + } + }, fee, memo, _funds); + }; + burn = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + amount + } + }, fee, memo, _funds); + }; + send = async ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: string; + msg: Binary; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: { + amount, + contract, + msg + } + }, fee, memo, _funds); + }; + increaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + increase_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + decreaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + decrease_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + transferFrom = async ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_from: { + amount, + owner, + recipient + } + }, fee, memo, _funds); + }; + sendFrom = async ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: string; + msg: Binary; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_from: { + amount, + contract, + msg, + owner + } + }, fee, memo, _funds); + }; + burnFrom = async ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn_from: { + amount, + owner + } + }, fee, memo, _funds); + }; + mint = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + amount, + recipient + } + }, fee, memo, _funds); + }; + updateMarketing = async ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_marketing: { + description, + marketing, + project + } + }, fee, memo, _funds); + }; + uploadLogo = async (logo: Logo, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + upload_logo: logo + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/0.2.16/Cw20ContractTs.message-builder.ts b/packages/adocodegen/src/cw20/0.2.16/Cw20ContractTs.message-builder.ts new file mode 100644 index 0000000..c33e5d2 --- /dev/null +++ b/packages/adocodegen/src/cw20/0.2.16/Cw20ContractTs.message-builder.ts @@ -0,0 +1,393 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, Logo, EmbeddedLogo, Binary, AndrAddr, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, Module, ExecuteMsg, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllowanceResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, IsOperatorResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20ContractTsExecuteMsgBuilder { + static transfer = ({ + amount, + recipient + }: CamelCasedProperties["transfer"]>): ExecuteMsg => { + return { + transfer: ({ + amount, + recipient + } as const) + }; + }; + static burn = ({ + amount + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + amount + } as const) + }; + }; + static send = ({ + amount, + contract, + msg + }: CamelCasedProperties["send"]>): ExecuteMsg => { + return { + send: ({ + amount, + contract, + msg + } as const) + }; + }; + static increaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["increase_allowance"]>): ExecuteMsg => { + return { + increase_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static decreaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["decrease_allowance"]>): ExecuteMsg => { + return { + decrease_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static transferFrom = ({ + amount, + owner, + recipient + }: CamelCasedProperties["transfer_from"]>): ExecuteMsg => { + return { + transfer_from: ({ + amount, + owner, + recipient + } as const) + }; + }; + static sendFrom = ({ + amount, + contract, + msg, + owner + }: CamelCasedProperties["send_from"]>): ExecuteMsg => { + return { + send_from: ({ + amount, + contract, + msg, + owner + } as const) + }; + }; + static burnFrom = ({ + amount, + owner + }: CamelCasedProperties["burn_from"]>): ExecuteMsg => { + return { + burn_from: ({ + amount, + owner + } as const) + }; + }; + static mint = ({ + amount, + recipient + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + amount, + recipient + } as const) + }; + }; + static updateMarketing = ({ + description, + marketing, + project + }: CamelCasedProperties["update_marketing"]>): ExecuteMsg => { + return { + update_marketing: ({ + description, + marketing, + project + } as const) + }; + }; + static uploadLogo = (logo: Logo): ExecuteMsg => { + return { + upload_logo: logo + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class Cw20ContractTsQueryMsgBuilder { + static tokenInfo = (): QueryMsg => { + return { + token_info: ({} as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static allowance = ({ + owner, + spender + }: CamelCasedProperties["allowance"]>): QueryMsg => { + return { + allowance: ({ + owner, + spender + } as const) + }; + }; + static allAllowances = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["all_allowances"]>): QueryMsg => { + return { + all_allowances: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allAccounts = ({ + limit, + startAfter + }: CamelCasedProperties["all_accounts"]>): QueryMsg => { + return { + all_accounts: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static marketingInfo = (): QueryMsg => { + return { + marketing_info: ({} as const) + }; + }; + static downloadLogo = (): QueryMsg => { + return { + download_logo: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/0.2.16/Cw20ContractTs.types.ts b/packages/adocodegen/src/cw20/0.2.16/Cw20ContractTs.types.ts new file mode 100644 index 0000000..f2351cd --- /dev/null +++ b/packages/adocodegen/src/cw20/0.2.16/Cw20ContractTs.types.ts @@ -0,0 +1,352 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type Logo = { + url: string; +} | { + embedded: EmbeddedLogo; +}; +export type EmbeddedLogo = { + svg: Binary; +} | { + png: Binary; +}; +export type Binary = string; +export type AndrAddr = string; +export interface InstantiateMsg { + decimals: number; + initial_balances: Cw20Coin[]; + kernel_address: string; + marketing?: InstantiateMarketingInfo | null; + mint?: MinterResponse | null; + modules?: Module[] | null; + name: string; + owner?: string | null; + symbol: string; +} +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export interface InstantiateMarketingInfo { + description?: string | null; + logo?: Logo | null; + marketing?: string | null; + project?: string | null; +} +export interface MinterResponse { + cap?: Uint128 | null; + minter: string; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + transfer: { + amount: Uint128; + recipient: string; + }; +} | { + burn: { + amount: Uint128; + }; +} | { + send: { + amount: Uint128; + contract: string; + msg: Binary; + }; +} | { + increase_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + decrease_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + transfer_from: { + amount: Uint128; + owner: string; + recipient: string; + }; +} | { + send_from: { + amount: Uint128; + contract: string; + msg: Binary; + owner: string; + }; +} | { + burn_from: { + amount: Uint128; + owner: string; + }; +} | { + mint: { + amount: Uint128; + recipient: string; + }; +} | { + update_marketing: { + description?: string | null; + marketing?: string | null; + project?: string | null; + }; +} | { + upload_logo: Logo; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + token_info: {}; +} | { + minter: {}; +} | { + allowance: { + owner: string; + spender: string; + }; +} | { + all_allowances: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_accounts: { + limit?: number | null; + start_after?: string | null; + }; +} | { + marketing_info: {}; +} | { + download_logo: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export interface AllAccountsResponse { + accounts: string[]; + [k: string]: unknown; +} +export interface AllAllowancesResponse { + allowances: AllowanceInfo[]; + [k: string]: unknown; +} +export interface AllowanceInfo { + allowance: Uint128; + expires: Expiration; + spender: string; +} +export interface AllowanceResponse { + allowance: Uint128; + expires: Expiration; + [k: string]: unknown; +} +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface DownloadLogoResponse { + data: Binary; + mime_type: string; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type LogoInfo = { + url: string; +} | "embedded"; +export interface MarketingInfoResponse { + description?: string | null; + logo?: LogoInfo | null; + marketing?: Addr | null; + project?: string | null; + [k: string]: unknown; +} +export type ArrayOfString = string[]; +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TokenInfoResponse { + decimals: number; + name: string; + symbol: string; + total_supply: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.1/Cw20ContractTs.client.ts b/packages/adocodegen/src/cw20/2.0.1/Cw20ContractTs.client.ts new file mode 100644 index 0000000..494c1a6 --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.1/Cw20ContractTs.client.ts @@ -0,0 +1,592 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, Logo, EmbeddedLogo, Binary, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, ExecuteMsg, AndrAddr, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, RatesQueryMessage, ADOBaseVersionResponse, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllowanceResponse, AppContractResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +export interface Cw20ContractTsReadOnlyInterface { + contractAddress: string; + tokenInfo: () => Promise; + minter: () => Promise; + allowance: ({ + owner, + spender + }: { + owner: string; + spender: string; + }) => Promise; + allAllowances: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allAccounts: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + marketingInfo: () => Promise; + downloadLogo: () => Promise; + balance: ({ + address + }: { + address: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: (ratesQueryMessage: RatesQueryMessage) => Promise; +} +export class Cw20ContractTsQueryClient implements Cw20ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.tokenInfo = this.tokenInfo.bind(this); + this.minter = this.minter.bind(this); + this.allowance = this.allowance.bind(this); + this.allAllowances = this.allAllowances.bind(this); + this.allAccounts = this.allAccounts.bind(this); + this.marketingInfo = this.marketingInfo.bind(this); + this.downloadLogo = this.downloadLogo.bind(this); + this.balance = this.balance.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + } + + tokenInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_info: {} + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + allowance = async ({ + owner, + spender + }: { + owner: string; + spender: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + allowance: { + owner, + spender + } + }); + }; + allAllowances = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_allowances: { + limit, + owner, + start_after: startAfter + } + }); + }; + allAccounts = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_accounts: { + limit, + start_after: startAfter + } + }); + }; + marketingInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + marketing_info: {} + }); + }; + downloadLogo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + download_logo: {} + }); + }; + balance = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async (ratesQueryMessage: RatesQueryMessage): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: ratesQueryMessage + }); + }; +} +export interface Cw20ContractTsInterface { + contractAddress: string; + sender: string; + transfer: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + increaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + decreaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferFrom: ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendFrom: ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burnFrom: ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + mint: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateMarketing: ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + uploadLogo: (logo: Logo, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20ContractTsClient implements Cw20ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transfer = this.transfer.bind(this); + this.burn = this.burn.bind(this); + this.send = this.send.bind(this); + this.increaseAllowance = this.increaseAllowance.bind(this); + this.decreaseAllowance = this.decreaseAllowance.bind(this); + this.transferFrom = this.transferFrom.bind(this); + this.sendFrom = this.sendFrom.bind(this); + this.burnFrom = this.burnFrom.bind(this); + this.mint = this.mint.bind(this); + this.updateMarketing = this.updateMarketing.bind(this); + this.uploadLogo = this.uploadLogo.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + transfer = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer: { + amount, + recipient + } + }, fee, memo, _funds); + }; + burn = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + amount + } + }, fee, memo, _funds); + }; + send = async ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: { + amount, + contract, + msg + } + }, fee, memo, _funds); + }; + increaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + increase_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + decreaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + decrease_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + transferFrom = async ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_from: { + amount, + owner, + recipient + } + }, fee, memo, _funds); + }; + sendFrom = async ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_from: { + amount, + contract, + msg, + owner + } + }, fee, memo, _funds); + }; + burnFrom = async ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn_from: { + amount, + owner + } + }, fee, memo, _funds); + }; + mint = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + amount, + recipient + } + }, fee, memo, _funds); + }; + updateMarketing = async ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_marketing: { + description, + marketing, + project + } + }, fee, memo, _funds); + }; + uploadLogo = async (logo: Logo, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + upload_logo: logo + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.1/Cw20ContractTs.message-builder.ts b/packages/adocodegen/src/cw20/2.0.1/Cw20ContractTs.message-builder.ts new file mode 100644 index 0000000..6ea0c2e --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.1/Cw20ContractTs.message-builder.ts @@ -0,0 +1,351 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, Logo, EmbeddedLogo, Binary, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, ExecuteMsg, AndrAddr, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, RatesQueryMessage, ADOBaseVersionResponse, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllowanceResponse, AppContractResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20ContractTsExecuteMsgBuilder { + static transfer = ({ + amount, + recipient + }: CamelCasedProperties["transfer"]>): ExecuteMsg => { + return { + transfer: ({ + amount, + recipient + } as const) + }; + }; + static burn = ({ + amount + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + amount + } as const) + }; + }; + static send = ({ + amount, + contract, + msg + }: CamelCasedProperties["send"]>): ExecuteMsg => { + return { + send: ({ + amount, + contract, + msg + } as const) + }; + }; + static increaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["increase_allowance"]>): ExecuteMsg => { + return { + increase_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static decreaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["decrease_allowance"]>): ExecuteMsg => { + return { + decrease_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static transferFrom = ({ + amount, + owner, + recipient + }: CamelCasedProperties["transfer_from"]>): ExecuteMsg => { + return { + transfer_from: ({ + amount, + owner, + recipient + } as const) + }; + }; + static sendFrom = ({ + amount, + contract, + msg, + owner + }: CamelCasedProperties["send_from"]>): ExecuteMsg => { + return { + send_from: ({ + amount, + contract, + msg, + owner + } as const) + }; + }; + static burnFrom = ({ + amount, + owner + }: CamelCasedProperties["burn_from"]>): ExecuteMsg => { + return { + burn_from: ({ + amount, + owner + } as const) + }; + }; + static mint = ({ + amount, + recipient + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + amount, + recipient + } as const) + }; + }; + static updateMarketing = ({ + description, + marketing, + project + }: CamelCasedProperties["update_marketing"]>): ExecuteMsg => { + return { + update_marketing: ({ + description, + marketing, + project + } as const) + }; + }; + static uploadLogo = (logo: Logo): ExecuteMsg => { + return { + upload_logo: logo + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class Cw20ContractTsQueryMsgBuilder { + static tokenInfo = (): QueryMsg => { + return { + token_info: ({} as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static allowance = ({ + owner, + spender + }: CamelCasedProperties["allowance"]>): QueryMsg => { + return { + allowance: ({ + owner, + spender + } as const) + }; + }; + static allAllowances = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["all_allowances"]>): QueryMsg => { + return { + all_allowances: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allAccounts = ({ + limit, + startAfter + }: CamelCasedProperties["all_accounts"]>): QueryMsg => { + return { + all_accounts: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static marketingInfo = (): QueryMsg => { + return { + marketing_info: ({} as const) + }; + }; + static downloadLogo = (): QueryMsg => { + return { + download_logo: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = (ratesQueryMessage: RatesQueryMessage): QueryMsg => { + return { + rates: ratesQueryMessage + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.1/Cw20ContractTs.types.ts b/packages/adocodegen/src/cw20/2.0.1/Cw20ContractTs.types.ts new file mode 100644 index 0000000..6e92c75 --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.1/Cw20ContractTs.types.ts @@ -0,0 +1,383 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type Logo = { + url: string; +} | { + embedded: EmbeddedLogo; +}; +export type EmbeddedLogo = { + svg: Binary; +} | { + png: Binary; +}; +export type Binary = string; +export interface InstantiateMsg { + decimals: number; + initial_balances: Cw20Coin[]; + kernel_address: string; + marketing?: InstantiateMarketingInfo | null; + mint?: MinterResponse | null; + name: string; + owner?: string | null; + symbol: string; +} +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export interface InstantiateMarketingInfo { + description?: string | null; + logo?: Logo | null; + marketing?: string | null; + project?: string | null; +} +export interface MinterResponse { + cap?: Uint128 | null; + minter: string; +} +export type ExecuteMsg = { + transfer: { + amount: Uint128; + recipient: AndrAddr; + }; +} | { + burn: { + amount: Uint128; + }; +} | { + send: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }; +} | { + increase_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + decrease_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + transfer_from: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }; +} | { + send_from: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }; +} | { + burn_from: { + amount: Uint128; + owner: string; + }; +} | { + mint: { + amount: Uint128; + recipient: string; + }; +} | { + update_marketing: { + description?: string | null; + marketing?: string | null; + project?: string | null; + }; +} | { + upload_logo: Logo; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + token_info: {}; +} | { + minter: {}; +} | { + allowance: { + owner: string; + spender: string; + }; +} | { + all_allowances: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_accounts: { + limit?: number | null; + start_after?: string | null; + }; +} | { + marketing_info: {}; +} | { + download_logo: {}; +} | { + balance: { + address: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: RatesQueryMessage; +}; +export type RatesQueryMessage = { + get_rate: { + action: string; + }; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllAccountsResponse { + accounts: string[]; + [k: string]: unknown; +} +export interface AllAllowancesResponse { + allowances: AllowanceInfo[]; + [k: string]: unknown; +} +export interface AllowanceInfo { + allowance: Uint128; + expires: Expiration; + spender: string; +} +export interface AllowanceResponse { + allowance: Uint128; + expires: Expiration; + [k: string]: unknown; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BalanceResponse { + balance: Uint128; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface DownloadLogoResponse { + data: Binary; + mime_type: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type LogoInfo = { + url: string; +} | "embedded"; +export interface MarketingInfoResponse { + description?: string | null; + logo?: LogoInfo | null; + marketing?: Addr | null; + project?: string | null; + [k: string]: unknown; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TokenInfoResponse { + decimals: number; + name: string; + symbol: string; + total_supply: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.2/Cw20ContractTs.client.ts b/packages/adocodegen/src/cw20/2.0.2/Cw20ContractTs.client.ts new file mode 100644 index 0000000..031c690 --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.2/Cw20ContractTs.client.ts @@ -0,0 +1,609 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, Logo, EmbeddedLogo, Binary, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, ExecuteMsg, AndrAddr, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllRatesResponse, AllowanceResponse, AppContractResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +export interface Cw20ContractTsReadOnlyInterface { + contractAddress: string; + tokenInfo: () => Promise; + minter: () => Promise; + allowance: ({ + owner, + spender + }: { + owner: string; + spender: string; + }) => Promise; + allAllowances: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allAccounts: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + marketingInfo: () => Promise; + downloadLogo: () => Promise; + balance: ({ + address + }: { + address: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class Cw20ContractTsQueryClient implements Cw20ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.tokenInfo = this.tokenInfo.bind(this); + this.minter = this.minter.bind(this); + this.allowance = this.allowance.bind(this); + this.allAllowances = this.allAllowances.bind(this); + this.allAccounts = this.allAccounts.bind(this); + this.marketingInfo = this.marketingInfo.bind(this); + this.downloadLogo = this.downloadLogo.bind(this); + this.balance = this.balance.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + tokenInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_info: {} + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + allowance = async ({ + owner, + spender + }: { + owner: string; + spender: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + allowance: { + owner, + spender + } + }); + }; + allAllowances = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_allowances: { + limit, + owner, + start_after: startAfter + } + }); + }; + allAccounts = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_accounts: { + limit, + start_after: startAfter + } + }); + }; + marketingInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + marketing_info: {} + }); + }; + downloadLogo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + download_logo: {} + }); + }; + balance = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface Cw20ContractTsInterface { + contractAddress: string; + sender: string; + transfer: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + increaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + decreaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferFrom: ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendFrom: ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burnFrom: ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + mint: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateMarketing: ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + uploadLogo: (logo: Logo, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20ContractTsClient implements Cw20ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transfer = this.transfer.bind(this); + this.burn = this.burn.bind(this); + this.send = this.send.bind(this); + this.increaseAllowance = this.increaseAllowance.bind(this); + this.decreaseAllowance = this.decreaseAllowance.bind(this); + this.transferFrom = this.transferFrom.bind(this); + this.sendFrom = this.sendFrom.bind(this); + this.burnFrom = this.burnFrom.bind(this); + this.mint = this.mint.bind(this); + this.updateMarketing = this.updateMarketing.bind(this); + this.uploadLogo = this.uploadLogo.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + transfer = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer: { + amount, + recipient + } + }, fee, memo, _funds); + }; + burn = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + amount + } + }, fee, memo, _funds); + }; + send = async ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: { + amount, + contract, + msg + } + }, fee, memo, _funds); + }; + increaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + increase_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + decreaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + decrease_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + transferFrom = async ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_from: { + amount, + owner, + recipient + } + }, fee, memo, _funds); + }; + sendFrom = async ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_from: { + amount, + contract, + msg, + owner + } + }, fee, memo, _funds); + }; + burnFrom = async ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn_from: { + amount, + owner + } + }, fee, memo, _funds); + }; + mint = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + amount, + recipient + } + }, fee, memo, _funds); + }; + updateMarketing = async ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_marketing: { + description, + marketing, + project + } + }, fee, memo, _funds); + }; + uploadLogo = async (logo: Logo, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + upload_logo: logo + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.2/Cw20ContractTs.message-builder.ts b/packages/adocodegen/src/cw20/2.0.2/Cw20ContractTs.message-builder.ts new file mode 100644 index 0000000..afa133a --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.2/Cw20ContractTs.message-builder.ts @@ -0,0 +1,362 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, Logo, EmbeddedLogo, Binary, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, ExecuteMsg, AndrAddr, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllRatesResponse, AllowanceResponse, AppContractResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20ContractTsExecuteMsgBuilder { + static transfer = ({ + amount, + recipient + }: CamelCasedProperties["transfer"]>): ExecuteMsg => { + return { + transfer: ({ + amount, + recipient + } as const) + }; + }; + static burn = ({ + amount + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + amount + } as const) + }; + }; + static send = ({ + amount, + contract, + msg + }: CamelCasedProperties["send"]>): ExecuteMsg => { + return { + send: ({ + amount, + contract, + msg + } as const) + }; + }; + static increaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["increase_allowance"]>): ExecuteMsg => { + return { + increase_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static decreaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["decrease_allowance"]>): ExecuteMsg => { + return { + decrease_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static transferFrom = ({ + amount, + owner, + recipient + }: CamelCasedProperties["transfer_from"]>): ExecuteMsg => { + return { + transfer_from: ({ + amount, + owner, + recipient + } as const) + }; + }; + static sendFrom = ({ + amount, + contract, + msg, + owner + }: CamelCasedProperties["send_from"]>): ExecuteMsg => { + return { + send_from: ({ + amount, + contract, + msg, + owner + } as const) + }; + }; + static burnFrom = ({ + amount, + owner + }: CamelCasedProperties["burn_from"]>): ExecuteMsg => { + return { + burn_from: ({ + amount, + owner + } as const) + }; + }; + static mint = ({ + amount, + recipient + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + amount, + recipient + } as const) + }; + }; + static updateMarketing = ({ + description, + marketing, + project + }: CamelCasedProperties["update_marketing"]>): ExecuteMsg => { + return { + update_marketing: ({ + description, + marketing, + project + } as const) + }; + }; + static uploadLogo = (logo: Logo): ExecuteMsg => { + return { + upload_logo: logo + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class Cw20ContractTsQueryMsgBuilder { + static tokenInfo = (): QueryMsg => { + return { + token_info: ({} as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static allowance = ({ + owner, + spender + }: CamelCasedProperties["allowance"]>): QueryMsg => { + return { + allowance: ({ + owner, + spender + } as const) + }; + }; + static allAllowances = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["all_allowances"]>): QueryMsg => { + return { + all_allowances: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allAccounts = ({ + limit, + startAfter + }: CamelCasedProperties["all_accounts"]>): QueryMsg => { + return { + all_accounts: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static marketingInfo = (): QueryMsg => { + return { + marketing_info: ({} as const) + }; + }; + static downloadLogo = (): QueryMsg => { + return { + download_logo: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.2/Cw20ContractTs.types.ts b/packages/adocodegen/src/cw20/2.0.2/Cw20ContractTs.types.ts new file mode 100644 index 0000000..6681246 --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.2/Cw20ContractTs.types.ts @@ -0,0 +1,385 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type Logo = { + url: string; +} | { + embedded: EmbeddedLogo; +}; +export type EmbeddedLogo = { + svg: Binary; +} | { + png: Binary; +}; +export type Binary = string; +export interface InstantiateMsg { + decimals: number; + initial_balances: Cw20Coin[]; + kernel_address: string; + marketing?: InstantiateMarketingInfo | null; + mint?: MinterResponse | null; + name: string; + owner?: string | null; + symbol: string; +} +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export interface InstantiateMarketingInfo { + description?: string | null; + logo?: Logo | null; + marketing?: string | null; + project?: string | null; +} +export interface MinterResponse { + cap?: Uint128 | null; + minter: string; +} +export type ExecuteMsg = { + transfer: { + amount: Uint128; + recipient: AndrAddr; + }; +} | { + burn: { + amount: Uint128; + }; +} | { + send: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }; +} | { + increase_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + decrease_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + transfer_from: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }; +} | { + send_from: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }; +} | { + burn_from: { + amount: Uint128; + owner: string; + }; +} | { + mint: { + amount: Uint128; + recipient: string; + }; +} | { + update_marketing: { + description?: string | null; + marketing?: string | null; + project?: string | null; + }; +} | { + upload_logo: Logo; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + token_info: {}; +} | { + minter: {}; +} | { + allowance: { + owner: string; + spender: string; + }; +} | { + all_allowances: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_accounts: { + limit?: number | null; + start_after?: string | null; + }; +} | { + marketing_info: {}; +} | { + download_logo: {}; +} | { + balance: { + address: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllAccountsResponse { + accounts: string[]; + [k: string]: unknown; +} +export interface AllAllowancesResponse { + allowances: AllowanceInfo[]; + [k: string]: unknown; +} +export interface AllowanceInfo { + allowance: Uint128; + expires: Expiration; + spender: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AllowanceResponse { + allowance: Uint128; + expires: Expiration; + [k: string]: unknown; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BalanceResponse { + balance: Uint128; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface DownloadLogoResponse { + data: Binary; + mime_type: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type LogoInfo = { + url: string; +} | "embedded"; +export interface MarketingInfoResponse { + description?: string | null; + logo?: LogoInfo | null; + marketing?: Addr | null; + project?: string | null; + [k: string]: unknown; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TokenInfoResponse { + decimals: number; + name: string; + symbol: string; + total_supply: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.3-beta.1/Cw20ContractTs.client.ts b/packages/adocodegen/src/cw20/2.0.3-beta.1/Cw20ContractTs.client.ts new file mode 100644 index 0000000..031c690 --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.3-beta.1/Cw20ContractTs.client.ts @@ -0,0 +1,609 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, Logo, EmbeddedLogo, Binary, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, ExecuteMsg, AndrAddr, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllRatesResponse, AllowanceResponse, AppContractResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +export interface Cw20ContractTsReadOnlyInterface { + contractAddress: string; + tokenInfo: () => Promise; + minter: () => Promise; + allowance: ({ + owner, + spender + }: { + owner: string; + spender: string; + }) => Promise; + allAllowances: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allAccounts: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + marketingInfo: () => Promise; + downloadLogo: () => Promise; + balance: ({ + address + }: { + address: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class Cw20ContractTsQueryClient implements Cw20ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.tokenInfo = this.tokenInfo.bind(this); + this.minter = this.minter.bind(this); + this.allowance = this.allowance.bind(this); + this.allAllowances = this.allAllowances.bind(this); + this.allAccounts = this.allAccounts.bind(this); + this.marketingInfo = this.marketingInfo.bind(this); + this.downloadLogo = this.downloadLogo.bind(this); + this.balance = this.balance.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + tokenInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_info: {} + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + allowance = async ({ + owner, + spender + }: { + owner: string; + spender: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + allowance: { + owner, + spender + } + }); + }; + allAllowances = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_allowances: { + limit, + owner, + start_after: startAfter + } + }); + }; + allAccounts = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_accounts: { + limit, + start_after: startAfter + } + }); + }; + marketingInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + marketing_info: {} + }); + }; + downloadLogo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + download_logo: {} + }); + }; + balance = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface Cw20ContractTsInterface { + contractAddress: string; + sender: string; + transfer: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + increaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + decreaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferFrom: ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendFrom: ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burnFrom: ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + mint: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateMarketing: ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + uploadLogo: (logo: Logo, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20ContractTsClient implements Cw20ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transfer = this.transfer.bind(this); + this.burn = this.burn.bind(this); + this.send = this.send.bind(this); + this.increaseAllowance = this.increaseAllowance.bind(this); + this.decreaseAllowance = this.decreaseAllowance.bind(this); + this.transferFrom = this.transferFrom.bind(this); + this.sendFrom = this.sendFrom.bind(this); + this.burnFrom = this.burnFrom.bind(this); + this.mint = this.mint.bind(this); + this.updateMarketing = this.updateMarketing.bind(this); + this.uploadLogo = this.uploadLogo.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + transfer = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer: { + amount, + recipient + } + }, fee, memo, _funds); + }; + burn = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + amount + } + }, fee, memo, _funds); + }; + send = async ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: { + amount, + contract, + msg + } + }, fee, memo, _funds); + }; + increaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + increase_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + decreaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + decrease_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + transferFrom = async ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_from: { + amount, + owner, + recipient + } + }, fee, memo, _funds); + }; + sendFrom = async ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_from: { + amount, + contract, + msg, + owner + } + }, fee, memo, _funds); + }; + burnFrom = async ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn_from: { + amount, + owner + } + }, fee, memo, _funds); + }; + mint = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + amount, + recipient + } + }, fee, memo, _funds); + }; + updateMarketing = async ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_marketing: { + description, + marketing, + project + } + }, fee, memo, _funds); + }; + uploadLogo = async (logo: Logo, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + upload_logo: logo + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.3-beta.1/Cw20ContractTs.message-builder.ts b/packages/adocodegen/src/cw20/2.0.3-beta.1/Cw20ContractTs.message-builder.ts new file mode 100644 index 0000000..afa133a --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.3-beta.1/Cw20ContractTs.message-builder.ts @@ -0,0 +1,362 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, Logo, EmbeddedLogo, Binary, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, ExecuteMsg, AndrAddr, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllRatesResponse, AllowanceResponse, AppContractResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20ContractTsExecuteMsgBuilder { + static transfer = ({ + amount, + recipient + }: CamelCasedProperties["transfer"]>): ExecuteMsg => { + return { + transfer: ({ + amount, + recipient + } as const) + }; + }; + static burn = ({ + amount + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + amount + } as const) + }; + }; + static send = ({ + amount, + contract, + msg + }: CamelCasedProperties["send"]>): ExecuteMsg => { + return { + send: ({ + amount, + contract, + msg + } as const) + }; + }; + static increaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["increase_allowance"]>): ExecuteMsg => { + return { + increase_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static decreaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["decrease_allowance"]>): ExecuteMsg => { + return { + decrease_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static transferFrom = ({ + amount, + owner, + recipient + }: CamelCasedProperties["transfer_from"]>): ExecuteMsg => { + return { + transfer_from: ({ + amount, + owner, + recipient + } as const) + }; + }; + static sendFrom = ({ + amount, + contract, + msg, + owner + }: CamelCasedProperties["send_from"]>): ExecuteMsg => { + return { + send_from: ({ + amount, + contract, + msg, + owner + } as const) + }; + }; + static burnFrom = ({ + amount, + owner + }: CamelCasedProperties["burn_from"]>): ExecuteMsg => { + return { + burn_from: ({ + amount, + owner + } as const) + }; + }; + static mint = ({ + amount, + recipient + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + amount, + recipient + } as const) + }; + }; + static updateMarketing = ({ + description, + marketing, + project + }: CamelCasedProperties["update_marketing"]>): ExecuteMsg => { + return { + update_marketing: ({ + description, + marketing, + project + } as const) + }; + }; + static uploadLogo = (logo: Logo): ExecuteMsg => { + return { + upload_logo: logo + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class Cw20ContractTsQueryMsgBuilder { + static tokenInfo = (): QueryMsg => { + return { + token_info: ({} as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static allowance = ({ + owner, + spender + }: CamelCasedProperties["allowance"]>): QueryMsg => { + return { + allowance: ({ + owner, + spender + } as const) + }; + }; + static allAllowances = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["all_allowances"]>): QueryMsg => { + return { + all_allowances: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allAccounts = ({ + limit, + startAfter + }: CamelCasedProperties["all_accounts"]>): QueryMsg => { + return { + all_accounts: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static marketingInfo = (): QueryMsg => { + return { + marketing_info: ({} as const) + }; + }; + static downloadLogo = (): QueryMsg => { + return { + download_logo: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.3-beta.1/Cw20ContractTs.types.ts b/packages/adocodegen/src/cw20/2.0.3-beta.1/Cw20ContractTs.types.ts new file mode 100644 index 0000000..94b934b --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.3-beta.1/Cw20ContractTs.types.ts @@ -0,0 +1,385 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type Logo = { + url: string; +} | { + embedded: EmbeddedLogo; +}; +export type EmbeddedLogo = { + svg: Binary; +} | { + png: Binary; +}; +export type Binary = string; +export interface InstantiateMsg { + decimals: number; + initial_balances: Cw20Coin[]; + kernel_address: string; + marketing?: InstantiateMarketingInfo | null; + mint?: MinterResponse | null; + name: string; + owner?: string | null; + symbol: string; +} +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export interface InstantiateMarketingInfo { + description?: string | null; + logo?: Logo | null; + marketing?: string | null; + project?: string | null; +} +export interface MinterResponse { + cap?: Uint128 | null; + minter: string; +} +export type ExecuteMsg = { + transfer: { + amount: Uint128; + recipient: AndrAddr; + }; +} | { + burn: { + amount: Uint128; + }; +} | { + send: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }; +} | { + increase_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + decrease_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + transfer_from: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }; +} | { + send_from: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }; +} | { + burn_from: { + amount: Uint128; + owner: string; + }; +} | { + mint: { + amount: Uint128; + recipient: string; + }; +} | { + update_marketing: { + description?: string | null; + marketing?: string | null; + project?: string | null; + }; +} | { + upload_logo: Logo; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + token_info: {}; +} | { + minter: {}; +} | { + allowance: { + owner: string; + spender: string; + }; +} | { + all_allowances: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_accounts: { + limit?: number | null; + start_after?: string | null; + }; +} | { + marketing_info: {}; +} | { + download_logo: {}; +} | { + balance: { + address: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllAccountsResponse { + accounts: string[]; + [k: string]: unknown; +} +export interface AllAllowancesResponse { + allowances: AllowanceInfo[]; + [k: string]: unknown; +} +export interface AllowanceInfo { + allowance: Uint128; + expires: Expiration; + spender: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AllowanceResponse { + allowance: Uint128; + expires: Expiration; + [k: string]: unknown; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BalanceResponse { + balance: Uint128; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface DownloadLogoResponse { + data: Binary; + mime_type: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type LogoInfo = { + url: string; +} | "embedded"; +export interface MarketingInfoResponse { + description?: string | null; + logo?: LogoInfo | null; + marketing?: Addr | null; + project?: string | null; + [k: string]: unknown; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TokenInfoResponse { + decimals: number; + name: string; + symbol: string; + total_supply: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.3/Cw20ContractTs.client.ts b/packages/adocodegen/src/cw20/2.0.3/Cw20ContractTs.client.ts new file mode 100644 index 0000000..031c690 --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.3/Cw20ContractTs.client.ts @@ -0,0 +1,609 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, Logo, EmbeddedLogo, Binary, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, ExecuteMsg, AndrAddr, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllRatesResponse, AllowanceResponse, AppContractResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +export interface Cw20ContractTsReadOnlyInterface { + contractAddress: string; + tokenInfo: () => Promise; + minter: () => Promise; + allowance: ({ + owner, + spender + }: { + owner: string; + spender: string; + }) => Promise; + allAllowances: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allAccounts: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + marketingInfo: () => Promise; + downloadLogo: () => Promise; + balance: ({ + address + }: { + address: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class Cw20ContractTsQueryClient implements Cw20ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.tokenInfo = this.tokenInfo.bind(this); + this.minter = this.minter.bind(this); + this.allowance = this.allowance.bind(this); + this.allAllowances = this.allAllowances.bind(this); + this.allAccounts = this.allAccounts.bind(this); + this.marketingInfo = this.marketingInfo.bind(this); + this.downloadLogo = this.downloadLogo.bind(this); + this.balance = this.balance.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + tokenInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + token_info: {} + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + allowance = async ({ + owner, + spender + }: { + owner: string; + spender: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + allowance: { + owner, + spender + } + }); + }; + allAllowances = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_allowances: { + limit, + owner, + start_after: startAfter + } + }); + }; + allAccounts = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_accounts: { + limit, + start_after: startAfter + } + }); + }; + marketingInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + marketing_info: {} + }); + }; + downloadLogo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + download_logo: {} + }); + }; + balance = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface Cw20ContractTsInterface { + contractAddress: string; + sender: string; + transfer: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + increaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + decreaseAllowance: ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferFrom: ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendFrom: ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burnFrom: ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + mint: ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateMarketing: ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + uploadLogo: (logo: Logo, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw20ContractTsClient implements Cw20ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.transfer = this.transfer.bind(this); + this.burn = this.burn.bind(this); + this.send = this.send.bind(this); + this.increaseAllowance = this.increaseAllowance.bind(this); + this.decreaseAllowance = this.decreaseAllowance.bind(this); + this.transferFrom = this.transferFrom.bind(this); + this.sendFrom = this.sendFrom.bind(this); + this.burnFrom = this.burnFrom.bind(this); + this.mint = this.mint.bind(this); + this.updateMarketing = this.updateMarketing.bind(this); + this.uploadLogo = this.uploadLogo.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + transfer = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer: { + amount, + recipient + } + }, fee, memo, _funds); + }; + burn = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + amount + } + }, fee, memo, _funds); + }; + send = async ({ + amount, + contract, + msg + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: { + amount, + contract, + msg + } + }, fee, memo, _funds); + }; + increaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + increase_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + decreaseAllowance = async ({ + amount, + expires, + spender + }: { + amount: Uint128; + expires?: Expiration; + spender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + decrease_allowance: { + amount, + expires, + spender + } + }, fee, memo, _funds); + }; + transferFrom = async ({ + amount, + owner, + recipient + }: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_from: { + amount, + owner, + recipient + } + }, fee, memo, _funds); + }; + sendFrom = async ({ + amount, + contract, + msg, + owner + }: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_from: { + amount, + contract, + msg, + owner + } + }, fee, memo, _funds); + }; + burnFrom = async ({ + amount, + owner + }: { + amount: Uint128; + owner: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn_from: { + amount, + owner + } + }, fee, memo, _funds); + }; + mint = async ({ + amount, + recipient + }: { + amount: Uint128; + recipient: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + amount, + recipient + } + }, fee, memo, _funds); + }; + updateMarketing = async ({ + description, + marketing, + project + }: { + description?: string; + marketing?: string; + project?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_marketing: { + description, + marketing, + project + } + }, fee, memo, _funds); + }; + uploadLogo = async (logo: Logo, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + upload_logo: logo + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.3/Cw20ContractTs.message-builder.ts b/packages/adocodegen/src/cw20/2.0.3/Cw20ContractTs.message-builder.ts new file mode 100644 index 0000000..afa133a --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.3/Cw20ContractTs.message-builder.ts @@ -0,0 +1,362 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, Logo, EmbeddedLogo, Binary, InstantiateMsg, Cw20Coin, InstantiateMarketingInfo, MinterResponse, ExecuteMsg, AndrAddr, Expiration, Timestamp, Uint64, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllAccountsResponse, AllAllowancesResponse, AllowanceInfo, AllRatesResponse, AllowanceResponse, AppContractResponse, BalanceResponse, BlockHeightResponse, DownloadLogoResponse, KernelAddressResponse, LogoInfo, MarketingInfoResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TokenInfoResponse, TypeResponse, VersionResponse } from "./Cw20ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw20ContractTsExecuteMsgBuilder { + static transfer = ({ + amount, + recipient + }: CamelCasedProperties["transfer"]>): ExecuteMsg => { + return { + transfer: ({ + amount, + recipient + } as const) + }; + }; + static burn = ({ + amount + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + amount + } as const) + }; + }; + static send = ({ + amount, + contract, + msg + }: CamelCasedProperties["send"]>): ExecuteMsg => { + return { + send: ({ + amount, + contract, + msg + } as const) + }; + }; + static increaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["increase_allowance"]>): ExecuteMsg => { + return { + increase_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static decreaseAllowance = ({ + amount, + expires, + spender + }: CamelCasedProperties["decrease_allowance"]>): ExecuteMsg => { + return { + decrease_allowance: ({ + amount, + expires, + spender + } as const) + }; + }; + static transferFrom = ({ + amount, + owner, + recipient + }: CamelCasedProperties["transfer_from"]>): ExecuteMsg => { + return { + transfer_from: ({ + amount, + owner, + recipient + } as const) + }; + }; + static sendFrom = ({ + amount, + contract, + msg, + owner + }: CamelCasedProperties["send_from"]>): ExecuteMsg => { + return { + send_from: ({ + amount, + contract, + msg, + owner + } as const) + }; + }; + static burnFrom = ({ + amount, + owner + }: CamelCasedProperties["burn_from"]>): ExecuteMsg => { + return { + burn_from: ({ + amount, + owner + } as const) + }; + }; + static mint = ({ + amount, + recipient + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + amount, + recipient + } as const) + }; + }; + static updateMarketing = ({ + description, + marketing, + project + }: CamelCasedProperties["update_marketing"]>): ExecuteMsg => { + return { + update_marketing: ({ + description, + marketing, + project + } as const) + }; + }; + static uploadLogo = (logo: Logo): ExecuteMsg => { + return { + upload_logo: logo + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class Cw20ContractTsQueryMsgBuilder { + static tokenInfo = (): QueryMsg => { + return { + token_info: ({} as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static allowance = ({ + owner, + spender + }: CamelCasedProperties["allowance"]>): QueryMsg => { + return { + allowance: ({ + owner, + spender + } as const) + }; + }; + static allAllowances = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["all_allowances"]>): QueryMsg => { + return { + all_allowances: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allAccounts = ({ + limit, + startAfter + }: CamelCasedProperties["all_accounts"]>): QueryMsg => { + return { + all_accounts: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static marketingInfo = (): QueryMsg => { + return { + marketing_info: ({} as const) + }; + }; + static downloadLogo = (): QueryMsg => { + return { + download_logo: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw20/2.0.3/Cw20ContractTs.types.ts b/packages/adocodegen/src/cw20/2.0.3/Cw20ContractTs.types.ts new file mode 100644 index 0000000..94b934b --- /dev/null +++ b/packages/adocodegen/src/cw20/2.0.3/Cw20ContractTs.types.ts @@ -0,0 +1,385 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type Logo = { + url: string; +} | { + embedded: EmbeddedLogo; +}; +export type EmbeddedLogo = { + svg: Binary; +} | { + png: Binary; +}; +export type Binary = string; +export interface InstantiateMsg { + decimals: number; + initial_balances: Cw20Coin[]; + kernel_address: string; + marketing?: InstantiateMarketingInfo | null; + mint?: MinterResponse | null; + name: string; + owner?: string | null; + symbol: string; +} +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export interface InstantiateMarketingInfo { + description?: string | null; + logo?: Logo | null; + marketing?: string | null; + project?: string | null; +} +export interface MinterResponse { + cap?: Uint128 | null; + minter: string; +} +export type ExecuteMsg = { + transfer: { + amount: Uint128; + recipient: AndrAddr; + }; +} | { + burn: { + amount: Uint128; + }; +} | { + send: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + }; +} | { + increase_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + decrease_allowance: { + amount: Uint128; + expires?: Expiration | null; + spender: string; + }; +} | { + transfer_from: { + amount: Uint128; + owner: string; + recipient: AndrAddr; + }; +} | { + send_from: { + amount: Uint128; + contract: AndrAddr; + msg: Binary; + owner: string; + }; +} | { + burn_from: { + amount: Uint128; + owner: string; + }; +} | { + mint: { + amount: Uint128; + recipient: string; + }; +} | { + update_marketing: { + description?: string | null; + marketing?: string | null; + project?: string | null; + }; +} | { + upload_logo: Logo; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + token_info: {}; +} | { + minter: {}; +} | { + allowance: { + owner: string; + spender: string; + }; +} | { + all_allowances: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_accounts: { + limit?: number | null; + start_after?: string | null; + }; +} | { + marketing_info: {}; +} | { + download_logo: {}; +} | { + balance: { + address: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllAccountsResponse { + accounts: string[]; + [k: string]: unknown; +} +export interface AllAllowancesResponse { + allowances: AllowanceInfo[]; + [k: string]: unknown; +} +export interface AllowanceInfo { + allowance: Uint128; + expires: Expiration; + spender: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AllowanceResponse { + allowance: Uint128; + expires: Expiration; + [k: string]: unknown; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BalanceResponse { + balance: Uint128; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface DownloadLogoResponse { + data: Binary; + mime_type: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type LogoInfo = { + url: string; +} | "embedded"; +export interface MarketingInfoResponse { + description?: string | null; + logo?: LogoInfo | null; + marketing?: Addr | null; + project?: string | null; + [k: string]: unknown; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TokenInfoResponse { + decimals: number; + name: string; + symbol: string; + total_supply: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw20ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw721-timelock/1.0.0/Cw721TimelockContractTs.client.ts b/packages/adocodegen/src/cw721-timelock/1.0.0/Cw721TimelockContractTs.client.ts new file mode 100644 index 0000000..cedb6c1 --- /dev/null +++ b/packages/adocodegen/src/cw721-timelock/1.0.0/Cw721TimelockContractTs.client.ts @@ -0,0 +1,313 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, ReplyOn, Uint128, OwnershipMessage, Milliseconds, Addr, PermissioningMessage, Permission, Cw721ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, AppContractResponse, BlockHeightResponse, IsLockedResponse, KernelAddressResponse, NftDetailsResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, UnlockTimeResponse, VersionResponse } from "./Cw721TimelockContractTs.types"; +export interface Cw721TimelockContractTsReadOnlyInterface { + contractAddress: string; + unlockTime: ({ + cw721Contract, + tokenId + }: { + cw721Contract: AndrAddr; + tokenId: string; + }) => Promise; + nftDetails: ({ + cw721Contract, + tokenId + }: { + cw721Contract: AndrAddr; + tokenId: string; + }) => Promise; + isLocked: ({ + cw721Contract, + tokenId + }: { + cw721Contract: AndrAddr; + tokenId: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class Cw721TimelockContractTsQueryClient implements Cw721TimelockContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.unlockTime = this.unlockTime.bind(this); + this.nftDetails = this.nftDetails.bind(this); + this.isLocked = this.isLocked.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + unlockTime = async ({ + cw721Contract, + tokenId + }: { + cw721Contract: AndrAddr; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + unlock_time: { + cw721_contract: cw721Contract, + token_id: tokenId + } + }); + }; + nftDetails = async ({ + cw721Contract, + tokenId + }: { + cw721Contract: AndrAddr; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_details: { + cw721_contract: cw721Contract, + token_id: tokenId + } + }); + }; + isLocked = async ({ + cw721Contract, + tokenId + }: { + cw721Contract: AndrAddr; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_locked: { + cw721_contract: cw721Contract, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface Cw721TimelockContractTsInterface { + contractAddress: string; + sender: string; + receiveNft: ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimNft: ({ + cw721Contract, + tokenId + }: { + cw721Contract: AndrAddr; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw721TimelockContractTsClient implements Cw721TimelockContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receiveNft = this.receiveNft.bind(this); + this.claimNft = this.claimNft.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + receiveNft = async ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive_nft: { + msg, + sender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + claimNft = async ({ + cw721Contract, + tokenId + }: { + cw721Contract: AndrAddr; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_nft: { + cw721_contract: cw721Contract, + token_id: tokenId + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721-timelock/1.0.0/Cw721TimelockContractTs.message-builder.ts b/packages/adocodegen/src/cw721-timelock/1.0.0/Cw721TimelockContractTs.message-builder.ts new file mode 100644 index 0000000..49bd8f3 --- /dev/null +++ b/packages/adocodegen/src/cw721-timelock/1.0.0/Cw721TimelockContractTs.message-builder.ts @@ -0,0 +1,184 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, ReplyOn, Uint128, OwnershipMessage, Milliseconds, Addr, PermissioningMessage, Permission, Cw721ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, AppContractResponse, BlockHeightResponse, IsLockedResponse, KernelAddressResponse, NftDetailsResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, UnlockTimeResponse, VersionResponse } from "./Cw721TimelockContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw721TimelockContractTsExecuteMsgBuilder { + static receiveNft = ({ + msg, + sender, + tokenId + }: CamelCasedProperties["receive_nft"]>): ExecuteMsg => { + return { + receive_nft: ({ + msg, + sender, + token_id: tokenId + } as const) + }; + }; + static claimNft = ({ + cw721Contract, + tokenId + }: CamelCasedProperties["claim_nft"]>): ExecuteMsg => { + return { + claim_nft: ({ + cw721_contract: cw721Contract, + token_id: tokenId + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class Cw721TimelockContractTsQueryMsgBuilder { + static unlockTime = ({ + cw721Contract, + tokenId + }: CamelCasedProperties["unlock_time"]>): QueryMsg => { + return { + unlock_time: ({ + cw721_contract: cw721Contract, + token_id: tokenId + } as const) + }; + }; + static nftDetails = ({ + cw721Contract, + tokenId + }: CamelCasedProperties["nft_details"]>): QueryMsg => { + return { + nft_details: ({ + cw721_contract: cw721Contract, + token_id: tokenId + } as const) + }; + }; + static isLocked = ({ + cw721Contract, + tokenId + }: CamelCasedProperties["is_locked"]>): QueryMsg => { + return { + is_locked: ({ + cw721_contract: cw721Contract, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721-timelock/1.0.0/Cw721TimelockContractTs.types.ts b/packages/adocodegen/src/cw721-timelock/1.0.0/Cw721TimelockContractTs.types.ts new file mode 100644 index 0000000..32e6ccc --- /dev/null +++ b/packages/adocodegen/src/cw721-timelock/1.0.0/Cw721TimelockContractTs.types.ts @@ -0,0 +1,194 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + authorized_token_addresses?: AndrAddr[] | null; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + receive_nft: Cw721ReceiveMsg; +} | { + claim_nft: { + cw721_contract: AndrAddr; + token_id: string; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Milliseconds | null; + new_owner: Addr; + }; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Milliseconds | null; +} | { + limited: { + expiration?: Milliseconds | null; + uses: number; + }; +} | { + whitelisted: Milliseconds | null; +}; +export interface Cw721ReceiveMsg { + msg: Binary; + sender: string; + token_id: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + unlock_time: { + cw721_contract: AndrAddr; + token_id: string; + }; +} | { + nft_details: { + cw721_contract: AndrAddr; + token_id: string; + }; +} | { + is_locked: { + cw721_contract: AndrAddr; + token_id: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IsLockedResponse { + is_locked: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface NftDetailsResponse { + recipient: Addr; + unlock_time: number; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface UnlockTimeResponse { + unlock_time: number; +} +export interface VersionResponse { + version: string; +} +export type Cw721TimelockContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/0.2.1/Cw721ContractTs.client.ts b/packages/adocodegen/src/cw721/0.2.1/Cw721ContractTs.client.ts new file mode 100644 index 0000000..d301fc7 --- /dev/null +++ b/packages/adocodegen/src/cw721/0.2.1/Cw721ContractTs.client.ts @@ -0,0 +1,886 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ExecuteMsg1, ReplyOn, OwnershipMessage, Addr, Permission, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, QueryMsg1, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, BalanceResponse, BlockHeightResponse, ContractInfoResponse, Boolean, IsOperatorResponse, KernelAddressResponse, MinterResponse, ArrayOfString, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +export interface Cw721ContractTsReadOnlyInterface { + contractAddress: string; + ownerOf: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + allOperators: ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + numTokens: () => Promise; + nftInfo: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + allNftInfo: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + tokens: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + isArchived: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + transferAgreement: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + contractInfo: () => Promise; + extension: ({ + msg + }: { + msg: QueryMsg; + }) => Promise; + minter: () => Promise; + approval: ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }) => Promise; + approvals: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class Cw721ContractTsQueryClient implements Cw721ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.ownerOf = this.ownerOf.bind(this); + this.allOperators = this.allOperators.bind(this); + this.numTokens = this.numTokens.bind(this); + this.nftInfo = this.nftInfo.bind(this); + this.allNftInfo = this.allNftInfo.bind(this); + this.tokens = this.tokens.bind(this); + this.allTokens = this.allTokens.bind(this); + this.isArchived = this.isArchived.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.contractInfo = this.contractInfo.bind(this); + this.extension = this.extension.bind(this); + this.minter = this.minter.bind(this); + this.approval = this.approval.bind(this); + this.approvals = this.approvals.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + ownerOf = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_of: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + allOperators = async ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_operators: { + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } + }); + }; + numTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + num_tokens: {} + }); + }; + nftInfo = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_info: { + token_id: tokenId + } + }); + }; + allNftInfo = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_nft_info: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + tokens = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tokens: { + limit, + owner, + start_after: startAfter + } + }); + }; + allTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_tokens: { + limit, + start_after: startAfter + } + }); + }; + isArchived = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_archived: { + token_id: tokenId + } + }); + }; + transferAgreement = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + transfer_agreement: { + token_id: tokenId + } + }); + }; + contractInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + contract_info: {} + }); + }; + extension = async ({ + msg + }: { + msg: QueryMsg; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + extension: { + msg + } + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + approval = async ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approval: { + include_expired: includeExpired, + spender, + token_id: tokenId + } + }); + }; + approvals = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approvals: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface Cw721ContractTsInterface { + contractAddress: string; + sender: string; + mint: ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, 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; + sendNft: ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + approve: ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, 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; + approveAll: ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + revokeAll: ({ + operator + }: { + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + archive: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferAgreement: ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + batchMint: ({ + tokens + }: { + tokens: MintMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + extension: ({ + msg + }: { + msg: ExecuteMsg; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw721ContractTsClient implements Cw721ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.burn = this.burn.bind(this); + this.archive = this.archive.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.batchMint = this.batchMint.bind(this); + this.extension = this.extension.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, _funds); + }; + transferNft = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, _funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, _funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, _funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + archive = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + archive: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + transferAgreement = async ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_agreement: { + agreement, + token_id: tokenId + } + }, fee, memo, _funds); + }; + batchMint = async ({ + tokens + }: { + tokens: MintMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + batch_mint: { + tokens + } + }, fee, memo, _funds); + }; + extension = async ({ + msg + }: { + msg: ExecuteMsg; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + extension: { + msg + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/0.2.1/Cw721ContractTs.message-builder.ts b/packages/adocodegen/src/cw721/0.2.1/Cw721ContractTs.message-builder.ts new file mode 100644 index 0000000..ed21280 --- /dev/null +++ b/packages/adocodegen/src/cw721/0.2.1/Cw721ContractTs.message-builder.ts @@ -0,0 +1,531 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ExecuteMsg1, ReplyOn, OwnershipMessage, Addr, Permission, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, QueryMsg1, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, BalanceResponse, BlockHeightResponse, ContractInfoResponse, Boolean, IsOperatorResponse, KernelAddressResponse, MinterResponse, ArrayOfString, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw721ContractTsExecuteMsgBuilder { + static mint = ({ + extension, + owner, + tokenId, + tokenUri + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } as const) + }; + }; + static transferNft = ({ + recipient, + tokenId + }: CamelCasedProperties["transfer_nft"]>): ExecuteMsg => { + return { + transfer_nft: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static sendNft = ({ + contract, + msg, + tokenId + }: CamelCasedProperties["send_nft"]>): ExecuteMsg => { + return { + send_nft: ({ + contract, + msg, + token_id: tokenId + } as const) + }; + }; + static approve = ({ + expires, + spender, + tokenId + }: CamelCasedProperties["approve"]>): ExecuteMsg => { + return { + approve: ({ + expires, + spender, + token_id: tokenId + } as const) + }; + }; + static revoke = ({ + spender, + tokenId + }: CamelCasedProperties["revoke"]>): ExecuteMsg => { + return { + revoke: ({ + spender, + token_id: tokenId + } as const) + }; + }; + static approveAll = ({ + expires, + operator + }: CamelCasedProperties["approve_all"]>): ExecuteMsg => { + return { + approve_all: ({ + expires, + operator + } as const) + }; + }; + static revokeAll = ({ + operator + }: CamelCasedProperties["revoke_all"]>): ExecuteMsg => { + return { + revoke_all: ({ + operator + } as const) + }; + }; + static burn = ({ + tokenId + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + token_id: tokenId + } as const) + }; + }; + static archive = ({ + tokenId + }: CamelCasedProperties["archive"]>): ExecuteMsg => { + return { + archive: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + agreement, + tokenId + }: CamelCasedProperties["transfer_agreement"]>): ExecuteMsg => { + return { + transfer_agreement: ({ + agreement, + token_id: tokenId + } as const) + }; + }; + static batchMint = ({ + tokens + }: CamelCasedProperties["batch_mint"]>): ExecuteMsg => { + return { + batch_mint: ({ + tokens + } as const) + }; + }; + static extension = ({ + msg + }: CamelCasedProperties["extension"]>): ExecuteMsg => { + return { + extension: ({ + msg + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class Cw721ContractTsQueryMsgBuilder { + static ownerOf = ({ + includeExpired, + tokenId + }: CamelCasedProperties["owner_of"]>): QueryMsg => { + return { + owner_of: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static allOperators = ({ + includeExpired, + limit, + owner, + startAfter + }: CamelCasedProperties["all_operators"]>): QueryMsg => { + return { + all_operators: ({ + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static numTokens = (): QueryMsg => { + return { + num_tokens: ({} as const) + }; + }; + static nftInfo = ({ + tokenId + }: CamelCasedProperties["nft_info"]>): QueryMsg => { + return { + nft_info: ({ + token_id: tokenId + } as const) + }; + }; + static allNftInfo = ({ + includeExpired, + tokenId + }: CamelCasedProperties["all_nft_info"]>): QueryMsg => { + return { + all_nft_info: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static tokens = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["tokens"]>): QueryMsg => { + return { + tokens: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allTokens = ({ + limit, + startAfter + }: CamelCasedProperties["all_tokens"]>): QueryMsg => { + return { + all_tokens: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static isArchived = ({ + tokenId + }: CamelCasedProperties["is_archived"]>): QueryMsg => { + return { + is_archived: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + tokenId + }: CamelCasedProperties["transfer_agreement"]>): QueryMsg => { + return { + transfer_agreement: ({ + token_id: tokenId + } as const) + }; + }; + static contractInfo = (): QueryMsg => { + return { + contract_info: ({} as const) + }; + }; + static extension = ({ + msg + }: CamelCasedProperties["extension"]>): QueryMsg => { + return { + extension: ({ + msg + } as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static approval = ({ + includeExpired, + spender, + tokenId + }: CamelCasedProperties["approval"]>): QueryMsg => { + return { + approval: ({ + include_expired: includeExpired, + spender, + token_id: tokenId + } as const) + }; + }; + static approvals = ({ + includeExpired, + tokenId + }: CamelCasedProperties["approvals"]>): QueryMsg => { + return { + approvals: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/0.2.1/Cw721ContractTs.types.ts b/packages/adocodegen/src/cw721/0.2.1/Cw721ContractTs.types.ts new file mode 100644 index 0000000..53fa209 --- /dev/null +++ b/packages/adocodegen/src/cw721/0.2.1/Cw721ContractTs.types.ts @@ -0,0 +1,566 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + minter: AndrAddr; + modules?: Module[] | null; + name: string; + owner?: string | null; + symbol: string; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + mint: { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; + }; +} | { + transfer_nft: { + recipient: string; + token_id: string; + }; +} | { + send_nft: { + contract: string; + msg: Binary; + token_id: string; + }; +} | { + approve: { + expires?: Expiration | null; + spender: string; + token_id: string; + }; +} | { + revoke: { + spender: string; + token_id: string; + }; +} | { + approve_all: { + expires?: Expiration | null; + operator: string; + }; +} | { + revoke_all: { + operator: string; + }; +} | { + burn: { + token_id: string; + }; +} | { + archive: { + token_id: string; + }; +} | { + transfer_agreement: { + agreement?: TransferAgreement | null; + token_id: string; + }; +} | { + batch_mint: { + tokens: MintMsg[]; + }; +} | { + extension: { + msg: ExecuteMsg1; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type Binary = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type ExecuteMsg1 = { + mint: { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; + }; +} | { + transfer_nft: { + recipient: string; + token_id: string; + }; +} | { + send_nft: { + contract: string; + msg: Binary; + token_id: string; + }; +} | { + approve: { + expires?: Expiration | null; + spender: string; + token_id: string; + }; +} | { + revoke: { + spender: string; + token_id: string; + }; +} | { + approve_all: { + expires?: Expiration | null; + operator: string; + }; +} | { + revoke_all: { + operator: string; + }; +} | { + burn: { + token_id: string; + }; +} | { + archive: { + token_id: string; + }; +} | { + transfer_agreement: { + agreement?: TransferAgreement | null; + token_id: string; + }; +} | { + batch_mint: { + tokens: MintMsg[]; + }; +} | { + extension: { + msg: ExecuteMsg1; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface TokenExtension { + publisher: string; +} +export interface TransferAgreement { + amount: Coin; + purchaser: string; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface MintMsg { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + owner_of: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + all_operators: { + include_expired?: boolean | null; + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + num_tokens: {}; +} | { + nft_info: { + token_id: string; + }; +} | { + all_nft_info: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + tokens: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + is_archived: { + token_id: string; + }; +} | { + transfer_agreement: { + token_id: string; + }; +} | { + contract_info: {}; +} | { + extension: { + msg: QueryMsg1; + }; +} | { + minter: {}; +} | { + approval: { + include_expired?: boolean | null; + spender: string; + token_id: string; + }; +} | { + approvals: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export type QueryMsg1 = { + owner_of: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + all_operators: { + include_expired?: boolean | null; + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + num_tokens: {}; +} | { + nft_info: { + token_id: string; + }; +} | { + all_nft_info: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + tokens: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + is_archived: { + token_id: string; + }; +} | { + transfer_agreement: { + token_id: string; + }; +} | { + contract_info: {}; +} | { + extension: { + msg: QueryMsg1; + }; +} | { + minter: {}; +} | { + approval: { + include_expired?: boolean | null; + spender: string; + token_id: string; + }; +} | { + approvals: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export interface AllNftInfoResponseForTokenExtension { + access: OwnerOfResponse; + info: NftInfoResponseForTokenExtension; +} +export interface OwnerOfResponse { + approvals: Approval[]; + owner: string; +} +export interface Approval { + expires: Expiration; + spender: string; +} +export interface NftInfoResponseForTokenExtension { + extension: TokenExtension; + token_uri?: string | null; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface TokensResponse { + tokens: string[]; +} +export interface ApprovalResponse { + approval: Approval; +} +export interface ApprovalsResponse { + approvals: Approval[]; +} +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ContractInfoResponse { + name: string; + symbol: string; +} +export type Boolean = boolean; +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface MinterResponse { + minter?: string | null; +} +export type ArrayOfString = string[]; +export interface NumTokensResponse { + count: number; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableTransferAgreement = TransferAgreement | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw721ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/0.2.16/Cw721ContractTs.client.ts b/packages/adocodegen/src/cw721/0.2.16/Cw721ContractTs.client.ts new file mode 100644 index 0000000..c9ebe6c --- /dev/null +++ b/packages/adocodegen/src/cw721/0.2.16/Cw721ContractTs.client.ts @@ -0,0 +1,827 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ExecuteMsg1, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, QueryMsg1, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, BalanceResponse, BlockHeightResponse, ContractInfoResponse, Boolean, IsOperatorResponse, KernelAddressResponse, MinterResponse, ArrayOfString, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +export interface Cw721ContractTsReadOnlyInterface { + contractAddress: string; + ownerOf: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + allOperators: ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + numTokens: () => Promise; + nftInfo: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + allNftInfo: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + tokens: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + isArchived: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + transferAgreement: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + contractInfo: () => Promise; + extension: ({ + msg + }: { + msg: QueryMsg; + }) => Promise; + minter: () => Promise; + approval: ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }) => Promise; + approvals: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class Cw721ContractTsQueryClient implements Cw721ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.ownerOf = this.ownerOf.bind(this); + this.allOperators = this.allOperators.bind(this); + this.numTokens = this.numTokens.bind(this); + this.nftInfo = this.nftInfo.bind(this); + this.allNftInfo = this.allNftInfo.bind(this); + this.tokens = this.tokens.bind(this); + this.allTokens = this.allTokens.bind(this); + this.isArchived = this.isArchived.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.contractInfo = this.contractInfo.bind(this); + this.extension = this.extension.bind(this); + this.minter = this.minter.bind(this); + this.approval = this.approval.bind(this); + this.approvals = this.approvals.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + ownerOf = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_of: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + allOperators = async ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_operators: { + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } + }); + }; + numTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + num_tokens: {} + }); + }; + nftInfo = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_info: { + token_id: tokenId + } + }); + }; + allNftInfo = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_nft_info: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + tokens = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tokens: { + limit, + owner, + start_after: startAfter + } + }); + }; + allTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_tokens: { + limit, + start_after: startAfter + } + }); + }; + isArchived = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_archived: { + token_id: tokenId + } + }); + }; + transferAgreement = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + transfer_agreement: { + token_id: tokenId + } + }); + }; + contractInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + contract_info: {} + }); + }; + extension = async ({ + msg + }: { + msg: QueryMsg; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + extension: { + msg + } + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + approval = async ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approval: { + include_expired: includeExpired, + spender, + token_id: tokenId + } + }); + }; + approvals = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approvals: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface Cw721ContractTsInterface { + contractAddress: string; + sender: string; + mint: ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, 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; + sendNft: ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + approve: ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, 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; + approveAll: ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + revokeAll: ({ + operator + }: { + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + archive: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferAgreement: ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + batchMint: ({ + tokens + }: { + tokens: MintMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + extension: ({ + msg + }: { + msg: ExecuteMsg; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw721ContractTsClient implements Cw721ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.burn = this.burn.bind(this); + this.archive = this.archive.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.batchMint = this.batchMint.bind(this); + this.extension = this.extension.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, _funds); + }; + transferNft = async ({ + recipient, + tokenId + }: { + recipient: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, _funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: string; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, _funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, _funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + archive = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + archive: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + transferAgreement = async ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_agreement: { + agreement, + token_id: tokenId + } + }, fee, memo, _funds); + }; + batchMint = async ({ + tokens + }: { + tokens: MintMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + batch_mint: { + tokens + } + }, fee, memo, _funds); + }; + extension = async ({ + msg + }: { + msg: ExecuteMsg; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + extension: { + msg + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/0.2.16/Cw721ContractTs.message-builder.ts b/packages/adocodegen/src/cw721/0.2.16/Cw721ContractTs.message-builder.ts new file mode 100644 index 0000000..b56b3eb --- /dev/null +++ b/packages/adocodegen/src/cw721/0.2.16/Cw721ContractTs.message-builder.ts @@ -0,0 +1,497 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ExecuteMsg1, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, QueryMsg1, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, TokensResponse, ApprovalResponse, ApprovalsResponse, BalanceResponse, BlockHeightResponse, ContractInfoResponse, Boolean, IsOperatorResponse, KernelAddressResponse, MinterResponse, ArrayOfString, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw721ContractTsExecuteMsgBuilder { + static mint = ({ + extension, + owner, + tokenId, + tokenUri + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } as const) + }; + }; + static transferNft = ({ + recipient, + tokenId + }: CamelCasedProperties["transfer_nft"]>): ExecuteMsg => { + return { + transfer_nft: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static sendNft = ({ + contract, + msg, + tokenId + }: CamelCasedProperties["send_nft"]>): ExecuteMsg => { + return { + send_nft: ({ + contract, + msg, + token_id: tokenId + } as const) + }; + }; + static approve = ({ + expires, + spender, + tokenId + }: CamelCasedProperties["approve"]>): ExecuteMsg => { + return { + approve: ({ + expires, + spender, + token_id: tokenId + } as const) + }; + }; + static revoke = ({ + spender, + tokenId + }: CamelCasedProperties["revoke"]>): ExecuteMsg => { + return { + revoke: ({ + spender, + token_id: tokenId + } as const) + }; + }; + static approveAll = ({ + expires, + operator + }: CamelCasedProperties["approve_all"]>): ExecuteMsg => { + return { + approve_all: ({ + expires, + operator + } as const) + }; + }; + static revokeAll = ({ + operator + }: CamelCasedProperties["revoke_all"]>): ExecuteMsg => { + return { + revoke_all: ({ + operator + } as const) + }; + }; + static burn = ({ + tokenId + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + token_id: tokenId + } as const) + }; + }; + static archive = ({ + tokenId + }: CamelCasedProperties["archive"]>): ExecuteMsg => { + return { + archive: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + agreement, + tokenId + }: CamelCasedProperties["transfer_agreement"]>): ExecuteMsg => { + return { + transfer_agreement: ({ + agreement, + token_id: tokenId + } as const) + }; + }; + static batchMint = ({ + tokens + }: CamelCasedProperties["batch_mint"]>): ExecuteMsg => { + return { + batch_mint: ({ + tokens + } as const) + }; + }; + static extension = ({ + msg + }: CamelCasedProperties["extension"]>): ExecuteMsg => { + return { + extension: ({ + msg + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class Cw721ContractTsQueryMsgBuilder { + static ownerOf = ({ + includeExpired, + tokenId + }: CamelCasedProperties["owner_of"]>): QueryMsg => { + return { + owner_of: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static allOperators = ({ + includeExpired, + limit, + owner, + startAfter + }: CamelCasedProperties["all_operators"]>): QueryMsg => { + return { + all_operators: ({ + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static numTokens = (): QueryMsg => { + return { + num_tokens: ({} as const) + }; + }; + static nftInfo = ({ + tokenId + }: CamelCasedProperties["nft_info"]>): QueryMsg => { + return { + nft_info: ({ + token_id: tokenId + } as const) + }; + }; + static allNftInfo = ({ + includeExpired, + tokenId + }: CamelCasedProperties["all_nft_info"]>): QueryMsg => { + return { + all_nft_info: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static tokens = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["tokens"]>): QueryMsg => { + return { + tokens: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allTokens = ({ + limit, + startAfter + }: CamelCasedProperties["all_tokens"]>): QueryMsg => { + return { + all_tokens: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static isArchived = ({ + tokenId + }: CamelCasedProperties["is_archived"]>): QueryMsg => { + return { + is_archived: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + tokenId + }: CamelCasedProperties["transfer_agreement"]>): QueryMsg => { + return { + transfer_agreement: ({ + token_id: tokenId + } as const) + }; + }; + static contractInfo = (): QueryMsg => { + return { + contract_info: ({} as const) + }; + }; + static extension = ({ + msg + }: CamelCasedProperties["extension"]>): QueryMsg => { + return { + extension: ({ + msg + } as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static approval = ({ + includeExpired, + spender, + tokenId + }: CamelCasedProperties["approval"]>): QueryMsg => { + return { + approval: ({ + include_expired: includeExpired, + spender, + token_id: tokenId + } as const) + }; + }; + static approvals = ({ + includeExpired, + tokenId + }: CamelCasedProperties["approvals"]>): QueryMsg => { + return { + approvals: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/0.2.16/Cw721ContractTs.types.ts b/packages/adocodegen/src/cw721/0.2.16/Cw721ContractTs.types.ts new file mode 100644 index 0000000..14ed279 --- /dev/null +++ b/packages/adocodegen/src/cw721/0.2.16/Cw721ContractTs.types.ts @@ -0,0 +1,560 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + minter: AndrAddr; + modules?: Module[] | null; + name: string; + owner?: string | null; + symbol: string; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + mint: { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; + }; +} | { + transfer_nft: { + recipient: string; + token_id: string; + }; +} | { + send_nft: { + contract: string; + msg: Binary; + token_id: string; + }; +} | { + approve: { + expires?: Expiration | null; + spender: string; + token_id: string; + }; +} | { + revoke: { + spender: string; + token_id: string; + }; +} | { + approve_all: { + expires?: Expiration | null; + operator: string; + }; +} | { + revoke_all: { + operator: string; + }; +} | { + burn: { + token_id: string; + }; +} | { + archive: { + token_id: string; + }; +} | { + transfer_agreement: { + agreement?: TransferAgreement | null; + token_id: string; + }; +} | { + batch_mint: { + tokens: MintMsg[]; + }; +} | { + extension: { + msg: ExecuteMsg1; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type Binary = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type ExecuteMsg1 = { + mint: { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; + }; +} | { + transfer_nft: { + recipient: string; + token_id: string; + }; +} | { + send_nft: { + contract: string; + msg: Binary; + token_id: string; + }; +} | { + approve: { + expires?: Expiration | null; + spender: string; + token_id: string; + }; +} | { + revoke: { + spender: string; + token_id: string; + }; +} | { + approve_all: { + expires?: Expiration | null; + operator: string; + }; +} | { + revoke_all: { + operator: string; + }; +} | { + burn: { + token_id: string; + }; +} | { + archive: { + token_id: string; + }; +} | { + transfer_agreement: { + agreement?: TransferAgreement | null; + token_id: string; + }; +} | { + batch_mint: { + tokens: MintMsg[]; + }; +} | { + extension: { + msg: ExecuteMsg1; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface TokenExtension { + publisher: string; +} +export interface TransferAgreement { + amount: Coin; + purchaser: string; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface MintMsg { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + owner_of: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + all_operators: { + include_expired?: boolean | null; + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + num_tokens: {}; +} | { + nft_info: { + token_id: string; + }; +} | { + all_nft_info: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + tokens: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + is_archived: { + token_id: string; + }; +} | { + transfer_agreement: { + token_id: string; + }; +} | { + contract_info: {}; +} | { + extension: { + msg: QueryMsg1; + }; +} | { + minter: {}; +} | { + approval: { + include_expired?: boolean | null; + spender: string; + token_id: string; + }; +} | { + approvals: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export type QueryMsg1 = { + owner_of: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + all_operators: { + include_expired?: boolean | null; + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + num_tokens: {}; +} | { + nft_info: { + token_id: string; + }; +} | { + all_nft_info: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + tokens: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + is_archived: { + token_id: string; + }; +} | { + transfer_agreement: { + token_id: string; + }; +} | { + contract_info: {}; +} | { + extension: { + msg: QueryMsg1; + }; +} | { + minter: {}; +} | { + approval: { + include_expired?: boolean | null; + spender: string; + token_id: string; + }; +} | { + approvals: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export interface AllNftInfoResponseForTokenExtension { + access: OwnerOfResponse; + info: NftInfoResponseForTokenExtension; +} +export interface OwnerOfResponse { + approvals: Approval[]; + owner: string; +} +export interface Approval { + expires: Expiration; + spender: string; +} +export interface NftInfoResponseForTokenExtension { + extension: TokenExtension; + token_uri?: string | null; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface TokensResponse { + tokens: string[]; +} +export interface ApprovalResponse { + approval: Approval; +} +export interface ApprovalsResponse { + approvals: Approval[]; +} +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ContractInfoResponse { + name: string; + symbol: string; +} +export type Boolean = boolean; +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface MinterResponse { + minter?: string | null; +} +export type ArrayOfString = string[]; +export interface NumTokensResponse { + count: number; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableTransferAgreement = TransferAgreement | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw721ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.0/Cw721ContractTs.client.ts b/packages/adocodegen/src/cw721/2.0.0/Cw721ContractTs.client.ts new file mode 100644 index 0000000..a18daf8 --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.0/Cw721ContractTs.client.ts @@ -0,0 +1,707 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, RatesQueryMessage, ADOBaseVersionResponse, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, TokensResponse, AppContractResponse, ApprovalResponse, ApprovalsResponse, BlockHeightResponse, ContractInfoResponse, IsArchivedResponse, KernelAddressResponse, MinterResponse, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +export interface Cw721ContractTsReadOnlyInterface { + contractAddress: string; + ownerOf: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + allOperators: ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + numTokens: () => Promise; + nftInfo: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + allNftInfo: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + tokens: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + isArchived: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + transferAgreement: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + contractInfo: () => Promise; + minter: () => Promise; + approval: ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }) => Promise; + approvals: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: (ratesQueryMessage: RatesQueryMessage) => Promise; +} +export class Cw721ContractTsQueryClient implements Cw721ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.ownerOf = this.ownerOf.bind(this); + this.allOperators = this.allOperators.bind(this); + this.numTokens = this.numTokens.bind(this); + this.nftInfo = this.nftInfo.bind(this); + this.allNftInfo = this.allNftInfo.bind(this); + this.tokens = this.tokens.bind(this); + this.allTokens = this.allTokens.bind(this); + this.isArchived = this.isArchived.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.contractInfo = this.contractInfo.bind(this); + this.minter = this.minter.bind(this); + this.approval = this.approval.bind(this); + this.approvals = this.approvals.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + } + + ownerOf = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_of: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + allOperators = async ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_operators: { + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } + }); + }; + numTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + num_tokens: {} + }); + }; + nftInfo = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_info: { + token_id: tokenId + } + }); + }; + allNftInfo = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_nft_info: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + tokens = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tokens: { + limit, + owner, + start_after: startAfter + } + }); + }; + allTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_tokens: { + limit, + start_after: startAfter + } + }); + }; + isArchived = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_archived: { + token_id: tokenId + } + }); + }; + transferAgreement = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + transfer_agreement: { + token_id: tokenId + } + }); + }; + contractInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + contract_info: {} + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + approval = async ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approval: { + include_expired: includeExpired, + spender, + token_id: tokenId + } + }); + }; + approvals = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approvals: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async (ratesQueryMessage: RatesQueryMessage): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: ratesQueryMessage + }); + }; +} +export interface Cw721ContractTsInterface { + contractAddress: string; + sender: string; + mint: ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferNft: ({ + recipient, + tokenId + }: { + recipient: AndrAddr; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendNft: ({ + contract, + msg, + tokenId + }: { + contract: AndrAddr; + msg: Binary; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + approve: ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, 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; + approveAll: ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + revokeAll: ({ + operator + }: { + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + archive: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferAgreement: ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + batchMint: ({ + tokens + }: { + tokens: MintMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw721ContractTsClient implements Cw721ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.burn = this.burn.bind(this); + this.archive = this.archive.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.batchMint = this.batchMint.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, _funds); + }; + transferNft = async ({ + recipient, + tokenId + }: { + recipient: AndrAddr; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, _funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: AndrAddr; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, _funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, _funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + archive = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + archive: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + transferAgreement = async ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_agreement: { + agreement, + token_id: tokenId + } + }, fee, memo, _funds); + }; + batchMint = async ({ + tokens + }: { + tokens: MintMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + batch_mint: { + tokens + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.0/Cw721ContractTs.message-builder.ts b/packages/adocodegen/src/cw721/2.0.0/Cw721ContractTs.message-builder.ts new file mode 100644 index 0000000..2a5754c --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.0/Cw721ContractTs.message-builder.ts @@ -0,0 +1,422 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, RatesQueryMessage, ADOBaseVersionResponse, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, TokensResponse, AppContractResponse, ApprovalResponse, ApprovalsResponse, BlockHeightResponse, ContractInfoResponse, IsArchivedResponse, KernelAddressResponse, MinterResponse, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw721ContractTsExecuteMsgBuilder { + static mint = ({ + extension, + owner, + tokenId, + tokenUri + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } as const) + }; + }; + static transferNft = ({ + recipient, + tokenId + }: CamelCasedProperties["transfer_nft"]>): ExecuteMsg => { + return { + transfer_nft: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static sendNft = ({ + contract, + msg, + tokenId + }: CamelCasedProperties["send_nft"]>): ExecuteMsg => { + return { + send_nft: ({ + contract, + msg, + token_id: tokenId + } as const) + }; + }; + static approve = ({ + expires, + spender, + tokenId + }: CamelCasedProperties["approve"]>): ExecuteMsg => { + return { + approve: ({ + expires, + spender, + token_id: tokenId + } as const) + }; + }; + static revoke = ({ + spender, + tokenId + }: CamelCasedProperties["revoke"]>): ExecuteMsg => { + return { + revoke: ({ + spender, + token_id: tokenId + } as const) + }; + }; + static approveAll = ({ + expires, + operator + }: CamelCasedProperties["approve_all"]>): ExecuteMsg => { + return { + approve_all: ({ + expires, + operator + } as const) + }; + }; + static revokeAll = ({ + operator + }: CamelCasedProperties["revoke_all"]>): ExecuteMsg => { + return { + revoke_all: ({ + operator + } as const) + }; + }; + static burn = ({ + tokenId + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + token_id: tokenId + } as const) + }; + }; + static archive = ({ + tokenId + }: CamelCasedProperties["archive"]>): ExecuteMsg => { + return { + archive: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + agreement, + tokenId + }: CamelCasedProperties["transfer_agreement"]>): ExecuteMsg => { + return { + transfer_agreement: ({ + agreement, + token_id: tokenId + } as const) + }; + }; + static batchMint = ({ + tokens + }: CamelCasedProperties["batch_mint"]>): ExecuteMsg => { + return { + batch_mint: ({ + tokens + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class Cw721ContractTsQueryMsgBuilder { + static ownerOf = ({ + includeExpired, + tokenId + }: CamelCasedProperties["owner_of"]>): QueryMsg => { + return { + owner_of: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static allOperators = ({ + includeExpired, + limit, + owner, + startAfter + }: CamelCasedProperties["all_operators"]>): QueryMsg => { + return { + all_operators: ({ + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static numTokens = (): QueryMsg => { + return { + num_tokens: ({} as const) + }; + }; + static nftInfo = ({ + tokenId + }: CamelCasedProperties["nft_info"]>): QueryMsg => { + return { + nft_info: ({ + token_id: tokenId + } as const) + }; + }; + static allNftInfo = ({ + includeExpired, + tokenId + }: CamelCasedProperties["all_nft_info"]>): QueryMsg => { + return { + all_nft_info: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static tokens = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["tokens"]>): QueryMsg => { + return { + tokens: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allTokens = ({ + limit, + startAfter + }: CamelCasedProperties["all_tokens"]>): QueryMsg => { + return { + all_tokens: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static isArchived = ({ + tokenId + }: CamelCasedProperties["is_archived"]>): QueryMsg => { + return { + is_archived: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + tokenId + }: CamelCasedProperties["transfer_agreement"]>): QueryMsg => { + return { + transfer_agreement: ({ + token_id: tokenId + } as const) + }; + }; + static contractInfo = (): QueryMsg => { + return { + contract_info: ({} as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static approval = ({ + includeExpired, + spender, + tokenId + }: CamelCasedProperties["approval"]>): QueryMsg => { + return { + approval: ({ + include_expired: includeExpired, + spender, + token_id: tokenId + } as const) + }; + }; + static approvals = ({ + includeExpired, + tokenId + }: CamelCasedProperties["approvals"]>): QueryMsg => { + return { + approvals: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = (ratesQueryMessage: RatesQueryMessage): QueryMsg => { + return { + rates: ratesQueryMessage + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.0/Cw721ContractTs.types.ts b/packages/adocodegen/src/cw721/2.0.0/Cw721ContractTs.types.ts new file mode 100644 index 0000000..39fdaef --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.0/Cw721ContractTs.types.ts @@ -0,0 +1,396 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + minter: AndrAddr; + name: string; + owner?: string | null; + symbol: string; +} +export type ExecuteMsg = { + mint: { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; + }; +} | { + transfer_nft: { + recipient: AndrAddr; + token_id: string; + }; +} | { + send_nft: { + contract: AndrAddr; + msg: Binary; + token_id: string; + }; +} | { + approve: { + expires?: Expiration | null; + spender: string; + token_id: string; + }; +} | { + revoke: { + spender: string; + token_id: string; + }; +} | { + approve_all: { + expires?: Expiration | null; + operator: string; + }; +} | { + revoke_all: { + operator: string; + }; +} | { + burn: { + token_id: string; + }; +} | { + archive: { + token_id: string; + }; +} | { + transfer_agreement: { + agreement?: TransferAgreement | null; + token_id: string; + }; +} | { + batch_mint: { + tokens: MintMsg[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface TokenExtension { + publisher: string; +} +export interface TransferAgreement { + amount: Coin; + purchaser: string; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface MintMsg { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + owner_of: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + all_operators: { + include_expired?: boolean | null; + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + num_tokens: {}; +} | { + nft_info: { + token_id: string; + }; +} | { + all_nft_info: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + tokens: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + is_archived: { + token_id: string; + }; +} | { + transfer_agreement: { + token_id: string; + }; +} | { + contract_info: {}; +} | { + minter: {}; +} | { + approval: { + include_expired?: boolean | null; + spender: string; + token_id: string; + }; +} | { + approvals: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: RatesQueryMessage; +}; +export type RatesQueryMessage = { + get_rate: { + action: string; + }; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllNftInfoResponseForTokenExtension { + access: OwnerOfResponse; + info: NftInfoResponseForTokenExtension; +} +export interface OwnerOfResponse { + approvals: Approval[]; + owner: string; +} +export interface Approval { + expires: Expiration; + spender: string; +} +export interface NftInfoResponseForTokenExtension { + extension: TokenExtension; + token_uri?: string | null; +} +export interface OperatorsResponse { + operators: Approval[]; +} +export interface TokensResponse { + tokens: string[]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface ApprovalResponse { + approval: Approval; +} +export interface ApprovalsResponse { + approvals: Approval[]; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ContractInfoResponse { + name: string; + symbol: string; +} +export interface IsArchivedResponse { + is_archived: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface MinterResponse { + minter?: string | null; +} +export interface NumTokensResponse { + count: number; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export type NullableTransferAgreement = TransferAgreement | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw721ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.1/Cw721ContractTs.client.ts b/packages/adocodegen/src/cw721/2.0.1/Cw721ContractTs.client.ts new file mode 100644 index 0000000..847b0fe --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.1/Cw721ContractTs.client.ts @@ -0,0 +1,724 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, AllRatesResponse, TokensResponse, AppContractResponse, ApprovalResponse, ApprovalsResponse, BlockHeightResponse, ContractInfoResponse, IsArchivedResponse, KernelAddressResponse, MinterResponse, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +export interface Cw721ContractTsReadOnlyInterface { + contractAddress: string; + ownerOf: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + allOperators: ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + numTokens: () => Promise; + nftInfo: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + allNftInfo: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + tokens: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + isArchived: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + transferAgreement: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + contractInfo: () => Promise; + minter: () => Promise; + approval: ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }) => Promise; + approvals: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class Cw721ContractTsQueryClient implements Cw721ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.ownerOf = this.ownerOf.bind(this); + this.allOperators = this.allOperators.bind(this); + this.numTokens = this.numTokens.bind(this); + this.nftInfo = this.nftInfo.bind(this); + this.allNftInfo = this.allNftInfo.bind(this); + this.tokens = this.tokens.bind(this); + this.allTokens = this.allTokens.bind(this); + this.isArchived = this.isArchived.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.contractInfo = this.contractInfo.bind(this); + this.minter = this.minter.bind(this); + this.approval = this.approval.bind(this); + this.approvals = this.approvals.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + ownerOf = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_of: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + allOperators = async ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_operators: { + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } + }); + }; + numTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + num_tokens: {} + }); + }; + nftInfo = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_info: { + token_id: tokenId + } + }); + }; + allNftInfo = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_nft_info: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + tokens = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tokens: { + limit, + owner, + start_after: startAfter + } + }); + }; + allTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_tokens: { + limit, + start_after: startAfter + } + }); + }; + isArchived = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_archived: { + token_id: tokenId + } + }); + }; + transferAgreement = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + transfer_agreement: { + token_id: tokenId + } + }); + }; + contractInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + contract_info: {} + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + approval = async ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approval: { + include_expired: includeExpired, + spender, + token_id: tokenId + } + }); + }; + approvals = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approvals: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface Cw721ContractTsInterface { + contractAddress: string; + sender: string; + mint: ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferNft: ({ + recipient, + tokenId + }: { + recipient: AndrAddr; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendNft: ({ + contract, + msg, + tokenId + }: { + contract: AndrAddr; + msg: Binary; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + approve: ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, 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; + approveAll: ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + revokeAll: ({ + operator + }: { + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + archive: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferAgreement: ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + batchMint: ({ + tokens + }: { + tokens: MintMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw721ContractTsClient implements Cw721ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.burn = this.burn.bind(this); + this.archive = this.archive.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.batchMint = this.batchMint.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, _funds); + }; + transferNft = async ({ + recipient, + tokenId + }: { + recipient: AndrAddr; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, _funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: AndrAddr; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, _funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, _funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + archive = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + archive: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + transferAgreement = async ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_agreement: { + agreement, + token_id: tokenId + } + }, fee, memo, _funds); + }; + batchMint = async ({ + tokens + }: { + tokens: MintMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + batch_mint: { + tokens + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.1/Cw721ContractTs.message-builder.ts b/packages/adocodegen/src/cw721/2.0.1/Cw721ContractTs.message-builder.ts new file mode 100644 index 0000000..6e5a4c4 --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.1/Cw721ContractTs.message-builder.ts @@ -0,0 +1,433 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, AllRatesResponse, TokensResponse, AppContractResponse, ApprovalResponse, ApprovalsResponse, BlockHeightResponse, ContractInfoResponse, IsArchivedResponse, KernelAddressResponse, MinterResponse, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw721ContractTsExecuteMsgBuilder { + static mint = ({ + extension, + owner, + tokenId, + tokenUri + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } as const) + }; + }; + static transferNft = ({ + recipient, + tokenId + }: CamelCasedProperties["transfer_nft"]>): ExecuteMsg => { + return { + transfer_nft: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static sendNft = ({ + contract, + msg, + tokenId + }: CamelCasedProperties["send_nft"]>): ExecuteMsg => { + return { + send_nft: ({ + contract, + msg, + token_id: tokenId + } as const) + }; + }; + static approve = ({ + expires, + spender, + tokenId + }: CamelCasedProperties["approve"]>): ExecuteMsg => { + return { + approve: ({ + expires, + spender, + token_id: tokenId + } as const) + }; + }; + static revoke = ({ + spender, + tokenId + }: CamelCasedProperties["revoke"]>): ExecuteMsg => { + return { + revoke: ({ + spender, + token_id: tokenId + } as const) + }; + }; + static approveAll = ({ + expires, + operator + }: CamelCasedProperties["approve_all"]>): ExecuteMsg => { + return { + approve_all: ({ + expires, + operator + } as const) + }; + }; + static revokeAll = ({ + operator + }: CamelCasedProperties["revoke_all"]>): ExecuteMsg => { + return { + revoke_all: ({ + operator + } as const) + }; + }; + static burn = ({ + tokenId + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + token_id: tokenId + } as const) + }; + }; + static archive = ({ + tokenId + }: CamelCasedProperties["archive"]>): ExecuteMsg => { + return { + archive: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + agreement, + tokenId + }: CamelCasedProperties["transfer_agreement"]>): ExecuteMsg => { + return { + transfer_agreement: ({ + agreement, + token_id: tokenId + } as const) + }; + }; + static batchMint = ({ + tokens + }: CamelCasedProperties["batch_mint"]>): ExecuteMsg => { + return { + batch_mint: ({ + tokens + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class Cw721ContractTsQueryMsgBuilder { + static ownerOf = ({ + includeExpired, + tokenId + }: CamelCasedProperties["owner_of"]>): QueryMsg => { + return { + owner_of: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static allOperators = ({ + includeExpired, + limit, + owner, + startAfter + }: CamelCasedProperties["all_operators"]>): QueryMsg => { + return { + all_operators: ({ + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static numTokens = (): QueryMsg => { + return { + num_tokens: ({} as const) + }; + }; + static nftInfo = ({ + tokenId + }: CamelCasedProperties["nft_info"]>): QueryMsg => { + return { + nft_info: ({ + token_id: tokenId + } as const) + }; + }; + static allNftInfo = ({ + includeExpired, + tokenId + }: CamelCasedProperties["all_nft_info"]>): QueryMsg => { + return { + all_nft_info: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static tokens = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["tokens"]>): QueryMsg => { + return { + tokens: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allTokens = ({ + limit, + startAfter + }: CamelCasedProperties["all_tokens"]>): QueryMsg => { + return { + all_tokens: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static isArchived = ({ + tokenId + }: CamelCasedProperties["is_archived"]>): QueryMsg => { + return { + is_archived: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + tokenId + }: CamelCasedProperties["transfer_agreement"]>): QueryMsg => { + return { + transfer_agreement: ({ + token_id: tokenId + } as const) + }; + }; + static contractInfo = (): QueryMsg => { + return { + contract_info: ({} as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static approval = ({ + includeExpired, + spender, + tokenId + }: CamelCasedProperties["approval"]>): QueryMsg => { + return { + approval: ({ + include_expired: includeExpired, + spender, + token_id: tokenId + } as const) + }; + }; + static approvals = ({ + includeExpired, + tokenId + }: CamelCasedProperties["approvals"]>): QueryMsg => { + return { + approvals: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.1/Cw721ContractTs.types.ts b/packages/adocodegen/src/cw721/2.0.1/Cw721ContractTs.types.ts new file mode 100644 index 0000000..d4bfb8e --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.1/Cw721ContractTs.types.ts @@ -0,0 +1,398 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + minter: AndrAddr; + name: string; + owner?: string | null; + symbol: string; +} +export type ExecuteMsg = { + mint: { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; + }; +} | { + transfer_nft: { + recipient: AndrAddr; + token_id: string; + }; +} | { + send_nft: { + contract: AndrAddr; + msg: Binary; + token_id: string; + }; +} | { + approve: { + expires?: Expiration | null; + spender: string; + token_id: string; + }; +} | { + revoke: { + spender: string; + token_id: string; + }; +} | { + approve_all: { + expires?: Expiration | null; + operator: string; + }; +} | { + revoke_all: { + operator: string; + }; +} | { + burn: { + token_id: string; + }; +} | { + archive: { + token_id: string; + }; +} | { + transfer_agreement: { + agreement?: TransferAgreement | null; + token_id: string; + }; +} | { + batch_mint: { + tokens: MintMsg[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface TokenExtension { + publisher: string; +} +export interface TransferAgreement { + amount: Coin; + purchaser: string; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface MintMsg { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + owner_of: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + all_operators: { + include_expired?: boolean | null; + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + num_tokens: {}; +} | { + nft_info: { + token_id: string; + }; +} | { + all_nft_info: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + tokens: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + is_archived: { + token_id: string; + }; +} | { + transfer_agreement: { + token_id: string; + }; +} | { + contract_info: {}; +} | { + minter: {}; +} | { + approval: { + include_expired?: boolean | null; + spender: string; + token_id: string; + }; +} | { + approvals: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllNftInfoResponseForTokenExtension { + access: OwnerOfResponse; + info: NftInfoResponseForTokenExtension; +} +export interface OwnerOfResponse { + approvals: Approval[]; + owner: string; +} +export interface Approval { + expires: Expiration; + spender: string; +} +export interface NftInfoResponseForTokenExtension { + extension: TokenExtension; + token_uri?: string | null; +} +export interface OperatorsResponse { + operators: Approval[]; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface TokensResponse { + tokens: string[]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface ApprovalResponse { + approval: Approval; +} +export interface ApprovalsResponse { + approvals: Approval[]; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ContractInfoResponse { + name: string; + symbol: string; +} +export interface IsArchivedResponse { + is_archived: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface MinterResponse { + minter?: string | null; +} +export interface NumTokensResponse { + count: number; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export type NullableTransferAgreement = TransferAgreement | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw721ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.3-beta.1/Cw721ContractTs.client.ts b/packages/adocodegen/src/cw721/2.0.3-beta.1/Cw721ContractTs.client.ts new file mode 100644 index 0000000..847b0fe --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.3-beta.1/Cw721ContractTs.client.ts @@ -0,0 +1,724 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, AllRatesResponse, TokensResponse, AppContractResponse, ApprovalResponse, ApprovalsResponse, BlockHeightResponse, ContractInfoResponse, IsArchivedResponse, KernelAddressResponse, MinterResponse, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +export interface Cw721ContractTsReadOnlyInterface { + contractAddress: string; + ownerOf: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + allOperators: ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + numTokens: () => Promise; + nftInfo: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + allNftInfo: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + tokens: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + isArchived: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + transferAgreement: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + contractInfo: () => Promise; + minter: () => Promise; + approval: ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }) => Promise; + approvals: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class Cw721ContractTsQueryClient implements Cw721ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.ownerOf = this.ownerOf.bind(this); + this.allOperators = this.allOperators.bind(this); + this.numTokens = this.numTokens.bind(this); + this.nftInfo = this.nftInfo.bind(this); + this.allNftInfo = this.allNftInfo.bind(this); + this.tokens = this.tokens.bind(this); + this.allTokens = this.allTokens.bind(this); + this.isArchived = this.isArchived.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.contractInfo = this.contractInfo.bind(this); + this.minter = this.minter.bind(this); + this.approval = this.approval.bind(this); + this.approvals = this.approvals.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + ownerOf = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_of: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + allOperators = async ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_operators: { + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } + }); + }; + numTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + num_tokens: {} + }); + }; + nftInfo = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_info: { + token_id: tokenId + } + }); + }; + allNftInfo = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_nft_info: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + tokens = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tokens: { + limit, + owner, + start_after: startAfter + } + }); + }; + allTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_tokens: { + limit, + start_after: startAfter + } + }); + }; + isArchived = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_archived: { + token_id: tokenId + } + }); + }; + transferAgreement = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + transfer_agreement: { + token_id: tokenId + } + }); + }; + contractInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + contract_info: {} + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + approval = async ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approval: { + include_expired: includeExpired, + spender, + token_id: tokenId + } + }); + }; + approvals = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approvals: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface Cw721ContractTsInterface { + contractAddress: string; + sender: string; + mint: ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferNft: ({ + recipient, + tokenId + }: { + recipient: AndrAddr; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendNft: ({ + contract, + msg, + tokenId + }: { + contract: AndrAddr; + msg: Binary; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + approve: ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, 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; + approveAll: ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + revokeAll: ({ + operator + }: { + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + archive: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferAgreement: ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + batchMint: ({ + tokens + }: { + tokens: MintMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw721ContractTsClient implements Cw721ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.burn = this.burn.bind(this); + this.archive = this.archive.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.batchMint = this.batchMint.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, _funds); + }; + transferNft = async ({ + recipient, + tokenId + }: { + recipient: AndrAddr; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, _funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: AndrAddr; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, _funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, _funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + archive = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + archive: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + transferAgreement = async ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_agreement: { + agreement, + token_id: tokenId + } + }, fee, memo, _funds); + }; + batchMint = async ({ + tokens + }: { + tokens: MintMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + batch_mint: { + tokens + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.3-beta.1/Cw721ContractTs.message-builder.ts b/packages/adocodegen/src/cw721/2.0.3-beta.1/Cw721ContractTs.message-builder.ts new file mode 100644 index 0000000..6e5a4c4 --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.3-beta.1/Cw721ContractTs.message-builder.ts @@ -0,0 +1,433 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, AllRatesResponse, TokensResponse, AppContractResponse, ApprovalResponse, ApprovalsResponse, BlockHeightResponse, ContractInfoResponse, IsArchivedResponse, KernelAddressResponse, MinterResponse, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw721ContractTsExecuteMsgBuilder { + static mint = ({ + extension, + owner, + tokenId, + tokenUri + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } as const) + }; + }; + static transferNft = ({ + recipient, + tokenId + }: CamelCasedProperties["transfer_nft"]>): ExecuteMsg => { + return { + transfer_nft: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static sendNft = ({ + contract, + msg, + tokenId + }: CamelCasedProperties["send_nft"]>): ExecuteMsg => { + return { + send_nft: ({ + contract, + msg, + token_id: tokenId + } as const) + }; + }; + static approve = ({ + expires, + spender, + tokenId + }: CamelCasedProperties["approve"]>): ExecuteMsg => { + return { + approve: ({ + expires, + spender, + token_id: tokenId + } as const) + }; + }; + static revoke = ({ + spender, + tokenId + }: CamelCasedProperties["revoke"]>): ExecuteMsg => { + return { + revoke: ({ + spender, + token_id: tokenId + } as const) + }; + }; + static approveAll = ({ + expires, + operator + }: CamelCasedProperties["approve_all"]>): ExecuteMsg => { + return { + approve_all: ({ + expires, + operator + } as const) + }; + }; + static revokeAll = ({ + operator + }: CamelCasedProperties["revoke_all"]>): ExecuteMsg => { + return { + revoke_all: ({ + operator + } as const) + }; + }; + static burn = ({ + tokenId + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + token_id: tokenId + } as const) + }; + }; + static archive = ({ + tokenId + }: CamelCasedProperties["archive"]>): ExecuteMsg => { + return { + archive: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + agreement, + tokenId + }: CamelCasedProperties["transfer_agreement"]>): ExecuteMsg => { + return { + transfer_agreement: ({ + agreement, + token_id: tokenId + } as const) + }; + }; + static batchMint = ({ + tokens + }: CamelCasedProperties["batch_mint"]>): ExecuteMsg => { + return { + batch_mint: ({ + tokens + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class Cw721ContractTsQueryMsgBuilder { + static ownerOf = ({ + includeExpired, + tokenId + }: CamelCasedProperties["owner_of"]>): QueryMsg => { + return { + owner_of: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static allOperators = ({ + includeExpired, + limit, + owner, + startAfter + }: CamelCasedProperties["all_operators"]>): QueryMsg => { + return { + all_operators: ({ + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static numTokens = (): QueryMsg => { + return { + num_tokens: ({} as const) + }; + }; + static nftInfo = ({ + tokenId + }: CamelCasedProperties["nft_info"]>): QueryMsg => { + return { + nft_info: ({ + token_id: tokenId + } as const) + }; + }; + static allNftInfo = ({ + includeExpired, + tokenId + }: CamelCasedProperties["all_nft_info"]>): QueryMsg => { + return { + all_nft_info: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static tokens = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["tokens"]>): QueryMsg => { + return { + tokens: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allTokens = ({ + limit, + startAfter + }: CamelCasedProperties["all_tokens"]>): QueryMsg => { + return { + all_tokens: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static isArchived = ({ + tokenId + }: CamelCasedProperties["is_archived"]>): QueryMsg => { + return { + is_archived: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + tokenId + }: CamelCasedProperties["transfer_agreement"]>): QueryMsg => { + return { + transfer_agreement: ({ + token_id: tokenId + } as const) + }; + }; + static contractInfo = (): QueryMsg => { + return { + contract_info: ({} as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static approval = ({ + includeExpired, + spender, + tokenId + }: CamelCasedProperties["approval"]>): QueryMsg => { + return { + approval: ({ + include_expired: includeExpired, + spender, + token_id: tokenId + } as const) + }; + }; + static approvals = ({ + includeExpired, + tokenId + }: CamelCasedProperties["approvals"]>): QueryMsg => { + return { + approvals: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.3-beta.1/Cw721ContractTs.types.ts b/packages/adocodegen/src/cw721/2.0.3-beta.1/Cw721ContractTs.types.ts new file mode 100644 index 0000000..ba1712f --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.3-beta.1/Cw721ContractTs.types.ts @@ -0,0 +1,398 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + minter: AndrAddr; + name: string; + owner?: string | null; + symbol: string; +} +export type ExecuteMsg = { + mint: { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; + }; +} | { + transfer_nft: { + recipient: AndrAddr; + token_id: string; + }; +} | { + send_nft: { + contract: AndrAddr; + msg: Binary; + token_id: string; + }; +} | { + approve: { + expires?: Expiration | null; + spender: string; + token_id: string; + }; +} | { + revoke: { + spender: string; + token_id: string; + }; +} | { + approve_all: { + expires?: Expiration | null; + operator: string; + }; +} | { + revoke_all: { + operator: string; + }; +} | { + burn: { + token_id: string; + }; +} | { + archive: { + token_id: string; + }; +} | { + transfer_agreement: { + agreement?: TransferAgreement | null; + token_id: string; + }; +} | { + batch_mint: { + tokens: MintMsg[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface TokenExtension { + publisher: string; +} +export interface TransferAgreement { + amount: Coin; + purchaser: string; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface MintMsg { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + owner_of: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + all_operators: { + include_expired?: boolean | null; + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + num_tokens: {}; +} | { + nft_info: { + token_id: string; + }; +} | { + all_nft_info: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + tokens: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + is_archived: { + token_id: string; + }; +} | { + transfer_agreement: { + token_id: string; + }; +} | { + contract_info: {}; +} | { + minter: {}; +} | { + approval: { + include_expired?: boolean | null; + spender: string; + token_id: string; + }; +} | { + approvals: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllNftInfoResponseForTokenExtension { + access: OwnerOfResponse; + info: NftInfoResponseForTokenExtension; +} +export interface OwnerOfResponse { + approvals: Approval[]; + owner: string; +} +export interface Approval { + expires: Expiration; + spender: string; +} +export interface NftInfoResponseForTokenExtension { + extension: TokenExtension; + token_uri?: string | null; +} +export interface OperatorsResponse { + operators: Approval[]; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface TokensResponse { + tokens: string[]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface ApprovalResponse { + approval: Approval; +} +export interface ApprovalsResponse { + approvals: Approval[]; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ContractInfoResponse { + name: string; + symbol: string; +} +export interface IsArchivedResponse { + is_archived: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface MinterResponse { + minter?: string | null; +} +export interface NumTokensResponse { + count: number; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export type NullableTransferAgreement = TransferAgreement | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw721ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.3/Cw721ContractTs.client.ts b/packages/adocodegen/src/cw721/2.0.3/Cw721ContractTs.client.ts new file mode 100644 index 0000000..847b0fe --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.3/Cw721ContractTs.client.ts @@ -0,0 +1,724 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, AllRatesResponse, TokensResponse, AppContractResponse, ApprovalResponse, ApprovalsResponse, BlockHeightResponse, ContractInfoResponse, IsArchivedResponse, KernelAddressResponse, MinterResponse, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +export interface Cw721ContractTsReadOnlyInterface { + contractAddress: string; + ownerOf: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + allOperators: ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + numTokens: () => Promise; + nftInfo: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + allNftInfo: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + tokens: ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }) => Promise; + allTokens: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }) => Promise; + isArchived: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + transferAgreement: ({ + tokenId + }: { + tokenId: string; + }) => Promise; + contractInfo: () => Promise; + minter: () => Promise; + approval: ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }) => Promise; + approvals: ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class Cw721ContractTsQueryClient implements Cw721ContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.ownerOf = this.ownerOf.bind(this); + this.allOperators = this.allOperators.bind(this); + this.numTokens = this.numTokens.bind(this); + this.nftInfo = this.nftInfo.bind(this); + this.allNftInfo = this.allNftInfo.bind(this); + this.tokens = this.tokens.bind(this); + this.allTokens = this.allTokens.bind(this); + this.isArchived = this.isArchived.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.contractInfo = this.contractInfo.bind(this); + this.minter = this.minter.bind(this); + this.approval = this.approval.bind(this); + this.approvals = this.approvals.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + ownerOf = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_of: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + allOperators = async ({ + includeExpired, + limit, + owner, + startAfter + }: { + includeExpired?: boolean; + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_operators: { + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } + }); + }; + numTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + num_tokens: {} + }); + }; + nftInfo = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + nft_info: { + token_id: tokenId + } + }); + }; + allNftInfo = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_nft_info: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + tokens = async ({ + limit, + owner, + startAfter + }: { + limit?: number; + owner: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + tokens: { + limit, + owner, + start_after: startAfter + } + }); + }; + allTokens = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_tokens: { + limit, + start_after: startAfter + } + }); + }; + isArchived = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_archived: { + token_id: tokenId + } + }); + }; + transferAgreement = async ({ + tokenId + }: { + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + transfer_agreement: { + token_id: tokenId + } + }); + }; + contractInfo = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + contract_info: {} + }); + }; + minter = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + minter: {} + }); + }; + approval = async ({ + includeExpired, + spender, + tokenId + }: { + includeExpired?: boolean; + spender: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approval: { + include_expired: includeExpired, + spender, + token_id: tokenId + } + }); + }; + approvals = async ({ + includeExpired, + tokenId + }: { + includeExpired?: boolean; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + approvals: { + include_expired: includeExpired, + token_id: tokenId + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface Cw721ContractTsInterface { + contractAddress: string; + sender: string; + mint: ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferNft: ({ + recipient, + tokenId + }: { + recipient: AndrAddr; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + sendNft: ({ + contract, + msg, + tokenId + }: { + contract: AndrAddr; + msg: Binary; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + approve: ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, 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; + approveAll: ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + revokeAll: ({ + operator + }: { + operator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + archive: ({ + tokenId + }: { + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + transferAgreement: ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + batchMint: ({ + tokens + }: { + tokens: MintMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class Cw721ContractTsClient implements Cw721ContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.mint = this.mint.bind(this); + this.transferNft = this.transferNft.bind(this); + this.sendNft = this.sendNft.bind(this); + this.approve = this.approve.bind(this); + this.revoke = this.revoke.bind(this); + this.approveAll = this.approveAll.bind(this); + this.revokeAll = this.revokeAll.bind(this); + this.burn = this.burn.bind(this); + this.archive = this.archive.bind(this); + this.transferAgreement = this.transferAgreement.bind(this); + this.batchMint = this.batchMint.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + mint = async ({ + extension, + owner, + tokenId, + tokenUri + }: { + extension: TokenExtension; + owner: string; + tokenId: string; + tokenUri?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + mint: { + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } + }, fee, memo, _funds); + }; + transferNft = async ({ + recipient, + tokenId + }: { + recipient: AndrAddr; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_nft: { + recipient, + token_id: tokenId + } + }, fee, memo, _funds); + }; + sendNft = async ({ + contract, + msg, + tokenId + }: { + contract: AndrAddr; + msg: Binary; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send_nft: { + contract, + msg, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approve = async ({ + expires, + spender, + tokenId + }: { + expires?: Expiration; + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve: { + expires, + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + revoke = async ({ + spender, + tokenId + }: { + spender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke: { + spender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + approveAll = async ({ + expires, + operator + }: { + expires?: Expiration; + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + approve_all: { + expires, + operator + } + }, fee, memo, _funds); + }; + revokeAll = async ({ + operator + }: { + operator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + revoke_all: { + operator + } + }, fee, memo, _funds); + }; + burn = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + archive = async ({ + tokenId + }: { + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + archive: { + token_id: tokenId + } + }, fee, memo, _funds); + }; + transferAgreement = async ({ + agreement, + tokenId + }: { + agreement?: TransferAgreement; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + transfer_agreement: { + agreement, + token_id: tokenId + } + }, fee, memo, _funds); + }; + batchMint = async ({ + tokens + }: { + tokens: MintMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + batch_mint: { + tokens + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.3/Cw721ContractTs.message-builder.ts b/packages/adocodegen/src/cw721/2.0.3/Cw721ContractTs.message-builder.ts new file mode 100644 index 0000000..6e5a4c4 --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.3/Cw721ContractTs.message-builder.ts @@ -0,0 +1,433 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Expiration, Timestamp, Uint64, Uint128, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, TokenExtension, TransferAgreement, Coin, MintMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllNftInfoResponseForTokenExtension, OwnerOfResponse, Approval, NftInfoResponseForTokenExtension, OperatorsResponse, AllRatesResponse, TokensResponse, AppContractResponse, ApprovalResponse, ApprovalsResponse, BlockHeightResponse, ContractInfoResponse, IsArchivedResponse, KernelAddressResponse, MinterResponse, NumTokensResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableTransferAgreement, TypeResponse, VersionResponse } from "./Cw721ContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class Cw721ContractTsExecuteMsgBuilder { + static mint = ({ + extension, + owner, + tokenId, + tokenUri + }: CamelCasedProperties["mint"]>): ExecuteMsg => { + return { + mint: ({ + extension, + owner, + token_id: tokenId, + token_uri: tokenUri + } as const) + }; + }; + static transferNft = ({ + recipient, + tokenId + }: CamelCasedProperties["transfer_nft"]>): ExecuteMsg => { + return { + transfer_nft: ({ + recipient, + token_id: tokenId + } as const) + }; + }; + static sendNft = ({ + contract, + msg, + tokenId + }: CamelCasedProperties["send_nft"]>): ExecuteMsg => { + return { + send_nft: ({ + contract, + msg, + token_id: tokenId + } as const) + }; + }; + static approve = ({ + expires, + spender, + tokenId + }: CamelCasedProperties["approve"]>): ExecuteMsg => { + return { + approve: ({ + expires, + spender, + token_id: tokenId + } as const) + }; + }; + static revoke = ({ + spender, + tokenId + }: CamelCasedProperties["revoke"]>): ExecuteMsg => { + return { + revoke: ({ + spender, + token_id: tokenId + } as const) + }; + }; + static approveAll = ({ + expires, + operator + }: CamelCasedProperties["approve_all"]>): ExecuteMsg => { + return { + approve_all: ({ + expires, + operator + } as const) + }; + }; + static revokeAll = ({ + operator + }: CamelCasedProperties["revoke_all"]>): ExecuteMsg => { + return { + revoke_all: ({ + operator + } as const) + }; + }; + static burn = ({ + tokenId + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + token_id: tokenId + } as const) + }; + }; + static archive = ({ + tokenId + }: CamelCasedProperties["archive"]>): ExecuteMsg => { + return { + archive: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + agreement, + tokenId + }: CamelCasedProperties["transfer_agreement"]>): ExecuteMsg => { + return { + transfer_agreement: ({ + agreement, + token_id: tokenId + } as const) + }; + }; + static batchMint = ({ + tokens + }: CamelCasedProperties["batch_mint"]>): ExecuteMsg => { + return { + batch_mint: ({ + tokens + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class Cw721ContractTsQueryMsgBuilder { + static ownerOf = ({ + includeExpired, + tokenId + }: CamelCasedProperties["owner_of"]>): QueryMsg => { + return { + owner_of: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static allOperators = ({ + includeExpired, + limit, + owner, + startAfter + }: CamelCasedProperties["all_operators"]>): QueryMsg => { + return { + all_operators: ({ + include_expired: includeExpired, + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static numTokens = (): QueryMsg => { + return { + num_tokens: ({} as const) + }; + }; + static nftInfo = ({ + tokenId + }: CamelCasedProperties["nft_info"]>): QueryMsg => { + return { + nft_info: ({ + token_id: tokenId + } as const) + }; + }; + static allNftInfo = ({ + includeExpired, + tokenId + }: CamelCasedProperties["all_nft_info"]>): QueryMsg => { + return { + all_nft_info: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static tokens = ({ + limit, + owner, + startAfter + }: CamelCasedProperties["tokens"]>): QueryMsg => { + return { + tokens: ({ + limit, + owner, + start_after: startAfter + } as const) + }; + }; + static allTokens = ({ + limit, + startAfter + }: CamelCasedProperties["all_tokens"]>): QueryMsg => { + return { + all_tokens: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static isArchived = ({ + tokenId + }: CamelCasedProperties["is_archived"]>): QueryMsg => { + return { + is_archived: ({ + token_id: tokenId + } as const) + }; + }; + static transferAgreement = ({ + tokenId + }: CamelCasedProperties["transfer_agreement"]>): QueryMsg => { + return { + transfer_agreement: ({ + token_id: tokenId + } as const) + }; + }; + static contractInfo = (): QueryMsg => { + return { + contract_info: ({} as const) + }; + }; + static minter = (): QueryMsg => { + return { + minter: ({} as const) + }; + }; + static approval = ({ + includeExpired, + spender, + tokenId + }: CamelCasedProperties["approval"]>): QueryMsg => { + return { + approval: ({ + include_expired: includeExpired, + spender, + token_id: tokenId + } as const) + }; + }; + static approvals = ({ + includeExpired, + tokenId + }: CamelCasedProperties["approvals"]>): QueryMsg => { + return { + approvals: ({ + include_expired: includeExpired, + token_id: tokenId + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/cw721/2.0.3/Cw721ContractTs.types.ts b/packages/adocodegen/src/cw721/2.0.3/Cw721ContractTs.types.ts new file mode 100644 index 0000000..ba1712f --- /dev/null +++ b/packages/adocodegen/src/cw721/2.0.3/Cw721ContractTs.types.ts @@ -0,0 +1,398 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + minter: AndrAddr; + name: string; + owner?: string | null; + symbol: string; +} +export type ExecuteMsg = { + mint: { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; + }; +} | { + transfer_nft: { + recipient: AndrAddr; + token_id: string; + }; +} | { + send_nft: { + contract: AndrAddr; + msg: Binary; + token_id: string; + }; +} | { + approve: { + expires?: Expiration | null; + spender: string; + token_id: string; + }; +} | { + revoke: { + spender: string; + token_id: string; + }; +} | { + approve_all: { + expires?: Expiration | null; + operator: string; + }; +} | { + revoke_all: { + operator: string; + }; +} | { + burn: { + token_id: string; + }; +} | { + archive: { + token_id: string; + }; +} | { + transfer_agreement: { + agreement?: TransferAgreement | null; + token_id: string; + }; +} | { + batch_mint: { + tokens: MintMsg[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface TokenExtension { + publisher: string; +} +export interface TransferAgreement { + amount: Coin; + purchaser: string; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface MintMsg { + extension: TokenExtension; + owner: string; + token_id: string; + token_uri?: string | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + owner_of: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + all_operators: { + include_expired?: boolean | null; + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + num_tokens: {}; +} | { + nft_info: { + token_id: string; + }; +} | { + all_nft_info: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + tokens: { + limit?: number | null; + owner: string; + start_after?: string | null; + }; +} | { + all_tokens: { + limit?: number | null; + start_after?: string | null; + }; +} | { + is_archived: { + token_id: string; + }; +} | { + transfer_agreement: { + token_id: string; + }; +} | { + contract_info: {}; +} | { + minter: {}; +} | { + approval: { + include_expired?: boolean | null; + spender: string; + token_id: string; + }; +} | { + approvals: { + include_expired?: boolean | null; + token_id: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllNftInfoResponseForTokenExtension { + access: OwnerOfResponse; + info: NftInfoResponseForTokenExtension; +} +export interface OwnerOfResponse { + approvals: Approval[]; + owner: string; +} +export interface Approval { + expires: Expiration; + spender: string; +} +export interface NftInfoResponseForTokenExtension { + extension: TokenExtension; + token_uri?: string | null; +} +export interface OperatorsResponse { + operators: Approval[]; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface TokensResponse { + tokens: string[]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface ApprovalResponse { + approval: Approval; +} +export interface ApprovalsResponse { + approvals: Approval[]; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ContractInfoResponse { + name: string; + symbol: string; +} +export interface IsArchivedResponse { + is_archived: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface MinterResponse { + minter?: string | null; +} +export interface NumTokensResponse { + count: number; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export type NullableTransferAgreement = TransferAgreement | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type Cw721ContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/date-time/1.0.0-beta.1/DateTimeContractTs.client.ts b/packages/adocodegen/src/date-time/1.0.0-beta.1/DateTimeContractTs.client.ts new file mode 100644 index 0000000..6ad0674 --- /dev/null +++ b/packages/adocodegen/src/date-time/1.0.0-beta.1/DateTimeContractTs.client.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, Timezone, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDateTimeResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./DateTimeContractTs.types"; +export interface DateTimeContractTsReadOnlyInterface { + contractAddress: string; + getDateTime: ({ + timezone + }: { + timezone?: Timezone; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class DateTimeContractTsQueryClient implements DateTimeContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getDateTime = this.getDateTime.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getDateTime = async ({ + timezone + }: { + timezone?: Timezone; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_date_time: { + timezone + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface DateTimeContractTsInterface { + contractAddress: string; + sender: string; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class DateTimeContractTsClient implements DateTimeContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/date-time/1.0.0-beta.1/DateTimeContractTs.message-builder.ts b/packages/adocodegen/src/date-time/1.0.0-beta.1/DateTimeContractTs.message-builder.ts new file mode 100644 index 0000000..ede576b --- /dev/null +++ b/packages/adocodegen/src/date-time/1.0.0-beta.1/DateTimeContractTs.message-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, Timezone, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDateTimeResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./DateTimeContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class DateTimeContractTsExecuteMsgBuilder { + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class DateTimeContractTsQueryMsgBuilder { + static getDateTime = ({ + timezone + }: CamelCasedProperties["get_date_time"]>): QueryMsg => { + return { + get_date_time: ({ + timezone + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/date-time/1.0.0-beta.1/DateTimeContractTs.types.ts b/packages/adocodegen/src/date-time/1.0.0-beta.1/DateTimeContractTs.types.ts new file mode 100644 index 0000000..34ca235 --- /dev/null +++ b/packages/adocodegen/src/date-time/1.0.0-beta.1/DateTimeContractTs.types.ts @@ -0,0 +1,228 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_date_time: { + timezone?: Timezone | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type Timezone = "utc_minus12" | "utc_minus11" | "utc_minus10" | "utc_minus9_30" | "utc_minus9" | "utc_minus8" | "utc_minus7" | "utc_minus6" | "utc_minus5" | "utc_minus4" | "utc_minus3" | "utc_minus2_30" | "utc_minus2" | "utc_minus1" | "utc" | "utc_plus1" | "utc_plus2" | "utc_plus3" | "utc_plus3_30" | "utc_plus4" | "utc_plus4_30" | "utc_plus5" | "utc_plus5_45" | "utc_plus5_30" | "utc_plus6" | "utc_plus6_30" | "utc_plus7" | "utc_plus8" | "utc_plus8_45" | "utc_plus9" | "utc_plus9_30" | "utc_plus10" | "utc_plus10_30" | "utc_plus11" | "utc_plus12" | "utc_plus12_45" | "utc_plus13" | "utc_plus14"; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetDateTimeResponse { + date_time: string; + day_of_week: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type DateTimeContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/date-time/1.0.0/DateTimeContractTs.client.ts b/packages/adocodegen/src/date-time/1.0.0/DateTimeContractTs.client.ts new file mode 100644 index 0000000..6ad0674 --- /dev/null +++ b/packages/adocodegen/src/date-time/1.0.0/DateTimeContractTs.client.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, Timezone, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDateTimeResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./DateTimeContractTs.types"; +export interface DateTimeContractTsReadOnlyInterface { + contractAddress: string; + getDateTime: ({ + timezone + }: { + timezone?: Timezone; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class DateTimeContractTsQueryClient implements DateTimeContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getDateTime = this.getDateTime.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getDateTime = async ({ + timezone + }: { + timezone?: Timezone; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_date_time: { + timezone + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface DateTimeContractTsInterface { + contractAddress: string; + sender: string; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class DateTimeContractTsClient implements DateTimeContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/date-time/1.0.0/DateTimeContractTs.message-builder.ts b/packages/adocodegen/src/date-time/1.0.0/DateTimeContractTs.message-builder.ts new file mode 100644 index 0000000..ede576b --- /dev/null +++ b/packages/adocodegen/src/date-time/1.0.0/DateTimeContractTs.message-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, Timezone, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDateTimeResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./DateTimeContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class DateTimeContractTsExecuteMsgBuilder { + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class DateTimeContractTsQueryMsgBuilder { + static getDateTime = ({ + timezone + }: CamelCasedProperties["get_date_time"]>): QueryMsg => { + return { + get_date_time: ({ + timezone + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/date-time/1.0.0/DateTimeContractTs.types.ts b/packages/adocodegen/src/date-time/1.0.0/DateTimeContractTs.types.ts new file mode 100644 index 0000000..34ca235 --- /dev/null +++ b/packages/adocodegen/src/date-time/1.0.0/DateTimeContractTs.types.ts @@ -0,0 +1,228 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_date_time: { + timezone?: Timezone | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type Timezone = "utc_minus12" | "utc_minus11" | "utc_minus10" | "utc_minus9_30" | "utc_minus9" | "utc_minus8" | "utc_minus7" | "utc_minus6" | "utc_minus5" | "utc_minus4" | "utc_minus3" | "utc_minus2_30" | "utc_minus2" | "utc_minus1" | "utc" | "utc_plus1" | "utc_plus2" | "utc_plus3" | "utc_plus3_30" | "utc_plus4" | "utc_plus4_30" | "utc_plus5" | "utc_plus5_45" | "utc_plus5_30" | "utc_plus6" | "utc_plus6_30" | "utc_plus7" | "utc_plus8" | "utc_plus8_45" | "utc_plus9" | "utc_plus9_30" | "utc_plus10" | "utc_plus10_30" | "utc_plus11" | "utc_plus12" | "utc_plus12_45" | "utc_plus13" | "utc_plus14"; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetDateTimeResponse { + date_time: string; + day_of_week: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type DateTimeContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/economics/0.2.0/EconomicsContractTs.client.ts b/packages/adocodegen/src/economics/0.2.0/EconomicsContractTs.client.ts new file mode 100644 index 0000000..e2c43fb --- /dev/null +++ b/packages/adocodegen/src/economics/0.2.0/EconomicsContractTs.client.ts @@ -0,0 +1,170 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, Addr, Uint128, Binary, Cw20ReceiveMsg, QueryMsg } from "./EconomicsContractTs.types"; +export interface EconomicsContractTsReadOnlyInterface { + contractAddress: string; + balance: ({ + address, + asset + }: { + address: AndrAddr; + asset: string; + }) => Promise; +} +export class EconomicsContractTsQueryClient implements EconomicsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.balance = this.balance.bind(this); + } + + balance = async ({ + address, + asset + }: { + address: AndrAddr; + asset: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address, + asset + } + }); + }; +} +export interface EconomicsContractTsInterface { + contractAddress: string; + sender: string; + deposit: ({ + address + }: { + address?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + payFee: ({ + action, + payee + }: { + action: string; + payee: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawCw20: ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class EconomicsContractTsClient implements EconomicsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.deposit = this.deposit.bind(this); + this.payFee = this.payFee.bind(this); + this.withdraw = this.withdraw.bind(this); + this.withdrawCw20 = this.withdrawCw20.bind(this); + this.receive = this.receive.bind(this); + } + + deposit = async ({ + address + }: { + address?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit: { + address + } + }, fee, memo, _funds); + }; + payFee = async ({ + action, + payee + }: { + action: string; + payee: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + pay_fee: { + action, + payee + } + }, fee, memo, _funds); + }; + withdraw = async ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: { + amount, + asset + } + }, fee, memo, _funds); + }; + withdrawCw20 = async ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_cw20: { + amount, + asset + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/economics/0.2.0/EconomicsContractTs.message-builder.ts b/packages/adocodegen/src/economics/0.2.0/EconomicsContractTs.message-builder.ts new file mode 100644 index 0000000..ed9a02b --- /dev/null +++ b/packages/adocodegen/src/economics/0.2.0/EconomicsContractTs.message-builder.ts @@ -0,0 +1,90 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, Addr, Uint128, Binary, Cw20ReceiveMsg, QueryMsg } from "./EconomicsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class EconomicsContractTsExecuteMsgBuilder { + static deposit = ({ + address + }: CamelCasedProperties["deposit"]>): ExecuteMsg => { + return { + deposit: ({ + address + } as const) + }; + }; + static payFee = ({ + action, + payee + }: CamelCasedProperties["pay_fee"]>): ExecuteMsg => { + return { + pay_fee: ({ + action, + payee + } as const) + }; + }; + static withdraw = ({ + amount, + asset + }: CamelCasedProperties["withdraw"]>): ExecuteMsg => { + return { + withdraw: ({ + amount, + asset + } as const) + }; + }; + static withdrawCw20 = ({ + amount, + asset + }: CamelCasedProperties["withdraw_cw20"]>): ExecuteMsg => { + return { + withdraw_cw20: ({ + amount, + asset + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; +} +export abstract class EconomicsContractTsQueryMsgBuilder { + static balance = ({ + address, + asset + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address, + asset + } as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/economics/0.2.0/EconomicsContractTs.types.ts b/packages/adocodegen/src/economics/0.2.0/EconomicsContractTs.types.ts new file mode 100644 index 0000000..1661782 --- /dev/null +++ b/packages/adocodegen/src/economics/0.2.0/EconomicsContractTs.types.ts @@ -0,0 +1,48 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + deposit: { + address?: AndrAddr | null; + }; +} | { + pay_fee: { + action: string; + payee: Addr; + }; +} | { + withdraw: { + amount?: Uint128 | null; + asset: string; + }; +} | { + withdraw_cw20: { + amount?: Uint128 | null; + asset: string; + }; +} | { + receive: Cw20ReceiveMsg; +}; +export type AndrAddr = string; +export type Addr = string; +export type Uint128 = string; +export type Binary = string; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export type QueryMsg = { + balance: { + address: AndrAddr; + asset: string; + }; +}; +export type EconomicsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/economics/0.2.16/EconomicsContractTs.client.ts b/packages/adocodegen/src/economics/0.2.16/EconomicsContractTs.client.ts new file mode 100644 index 0000000..bf93c37 --- /dev/null +++ b/packages/adocodegen/src/economics/0.2.16/EconomicsContractTs.client.ts @@ -0,0 +1,198 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, Addr, Uint128, Binary, Cw20ReceiveMsg, QueryMsg, KernelAddressResponse, ContractOwnerResponse, TypeResponse, VersionResponse } from "./EconomicsContractTs.types"; +export interface EconomicsContractTsReadOnlyInterface { + contractAddress: string; + balance: ({ + address, + asset + }: { + address: AndrAddr; + asset: string; + }) => Promise; + version: () => Promise; + type: () => Promise; + owner: () => Promise; + kernelAddress: () => Promise; +} +export class EconomicsContractTsQueryClient implements EconomicsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.balance = this.balance.bind(this); + this.version = this.version.bind(this); + this.type = this.type.bind(this); + this.owner = this.owner.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + } + + balance = async ({ + address, + asset + }: { + address: AndrAddr; + asset: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address, + asset + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; +} +export interface EconomicsContractTsInterface { + contractAddress: string; + sender: string; + deposit: ({ + address + }: { + address?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + payFee: ({ + action, + payee + }: { + action: string; + payee: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawCw20: ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class EconomicsContractTsClient implements EconomicsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.deposit = this.deposit.bind(this); + this.payFee = this.payFee.bind(this); + this.withdraw = this.withdraw.bind(this); + this.withdrawCw20 = this.withdrawCw20.bind(this); + this.receive = this.receive.bind(this); + } + + deposit = async ({ + address + }: { + address?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit: { + address + } + }, fee, memo, _funds); + }; + payFee = async ({ + action, + payee + }: { + action: string; + payee: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + pay_fee: { + action, + payee + } + }, fee, memo, _funds); + }; + withdraw = async ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: { + amount, + asset + } + }, fee, memo, _funds); + }; + withdrawCw20 = async ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_cw20: { + amount, + asset + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/economics/0.2.16/EconomicsContractTs.message-builder.ts b/packages/adocodegen/src/economics/0.2.16/EconomicsContractTs.message-builder.ts new file mode 100644 index 0000000..81f0792 --- /dev/null +++ b/packages/adocodegen/src/economics/0.2.16/EconomicsContractTs.message-builder.ts @@ -0,0 +1,110 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, Addr, Uint128, Binary, Cw20ReceiveMsg, QueryMsg, KernelAddressResponse, ContractOwnerResponse, TypeResponse, VersionResponse } from "./EconomicsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class EconomicsContractTsExecuteMsgBuilder { + static deposit = ({ + address + }: CamelCasedProperties["deposit"]>): ExecuteMsg => { + return { + deposit: ({ + address + } as const) + }; + }; + static payFee = ({ + action, + payee + }: CamelCasedProperties["pay_fee"]>): ExecuteMsg => { + return { + pay_fee: ({ + action, + payee + } as const) + }; + }; + static withdraw = ({ + amount, + asset + }: CamelCasedProperties["withdraw"]>): ExecuteMsg => { + return { + withdraw: ({ + amount, + asset + } as const) + }; + }; + static withdrawCw20 = ({ + amount, + asset + }: CamelCasedProperties["withdraw_cw20"]>): ExecuteMsg => { + return { + withdraw_cw20: ({ + amount, + asset + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; +} +export abstract class EconomicsContractTsQueryMsgBuilder { + static balance = ({ + address, + asset + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address, + asset + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/economics/0.2.16/EconomicsContractTs.types.ts b/packages/adocodegen/src/economics/0.2.16/EconomicsContractTs.types.ts new file mode 100644 index 0000000..50fd2cb --- /dev/null +++ b/packages/adocodegen/src/economics/0.2.16/EconomicsContractTs.types.ts @@ -0,0 +1,68 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + deposit: { + address?: AndrAddr | null; + }; +} | { + pay_fee: { + action: string; + payee: Addr; + }; +} | { + withdraw: { + amount?: Uint128 | null; + asset: string; + }; +} | { + withdraw_cw20: { + amount?: Uint128 | null; + asset: string; + }; +} | { + receive: Cw20ReceiveMsg; +}; +export type AndrAddr = string; +export type Addr = string; +export type Uint128 = string; +export type Binary = string; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export type QueryMsg = { + balance: { + address: AndrAddr; + asset: string; + }; +} | { + version: {}; +} | { + type: {}; +} | { + owner: {}; +} | { + kernel_address: {}; +}; +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type EconomicsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/economics/1.1.1/EconomicsContractTs.client.ts b/packages/adocodegen/src/economics/1.1.1/EconomicsContractTs.client.ts new file mode 100644 index 0000000..b00a559 --- /dev/null +++ b/packages/adocodegen/src/economics/1.1.1/EconomicsContractTs.client.ts @@ -0,0 +1,205 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, Addr, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Cw20ReceiveMsg, QueryMsg, BalanceResponse, KernelAddressResponse, ContractOwnerResponse, TypeResponse, VersionResponse } from "./EconomicsContractTs.types"; +export interface EconomicsContractTsReadOnlyInterface { + contractAddress: string; + balance: ({ + address, + asset + }: { + address: AndrAddr; + asset: string; + }) => Promise; + version: () => Promise; + type: () => Promise; + owner: () => Promise; + kernelAddress: () => Promise; +} +export class EconomicsContractTsQueryClient implements EconomicsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.balance = this.balance.bind(this); + this.version = this.version.bind(this); + this.type = this.type.bind(this); + this.owner = this.owner.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + } + + balance = async ({ + address, + asset + }: { + address: AndrAddr; + asset: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address, + asset + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; +} +export interface EconomicsContractTsInterface { + contractAddress: string; + sender: string; + deposit: ({ + address + }: { + address?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + payFee: ({ + action, + payee + }: { + action: string; + payee: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawCw20: ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class EconomicsContractTsClient implements EconomicsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.deposit = this.deposit.bind(this); + this.payFee = this.payFee.bind(this); + this.withdraw = this.withdraw.bind(this); + this.withdrawCw20 = this.withdrawCw20.bind(this); + this.receive = this.receive.bind(this); + this.ownership = this.ownership.bind(this); + } + + deposit = async ({ + address + }: { + address?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit: { + address + } + }, fee, memo, _funds); + }; + payFee = async ({ + action, + payee + }: { + action: string; + payee: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + pay_fee: { + action, + payee + } + }, fee, memo, _funds); + }; + withdraw = async ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: { + amount, + asset + } + }, fee, memo, _funds); + }; + withdrawCw20 = async ({ + amount, + asset + }: { + amount?: Uint128; + asset: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_cw20: { + amount, + asset + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/economics/1.1.1/EconomicsContractTs.message-builder.ts b/packages/adocodegen/src/economics/1.1.1/EconomicsContractTs.message-builder.ts new file mode 100644 index 0000000..900b0db --- /dev/null +++ b/packages/adocodegen/src/economics/1.1.1/EconomicsContractTs.message-builder.ts @@ -0,0 +1,115 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, Addr, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Cw20ReceiveMsg, QueryMsg, BalanceResponse, KernelAddressResponse, ContractOwnerResponse, TypeResponse, VersionResponse } from "./EconomicsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class EconomicsContractTsExecuteMsgBuilder { + static deposit = ({ + address + }: CamelCasedProperties["deposit"]>): ExecuteMsg => { + return { + deposit: ({ + address + } as const) + }; + }; + static payFee = ({ + action, + payee + }: CamelCasedProperties["pay_fee"]>): ExecuteMsg => { + return { + pay_fee: ({ + action, + payee + } as const) + }; + }; + static withdraw = ({ + amount, + asset + }: CamelCasedProperties["withdraw"]>): ExecuteMsg => { + return { + withdraw: ({ + amount, + asset + } as const) + }; + }; + static withdrawCw20 = ({ + amount, + asset + }: CamelCasedProperties["withdraw_cw20"]>): ExecuteMsg => { + return { + withdraw_cw20: ({ + amount, + asset + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; +} +export abstract class EconomicsContractTsQueryMsgBuilder { + static balance = ({ + address, + asset + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address, + asset + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/economics/1.1.1/EconomicsContractTs.types.ts b/packages/adocodegen/src/economics/1.1.1/EconomicsContractTs.types.ts new file mode 100644 index 0000000..93383bf --- /dev/null +++ b/packages/adocodegen/src/economics/1.1.1/EconomicsContractTs.types.ts @@ -0,0 +1,85 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + deposit: { + address?: AndrAddr | null; + }; +} | { + pay_fee: { + action: string; + payee: Addr; + }; +} | { + withdraw: { + amount?: Uint128 | null; + asset: string; + }; +} | { + withdraw_cw20: { + amount?: Uint128 | null; + asset: string; + }; +} | { + receive: Cw20ReceiveMsg; +} | { + ownership: OwnershipMessage; +}; +export type AndrAddr = string; +export type Addr = string; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export type QueryMsg = { + balance: { + address: AndrAddr; + asset: string; + }; +} | { + version: {}; +} | { + type: {}; +} | { + owner: {}; +} | { + kernel_address: {}; +}; +export interface BalanceResponse { + balance: Uint128; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type EconomicsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/kernel/0.2.15/KernelContractTs.client.ts b/packages/adocodegen/src/kernel/0.2.15/KernelContractTs.client.ts new file mode 100644 index 0000000..71b1b4b --- /dev/null +++ b/packages/adocodegen/src/kernel/0.2.15/KernelContractTs.client.ts @@ -0,0 +1,245 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, InternalMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, Addr, NullableChannelInfoResponse, ChannelInfoResponse, ArrayOfCoin, Boolean } from "./KernelContractTs.types"; +export interface KernelContractTsReadOnlyInterface { + contractAddress: string; + keyAddress: ({ + key + }: { + key: string; + }) => Promise; + verifyAddress: ({ + address + }: { + address: string; + }) => Promise; + channelInfo: ({ + chain + }: { + chain: string; + }) => Promise; + recoveries: ({ + addr + }: { + addr: Addr; + }) => Promise; +} +export class KernelContractTsQueryClient implements KernelContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.keyAddress = this.keyAddress.bind(this); + this.verifyAddress = this.verifyAddress.bind(this); + this.channelInfo = this.channelInfo.bind(this); + this.recoveries = this.recoveries.bind(this); + } + + keyAddress = async ({ + key + }: { + key: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + key_address: { + key + } + }); + }; + verifyAddress = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + verify_address: { + address + } + }); + }; + channelInfo = async ({ + chain + }: { + chain: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + channel_info: { + chain + } + }); + }; + recoveries = async ({ + addr + }: { + addr: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + recoveries: { + addr + } + }); + }; +} +export interface KernelContractTsInterface { + contractAddress: string; + sender: string; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: ({ + message + }: { + message: AMPMsg; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + upsertKeyAddress: ({ + key, + value + }: { + key: string; + value: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + create: ({ + adoType, + chain, + msg, + owner + }: { + adoType: string; + chain?: string; + msg: Binary; + owner?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + assignChannels: ({ + chain, + directChannelId, + ics20ChannelId, + kernelAddress + }: { + chain: string; + directChannelId?: string; + ics20ChannelId?: string; + kernelAddress: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + recover: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + internal: (internalMsg: InternalMsg, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class KernelContractTsClient implements KernelContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.ampReceive = this.ampReceive.bind(this); + this.send = this.send.bind(this); + this.upsertKeyAddress = this.upsertKeyAddress.bind(this); + this.create = this.create.bind(this); + this.assignChannels = this.assignChannels.bind(this); + this.recover = this.recover.bind(this); + this.internal = this.internal.bind(this); + } + + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + send = async ({ + message + }: { + message: AMPMsg; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: { + message + } + }, fee, memo, _funds); + }; + upsertKeyAddress = async ({ + key, + value + }: { + key: string; + value: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + upsert_key_address: { + key, + value + } + }, fee, memo, _funds); + }; + create = async ({ + adoType, + chain, + msg, + owner + }: { + adoType: string; + chain?: string; + msg: Binary; + owner?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create: { + ado_type: adoType, + chain, + msg, + owner + } + }, fee, memo, _funds); + }; + assignChannels = async ({ + chain, + directChannelId, + ics20ChannelId, + kernelAddress + }: { + chain: string; + directChannelId?: string; + ics20ChannelId?: string; + kernelAddress: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + assign_channels: { + chain, + direct_channel_id: directChannelId, + ics20_channel_id: ics20ChannelId, + kernel_address: kernelAddress + } + }, fee, memo, _funds); + }; + recover = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + recover: {} + }, fee, memo, _funds); + }; + internal = async (internalMsg: InternalMsg, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + internal: internalMsg + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/kernel/0.2.15/KernelContractTs.message-builder.ts b/packages/adocodegen/src/kernel/0.2.15/KernelContractTs.message-builder.ts new file mode 100644 index 0000000..679048f --- /dev/null +++ b/packages/adocodegen/src/kernel/0.2.15/KernelContractTs.message-builder.ts @@ -0,0 +1,137 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, InternalMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, Addr, NullableChannelInfoResponse, ChannelInfoResponse, ArrayOfCoin, Boolean } from "./KernelContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class KernelContractTsExecuteMsgBuilder { + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static send = ({ + message + }: CamelCasedProperties["send"]>): ExecuteMsg => { + return { + send: ({ + message + } as const) + }; + }; + static upsertKeyAddress = ({ + key, + value + }: CamelCasedProperties["upsert_key_address"]>): ExecuteMsg => { + return { + upsert_key_address: ({ + key, + value + } as const) + }; + }; + static create = ({ + adoType, + chain, + msg, + owner + }: CamelCasedProperties["create"]>): ExecuteMsg => { + return { + create: ({ + ado_type: adoType, + chain, + msg, + owner + } as const) + }; + }; + static assignChannels = ({ + chain, + directChannelId, + ics20ChannelId, + kernelAddress + }: CamelCasedProperties["assign_channels"]>): ExecuteMsg => { + return { + assign_channels: ({ + chain, + direct_channel_id: directChannelId, + ics20_channel_id: ics20ChannelId, + kernel_address: kernelAddress + } as const) + }; + }; + static recover = (): ExecuteMsg => { + return { + recover: ({} as const) + }; + }; + static internal = (internalMsg: InternalMsg): ExecuteMsg => { + return { + internal: internalMsg + }; + }; +} +export abstract class KernelContractTsQueryMsgBuilder { + static keyAddress = ({ + key + }: CamelCasedProperties["key_address"]>): QueryMsg => { + return { + key_address: ({ + key + } as const) + }; + }; + static verifyAddress = ({ + address + }: CamelCasedProperties["verify_address"]>): QueryMsg => { + return { + verify_address: ({ + address + } as const) + }; + }; + static channelInfo = ({ + chain + }: CamelCasedProperties["channel_info"]>): QueryMsg => { + return { + channel_info: ({ + chain + } as const) + }; + }; + static recoveries = ({ + addr + }: CamelCasedProperties["recoveries"]>): QueryMsg => { + return { + recoveries: ({ + addr + } as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/kernel/0.2.15/KernelContractTs.types.ts b/packages/adocodegen/src/kernel/0.2.15/KernelContractTs.types.ts new file mode 100644 index 0000000..89594ae --- /dev/null +++ b/packages/adocodegen/src/kernel/0.2.15/KernelContractTs.types.ts @@ -0,0 +1,110 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + chain_name: string; + owner?: string | null; +} +export type ExecuteMsg = { + amp_receive: AMPPkt; +} | { + send: { + message: AMPMsg; + }; +} | { + upsert_key_address: { + key: string; + value: string; + }; +} | { + create: { + ado_type: string; + chain?: string | null; + msg: Binary; + owner?: AndrAddr | null; + }; +} | { + assign_channels: { + chain: string; + direct_channel_id?: string | null; + ics20_channel_id?: string | null; + kernel_address: string; + }; +} | { + recover: {}; +} | { + internal: InternalMsg; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type InternalMsg = { + register_user_cross_chain: { + address: string; + chain: string; + username: string; + }; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + key_address: { + key: string; + }; +} | { + verify_address: { + address: string; + }; +} | { + channel_info: { + chain: string; + }; +} | { + recoveries: { + addr: Addr; + }; +}; +export type Addr = string; +export type NullableChannelInfoResponse = ChannelInfoResponse | null; +export interface ChannelInfoResponse { + direct?: string | null; + ics20?: string | null; + kernel_address: string; + supported_modules: string[]; +} +export type ArrayOfCoin = Coin[]; +export type Boolean = boolean; +export type KernelContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/kernel/0.2.16/KernelContractTs.client.ts b/packages/adocodegen/src/kernel/0.2.16/KernelContractTs.client.ts new file mode 100644 index 0000000..fe3b844 --- /dev/null +++ b/packages/adocodegen/src/kernel/0.2.16/KernelContractTs.client.ts @@ -0,0 +1,266 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, InternalMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, Addr, NullableChannelInfoResponse, ChannelInfoResponse, ContractOwnerResponse, ArrayOfCoin, TypeResponse, Boolean, VersionResponse } from "./KernelContractTs.types"; +export interface KernelContractTsReadOnlyInterface { + contractAddress: string; + keyAddress: ({ + key + }: { + key: string; + }) => Promise; + verifyAddress: ({ + address + }: { + address: string; + }) => Promise; + channelInfo: ({ + chain + }: { + chain: string; + }) => Promise; + recoveries: ({ + addr + }: { + addr: Addr; + }) => Promise; + version: () => Promise; + type: () => Promise; + owner: () => Promise; +} +export class KernelContractTsQueryClient implements KernelContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.keyAddress = this.keyAddress.bind(this); + this.verifyAddress = this.verifyAddress.bind(this); + this.channelInfo = this.channelInfo.bind(this); + this.recoveries = this.recoveries.bind(this); + this.version = this.version.bind(this); + this.type = this.type.bind(this); + this.owner = this.owner.bind(this); + } + + keyAddress = async ({ + key + }: { + key: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + key_address: { + key + } + }); + }; + verifyAddress = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + verify_address: { + address + } + }); + }; + channelInfo = async ({ + chain + }: { + chain: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + channel_info: { + chain + } + }); + }; + recoveries = async ({ + addr + }: { + addr: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + recoveries: { + addr + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; +} +export interface KernelContractTsInterface { + contractAddress: string; + sender: string; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: ({ + message + }: { + message: AMPMsg; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + upsertKeyAddress: ({ + key, + value + }: { + key: string; + value: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + create: ({ + adoType, + chain, + msg, + owner + }: { + adoType: string; + chain?: string; + msg: Binary; + owner?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + assignChannels: ({ + chain, + directChannelId, + ics20ChannelId, + kernelAddress + }: { + chain: string; + directChannelId?: string; + ics20ChannelId?: string; + kernelAddress: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + recover: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + internal: (internalMsg: InternalMsg, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class KernelContractTsClient implements KernelContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.ampReceive = this.ampReceive.bind(this); + this.send = this.send.bind(this); + this.upsertKeyAddress = this.upsertKeyAddress.bind(this); + this.create = this.create.bind(this); + this.assignChannels = this.assignChannels.bind(this); + this.recover = this.recover.bind(this); + this.internal = this.internal.bind(this); + } + + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + send = async ({ + message + }: { + message: AMPMsg; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: { + message + } + }, fee, memo, _funds); + }; + upsertKeyAddress = async ({ + key, + value + }: { + key: string; + value: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + upsert_key_address: { + key, + value + } + }, fee, memo, _funds); + }; + create = async ({ + adoType, + chain, + msg, + owner + }: { + adoType: string; + chain?: string; + msg: Binary; + owner?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create: { + ado_type: adoType, + chain, + msg, + owner + } + }, fee, memo, _funds); + }; + assignChannels = async ({ + chain, + directChannelId, + ics20ChannelId, + kernelAddress + }: { + chain: string; + directChannelId?: string; + ics20ChannelId?: string; + kernelAddress: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + assign_channels: { + chain, + direct_channel_id: directChannelId, + ics20_channel_id: ics20ChannelId, + kernel_address: kernelAddress + } + }, fee, memo, _funds); + }; + recover = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + recover: {} + }, fee, memo, _funds); + }; + internal = async (internalMsg: InternalMsg, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + internal: internalMsg + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/kernel/0.2.16/KernelContractTs.message-builder.ts b/packages/adocodegen/src/kernel/0.2.16/KernelContractTs.message-builder.ts new file mode 100644 index 0000000..0d6e200 --- /dev/null +++ b/packages/adocodegen/src/kernel/0.2.16/KernelContractTs.message-builder.ts @@ -0,0 +1,152 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, InternalMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, Addr, NullableChannelInfoResponse, ChannelInfoResponse, ContractOwnerResponse, ArrayOfCoin, TypeResponse, Boolean, VersionResponse } from "./KernelContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class KernelContractTsExecuteMsgBuilder { + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static send = ({ + message + }: CamelCasedProperties["send"]>): ExecuteMsg => { + return { + send: ({ + message + } as const) + }; + }; + static upsertKeyAddress = ({ + key, + value + }: CamelCasedProperties["upsert_key_address"]>): ExecuteMsg => { + return { + upsert_key_address: ({ + key, + value + } as const) + }; + }; + static create = ({ + adoType, + chain, + msg, + owner + }: CamelCasedProperties["create"]>): ExecuteMsg => { + return { + create: ({ + ado_type: adoType, + chain, + msg, + owner + } as const) + }; + }; + static assignChannels = ({ + chain, + directChannelId, + ics20ChannelId, + kernelAddress + }: CamelCasedProperties["assign_channels"]>): ExecuteMsg => { + return { + assign_channels: ({ + chain, + direct_channel_id: directChannelId, + ics20_channel_id: ics20ChannelId, + kernel_address: kernelAddress + } as const) + }; + }; + static recover = (): ExecuteMsg => { + return { + recover: ({} as const) + }; + }; + static internal = (internalMsg: InternalMsg): ExecuteMsg => { + return { + internal: internalMsg + }; + }; +} +export abstract class KernelContractTsQueryMsgBuilder { + static keyAddress = ({ + key + }: CamelCasedProperties["key_address"]>): QueryMsg => { + return { + key_address: ({ + key + } as const) + }; + }; + static verifyAddress = ({ + address + }: CamelCasedProperties["verify_address"]>): QueryMsg => { + return { + verify_address: ({ + address + } as const) + }; + }; + static channelInfo = ({ + chain + }: CamelCasedProperties["channel_info"]>): QueryMsg => { + return { + channel_info: ({ + chain + } as const) + }; + }; + static recoveries = ({ + addr + }: CamelCasedProperties["recoveries"]>): QueryMsg => { + return { + recoveries: ({ + addr + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/kernel/0.2.16/KernelContractTs.types.ts b/packages/adocodegen/src/kernel/0.2.16/KernelContractTs.types.ts new file mode 100644 index 0000000..75fe3a3 --- /dev/null +++ b/packages/adocodegen/src/kernel/0.2.16/KernelContractTs.types.ts @@ -0,0 +1,125 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + chain_name: string; + owner?: string | null; +} +export type ExecuteMsg = { + amp_receive: AMPPkt; +} | { + send: { + message: AMPMsg; + }; +} | { + upsert_key_address: { + key: string; + value: string; + }; +} | { + create: { + ado_type: string; + chain?: string | null; + msg: Binary; + owner?: AndrAddr | null; + }; +} | { + assign_channels: { + chain: string; + direct_channel_id?: string | null; + ics20_channel_id?: string | null; + kernel_address: string; + }; +} | { + recover: {}; +} | { + internal: InternalMsg; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type InternalMsg = { + register_user_cross_chain: { + address: string; + chain: string; + username: string; + }; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + key_address: { + key: string; + }; +} | { + verify_address: { + address: string; + }; +} | { + channel_info: { + chain: string; + }; +} | { + recoveries: { + addr: Addr; + }; +} | { + version: {}; +} | { + type: {}; +} | { + owner: {}; +}; +export type Addr = string; +export type NullableChannelInfoResponse = ChannelInfoResponse | null; +export interface ChannelInfoResponse { + direct?: string | null; + ics20?: string | null; + kernel_address: string; + supported_modules: string[]; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfCoin = Coin[]; +export interface TypeResponse { + ado_type: string; +} +export type Boolean = boolean; +export interface VersionResponse { + version: string; +} +export type KernelContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/kernel/1.1.1/KernelContractTs.client.ts b/packages/adocodegen/src/kernel/1.1.1/KernelContractTs.client.ts new file mode 100644 index 0000000..e400b0d --- /dev/null +++ b/packages/adocodegen/src/kernel/1.1.1/KernelContractTs.client.ts @@ -0,0 +1,297 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, InternalMsg, OwnershipMessage, Expiry, Milliseconds, Addr, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ChainNameResponse, NullableChannelInfoResponse, ChannelInfoResponse, ContractOwnerResponse, ArrayOfCoin, TypeResponse, VerifyAddressResponse, VersionResponse } from "./KernelContractTs.types"; +export interface KernelContractTsReadOnlyInterface { + contractAddress: string; + keyAddress: ({ + key + }: { + key: string; + }) => Promise; + verifyAddress: ({ + address + }: { + address: string; + }) => Promise; + channelInfo: ({ + chain + }: { + chain: string; + }) => Promise; + recoveries: ({ + addr + }: { + addr: Addr; + }) => Promise; + chainName: () => Promise; + version: () => Promise; + type: () => Promise; + owner: () => Promise; +} +export class KernelContractTsQueryClient implements KernelContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.keyAddress = this.keyAddress.bind(this); + this.verifyAddress = this.verifyAddress.bind(this); + this.channelInfo = this.channelInfo.bind(this); + this.recoveries = this.recoveries.bind(this); + this.chainName = this.chainName.bind(this); + this.version = this.version.bind(this); + this.type = this.type.bind(this); + this.owner = this.owner.bind(this); + } + + keyAddress = async ({ + key + }: { + key: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + key_address: { + key + } + }); + }; + verifyAddress = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + verify_address: { + address + } + }); + }; + channelInfo = async ({ + chain + }: { + chain: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + channel_info: { + chain + } + }); + }; + recoveries = async ({ + addr + }: { + addr: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + recoveries: { + addr + } + }); + }; + chainName = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + chain_name: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; +} +export interface KernelContractTsInterface { + contractAddress: string; + sender: string; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: ({ + message + }: { + message: AMPMsg; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + upsertKeyAddress: ({ + key, + value + }: { + key: string; + value: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + create: ({ + adoType, + chain, + msg, + owner + }: { + adoType: string; + chain?: string; + msg: Binary; + owner?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + assignChannels: ({ + chain, + directChannelId, + ics20ChannelId, + kernelAddress + }: { + chain: string; + directChannelId?: string; + ics20ChannelId?: string; + kernelAddress: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + recover: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateChainName: ({ + chainName + }: { + chainName: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + internal: (internalMsg: InternalMsg, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class KernelContractTsClient implements KernelContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.ampReceive = this.ampReceive.bind(this); + this.send = this.send.bind(this); + this.upsertKeyAddress = this.upsertKeyAddress.bind(this); + this.create = this.create.bind(this); + this.assignChannels = this.assignChannels.bind(this); + this.recover = this.recover.bind(this); + this.updateChainName = this.updateChainName.bind(this); + this.internal = this.internal.bind(this); + this.ownership = this.ownership.bind(this); + } + + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + send = async ({ + message + }: { + message: AMPMsg; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: { + message + } + }, fee, memo, _funds); + }; + upsertKeyAddress = async ({ + key, + value + }: { + key: string; + value: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + upsert_key_address: { + key, + value + } + }, fee, memo, _funds); + }; + create = async ({ + adoType, + chain, + msg, + owner + }: { + adoType: string; + chain?: string; + msg: Binary; + owner?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create: { + ado_type: adoType, + chain, + msg, + owner + } + }, fee, memo, _funds); + }; + assignChannels = async ({ + chain, + directChannelId, + ics20ChannelId, + kernelAddress + }: { + chain: string; + directChannelId?: string; + ics20ChannelId?: string; + kernelAddress: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + assign_channels: { + chain, + direct_channel_id: directChannelId, + ics20_channel_id: ics20ChannelId, + kernel_address: kernelAddress + } + }, fee, memo, _funds); + }; + recover = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + recover: {} + }, fee, memo, _funds); + }; + updateChainName = async ({ + chainName + }: { + chainName: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_chain_name: { + chain_name: chainName + } + }, fee, memo, _funds); + }; + internal = async (internalMsg: InternalMsg, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + internal: internalMsg + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/kernel/1.1.1/KernelContractTs.message-builder.ts b/packages/adocodegen/src/kernel/1.1.1/KernelContractTs.message-builder.ts new file mode 100644 index 0000000..d50f8cc --- /dev/null +++ b/packages/adocodegen/src/kernel/1.1.1/KernelContractTs.message-builder.ts @@ -0,0 +1,173 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, InternalMsg, OwnershipMessage, Expiry, Milliseconds, Addr, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ChainNameResponse, NullableChannelInfoResponse, ChannelInfoResponse, ContractOwnerResponse, ArrayOfCoin, TypeResponse, VerifyAddressResponse, VersionResponse } from "./KernelContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class KernelContractTsExecuteMsgBuilder { + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static send = ({ + message + }: CamelCasedProperties["send"]>): ExecuteMsg => { + return { + send: ({ + message + } as const) + }; + }; + static upsertKeyAddress = ({ + key, + value + }: CamelCasedProperties["upsert_key_address"]>): ExecuteMsg => { + return { + upsert_key_address: ({ + key, + value + } as const) + }; + }; + static create = ({ + adoType, + chain, + msg, + owner + }: CamelCasedProperties["create"]>): ExecuteMsg => { + return { + create: ({ + ado_type: adoType, + chain, + msg, + owner + } as const) + }; + }; + static assignChannels = ({ + chain, + directChannelId, + ics20ChannelId, + kernelAddress + }: CamelCasedProperties["assign_channels"]>): ExecuteMsg => { + return { + assign_channels: ({ + chain, + direct_channel_id: directChannelId, + ics20_channel_id: ics20ChannelId, + kernel_address: kernelAddress + } as const) + }; + }; + static recover = (): ExecuteMsg => { + return { + recover: ({} as const) + }; + }; + static updateChainName = ({ + chainName + }: CamelCasedProperties["update_chain_name"]>): ExecuteMsg => { + return { + update_chain_name: ({ + chain_name: chainName + } as const) + }; + }; + static internal = (internalMsg: InternalMsg): ExecuteMsg => { + return { + internal: internalMsg + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; +} +export abstract class KernelContractTsQueryMsgBuilder { + static keyAddress = ({ + key + }: CamelCasedProperties["key_address"]>): QueryMsg => { + return { + key_address: ({ + key + } as const) + }; + }; + static verifyAddress = ({ + address + }: CamelCasedProperties["verify_address"]>): QueryMsg => { + return { + verify_address: ({ + address + } as const) + }; + }; + static channelInfo = ({ + chain + }: CamelCasedProperties["channel_info"]>): QueryMsg => { + return { + channel_info: ({ + chain + } as const) + }; + }; + static recoveries = ({ + addr + }: CamelCasedProperties["recoveries"]>): QueryMsg => { + return { + recoveries: ({ + addr + } as const) + }; + }; + static chainName = (): QueryMsg => { + return { + chain_name: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/kernel/1.1.1/KernelContractTs.types.ts b/packages/adocodegen/src/kernel/1.1.1/KernelContractTs.types.ts new file mode 100644 index 0000000..854f677 --- /dev/null +++ b/packages/adocodegen/src/kernel/1.1.1/KernelContractTs.types.ts @@ -0,0 +1,150 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + chain_name: string; + owner?: string | null; +} +export type ExecuteMsg = { + amp_receive: AMPPkt; +} | { + send: { + message: AMPMsg; + }; +} | { + upsert_key_address: { + key: string; + value: string; + }; +} | { + create: { + ado_type: string; + chain?: string | null; + msg: Binary; + owner?: AndrAddr | null; + }; +} | { + assign_channels: { + chain: string; + direct_channel_id?: string | null; + ics20_channel_id?: string | null; + kernel_address: string; + }; +} | { + recover: {}; +} | { + update_chain_name: { + chain_name: string; + }; +} | { + internal: InternalMsg; +} | { + ownership: OwnershipMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type InternalMsg = { + register_user_cross_chain: { + address: string; + chain: string; + username: string; + }; +}; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + key_address: { + key: string; + }; +} | { + verify_address: { + address: string; + }; +} | { + channel_info: { + chain: string; + }; +} | { + recoveries: { + addr: Addr; + }; +} | { + chain_name: {}; +} | { + version: {}; +} | { + type: {}; +} | { + owner: {}; +}; +export interface ChainNameResponse { + chain_name: string; +} +export type NullableChannelInfoResponse = ChannelInfoResponse | null; +export interface ChannelInfoResponse { + direct?: string | null; + ics20?: string | null; + kernel_address: string; + supported_modules: string[]; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfCoin = Coin[]; +export interface TypeResponse { + ado_type: string; +} +export interface VerifyAddressResponse { + verify_address: boolean; +} +export interface VersionResponse { + version: string; +} +export type KernelContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/0.2.1/LockdropContractTs.client.ts b/packages/adocodegen/src/lockdrop/0.2.1/LockdropContractTs.client.ts new file mode 100644 index 0000000..541edea --- /dev/null +++ b/packages/adocodegen/src/lockdrop/0.2.1/LockdropContractTs.client.ts @@ -0,0 +1,477 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Uint128, Binary, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, ConfigResponse, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, StateResponse, TypeResponse, UserInfoResponse, VersionResponse, Decimal } from "./LockdropContractTs.types"; +export interface LockdropContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + userInfo: ({ + address + }: { + address: string; + }) => Promise; + withdrawalPercentAllowed: ({ + timestamp + }: { + timestamp?: number; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class LockdropContractTsQueryClient implements LockdropContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.userInfo = this.userInfo.bind(this); + this.withdrawalPercentAllowed = this.withdrawalPercentAllowed.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + userInfo = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + user_info: { + address + } + }); + }; + withdrawalPercentAllowed = async ({ + timestamp + }: { + timestamp?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + withdrawal_percent_allowed: { + timestamp + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface LockdropContractTsInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + depositNative: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawNative: ({ + amount + }: { + amount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + enableClaims: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class LockdropContractTsClient implements LockdropContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.depositNative = this.depositNative.bind(this); + this.withdrawNative = this.withdrawNative.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.enableClaims = this.enableClaims.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + depositNative = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit_native: {} + }, fee, memo, _funds); + }; + withdrawNative = async ({ + amount + }: { + amount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_native: { + amount + } + }, fee, memo, _funds); + }; + claimRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_rewards: {} + }, fee, memo, _funds); + }; + enableClaims = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + enable_claims: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/0.2.1/LockdropContractTs.message-builder.ts b/packages/adocodegen/src/lockdrop/0.2.1/LockdropContractTs.message-builder.ts new file mode 100644 index 0000000..346f53d --- /dev/null +++ b/packages/adocodegen/src/lockdrop/0.2.1/LockdropContractTs.message-builder.ts @@ -0,0 +1,292 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Uint128, Binary, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, ConfigResponse, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, StateResponse, TypeResponse, UserInfoResponse, VersionResponse, Decimal } from "./LockdropContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class LockdropContractTsExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static depositNative = (): ExecuteMsg => { + return { + deposit_native: ({} as const) + }; + }; + static withdrawNative = ({ + amount + }: CamelCasedProperties["withdraw_native"]>): ExecuteMsg => { + return { + withdraw_native: ({ + amount + } as const) + }; + }; + static claimRewards = (): ExecuteMsg => { + return { + claim_rewards: ({} as const) + }; + }; + static enableClaims = (): ExecuteMsg => { + return { + enable_claims: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class LockdropContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static userInfo = ({ + address + }: CamelCasedProperties["user_info"]>): QueryMsg => { + return { + user_info: ({ + address + } as const) + }; + }; + static withdrawalPercentAllowed = ({ + timestamp + }: CamelCasedProperties["withdrawal_percent_allowed"]>): QueryMsg => { + return { + withdrawal_percent_allowed: ({ + timestamp + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/0.2.1/LockdropContractTs.types.ts b/packages/adocodegen/src/lockdrop/0.2.1/LockdropContractTs.types.ts new file mode 100644 index 0000000..d7b7851 --- /dev/null +++ b/packages/adocodegen/src/lockdrop/0.2.1/LockdropContractTs.types.ts @@ -0,0 +1,248 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + deposit_window: number; + incentive_token: string; + init_timestamp: number; + kernel_address: string; + modules?: Module[] | null; + native_denom: string; + owner?: string | null; + withdrawal_window: number; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + deposit_native: {}; +} | { + withdraw_native: { + amount?: Uint128 | null; + }; +} | { + claim_rewards: {}; +} | { + enable_claims: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + user_info: { + address: string; + }; +} | { + withdrawal_percent_allowed: { + timestamp?: number | null; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ConfigResponse { + deposit_window: number; + incentive_token: string; + init_timestamp: number; + lockdrop_incentives: Uint128; + native_denom: string; + withdrawal_window: number; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type ArrayOfString = string[]; +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface StateResponse { + are_claims_allowed: boolean; + total_native_locked: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface UserInfoResponse { + is_lockdrop_claimed: boolean; + total_incentives: Uint128; + total_native_locked: Uint128; + withdrawal_flag: boolean; +} +export interface VersionResponse { + version: string; +} +export type Decimal = string; +export type LockdropContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/0.2.16/LockdropContractTs.client.ts b/packages/adocodegen/src/lockdrop/0.2.16/LockdropContractTs.client.ts new file mode 100644 index 0000000..7de33f7 --- /dev/null +++ b/packages/adocodegen/src/lockdrop/0.2.16/LockdropContractTs.client.ts @@ -0,0 +1,418 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Uint128, Binary, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, ConfigResponse, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, StateResponse, TypeResponse, UserInfoResponse, VersionResponse, Decimal } from "./LockdropContractTs.types"; +export interface LockdropContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + userInfo: ({ + address + }: { + address: string; + }) => Promise; + withdrawalPercentAllowed: ({ + timestamp + }: { + timestamp?: number; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class LockdropContractTsQueryClient implements LockdropContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.userInfo = this.userInfo.bind(this); + this.withdrawalPercentAllowed = this.withdrawalPercentAllowed.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + userInfo = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + user_info: { + address + } + }); + }; + withdrawalPercentAllowed = async ({ + timestamp + }: { + timestamp?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + withdrawal_percent_allowed: { + timestamp + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface LockdropContractTsInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + depositNative: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawNative: ({ + amount + }: { + amount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + enableClaims: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class LockdropContractTsClient implements LockdropContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.depositNative = this.depositNative.bind(this); + this.withdrawNative = this.withdrawNative.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.enableClaims = this.enableClaims.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + depositNative = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit_native: {} + }, fee, memo, _funds); + }; + withdrawNative = async ({ + amount + }: { + amount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_native: { + amount + } + }, fee, memo, _funds); + }; + claimRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_rewards: {} + }, fee, memo, _funds); + }; + enableClaims = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + enable_claims: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/0.2.16/LockdropContractTs.message-builder.ts b/packages/adocodegen/src/lockdrop/0.2.16/LockdropContractTs.message-builder.ts new file mode 100644 index 0000000..36b8ca2 --- /dev/null +++ b/packages/adocodegen/src/lockdrop/0.2.16/LockdropContractTs.message-builder.ts @@ -0,0 +1,258 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, Uint128, Binary, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, ConfigResponse, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, StateResponse, TypeResponse, UserInfoResponse, VersionResponse, Decimal } from "./LockdropContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class LockdropContractTsExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static depositNative = (): ExecuteMsg => { + return { + deposit_native: ({} as const) + }; + }; + static withdrawNative = ({ + amount + }: CamelCasedProperties["withdraw_native"]>): ExecuteMsg => { + return { + withdraw_native: ({ + amount + } as const) + }; + }; + static claimRewards = (): ExecuteMsg => { + return { + claim_rewards: ({} as const) + }; + }; + static enableClaims = (): ExecuteMsg => { + return { + enable_claims: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class LockdropContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static userInfo = ({ + address + }: CamelCasedProperties["user_info"]>): QueryMsg => { + return { + user_info: ({ + address + } as const) + }; + }; + static withdrawalPercentAllowed = ({ + timestamp + }: CamelCasedProperties["withdrawal_percent_allowed"]>): QueryMsg => { + return { + withdrawal_percent_allowed: ({ + timestamp + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/0.2.16/LockdropContractTs.types.ts b/packages/adocodegen/src/lockdrop/0.2.16/LockdropContractTs.types.ts new file mode 100644 index 0000000..0b79c9d --- /dev/null +++ b/packages/adocodegen/src/lockdrop/0.2.16/LockdropContractTs.types.ts @@ -0,0 +1,255 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + deposit_window: number; + incentive_token: string; + init_timestamp: number; + kernel_address: string; + modules?: Module[] | null; + native_denom: string; + owner?: string | null; + withdrawal_window: number; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + deposit_native: {}; +} | { + withdraw_native: { + amount?: Uint128 | null; + }; +} | { + claim_rewards: {}; +} | { + enable_claims: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + user_info: { + address: string; + }; +} | { + withdrawal_percent_allowed: { + timestamp?: number | null; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ConfigResponse { + deposit_window: number; + incentive_token: string; + init_timestamp: number; + lockdrop_incentives: Uint128; + native_denom: string; + withdrawal_window: number; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type ArrayOfString = string[]; +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface StateResponse { + are_claims_allowed: boolean; + total_native_locked: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface UserInfoResponse { + is_lockdrop_claimed: boolean; + total_incentives: Uint128; + total_native_locked: Uint128; + withdrawal_flag: boolean; +} +export interface VersionResponse { + version: string; +} +export type Decimal = string; +export type LockdropContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/2.0.0/LockdropContractTs.client.ts b/packages/adocodegen/src/lockdrop/2.0.0/LockdropContractTs.client.ts new file mode 100644 index 0000000..5bc64ee --- /dev/null +++ b/packages/adocodegen/src/lockdrop/2.0.0/LockdropContractTs.client.ts @@ -0,0 +1,349 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Milliseconds, AndrAddr, Expiry, InstantiateMsg, ExecuteMsg, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, StateResponse, TypeResponse, UserInfoResponse, VersionResponse } from "./LockdropContractTs.types"; +export interface LockdropContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + userInfo: ({ + address + }: { + address: string; + }) => Promise; + withdrawalPercentAllowed: ({ + timestamp + }: { + timestamp?: Milliseconds; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class LockdropContractTsQueryClient implements LockdropContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.userInfo = this.userInfo.bind(this); + this.withdrawalPercentAllowed = this.withdrawalPercentAllowed.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + userInfo = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + user_info: { + address + } + }); + }; + withdrawalPercentAllowed = async ({ + timestamp + }: { + timestamp?: Milliseconds; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + withdrawal_percent_allowed: { + timestamp + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface LockdropContractTsInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + depositNative: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawNative: ({ + amount + }: { + amount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + enableClaims: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class LockdropContractTsClient implements LockdropContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.depositNative = this.depositNative.bind(this); + this.withdrawNative = this.withdrawNative.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.enableClaims = this.enableClaims.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + depositNative = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit_native: {} + }, fee, memo, _funds); + }; + withdrawNative = async ({ + amount + }: { + amount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_native: { + amount + } + }, fee, memo, _funds); + }; + claimRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_rewards: {} + }, fee, memo, _funds); + }; + enableClaims = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + enable_claims: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/2.0.0/LockdropContractTs.message-builder.ts b/packages/adocodegen/src/lockdrop/2.0.0/LockdropContractTs.message-builder.ts new file mode 100644 index 0000000..bb8ed6f --- /dev/null +++ b/packages/adocodegen/src/lockdrop/2.0.0/LockdropContractTs.message-builder.ts @@ -0,0 +1,216 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Milliseconds, AndrAddr, Expiry, InstantiateMsg, ExecuteMsg, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, StateResponse, TypeResponse, UserInfoResponse, VersionResponse } from "./LockdropContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class LockdropContractTsExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static depositNative = (): ExecuteMsg => { + return { + deposit_native: ({} as const) + }; + }; + static withdrawNative = ({ + amount + }: CamelCasedProperties["withdraw_native"]>): ExecuteMsg => { + return { + withdraw_native: ({ + amount + } as const) + }; + }; + static claimRewards = (): ExecuteMsg => { + return { + claim_rewards: ({} as const) + }; + }; + static enableClaims = (): ExecuteMsg => { + return { + enable_claims: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class LockdropContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static userInfo = ({ + address + }: CamelCasedProperties["user_info"]>): QueryMsg => { + return { + user_info: ({ + address + } as const) + }; + }; + static withdrawalPercentAllowed = ({ + timestamp + }: CamelCasedProperties["withdrawal_percent_allowed"]>): QueryMsg => { + return { + withdrawal_percent_allowed: ({ + timestamp + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/2.0.0/LockdropContractTs.types.ts b/packages/adocodegen/src/lockdrop/2.0.0/LockdropContractTs.types.ts new file mode 100644 index 0000000..f3ed80d --- /dev/null +++ b/packages/adocodegen/src/lockdrop/2.0.0/LockdropContractTs.types.ts @@ -0,0 +1,271 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Milliseconds = number; +export type AndrAddr = string; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export interface InstantiateMsg { + deposit_window: Milliseconds; + incentive_token: AndrAddr; + init_timestamp: Expiry; + kernel_address: string; + native_denom: string; + owner?: string | null; + withdrawal_window: Milliseconds; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + deposit_native: {}; +} | { + withdraw_native: { + amount?: Uint128 | null; + }; +} | { + claim_rewards: {}; +} | { + enable_claims: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + user_info: { + address: string; + }; +} | { + withdrawal_percent_allowed: { + timestamp?: Milliseconds | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ConfigResponse { + deposit_window: Milliseconds; + incentive_token: AndrAddr; + init_timestamp: Milliseconds; + lockdrop_incentives: Uint128; + native_denom: string; + withdrawal_window: Milliseconds; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface StateResponse { + are_claims_allowed: boolean; + total_native_locked: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface UserInfoResponse { + is_lockdrop_claimed: boolean; + total_incentives: Uint128; + total_native_locked: Uint128; + withdrawal_flag: boolean; +} +export interface VersionResponse { + version: string; +} +export type LockdropContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/2.0.1-beta.1/LockdropContractTs.client.ts b/packages/adocodegen/src/lockdrop/2.0.1-beta.1/LockdropContractTs.client.ts new file mode 100644 index 0000000..5bc64ee --- /dev/null +++ b/packages/adocodegen/src/lockdrop/2.0.1-beta.1/LockdropContractTs.client.ts @@ -0,0 +1,349 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Milliseconds, AndrAddr, Expiry, InstantiateMsg, ExecuteMsg, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, StateResponse, TypeResponse, UserInfoResponse, VersionResponse } from "./LockdropContractTs.types"; +export interface LockdropContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + userInfo: ({ + address + }: { + address: string; + }) => Promise; + withdrawalPercentAllowed: ({ + timestamp + }: { + timestamp?: Milliseconds; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class LockdropContractTsQueryClient implements LockdropContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.userInfo = this.userInfo.bind(this); + this.withdrawalPercentAllowed = this.withdrawalPercentAllowed.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + userInfo = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + user_info: { + address + } + }); + }; + withdrawalPercentAllowed = async ({ + timestamp + }: { + timestamp?: Milliseconds; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + withdrawal_percent_allowed: { + timestamp + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface LockdropContractTsInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + depositNative: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawNative: ({ + amount + }: { + amount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + enableClaims: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class LockdropContractTsClient implements LockdropContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.depositNative = this.depositNative.bind(this); + this.withdrawNative = this.withdrawNative.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.enableClaims = this.enableClaims.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + depositNative = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit_native: {} + }, fee, memo, _funds); + }; + withdrawNative = async ({ + amount + }: { + amount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_native: { + amount + } + }, fee, memo, _funds); + }; + claimRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_rewards: {} + }, fee, memo, _funds); + }; + enableClaims = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + enable_claims: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/2.0.1-beta.1/LockdropContractTs.message-builder.ts b/packages/adocodegen/src/lockdrop/2.0.1-beta.1/LockdropContractTs.message-builder.ts new file mode 100644 index 0000000..bb8ed6f --- /dev/null +++ b/packages/adocodegen/src/lockdrop/2.0.1-beta.1/LockdropContractTs.message-builder.ts @@ -0,0 +1,216 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Milliseconds, AndrAddr, Expiry, InstantiateMsg, ExecuteMsg, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, StateResponse, TypeResponse, UserInfoResponse, VersionResponse } from "./LockdropContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class LockdropContractTsExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static depositNative = (): ExecuteMsg => { + return { + deposit_native: ({} as const) + }; + }; + static withdrawNative = ({ + amount + }: CamelCasedProperties["withdraw_native"]>): ExecuteMsg => { + return { + withdraw_native: ({ + amount + } as const) + }; + }; + static claimRewards = (): ExecuteMsg => { + return { + claim_rewards: ({} as const) + }; + }; + static enableClaims = (): ExecuteMsg => { + return { + enable_claims: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class LockdropContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static userInfo = ({ + address + }: CamelCasedProperties["user_info"]>): QueryMsg => { + return { + user_info: ({ + address + } as const) + }; + }; + static withdrawalPercentAllowed = ({ + timestamp + }: CamelCasedProperties["withdrawal_percent_allowed"]>): QueryMsg => { + return { + withdrawal_percent_allowed: ({ + timestamp + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/2.0.1-beta.1/LockdropContractTs.types.ts b/packages/adocodegen/src/lockdrop/2.0.1-beta.1/LockdropContractTs.types.ts new file mode 100644 index 0000000..db69334 --- /dev/null +++ b/packages/adocodegen/src/lockdrop/2.0.1-beta.1/LockdropContractTs.types.ts @@ -0,0 +1,271 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Milliseconds = number; +export type AndrAddr = string; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export interface InstantiateMsg { + deposit_window: Milliseconds; + incentive_token: AndrAddr; + init_timestamp: Expiry; + kernel_address: string; + native_denom: string; + owner?: string | null; + withdrawal_window: Milliseconds; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + deposit_native: {}; +} | { + withdraw_native: { + amount?: Uint128 | null; + }; +} | { + claim_rewards: {}; +} | { + enable_claims: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + user_info: { + address: string; + }; +} | { + withdrawal_percent_allowed: { + timestamp?: Milliseconds | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ConfigResponse { + deposit_window: Milliseconds; + incentive_token: AndrAddr; + init_timestamp: Milliseconds; + lockdrop_incentives: Uint128; + native_denom: string; + withdrawal_window: Milliseconds; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface StateResponse { + are_claims_allowed: boolean; + total_native_locked: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface UserInfoResponse { + is_lockdrop_claimed: boolean; + total_incentives: Uint128; + total_native_locked: Uint128; + withdrawal_flag: boolean; +} +export interface VersionResponse { + version: string; +} +export type LockdropContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/2.0.1/LockdropContractTs.client.ts b/packages/adocodegen/src/lockdrop/2.0.1/LockdropContractTs.client.ts new file mode 100644 index 0000000..5bc64ee --- /dev/null +++ b/packages/adocodegen/src/lockdrop/2.0.1/LockdropContractTs.client.ts @@ -0,0 +1,349 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Milliseconds, AndrAddr, Expiry, InstantiateMsg, ExecuteMsg, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, StateResponse, TypeResponse, UserInfoResponse, VersionResponse } from "./LockdropContractTs.types"; +export interface LockdropContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + state: () => Promise; + userInfo: ({ + address + }: { + address: string; + }) => Promise; + withdrawalPercentAllowed: ({ + timestamp + }: { + timestamp?: Milliseconds; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class LockdropContractTsQueryClient implements LockdropContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.state = this.state.bind(this); + this.userInfo = this.userInfo.bind(this); + this.withdrawalPercentAllowed = this.withdrawalPercentAllowed.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + state = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + state: {} + }); + }; + userInfo = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + user_info: { + address + } + }); + }; + withdrawalPercentAllowed = async ({ + timestamp + }: { + timestamp?: Milliseconds; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + withdrawal_percent_allowed: { + timestamp + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface LockdropContractTsInterface { + contractAddress: string; + sender: string; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + depositNative: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawNative: ({ + amount + }: { + amount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + enableClaims: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class LockdropContractTsClient implements LockdropContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receive = this.receive.bind(this); + this.depositNative = this.depositNative.bind(this); + this.withdrawNative = this.withdrawNative.bind(this); + this.claimRewards = this.claimRewards.bind(this); + this.enableClaims = this.enableClaims.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + depositNative = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit_native: {} + }, fee, memo, _funds); + }; + withdrawNative = async ({ + amount + }: { + amount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_native: { + amount + } + }, fee, memo, _funds); + }; + claimRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_rewards: {} + }, fee, memo, _funds); + }; + enableClaims = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + enable_claims: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/2.0.1/LockdropContractTs.message-builder.ts b/packages/adocodegen/src/lockdrop/2.0.1/LockdropContractTs.message-builder.ts new file mode 100644 index 0000000..bb8ed6f --- /dev/null +++ b/packages/adocodegen/src/lockdrop/2.0.1/LockdropContractTs.message-builder.ts @@ -0,0 +1,216 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Milliseconds, AndrAddr, Expiry, InstantiateMsg, ExecuteMsg, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw20ReceiveMsg, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, StateResponse, TypeResponse, UserInfoResponse, VersionResponse } from "./LockdropContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class LockdropContractTsExecuteMsgBuilder { + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static depositNative = (): ExecuteMsg => { + return { + deposit_native: ({} as const) + }; + }; + static withdrawNative = ({ + amount + }: CamelCasedProperties["withdraw_native"]>): ExecuteMsg => { + return { + withdraw_native: ({ + amount + } as const) + }; + }; + static claimRewards = (): ExecuteMsg => { + return { + claim_rewards: ({} as const) + }; + }; + static enableClaims = (): ExecuteMsg => { + return { + enable_claims: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class LockdropContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static state = (): QueryMsg => { + return { + state: ({} as const) + }; + }; + static userInfo = ({ + address + }: CamelCasedProperties["user_info"]>): QueryMsg => { + return { + user_info: ({ + address + } as const) + }; + }; + static withdrawalPercentAllowed = ({ + timestamp + }: CamelCasedProperties["withdrawal_percent_allowed"]>): QueryMsg => { + return { + withdrawal_percent_allowed: ({ + timestamp + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/lockdrop/2.0.1/LockdropContractTs.types.ts b/packages/adocodegen/src/lockdrop/2.0.1/LockdropContractTs.types.ts new file mode 100644 index 0000000..db69334 --- /dev/null +++ b/packages/adocodegen/src/lockdrop/2.0.1/LockdropContractTs.types.ts @@ -0,0 +1,271 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Milliseconds = number; +export type AndrAddr = string; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export interface InstantiateMsg { + deposit_window: Milliseconds; + incentive_token: AndrAddr; + init_timestamp: Expiry; + kernel_address: string; + native_denom: string; + owner?: string | null; + withdrawal_window: Milliseconds; +} +export type ExecuteMsg = { + receive: Cw20ReceiveMsg; +} | { + deposit_native: {}; +} | { + withdraw_native: { + amount?: Uint128 | null; + }; +} | { + claim_rewards: {}; +} | { + enable_claims: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + config: {}; +} | { + state: {}; +} | { + user_info: { + address: string; + }; +} | { + withdrawal_percent_allowed: { + timestamp?: Milliseconds | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ConfigResponse { + deposit_window: Milliseconds; + incentive_token: AndrAddr; + init_timestamp: Milliseconds; + lockdrop_incentives: Uint128; + native_denom: string; + withdrawal_window: Milliseconds; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface StateResponse { + are_claims_allowed: boolean; + total_native_locked: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface UserInfoResponse { + is_lockdrop_claimed: boolean; + total_incentives: Uint128; + total_native_locked: Uint128; + withdrawal_flag: boolean; +} +export interface VersionResponse { + version: string; +} +export type LockdropContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.0.0/MarketplaceContractTs.client.ts b/packages/adocodegen/src/marketplace/2.0.0/MarketplaceContractTs.client.ts new file mode 100644 index 0000000..c7228bc --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.0.0/MarketplaceContractTs.client.ts @@ -0,0 +1,442 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, RatesQueryMessage, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, Expiration, Timestamp, Uint64, Status, SaleStateResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, SaleIdsResponse, ArrayOfSaleInfo, SaleInfo, TypeResponse, VersionResponse } from "./MarketplaceContractTs.types"; +export interface MarketplaceContractTsReadOnlyInterface { + contractAddress: string; + latestSaleState: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + saleState: ({ + saleId + }: { + saleId: Uint128; + }) => Promise; + saleIds: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + saleInfosForAddress: ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: (ratesQueryMessage: RatesQueryMessage) => Promise; +} +export class MarketplaceContractTsQueryClient implements MarketplaceContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.latestSaleState = this.latestSaleState.bind(this); + this.saleState = this.saleState.bind(this); + this.saleIds = this.saleIds.bind(this); + this.saleInfosForAddress = this.saleInfosForAddress.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + } + + latestSaleState = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_sale_state: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + saleState = async ({ + saleId + }: { + saleId: Uint128; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_state: { + sale_id: saleId + } + }); + }; + saleIds = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_ids: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + saleInfosForAddress = async ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_infos_for_address: { + limit, + start_after: startAfter, + token_address: tokenAddress + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async (ratesQueryMessage: RatesQueryMessage): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: ratesQueryMessage + }); + }; +} +export interface MarketplaceContractTsInterface { + contractAddress: string; + sender: string; + receiveNft: ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + buy: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateSale: ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: { + coinDenom: Asset; + price: Uint128; + recipient?: Recipient; + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + cancelSale: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class MarketplaceContractTsClient implements MarketplaceContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receiveNft = this.receiveNft.bind(this); + this.receive = this.receive.bind(this); + this.buy = this.buy.bind(this); + this.updateSale = this.updateSale.bind(this); + this.cancelSale = this.cancelSale.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receiveNft = async ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive_nft: { + msg, + sender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + buy = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + buy: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + updateSale = async ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: { + coinDenom: Asset; + price: Uint128; + recipient?: Recipient; + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_sale: { + coin_denom: coinDenom, + price, + recipient, + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + cancelSale = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_sale: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.0.0/MarketplaceContractTs.message-builder.ts b/packages/adocodegen/src/marketplace/2.0.0/MarketplaceContractTs.message-builder.ts new file mode 100644 index 0000000..1116a42 --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.0.0/MarketplaceContractTs.message-builder.ts @@ -0,0 +1,259 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, RatesQueryMessage, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, Expiration, Timestamp, Uint64, Status, SaleStateResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, SaleIdsResponse, ArrayOfSaleInfo, SaleInfo, TypeResponse, VersionResponse } from "./MarketplaceContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MarketplaceContractTsExecuteMsgBuilder { + static receiveNft = ({ + msg, + sender, + tokenId + }: CamelCasedProperties["receive_nft"]>): ExecuteMsg => { + return { + receive_nft: ({ + msg, + sender, + token_id: tokenId + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static buy = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["buy"]>): ExecuteMsg => { + return { + buy: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static updateSale = ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: CamelCasedProperties["update_sale"]>): ExecuteMsg => { + return { + update_sale: ({ + coin_denom: coinDenom, + price, + recipient, + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static cancelSale = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["cancel_sale"]>): ExecuteMsg => { + return { + cancel_sale: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class MarketplaceContractTsQueryMsgBuilder { + static latestSaleState = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["latest_sale_state"]>): QueryMsg => { + return { + latest_sale_state: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static saleState = ({ + saleId + }: CamelCasedProperties["sale_state"]>): QueryMsg => { + return { + sale_state: ({ + sale_id: saleId + } as const) + }; + }; + static saleIds = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["sale_ids"]>): QueryMsg => { + return { + sale_ids: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static saleInfosForAddress = ({ + limit, + startAfter, + tokenAddress + }: CamelCasedProperties["sale_infos_for_address"]>): QueryMsg => { + return { + sale_infos_for_address: ({ + limit, + start_after: startAfter, + token_address: tokenAddress + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = (ratesQueryMessage: RatesQueryMessage): QueryMsg => { + return { + rates: ratesQueryMessage + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.0.0/MarketplaceContractTs.types.ts b/packages/adocodegen/src/marketplace/2.0.0/MarketplaceContractTs.types.ts new file mode 100644 index 0000000..db743cb --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.0.0/MarketplaceContractTs.types.ts @@ -0,0 +1,303 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + authorized_cw20_address?: AndrAddr | null; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + receive_nft: Cw721ReceiveMsg; +} | { + receive: Cw20ReceiveMsg; +} | { + buy: { + token_address: string; + token_id: string; + }; +} | { + update_sale: { + coin_denom: Asset; + price: Uint128; + recipient?: Recipient | null; + token_address: string; + token_id: string; + }; +} | { + cancel_sale: { + token_address: string; + token_id: string; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Uint128 = string; +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw721ReceiveMsg { + msg: Binary; + sender: string; + token_id: string; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + latest_sale_state: { + token_address: string; + token_id: string; + }; +} | { + sale_state: { + sale_id: Uint128; + }; +} | { + sale_ids: { + token_address: string; + token_id: string; + }; +} | { + sale_infos_for_address: { + limit?: number | null; + start_after?: string | null; + token_address: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: RatesQueryMessage; +}; +export type RatesQueryMessage = { + get_rate: { + action: string; + }; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Status = "open" | "expired" | "executed" | "cancelled"; +export interface SaleStateResponse { + coin_denom: string; + end_time: Expiration; + price: Uint128; + recipient?: Recipient | null; + sale_id: Uint128; + start_time: Expiration; + status: Status; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface SaleIdsResponse { + sale_ids: Uint128[]; +} +export type ArrayOfSaleInfo = SaleInfo[]; +export interface SaleInfo { + sale_ids: Uint128[]; + token_address: string; + token_id: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type MarketplaceContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.0.1/MarketplaceContractTs.client.ts b/packages/adocodegen/src/marketplace/2.0.1/MarketplaceContractTs.client.ts new file mode 100644 index 0000000..7338bf7 --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.0.1/MarketplaceContractTs.client.ts @@ -0,0 +1,459 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, Expiration, Timestamp, Uint64, Status, SaleStateResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, SaleIdsResponse, ArrayOfSaleInfo, SaleInfo, TypeResponse, VersionResponse } from "./MarketplaceContractTs.types"; +export interface MarketplaceContractTsReadOnlyInterface { + contractAddress: string; + latestSaleState: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + saleState: ({ + saleId + }: { + saleId: Uint128; + }) => Promise; + saleIds: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + saleInfosForAddress: ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class MarketplaceContractTsQueryClient implements MarketplaceContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.latestSaleState = this.latestSaleState.bind(this); + this.saleState = this.saleState.bind(this); + this.saleIds = this.saleIds.bind(this); + this.saleInfosForAddress = this.saleInfosForAddress.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + latestSaleState = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_sale_state: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + saleState = async ({ + saleId + }: { + saleId: Uint128; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_state: { + sale_id: saleId + } + }); + }; + saleIds = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_ids: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + saleInfosForAddress = async ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_infos_for_address: { + limit, + start_after: startAfter, + token_address: tokenAddress + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface MarketplaceContractTsInterface { + contractAddress: string; + sender: string; + receiveNft: ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + buy: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateSale: ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: { + coinDenom: Asset; + price: Uint128; + recipient?: Recipient; + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + cancelSale: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class MarketplaceContractTsClient implements MarketplaceContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receiveNft = this.receiveNft.bind(this); + this.receive = this.receive.bind(this); + this.buy = this.buy.bind(this); + this.updateSale = this.updateSale.bind(this); + this.cancelSale = this.cancelSale.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receiveNft = async ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive_nft: { + msg, + sender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + buy = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + buy: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + updateSale = async ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: { + coinDenom: Asset; + price: Uint128; + recipient?: Recipient; + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_sale: { + coin_denom: coinDenom, + price, + recipient, + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + cancelSale = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_sale: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.0.1/MarketplaceContractTs.message-builder.ts b/packages/adocodegen/src/marketplace/2.0.1/MarketplaceContractTs.message-builder.ts new file mode 100644 index 0000000..f25ce91 --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.0.1/MarketplaceContractTs.message-builder.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, Expiration, Timestamp, Uint64, Status, SaleStateResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, SaleIdsResponse, ArrayOfSaleInfo, SaleInfo, TypeResponse, VersionResponse } from "./MarketplaceContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MarketplaceContractTsExecuteMsgBuilder { + static receiveNft = ({ + msg, + sender, + tokenId + }: CamelCasedProperties["receive_nft"]>): ExecuteMsg => { + return { + receive_nft: ({ + msg, + sender, + token_id: tokenId + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static buy = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["buy"]>): ExecuteMsg => { + return { + buy: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static updateSale = ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: CamelCasedProperties["update_sale"]>): ExecuteMsg => { + return { + update_sale: ({ + coin_denom: coinDenom, + price, + recipient, + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static cancelSale = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["cancel_sale"]>): ExecuteMsg => { + return { + cancel_sale: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class MarketplaceContractTsQueryMsgBuilder { + static latestSaleState = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["latest_sale_state"]>): QueryMsg => { + return { + latest_sale_state: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static saleState = ({ + saleId + }: CamelCasedProperties["sale_state"]>): QueryMsg => { + return { + sale_state: ({ + sale_id: saleId + } as const) + }; + }; + static saleIds = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["sale_ids"]>): QueryMsg => { + return { + sale_ids: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static saleInfosForAddress = ({ + limit, + startAfter, + tokenAddress + }: CamelCasedProperties["sale_infos_for_address"]>): QueryMsg => { + return { + sale_infos_for_address: ({ + limit, + start_after: startAfter, + token_address: tokenAddress + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.0.1/MarketplaceContractTs.types.ts b/packages/adocodegen/src/marketplace/2.0.1/MarketplaceContractTs.types.ts new file mode 100644 index 0000000..3a4b7bd --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.0.1/MarketplaceContractTs.types.ts @@ -0,0 +1,305 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + authorized_cw20_address?: AndrAddr | null; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + receive_nft: Cw721ReceiveMsg; +} | { + receive: Cw20ReceiveMsg; +} | { + buy: { + token_address: string; + token_id: string; + }; +} | { + update_sale: { + coin_denom: Asset; + price: Uint128; + recipient?: Recipient | null; + token_address: string; + token_id: string; + }; +} | { + cancel_sale: { + token_address: string; + token_id: string; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Uint128 = string; +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw721ReceiveMsg { + msg: Binary; + sender: string; + token_id: string; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + latest_sale_state: { + token_address: string; + token_id: string; + }; +} | { + sale_state: { + sale_id: Uint128; + }; +} | { + sale_ids: { + token_address: string; + token_id: string; + }; +} | { + sale_infos_for_address: { + limit?: number | null; + start_after?: string | null; + token_address: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Status = "open" | "expired" | "executed" | "cancelled"; +export interface SaleStateResponse { + coin_denom: string; + end_time: Expiration; + price: Uint128; + recipient?: Recipient | null; + sale_id: Uint128; + start_time: Expiration; + status: Status; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface SaleIdsResponse { + sale_ids: Uint128[]; +} +export type ArrayOfSaleInfo = SaleInfo[]; +export interface SaleInfo { + sale_ids: Uint128[]; + token_address: string; + token_id: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type MarketplaceContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.1.2-beta.1/MarketplaceContractTs.client.ts b/packages/adocodegen/src/marketplace/2.1.2-beta.1/MarketplaceContractTs.client.ts new file mode 100644 index 0000000..7338bf7 --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.1.2-beta.1/MarketplaceContractTs.client.ts @@ -0,0 +1,459 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, Expiration, Timestamp, Uint64, Status, SaleStateResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, SaleIdsResponse, ArrayOfSaleInfo, SaleInfo, TypeResponse, VersionResponse } from "./MarketplaceContractTs.types"; +export interface MarketplaceContractTsReadOnlyInterface { + contractAddress: string; + latestSaleState: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + saleState: ({ + saleId + }: { + saleId: Uint128; + }) => Promise; + saleIds: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + saleInfosForAddress: ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class MarketplaceContractTsQueryClient implements MarketplaceContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.latestSaleState = this.latestSaleState.bind(this); + this.saleState = this.saleState.bind(this); + this.saleIds = this.saleIds.bind(this); + this.saleInfosForAddress = this.saleInfosForAddress.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + latestSaleState = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_sale_state: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + saleState = async ({ + saleId + }: { + saleId: Uint128; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_state: { + sale_id: saleId + } + }); + }; + saleIds = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_ids: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + saleInfosForAddress = async ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_infos_for_address: { + limit, + start_after: startAfter, + token_address: tokenAddress + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface MarketplaceContractTsInterface { + contractAddress: string; + sender: string; + receiveNft: ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + buy: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateSale: ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: { + coinDenom: Asset; + price: Uint128; + recipient?: Recipient; + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + cancelSale: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class MarketplaceContractTsClient implements MarketplaceContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receiveNft = this.receiveNft.bind(this); + this.receive = this.receive.bind(this); + this.buy = this.buy.bind(this); + this.updateSale = this.updateSale.bind(this); + this.cancelSale = this.cancelSale.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receiveNft = async ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive_nft: { + msg, + sender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + buy = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + buy: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + updateSale = async ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: { + coinDenom: Asset; + price: Uint128; + recipient?: Recipient; + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_sale: { + coin_denom: coinDenom, + price, + recipient, + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + cancelSale = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_sale: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.1.2-beta.1/MarketplaceContractTs.message-builder.ts b/packages/adocodegen/src/marketplace/2.1.2-beta.1/MarketplaceContractTs.message-builder.ts new file mode 100644 index 0000000..f25ce91 --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.1.2-beta.1/MarketplaceContractTs.message-builder.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, Expiration, Timestamp, Uint64, Status, SaleStateResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, SaleIdsResponse, ArrayOfSaleInfo, SaleInfo, TypeResponse, VersionResponse } from "./MarketplaceContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MarketplaceContractTsExecuteMsgBuilder { + static receiveNft = ({ + msg, + sender, + tokenId + }: CamelCasedProperties["receive_nft"]>): ExecuteMsg => { + return { + receive_nft: ({ + msg, + sender, + token_id: tokenId + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static buy = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["buy"]>): ExecuteMsg => { + return { + buy: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static updateSale = ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: CamelCasedProperties["update_sale"]>): ExecuteMsg => { + return { + update_sale: ({ + coin_denom: coinDenom, + price, + recipient, + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static cancelSale = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["cancel_sale"]>): ExecuteMsg => { + return { + cancel_sale: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class MarketplaceContractTsQueryMsgBuilder { + static latestSaleState = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["latest_sale_state"]>): QueryMsg => { + return { + latest_sale_state: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static saleState = ({ + saleId + }: CamelCasedProperties["sale_state"]>): QueryMsg => { + return { + sale_state: ({ + sale_id: saleId + } as const) + }; + }; + static saleIds = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["sale_ids"]>): QueryMsg => { + return { + sale_ids: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static saleInfosForAddress = ({ + limit, + startAfter, + tokenAddress + }: CamelCasedProperties["sale_infos_for_address"]>): QueryMsg => { + return { + sale_infos_for_address: ({ + limit, + start_after: startAfter, + token_address: tokenAddress + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.1.2-beta.1/MarketplaceContractTs.types.ts b/packages/adocodegen/src/marketplace/2.1.2-beta.1/MarketplaceContractTs.types.ts new file mode 100644 index 0000000..90127ba --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.1.2-beta.1/MarketplaceContractTs.types.ts @@ -0,0 +1,306 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + authorized_cw20_address?: AndrAddr | null; + authorized_token_addresses?: AndrAddr[] | null; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + receive_nft: Cw721ReceiveMsg; +} | { + receive: Cw20ReceiveMsg; +} | { + buy: { + token_address: string; + token_id: string; + }; +} | { + update_sale: { + coin_denom: Asset; + price: Uint128; + recipient?: Recipient | null; + token_address: string; + token_id: string; + }; +} | { + cancel_sale: { + token_address: string; + token_id: string; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Uint128 = string; +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw721ReceiveMsg { + msg: Binary; + sender: string; + token_id: string; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + latest_sale_state: { + token_address: string; + token_id: string; + }; +} | { + sale_state: { + sale_id: Uint128; + }; +} | { + sale_ids: { + token_address: string; + token_id: string; + }; +} | { + sale_infos_for_address: { + limit?: number | null; + start_after?: string | null; + token_address: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Status = "open" | "expired" | "executed" | "cancelled"; +export interface SaleStateResponse { + coin_denom: string; + end_time: Expiration; + price: Uint128; + recipient?: Recipient | null; + sale_id: Uint128; + start_time: Expiration; + status: Status; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface SaleIdsResponse { + sale_ids: Uint128[]; +} +export type ArrayOfSaleInfo = SaleInfo[]; +export interface SaleInfo { + sale_ids: Uint128[]; + token_address: string; + token_id: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type MarketplaceContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.1.2/MarketplaceContractTs.client.ts b/packages/adocodegen/src/marketplace/2.1.2/MarketplaceContractTs.client.ts new file mode 100644 index 0000000..7338bf7 --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.1.2/MarketplaceContractTs.client.ts @@ -0,0 +1,459 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, Expiration, Timestamp, Uint64, Status, SaleStateResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, SaleIdsResponse, ArrayOfSaleInfo, SaleInfo, TypeResponse, VersionResponse } from "./MarketplaceContractTs.types"; +export interface MarketplaceContractTsReadOnlyInterface { + contractAddress: string; + latestSaleState: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + saleState: ({ + saleId + }: { + saleId: Uint128; + }) => Promise; + saleIds: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }) => Promise; + saleInfosForAddress: ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class MarketplaceContractTsQueryClient implements MarketplaceContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.latestSaleState = this.latestSaleState.bind(this); + this.saleState = this.saleState.bind(this); + this.saleIds = this.saleIds.bind(this); + this.saleInfosForAddress = this.saleInfosForAddress.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + latestSaleState = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_sale_state: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + saleState = async ({ + saleId + }: { + saleId: Uint128; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_state: { + sale_id: saleId + } + }); + }; + saleIds = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_ids: { + token_address: tokenAddress, + token_id: tokenId + } + }); + }; + saleInfosForAddress = async ({ + limit, + startAfter, + tokenAddress + }: { + limit?: number; + startAfter?: string; + tokenAddress: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sale_infos_for_address: { + limit, + start_after: startAfter, + token_address: tokenAddress + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface MarketplaceContractTsInterface { + contractAddress: string; + sender: string; + receiveNft: ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + receive: ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + buy: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateSale: ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: { + coinDenom: Asset; + price: Uint128; + recipient?: Recipient; + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + cancelSale: ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class MarketplaceContractTsClient implements MarketplaceContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.receiveNft = this.receiveNft.bind(this); + this.receive = this.receive.bind(this); + this.buy = this.buy.bind(this); + this.updateSale = this.updateSale.bind(this); + this.cancelSale = this.cancelSale.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + receiveNft = async ({ + msg, + sender, + tokenId + }: { + msg: Binary; + sender: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive_nft: { + msg, + sender, + token_id: tokenId + } + }, fee, memo, _funds); + }; + receive = async ({ + amount, + msg, + sender + }: { + amount: Uint128; + msg: Binary; + sender: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + receive: { + amount, + msg, + sender + } + }, fee, memo, _funds); + }; + buy = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + buy: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + updateSale = async ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: { + coinDenom: Asset; + price: Uint128; + recipient?: Recipient; + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_sale: { + coin_denom: coinDenom, + price, + recipient, + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + cancelSale = async ({ + tokenAddress, + tokenId + }: { + tokenAddress: string; + tokenId: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + cancel_sale: { + token_address: tokenAddress, + token_id: tokenId + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.1.2/MarketplaceContractTs.message-builder.ts b/packages/adocodegen/src/marketplace/2.1.2/MarketplaceContractTs.message-builder.ts new file mode 100644 index 0000000..f25ce91 --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.1.2/MarketplaceContractTs.message-builder.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, ExecuteMsg, Binary, Uint128, Asset, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Cw721ReceiveMsg, Cw20ReceiveMsg, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, Expiration, Timestamp, Uint64, Status, SaleStateResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, SaleIdsResponse, ArrayOfSaleInfo, SaleInfo, TypeResponse, VersionResponse } from "./MarketplaceContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MarketplaceContractTsExecuteMsgBuilder { + static receiveNft = ({ + msg, + sender, + tokenId + }: CamelCasedProperties["receive_nft"]>): ExecuteMsg => { + return { + receive_nft: ({ + msg, + sender, + token_id: tokenId + } as const) + }; + }; + static receive = ({ + amount, + msg, + sender + }: CamelCasedProperties["receive"]>): ExecuteMsg => { + return { + receive: ({ + amount, + msg, + sender + } as const) + }; + }; + static buy = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["buy"]>): ExecuteMsg => { + return { + buy: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static updateSale = ({ + coinDenom, + price, + recipient, + tokenAddress, + tokenId + }: CamelCasedProperties["update_sale"]>): ExecuteMsg => { + return { + update_sale: ({ + coin_denom: coinDenom, + price, + recipient, + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static cancelSale = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["cancel_sale"]>): ExecuteMsg => { + return { + cancel_sale: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class MarketplaceContractTsQueryMsgBuilder { + static latestSaleState = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["latest_sale_state"]>): QueryMsg => { + return { + latest_sale_state: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static saleState = ({ + saleId + }: CamelCasedProperties["sale_state"]>): QueryMsg => { + return { + sale_state: ({ + sale_id: saleId + } as const) + }; + }; + static saleIds = ({ + tokenAddress, + tokenId + }: CamelCasedProperties["sale_ids"]>): QueryMsg => { + return { + sale_ids: ({ + token_address: tokenAddress, + token_id: tokenId + } as const) + }; + }; + static saleInfosForAddress = ({ + limit, + startAfter, + tokenAddress + }: CamelCasedProperties["sale_infos_for_address"]>): QueryMsg => { + return { + sale_infos_for_address: ({ + limit, + start_after: startAfter, + token_address: tokenAddress + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/marketplace/2.1.2/MarketplaceContractTs.types.ts b/packages/adocodegen/src/marketplace/2.1.2/MarketplaceContractTs.types.ts new file mode 100644 index 0000000..90127ba --- /dev/null +++ b/packages/adocodegen/src/marketplace/2.1.2/MarketplaceContractTs.types.ts @@ -0,0 +1,306 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + authorized_cw20_address?: AndrAddr | null; + authorized_token_addresses?: AndrAddr[] | null; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + receive_nft: Cw721ReceiveMsg; +} | { + receive: Cw20ReceiveMsg; +} | { + buy: { + token_address: string; + token_id: string; + }; +} | { + update_sale: { + coin_denom: Asset; + price: Uint128; + recipient?: Recipient | null; + token_address: string; + token_id: string; + }; +} | { + cancel_sale: { + token_address: string; + token_id: string; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Binary = string; +export type Uint128 = string; +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Cw721ReceiveMsg { + msg: Binary; + sender: string; + token_id: string; +} +export interface Cw20ReceiveMsg { + amount: Uint128; + msg: Binary; + sender: string; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + latest_sale_state: { + token_address: string; + token_id: string; + }; +} | { + sale_state: { + sale_id: Uint128; + }; +} | { + sale_ids: { + token_address: string; + token_id: string; + }; +} | { + sale_infos_for_address: { + limit?: number | null; + start_after?: string | null; + token_address: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Status = "open" | "expired" | "executed" | "cancelled"; +export interface SaleStateResponse { + coin_denom: string; + end_time: Expiration; + price: Uint128; + recipient?: Recipient | null; + sale_id: Uint128; + start_time: Expiration; + status: Status; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface SaleIdsResponse { + sale_ids: Uint128[]; +} +export type ArrayOfSaleInfo = SaleInfo[]; +export interface SaleInfo { + sale_ids: Uint128[]; + token_address: string; + token_id: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type MarketplaceContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/0.2.1/MerkleAirdropContractTs.client.ts b/packages/adocodegen/src/merkle-airdrop/0.2.1/MerkleAirdropContractTs.client.ts new file mode 100644 index 0000000..5d1e42d --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/0.2.1/MerkleAirdropContractTs.client.ts @@ -0,0 +1,425 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AssetInfoBaseForString, AndrAddr, InstantiateMsg, Module, ExecuteMsg, Expiration, Timestamp, Uint64, Uint128, ReplyOn, Binary, OwnershipMessage, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, AssetInfoBaseForAddr, ConfigResponse, IsClaimedResponse, IsOperatorResponse, KernelAddressResponse, LatestStageResponse, MerkleRootResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TotalClaimedResponse, TypeResponse, VersionResponse } from "./MerkleAirdropContractTs.types"; +export interface MerkleAirdropContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + merkleRoot: ({ + stage + }: { + stage: number; + }) => Promise; + latestStage: () => Promise; + isClaimed: ({ + address, + stage + }: { + address: string; + stage: number; + }) => Promise; + totalClaimed: ({ + stage + }: { + stage: number; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class MerkleAirdropContractTsQueryClient implements MerkleAirdropContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.merkleRoot = this.merkleRoot.bind(this); + this.latestStage = this.latestStage.bind(this); + this.isClaimed = this.isClaimed.bind(this); + this.totalClaimed = this.totalClaimed.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + merkleRoot = async ({ + stage + }: { + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + merkle_root: { + stage + } + }); + }; + latestStage = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_stage: {} + }); + }; + isClaimed = async ({ + address, + stage + }: { + address: string; + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_claimed: { + address, + stage + } + }); + }; + totalClaimed = async ({ + stage + }: { + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + total_claimed: { + stage + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface MerkleAirdropContractTsInterface { + contractAddress: string; + sender: string; + registerMerkleRoot: ({ + expiration, + merkleRoot, + totalAmount + }: { + expiration?: Expiration; + merkleRoot: string; + totalAmount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + amount, + proof, + stage + }: { + amount: Uint128; + proof: string[]; + stage: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + stage + }: { + stage: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class MerkleAirdropContractTsClient implements MerkleAirdropContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.registerMerkleRoot = this.registerMerkleRoot.bind(this); + this.claim = this.claim.bind(this); + this.burn = this.burn.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + registerMerkleRoot = async ({ + expiration, + merkleRoot, + totalAmount + }: { + expiration?: Expiration; + merkleRoot: string; + totalAmount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_merkle_root: { + expiration, + merkle_root: merkleRoot, + total_amount: totalAmount + } + }, fee, memo, _funds); + }; + claim = async ({ + amount, + proof, + stage + }: { + amount: Uint128; + proof: string[]; + stage: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + amount, + proof, + stage + } + }, fee, memo, _funds); + }; + burn = async ({ + stage + }: { + stage: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + stage + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/0.2.1/MerkleAirdropContractTs.message-builder.ts b/packages/adocodegen/src/merkle-airdrop/0.2.1/MerkleAirdropContractTs.message-builder.ts new file mode 100644 index 0000000..12c897b --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/0.2.1/MerkleAirdropContractTs.message-builder.ts @@ -0,0 +1,254 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AssetInfoBaseForString, AndrAddr, InstantiateMsg, Module, ExecuteMsg, Expiration, Timestamp, Uint64, Uint128, ReplyOn, Binary, OwnershipMessage, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, AssetInfoBaseForAddr, ConfigResponse, IsClaimedResponse, IsOperatorResponse, KernelAddressResponse, LatestStageResponse, MerkleRootResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TotalClaimedResponse, TypeResponse, VersionResponse } from "./MerkleAirdropContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MerkleAirdropContractTsExecuteMsgBuilder { + static registerMerkleRoot = ({ + expiration, + merkleRoot, + totalAmount + }: CamelCasedProperties["register_merkle_root"]>): ExecuteMsg => { + return { + register_merkle_root: ({ + expiration, + merkle_root: merkleRoot, + total_amount: totalAmount + } as const) + }; + }; + static claim = ({ + amount, + proof, + stage + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + amount, + proof, + stage + } as const) + }; + }; + static burn = ({ + stage + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + stage + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class MerkleAirdropContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static merkleRoot = ({ + stage + }: CamelCasedProperties["merkle_root"]>): QueryMsg => { + return { + merkle_root: ({ + stage + } as const) + }; + }; + static latestStage = (): QueryMsg => { + return { + latest_stage: ({} as const) + }; + }; + static isClaimed = ({ + address, + stage + }: CamelCasedProperties["is_claimed"]>): QueryMsg => { + return { + is_claimed: ({ + address, + stage + } as const) + }; + }; + static totalClaimed = ({ + stage + }: CamelCasedProperties["total_claimed"]>): QueryMsg => { + return { + total_claimed: ({ + stage + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/0.2.1/MerkleAirdropContractTs.types.ts b/packages/adocodegen/src/merkle-airdrop/0.2.1/MerkleAirdropContractTs.types.ts new file mode 100644 index 0000000..2f30fa4 --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/0.2.1/MerkleAirdropContractTs.types.ts @@ -0,0 +1,238 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AssetInfoBaseForString = { + native: string; +} | { + cw20: string; +}; +export type AndrAddr = string; +export interface InstantiateMsg { + asset_info: AssetInfoBaseForString; + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + register_merkle_root: { + expiration?: Expiration | null; + merkle_root: string; + total_amount?: Uint128 | null; + }; +} | { + claim: { + amount: Uint128; + proof: string[]; + stage: number; + }; +} | { + burn: { + stage: number; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + merkle_root: { + stage: number; + }; +} | { + latest_stage: {}; +} | { + is_claimed: { + address: string; + stage: number; + }; +} | { + total_claimed: { + stage: number; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export type AssetInfoBaseForAddr = { + native: string; +} | { + cw20: Addr; +}; +export interface ConfigResponse { + asset_info: AssetInfoBaseForAddr; +} +export interface IsClaimedResponse { + is_claimed: boolean; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface LatestStageResponse { + latest_stage: number; +} +export interface MerkleRootResponse { + expiration: Expiration; + merkle_root: string; + stage: number; + total_amount: Uint128; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TotalClaimedResponse { + total_claimed: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type MerkleAirdropContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/0.2.16/MerkleAirdropContractTs.client.ts b/packages/adocodegen/src/merkle-airdrop/0.2.16/MerkleAirdropContractTs.client.ts new file mode 100644 index 0000000..d8bc174 --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/0.2.16/MerkleAirdropContractTs.client.ts @@ -0,0 +1,366 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AssetInfoBaseForString, AndrAddr, InstantiateMsg, Module, ExecuteMsg, Expiration, Timestamp, Uint64, Uint128, ReplyOn, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, AssetInfoBaseForAddr, ConfigResponse, IsClaimedResponse, IsOperatorResponse, KernelAddressResponse, LatestStageResponse, MerkleRootResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TotalClaimedResponse, TypeResponse, VersionResponse } from "./MerkleAirdropContractTs.types"; +export interface MerkleAirdropContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + merkleRoot: ({ + stage + }: { + stage: number; + }) => Promise; + latestStage: () => Promise; + isClaimed: ({ + address, + stage + }: { + address: string; + stage: number; + }) => Promise; + totalClaimed: ({ + stage + }: { + stage: number; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class MerkleAirdropContractTsQueryClient implements MerkleAirdropContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.merkleRoot = this.merkleRoot.bind(this); + this.latestStage = this.latestStage.bind(this); + this.isClaimed = this.isClaimed.bind(this); + this.totalClaimed = this.totalClaimed.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + merkleRoot = async ({ + stage + }: { + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + merkle_root: { + stage + } + }); + }; + latestStage = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_stage: {} + }); + }; + isClaimed = async ({ + address, + stage + }: { + address: string; + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_claimed: { + address, + stage + } + }); + }; + totalClaimed = async ({ + stage + }: { + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + total_claimed: { + stage + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface MerkleAirdropContractTsInterface { + contractAddress: string; + sender: string; + registerMerkleRoot: ({ + expiration, + merkleRoot, + totalAmount + }: { + expiration?: Expiration; + merkleRoot: string; + totalAmount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + amount, + proof, + stage + }: { + amount: Uint128; + proof: string[]; + stage: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + stage + }: { + stage: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class MerkleAirdropContractTsClient implements MerkleAirdropContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.registerMerkleRoot = this.registerMerkleRoot.bind(this); + this.claim = this.claim.bind(this); + this.burn = this.burn.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + registerMerkleRoot = async ({ + expiration, + merkleRoot, + totalAmount + }: { + expiration?: Expiration; + merkleRoot: string; + totalAmount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_merkle_root: { + expiration, + merkle_root: merkleRoot, + total_amount: totalAmount + } + }, fee, memo, _funds); + }; + claim = async ({ + amount, + proof, + stage + }: { + amount: Uint128; + proof: string[]; + stage: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + amount, + proof, + stage + } + }, fee, memo, _funds); + }; + burn = async ({ + stage + }: { + stage: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + stage + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/0.2.16/MerkleAirdropContractTs.message-builder.ts b/packages/adocodegen/src/merkle-airdrop/0.2.16/MerkleAirdropContractTs.message-builder.ts new file mode 100644 index 0000000..1308e2d --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/0.2.16/MerkleAirdropContractTs.message-builder.ts @@ -0,0 +1,220 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AssetInfoBaseForString, AndrAddr, InstantiateMsg, Module, ExecuteMsg, Expiration, Timestamp, Uint64, Uint128, ReplyOn, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, AssetInfoBaseForAddr, ConfigResponse, IsClaimedResponse, IsOperatorResponse, KernelAddressResponse, LatestStageResponse, MerkleRootResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TotalClaimedResponse, TypeResponse, VersionResponse } from "./MerkleAirdropContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MerkleAirdropContractTsExecuteMsgBuilder { + static registerMerkleRoot = ({ + expiration, + merkleRoot, + totalAmount + }: CamelCasedProperties["register_merkle_root"]>): ExecuteMsg => { + return { + register_merkle_root: ({ + expiration, + merkle_root: merkleRoot, + total_amount: totalAmount + } as const) + }; + }; + static claim = ({ + amount, + proof, + stage + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + amount, + proof, + stage + } as const) + }; + }; + static burn = ({ + stage + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + stage + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class MerkleAirdropContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static merkleRoot = ({ + stage + }: CamelCasedProperties["merkle_root"]>): QueryMsg => { + return { + merkle_root: ({ + stage + } as const) + }; + }; + static latestStage = (): QueryMsg => { + return { + latest_stage: ({} as const) + }; + }; + static isClaimed = ({ + address, + stage + }: CamelCasedProperties["is_claimed"]>): QueryMsg => { + return { + is_claimed: ({ + address, + stage + } as const) + }; + }; + static totalClaimed = ({ + stage + }: CamelCasedProperties["total_claimed"]>): QueryMsg => { + return { + total_claimed: ({ + stage + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/0.2.16/MerkleAirdropContractTs.types.ts b/packages/adocodegen/src/merkle-airdrop/0.2.16/MerkleAirdropContractTs.types.ts new file mode 100644 index 0000000..e4d99a1 --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/0.2.16/MerkleAirdropContractTs.types.ts @@ -0,0 +1,245 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AssetInfoBaseForString = { + native: string; +} | { + cw20: string; +}; +export type AndrAddr = string; +export interface InstantiateMsg { + asset_info: AssetInfoBaseForString; + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + register_merkle_root: { + expiration?: Expiration | null; + merkle_root: string; + total_amount?: Uint128 | null; + }; +} | { + claim: { + amount: Uint128; + proof: string[]; + stage: number; + }; +} | { + burn: { + stage: number; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + merkle_root: { + stage: number; + }; +} | { + latest_stage: {}; +} | { + is_claimed: { + address: string; + stage: number; + }; +} | { + total_claimed: { + stage: number; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export type AssetInfoBaseForAddr = { + native: string; +} | { + cw20: Addr; +}; +export interface ConfigResponse { + asset_info: AssetInfoBaseForAddr; +} +export interface IsClaimedResponse { + is_claimed: boolean; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface LatestStageResponse { + latest_stage: number; +} +export interface MerkleRootResponse { + expiration: Expiration; + merkle_root: string; + stage: number; + total_amount: Uint128; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TotalClaimedResponse { + total_claimed: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type MerkleAirdropContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/2.0.0/MerkleAirdropContractTs.client.ts b/packages/adocodegen/src/merkle-airdrop/2.0.0/MerkleAirdropContractTs.client.ts new file mode 100644 index 0000000..2a53df0 --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/2.0.0/MerkleAirdropContractTs.client.ts @@ -0,0 +1,377 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Asset, AndrAddr, InstantiateMsg, ExecuteMsg, Expiry, Milliseconds, Uint128, ReplyOn, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, IsClaimedResponse, KernelAddressResponse, LatestStageResponse, MerkleRootResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TotalClaimedResponse, TypeResponse, VersionResponse } from "./MerkleAirdropContractTs.types"; +export interface MerkleAirdropContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + merkleRoot: ({ + stage + }: { + stage: number; + }) => Promise; + latestStage: () => Promise; + isClaimed: ({ + address, + stage + }: { + address: string; + stage: number; + }) => Promise; + totalClaimed: ({ + stage + }: { + stage: number; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class MerkleAirdropContractTsQueryClient implements MerkleAirdropContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.merkleRoot = this.merkleRoot.bind(this); + this.latestStage = this.latestStage.bind(this); + this.isClaimed = this.isClaimed.bind(this); + this.totalClaimed = this.totalClaimed.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + merkleRoot = async ({ + stage + }: { + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + merkle_root: { + stage + } + }); + }; + latestStage = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_stage: {} + }); + }; + isClaimed = async ({ + address, + stage + }: { + address: string; + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_claimed: { + address, + stage + } + }); + }; + totalClaimed = async ({ + stage + }: { + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + total_claimed: { + stage + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface MerkleAirdropContractTsInterface { + contractAddress: string; + sender: string; + registerMerkleRoot: ({ + expiration, + merkleRoot, + totalAmount + }: { + expiration?: Expiry; + merkleRoot: string; + totalAmount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + amount, + proof, + stage + }: { + amount: Uint128; + proof: string[]; + stage: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + stage + }: { + stage: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class MerkleAirdropContractTsClient implements MerkleAirdropContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.registerMerkleRoot = this.registerMerkleRoot.bind(this); + this.claim = this.claim.bind(this); + this.burn = this.burn.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + registerMerkleRoot = async ({ + expiration, + merkleRoot, + totalAmount + }: { + expiration?: Expiry; + merkleRoot: string; + totalAmount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_merkle_root: { + expiration, + merkle_root: merkleRoot, + total_amount: totalAmount + } + }, fee, memo, _funds); + }; + claim = async ({ + amount, + proof, + stage + }: { + amount: Uint128; + proof: string[]; + stage: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + amount, + proof, + stage + } + }, fee, memo, _funds); + }; + burn = async ({ + stage + }: { + stage: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + stage + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/2.0.0/MerkleAirdropContractTs.message-builder.ts b/packages/adocodegen/src/merkle-airdrop/2.0.0/MerkleAirdropContractTs.message-builder.ts new file mode 100644 index 0000000..7fa06d2 --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/2.0.0/MerkleAirdropContractTs.message-builder.ts @@ -0,0 +1,229 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Asset, AndrAddr, InstantiateMsg, ExecuteMsg, Expiry, Milliseconds, Uint128, ReplyOn, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, IsClaimedResponse, KernelAddressResponse, LatestStageResponse, MerkleRootResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TotalClaimedResponse, TypeResponse, VersionResponse } from "./MerkleAirdropContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MerkleAirdropContractTsExecuteMsgBuilder { + static registerMerkleRoot = ({ + expiration, + merkleRoot, + totalAmount + }: CamelCasedProperties["register_merkle_root"]>): ExecuteMsg => { + return { + register_merkle_root: ({ + expiration, + merkle_root: merkleRoot, + total_amount: totalAmount + } as const) + }; + }; + static claim = ({ + amount, + proof, + stage + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + amount, + proof, + stage + } as const) + }; + }; + static burn = ({ + stage + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + stage + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class MerkleAirdropContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static merkleRoot = ({ + stage + }: CamelCasedProperties["merkle_root"]>): QueryMsg => { + return { + merkle_root: ({ + stage + } as const) + }; + }; + static latestStage = (): QueryMsg => { + return { + latest_stage: ({} as const) + }; + }; + static isClaimed = ({ + address, + stage + }: CamelCasedProperties["is_claimed"]>): QueryMsg => { + return { + is_claimed: ({ + address, + stage + } as const) + }; + }; + static totalClaimed = ({ + stage + }: CamelCasedProperties["total_claimed"]>): QueryMsg => { + return { + total_claimed: ({ + stage + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/2.0.0/MerkleAirdropContractTs.types.ts b/packages/adocodegen/src/merkle-airdrop/2.0.0/MerkleAirdropContractTs.types.ts new file mode 100644 index 0000000..5c449b6 --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/2.0.0/MerkleAirdropContractTs.types.ts @@ -0,0 +1,276 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type AndrAddr = string; +export interface InstantiateMsg { + asset_info: Asset; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + register_merkle_root: { + expiration?: Expiry | null; + merkle_root: string; + total_amount?: Uint128 | null; + }; +} | { + claim: { + amount: Uint128; + proof: string[]; + stage: number; + }; +} | { + burn: { + stage: number; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Uint128 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + config: {}; +} | { + merkle_root: { + stage: number; + }; +} | { + latest_stage: {}; +} | { + is_claimed: { + address: string; + stage: number; + }; +} | { + total_claimed: { + stage: number; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ConfigResponse { + asset_info: Asset; +} +export interface IsClaimedResponse { + is_claimed: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface LatestStageResponse { + latest_stage: number; +} +export interface MerkleRootResponse { + expiration?: Milliseconds | null; + merkle_root: string; + stage: number; + total_amount: Uint128; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TotalClaimedResponse { + total_claimed: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type MerkleAirdropContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/2.0.1-beta.1/MerkleAirdropContractTs.client.ts b/packages/adocodegen/src/merkle-airdrop/2.0.1-beta.1/MerkleAirdropContractTs.client.ts new file mode 100644 index 0000000..2a53df0 --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/2.0.1-beta.1/MerkleAirdropContractTs.client.ts @@ -0,0 +1,377 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Asset, AndrAddr, InstantiateMsg, ExecuteMsg, Expiry, Milliseconds, Uint128, ReplyOn, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, IsClaimedResponse, KernelAddressResponse, LatestStageResponse, MerkleRootResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TotalClaimedResponse, TypeResponse, VersionResponse } from "./MerkleAirdropContractTs.types"; +export interface MerkleAirdropContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + merkleRoot: ({ + stage + }: { + stage: number; + }) => Promise; + latestStage: () => Promise; + isClaimed: ({ + address, + stage + }: { + address: string; + stage: number; + }) => Promise; + totalClaimed: ({ + stage + }: { + stage: number; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class MerkleAirdropContractTsQueryClient implements MerkleAirdropContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.merkleRoot = this.merkleRoot.bind(this); + this.latestStage = this.latestStage.bind(this); + this.isClaimed = this.isClaimed.bind(this); + this.totalClaimed = this.totalClaimed.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + merkleRoot = async ({ + stage + }: { + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + merkle_root: { + stage + } + }); + }; + latestStage = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_stage: {} + }); + }; + isClaimed = async ({ + address, + stage + }: { + address: string; + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_claimed: { + address, + stage + } + }); + }; + totalClaimed = async ({ + stage + }: { + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + total_claimed: { + stage + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface MerkleAirdropContractTsInterface { + contractAddress: string; + sender: string; + registerMerkleRoot: ({ + expiration, + merkleRoot, + totalAmount + }: { + expiration?: Expiry; + merkleRoot: string; + totalAmount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + amount, + proof, + stage + }: { + amount: Uint128; + proof: string[]; + stage: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + stage + }: { + stage: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class MerkleAirdropContractTsClient implements MerkleAirdropContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.registerMerkleRoot = this.registerMerkleRoot.bind(this); + this.claim = this.claim.bind(this); + this.burn = this.burn.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + registerMerkleRoot = async ({ + expiration, + merkleRoot, + totalAmount + }: { + expiration?: Expiry; + merkleRoot: string; + totalAmount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_merkle_root: { + expiration, + merkle_root: merkleRoot, + total_amount: totalAmount + } + }, fee, memo, _funds); + }; + claim = async ({ + amount, + proof, + stage + }: { + amount: Uint128; + proof: string[]; + stage: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + amount, + proof, + stage + } + }, fee, memo, _funds); + }; + burn = async ({ + stage + }: { + stage: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + stage + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/2.0.1-beta.1/MerkleAirdropContractTs.message-builder.ts b/packages/adocodegen/src/merkle-airdrop/2.0.1-beta.1/MerkleAirdropContractTs.message-builder.ts new file mode 100644 index 0000000..7fa06d2 --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/2.0.1-beta.1/MerkleAirdropContractTs.message-builder.ts @@ -0,0 +1,229 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Asset, AndrAddr, InstantiateMsg, ExecuteMsg, Expiry, Milliseconds, Uint128, ReplyOn, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, IsClaimedResponse, KernelAddressResponse, LatestStageResponse, MerkleRootResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TotalClaimedResponse, TypeResponse, VersionResponse } from "./MerkleAirdropContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MerkleAirdropContractTsExecuteMsgBuilder { + static registerMerkleRoot = ({ + expiration, + merkleRoot, + totalAmount + }: CamelCasedProperties["register_merkle_root"]>): ExecuteMsg => { + return { + register_merkle_root: ({ + expiration, + merkle_root: merkleRoot, + total_amount: totalAmount + } as const) + }; + }; + static claim = ({ + amount, + proof, + stage + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + amount, + proof, + stage + } as const) + }; + }; + static burn = ({ + stage + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + stage + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class MerkleAirdropContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static merkleRoot = ({ + stage + }: CamelCasedProperties["merkle_root"]>): QueryMsg => { + return { + merkle_root: ({ + stage + } as const) + }; + }; + static latestStage = (): QueryMsg => { + return { + latest_stage: ({} as const) + }; + }; + static isClaimed = ({ + address, + stage + }: CamelCasedProperties["is_claimed"]>): QueryMsg => { + return { + is_claimed: ({ + address, + stage + } as const) + }; + }; + static totalClaimed = ({ + stage + }: CamelCasedProperties["total_claimed"]>): QueryMsg => { + return { + total_claimed: ({ + stage + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/2.0.1-beta.1/MerkleAirdropContractTs.types.ts b/packages/adocodegen/src/merkle-airdrop/2.0.1-beta.1/MerkleAirdropContractTs.types.ts new file mode 100644 index 0000000..fbaa50c --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/2.0.1-beta.1/MerkleAirdropContractTs.types.ts @@ -0,0 +1,276 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type AndrAddr = string; +export interface InstantiateMsg { + asset_info: Asset; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + register_merkle_root: { + expiration?: Expiry | null; + merkle_root: string; + total_amount?: Uint128 | null; + }; +} | { + claim: { + amount: Uint128; + proof: string[]; + stage: number; + }; +} | { + burn: { + stage: number; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Uint128 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + config: {}; +} | { + merkle_root: { + stage: number; + }; +} | { + latest_stage: {}; +} | { + is_claimed: { + address: string; + stage: number; + }; +} | { + total_claimed: { + stage: number; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ConfigResponse { + asset_info: Asset; +} +export interface IsClaimedResponse { + is_claimed: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface LatestStageResponse { + latest_stage: number; +} +export interface MerkleRootResponse { + expiration?: Milliseconds | null; + merkle_root: string; + stage: number; + total_amount: Uint128; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TotalClaimedResponse { + total_claimed: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type MerkleAirdropContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/2.0.1/MerkleAirdropContractTs.client.ts b/packages/adocodegen/src/merkle-airdrop/2.0.1/MerkleAirdropContractTs.client.ts new file mode 100644 index 0000000..2a53df0 --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/2.0.1/MerkleAirdropContractTs.client.ts @@ -0,0 +1,377 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Asset, AndrAddr, InstantiateMsg, ExecuteMsg, Expiry, Milliseconds, Uint128, ReplyOn, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, IsClaimedResponse, KernelAddressResponse, LatestStageResponse, MerkleRootResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TotalClaimedResponse, TypeResponse, VersionResponse } from "./MerkleAirdropContractTs.types"; +export interface MerkleAirdropContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + merkleRoot: ({ + stage + }: { + stage: number; + }) => Promise; + latestStage: () => Promise; + isClaimed: ({ + address, + stage + }: { + address: string; + stage: number; + }) => Promise; + totalClaimed: ({ + stage + }: { + stage: number; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class MerkleAirdropContractTsQueryClient implements MerkleAirdropContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.merkleRoot = this.merkleRoot.bind(this); + this.latestStage = this.latestStage.bind(this); + this.isClaimed = this.isClaimed.bind(this); + this.totalClaimed = this.totalClaimed.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + merkleRoot = async ({ + stage + }: { + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + merkle_root: { + stage + } + }); + }; + latestStage = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + latest_stage: {} + }); + }; + isClaimed = async ({ + address, + stage + }: { + address: string; + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_claimed: { + address, + stage + } + }); + }; + totalClaimed = async ({ + stage + }: { + stage: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + total_claimed: { + stage + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface MerkleAirdropContractTsInterface { + contractAddress: string; + sender: string; + registerMerkleRoot: ({ + expiration, + merkleRoot, + totalAmount + }: { + expiration?: Expiry; + merkleRoot: string; + totalAmount?: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + amount, + proof, + stage + }: { + amount: Uint128; + proof: string[]; + stage: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + burn: ({ + stage + }: { + stage: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class MerkleAirdropContractTsClient implements MerkleAirdropContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.registerMerkleRoot = this.registerMerkleRoot.bind(this); + this.claim = this.claim.bind(this); + this.burn = this.burn.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + registerMerkleRoot = async ({ + expiration, + merkleRoot, + totalAmount + }: { + expiration?: Expiry; + merkleRoot: string; + totalAmount?: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_merkle_root: { + expiration, + merkle_root: merkleRoot, + total_amount: totalAmount + } + }, fee, memo, _funds); + }; + claim = async ({ + amount, + proof, + stage + }: { + amount: Uint128; + proof: string[]; + stage: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + amount, + proof, + stage + } + }, fee, memo, _funds); + }; + burn = async ({ + stage + }: { + stage: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + burn: { + stage + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/2.0.1/MerkleAirdropContractTs.message-builder.ts b/packages/adocodegen/src/merkle-airdrop/2.0.1/MerkleAirdropContractTs.message-builder.ts new file mode 100644 index 0000000..7fa06d2 --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/2.0.1/MerkleAirdropContractTs.message-builder.ts @@ -0,0 +1,229 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Asset, AndrAddr, InstantiateMsg, ExecuteMsg, Expiry, Milliseconds, Uint128, ReplyOn, Binary, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ConfigResponse, IsClaimedResponse, KernelAddressResponse, LatestStageResponse, MerkleRootResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TotalClaimedResponse, TypeResponse, VersionResponse } from "./MerkleAirdropContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class MerkleAirdropContractTsExecuteMsgBuilder { + static registerMerkleRoot = ({ + expiration, + merkleRoot, + totalAmount + }: CamelCasedProperties["register_merkle_root"]>): ExecuteMsg => { + return { + register_merkle_root: ({ + expiration, + merkle_root: merkleRoot, + total_amount: totalAmount + } as const) + }; + }; + static claim = ({ + amount, + proof, + stage + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + amount, + proof, + stage + } as const) + }; + }; + static burn = ({ + stage + }: CamelCasedProperties["burn"]>): ExecuteMsg => { + return { + burn: ({ + stage + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class MerkleAirdropContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static merkleRoot = ({ + stage + }: CamelCasedProperties["merkle_root"]>): QueryMsg => { + return { + merkle_root: ({ + stage + } as const) + }; + }; + static latestStage = (): QueryMsg => { + return { + latest_stage: ({} as const) + }; + }; + static isClaimed = ({ + address, + stage + }: CamelCasedProperties["is_claimed"]>): QueryMsg => { + return { + is_claimed: ({ + address, + stage + } as const) + }; + }; + static totalClaimed = ({ + stage + }: CamelCasedProperties["total_claimed"]>): QueryMsg => { + return { + total_claimed: ({ + stage + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/merkle-airdrop/2.0.1/MerkleAirdropContractTs.types.ts b/packages/adocodegen/src/merkle-airdrop/2.0.1/MerkleAirdropContractTs.types.ts new file mode 100644 index 0000000..fbaa50c --- /dev/null +++ b/packages/adocodegen/src/merkle-airdrop/2.0.1/MerkleAirdropContractTs.types.ts @@ -0,0 +1,276 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Asset = { + cw20_token: AndrAddr; +} | { + native_token: string; +}; +export type AndrAddr = string; +export interface InstantiateMsg { + asset_info: Asset; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + register_merkle_root: { + expiration?: Expiry | null; + merkle_root: string; + total_amount?: Uint128 | null; + }; +} | { + claim: { + amount: Uint128; + proof: string[]; + stage: number; + }; +} | { + burn: { + stage: number; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Uint128 = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + config: {}; +} | { + merkle_root: { + stage: number; + }; +} | { + latest_stage: {}; +} | { + is_claimed: { + address: string; + stage: number; + }; +} | { + total_claimed: { + stage: number; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ConfigResponse { + asset_info: Asset; +} +export interface IsClaimedResponse { + is_claimed: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface LatestStageResponse { + latest_stage: number; +} +export interface MerkleRootResponse { + expiration?: Milliseconds | null; + merkle_root: string; + stage: number; + total_amount: Uint128; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TotalClaimedResponse { + total_claimed: Uint128; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type MerkleAirdropContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/0.2.0/PrimitiveContractTs.client.ts b/packages/adocodegen/src/primitive/0.2.0/PrimitiveContractTs.client.ts new file mode 100644 index 0000000..c6208dc --- /dev/null +++ b/packages/adocodegen/src/primitive/0.2.0/PrimitiveContractTs.client.ts @@ -0,0 +1,388 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Permission, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, AndromedaHook, Funds, Cw20Coin, ArrayOfString, BalanceResponse, BlockHeightResponse, GetValueResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +export interface PrimitiveContractTsReadOnlyInterface { + contractAddress: string; + getValue: ({ + key + }: { + key?: string; + }) => Promise; + allKeys: () => Promise; + ownerKeys: ({ + owner + }: { + owner: AndrAddr; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + andrHook: (andromedaHook: AndromedaHook) => Promise; +} +export class PrimitiveContractTsQueryClient implements PrimitiveContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getValue = this.getValue.bind(this); + this.allKeys = this.allKeys.bind(this); + this.ownerKeys = this.ownerKeys.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.andrHook = this.andrHook.bind(this); + } + + getValue = async ({ + key + }: { + key?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_value: { + key + } + }); + }; + allKeys = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_keys: {} + }); + }; + ownerKeys = async ({ + owner + }: { + owner: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_keys: { + owner + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + andrHook = async (andromedaHook: AndromedaHook): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + andr_hook: andromedaHook + }); + }; +} +export interface PrimitiveContractTsInterface { + contractAddress: string; + sender: string; + setValue: ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deleteValue: ({ + key + }: { + key?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class PrimitiveContractTsClient implements PrimitiveContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setValue = this.setValue.bind(this); + this.deleteValue = this.deleteValue.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + setValue = async ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_value: { + key, + value + } + }, fee, memo, _funds); + }; + deleteValue = async ({ + key + }: { + key?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delete_value: { + key + } + }, fee, memo, _funds); + }; + updateRestriction = async ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/0.2.0/PrimitiveContractTs.message-builder.ts b/packages/adocodegen/src/primitive/0.2.0/PrimitiveContractTs.message-builder.ts new file mode 100644 index 0000000..1ecaf53 --- /dev/null +++ b/packages/adocodegen/src/primitive/0.2.0/PrimitiveContractTs.message-builder.ts @@ -0,0 +1,235 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Permission, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, AndromedaHook, Funds, Cw20Coin, ArrayOfString, BalanceResponse, BlockHeightResponse, GetValueResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class PrimitiveContractTsExecuteMsgBuilder { + static setValue = ({ + key, + value + }: CamelCasedProperties["set_value"]>): ExecuteMsg => { + return { + set_value: ({ + key, + value + } as const) + }; + }; + static deleteValue = ({ + key + }: CamelCasedProperties["delete_value"]>): ExecuteMsg => { + return { + delete_value: ({ + key + } as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class PrimitiveContractTsQueryMsgBuilder { + static getValue = ({ + key + }: CamelCasedProperties["get_value"]>): QueryMsg => { + return { + get_value: ({ + key + } as const) + }; + }; + static allKeys = (): QueryMsg => { + return { + all_keys: ({} as const) + }; + }; + static ownerKeys = ({ + owner + }: CamelCasedProperties["owner_keys"]>): QueryMsg => { + return { + owner_keys: ({ + owner + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static andrHook = (andromedaHook: AndromedaHook): QueryMsg => { + return { + andr_hook: andromedaHook + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/0.2.0/PrimitiveContractTs.types.ts b/packages/adocodegen/src/primitive/0.2.0/PrimitiveContractTs.types.ts new file mode 100644 index 0000000..4633d62 --- /dev/null +++ b/packages/adocodegen/src/primitive/0.2.0/PrimitiveContractTs.types.ts @@ -0,0 +1,250 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type PrimitiveRestriction = "private" | "public" | "restricted"; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + restriction: PrimitiveRestriction; +} +export type ExecuteMsg = { + set_value: { + key?: string | null; + value: Primitive; + }; +} | { + delete_value: { + key?: string | null; + }; +} | { + update_restriction: { + restriction: PrimitiveRestriction; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type Primitive = { + uint128: Uint128; +} | { + decimal: Decimal; +} | { + coin: Coin; +} | { + addr: Addr; +} | { + string: string; +} | { + bool: boolean; +} | { + vec: Primitive[]; +} | { + binary: Binary; +} | { + object: { + [k: string]: Primitive; + }; +}; +export type Uint128 = string; +export type Decimal = string; +export type Addr = string; +export type Binary = string; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + get_value: { + key?: string | null; + }; +} | { + all_keys: {}; +} | { + owner_keys: { + owner: AndrAddr; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + andr_hook: AndromedaHook; +}; +export type AndromedaHook = { + on_execute: { + payload: Binary; + sender: string; + }; +} | { + on_funds_transfer: { + amount: Funds; + payload: Binary; + sender: string; + }; +} | { + on_token_transfer: { + recipient: string; + sender: string; + token_id: string; + }; +}; +export type Funds = { + native: Coin; +} | { + cw20: Cw20Coin; +}; +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export type ArrayOfString = string[]; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetValueResponse { + key: string; + value: Primitive; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type PrimitiveContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/0.2.16/PrimitiveContractTs.client.ts b/packages/adocodegen/src/primitive/0.2.16/PrimitiveContractTs.client.ts new file mode 100644 index 0000000..a50e743 --- /dev/null +++ b/packages/adocodegen/src/primitive/0.2.16/PrimitiveContractTs.client.ts @@ -0,0 +1,329 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, PermissioningMessage, Permission, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, AndromedaHook, Funds, Cw20Coin, ArrayOfString, BalanceResponse, BlockHeightResponse, GetValueResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +export interface PrimitiveContractTsReadOnlyInterface { + contractAddress: string; + getValue: ({ + key + }: { + key?: string; + }) => Promise; + allKeys: () => Promise; + ownerKeys: ({ + owner + }: { + owner: AndrAddr; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + andrHook: (andromedaHook: AndromedaHook) => Promise; +} +export class PrimitiveContractTsQueryClient implements PrimitiveContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getValue = this.getValue.bind(this); + this.allKeys = this.allKeys.bind(this); + this.ownerKeys = this.ownerKeys.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.andrHook = this.andrHook.bind(this); + } + + getValue = async ({ + key + }: { + key?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_value: { + key + } + }); + }; + allKeys = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_keys: {} + }); + }; + ownerKeys = async ({ + owner + }: { + owner: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_keys: { + owner + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + andrHook = async (andromedaHook: AndromedaHook): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + andr_hook: andromedaHook + }); + }; +} +export interface PrimitiveContractTsInterface { + contractAddress: string; + sender: string; + setValue: ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deleteValue: ({ + key + }: { + key?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class PrimitiveContractTsClient implements PrimitiveContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setValue = this.setValue.bind(this); + this.deleteValue = this.deleteValue.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + setValue = async ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_value: { + key, + value + } + }, fee, memo, _funds); + }; + deleteValue = async ({ + key + }: { + key?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delete_value: { + key + } + }, fee, memo, _funds); + }; + updateRestriction = async ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/0.2.16/PrimitiveContractTs.message-builder.ts b/packages/adocodegen/src/primitive/0.2.16/PrimitiveContractTs.message-builder.ts new file mode 100644 index 0000000..69359d5 --- /dev/null +++ b/packages/adocodegen/src/primitive/0.2.16/PrimitiveContractTs.message-builder.ts @@ -0,0 +1,201 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, PermissioningMessage, Permission, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, AndromedaHook, Funds, Cw20Coin, ArrayOfString, BalanceResponse, BlockHeightResponse, GetValueResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class PrimitiveContractTsExecuteMsgBuilder { + static setValue = ({ + key, + value + }: CamelCasedProperties["set_value"]>): ExecuteMsg => { + return { + set_value: ({ + key, + value + } as const) + }; + }; + static deleteValue = ({ + key + }: CamelCasedProperties["delete_value"]>): ExecuteMsg => { + return { + delete_value: ({ + key + } as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class PrimitiveContractTsQueryMsgBuilder { + static getValue = ({ + key + }: CamelCasedProperties["get_value"]>): QueryMsg => { + return { + get_value: ({ + key + } as const) + }; + }; + static allKeys = (): QueryMsg => { + return { + all_keys: ({} as const) + }; + }; + static ownerKeys = ({ + owner + }: CamelCasedProperties["owner_keys"]>): QueryMsg => { + return { + owner_keys: ({ + owner + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static andrHook = (andromedaHook: AndromedaHook): QueryMsg => { + return { + andr_hook: andromedaHook + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/0.2.16/PrimitiveContractTs.types.ts b/packages/adocodegen/src/primitive/0.2.16/PrimitiveContractTs.types.ts new file mode 100644 index 0000000..37419e8 --- /dev/null +++ b/packages/adocodegen/src/primitive/0.2.16/PrimitiveContractTs.types.ts @@ -0,0 +1,257 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type PrimitiveRestriction = "private" | "public" | "restricted"; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + restriction: PrimitiveRestriction; +} +export type ExecuteMsg = { + set_value: { + key?: string | null; + value: Primitive; + }; +} | { + delete_value: { + key?: string | null; + }; +} | { + update_restriction: { + restriction: PrimitiveRestriction; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type Primitive = { + uint128: Uint128; +} | { + decimal: Decimal; +} | { + coin: Coin; +} | { + addr: Addr; +} | { + string: string; +} | { + bool: boolean; +} | { + vec: Primitive[]; +} | { + binary: Binary; +} | { + object: { + [k: string]: Primitive; + }; +}; +export type Uint128 = string; +export type Decimal = string; +export type Addr = string; +export type Binary = string; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + get_value: { + key?: string | null; + }; +} | { + all_keys: {}; +} | { + owner_keys: { + owner: AndrAddr; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + andr_hook: AndromedaHook; +}; +export type AndromedaHook = { + on_execute: { + payload: Binary; + sender: string; + }; +} | { + on_funds_transfer: { + amount: Funds; + payload: Binary; + sender: string; + }; +} | { + on_token_transfer: { + recipient: string; + sender: string; + token_id: string; + }; +}; +export type Funds = { + native: Coin; +} | { + cw20: Cw20Coin; +}; +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export type ArrayOfString = string[]; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetValueResponse { + key: string; + value: Primitive; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type PrimitiveContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.0/PrimitiveContractTs.client.ts b/packages/adocodegen/src/primitive/2.0.0/PrimitiveContractTs.client.ts new file mode 100644 index 0000000..1adeabc --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.0/PrimitiveContractTs.client.ts @@ -0,0 +1,333 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, RatesQueryMessage, ADOBaseVersionResponse, ArrayOfString, AppContractResponse, BlockHeightResponse, GetTypeResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +export interface PrimitiveContractTsReadOnlyInterface { + contractAddress: string; + getValue: ({ + key + }: { + key?: string; + }) => Promise; + getType: ({ + key + }: { + key?: string; + }) => Promise; + allKeys: () => Promise; + ownerKeys: ({ + owner + }: { + owner: AndrAddr; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: (ratesQueryMessage: RatesQueryMessage) => Promise; +} +export class PrimitiveContractTsQueryClient implements PrimitiveContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getValue = this.getValue.bind(this); + this.getType = this.getType.bind(this); + this.allKeys = this.allKeys.bind(this); + this.ownerKeys = this.ownerKeys.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + } + + getValue = async ({ + key + }: { + key?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_value: { + key + } + }); + }; + getType = async ({ + key + }: { + key?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_type: { + key + } + }); + }; + allKeys = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_keys: {} + }); + }; + ownerKeys = async ({ + owner + }: { + owner: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_keys: { + owner + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async (ratesQueryMessage: RatesQueryMessage): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: ratesQueryMessage + }); + }; +} +export interface PrimitiveContractTsInterface { + contractAddress: string; + sender: string; + setValue: ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deleteValue: ({ + key + }: { + key?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class PrimitiveContractTsClient implements PrimitiveContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setValue = this.setValue.bind(this); + this.deleteValue = this.deleteValue.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setValue = async ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_value: { + key, + value + } + }, fee, memo, _funds); + }; + deleteValue = async ({ + key + }: { + key?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delete_value: { + key + } + }, fee, memo, _funds); + }; + updateRestriction = async ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.0/PrimitiveContractTs.message-builder.ts b/packages/adocodegen/src/primitive/2.0.0/PrimitiveContractTs.message-builder.ts new file mode 100644 index 0000000..fdfb354 --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.0/PrimitiveContractTs.message-builder.ts @@ -0,0 +1,205 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, RatesQueryMessage, ADOBaseVersionResponse, ArrayOfString, AppContractResponse, BlockHeightResponse, GetTypeResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class PrimitiveContractTsExecuteMsgBuilder { + static setValue = ({ + key, + value + }: CamelCasedProperties["set_value"]>): ExecuteMsg => { + return { + set_value: ({ + key, + value + } as const) + }; + }; + static deleteValue = ({ + key + }: CamelCasedProperties["delete_value"]>): ExecuteMsg => { + return { + delete_value: ({ + key + } as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class PrimitiveContractTsQueryMsgBuilder { + static getValue = ({ + key + }: CamelCasedProperties["get_value"]>): QueryMsg => { + return { + get_value: ({ + key + } as const) + }; + }; + static getType = ({ + key + }: CamelCasedProperties["get_type"]>): QueryMsg => { + return { + get_type: ({ + key + } as const) + }; + }; + static allKeys = (): QueryMsg => { + return { + all_keys: ({} as const) + }; + }; + static ownerKeys = ({ + owner + }: CamelCasedProperties["owner_keys"]>): QueryMsg => { + return { + owner_keys: ({ + owner + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = (ratesQueryMessage: RatesQueryMessage): QueryMsg => { + return { + rates: ratesQueryMessage + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.0/PrimitiveContractTs.types.ts b/packages/adocodegen/src/primitive/2.0.0/PrimitiveContractTs.types.ts new file mode 100644 index 0000000..47884a7 --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.0/PrimitiveContractTs.types.ts @@ -0,0 +1,268 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type PrimitiveRestriction = "private" | "public" | "restricted"; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + restriction: PrimitiveRestriction; +} +export type ExecuteMsg = { + set_value: { + key?: string | null; + value: Primitive; + }; +} | { + delete_value: { + key?: string | null; + }; +} | { + update_restriction: { + restriction: PrimitiveRestriction; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Primitive = { + uint128: Uint128; +} | { + decimal: Decimal; +} | { + coin: Coin; +} | { + addr: Addr; +} | { + string: string; +} | { + bool: boolean; +} | { + binary: Binary; +}; +export type Uint128 = string; +export type Decimal = string; +export type Addr = string; +export type Binary = string; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_value: { + key?: string | null; + }; +} | { + get_type: { + key?: string | null; + }; +} | { + all_keys: {}; +} | { + owner_keys: { + owner: AndrAddr; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: RatesQueryMessage; +}; +export type RatesQueryMessage = { + get_rate: { + action: string; + }; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export type ArrayOfString = string[]; +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetTypeResponse { + value_type: string; +} +export interface GetValueResponse { + key: string; + value: Primitive; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type PrimitiveContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.1/PrimitiveContractTs.client.ts b/packages/adocodegen/src/primitive/2.0.1/PrimitiveContractTs.client.ts new file mode 100644 index 0000000..b057b7e --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.1/PrimitiveContractTs.client.ts @@ -0,0 +1,350 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ArrayOfString, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetTypeResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +export interface PrimitiveContractTsReadOnlyInterface { + contractAddress: string; + getValue: ({ + key + }: { + key?: string; + }) => Promise; + getType: ({ + key + }: { + key?: string; + }) => Promise; + allKeys: () => Promise; + ownerKeys: ({ + owner + }: { + owner: AndrAddr; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class PrimitiveContractTsQueryClient implements PrimitiveContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getValue = this.getValue.bind(this); + this.getType = this.getType.bind(this); + this.allKeys = this.allKeys.bind(this); + this.ownerKeys = this.ownerKeys.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getValue = async ({ + key + }: { + key?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_value: { + key + } + }); + }; + getType = async ({ + key + }: { + key?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_type: { + key + } + }); + }; + allKeys = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_keys: {} + }); + }; + ownerKeys = async ({ + owner + }: { + owner: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_keys: { + owner + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface PrimitiveContractTsInterface { + contractAddress: string; + sender: string; + setValue: ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deleteValue: ({ + key + }: { + key?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class PrimitiveContractTsClient implements PrimitiveContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setValue = this.setValue.bind(this); + this.deleteValue = this.deleteValue.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setValue = async ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_value: { + key, + value + } + }, fee, memo, _funds); + }; + deleteValue = async ({ + key + }: { + key?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delete_value: { + key + } + }, fee, memo, _funds); + }; + updateRestriction = async ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.1/PrimitiveContractTs.message-builder.ts b/packages/adocodegen/src/primitive/2.0.1/PrimitiveContractTs.message-builder.ts new file mode 100644 index 0000000..84b7ad5 --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.1/PrimitiveContractTs.message-builder.ts @@ -0,0 +1,216 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ArrayOfString, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetTypeResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class PrimitiveContractTsExecuteMsgBuilder { + static setValue = ({ + key, + value + }: CamelCasedProperties["set_value"]>): ExecuteMsg => { + return { + set_value: ({ + key, + value + } as const) + }; + }; + static deleteValue = ({ + key + }: CamelCasedProperties["delete_value"]>): ExecuteMsg => { + return { + delete_value: ({ + key + } as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class PrimitiveContractTsQueryMsgBuilder { + static getValue = ({ + key + }: CamelCasedProperties["get_value"]>): QueryMsg => { + return { + get_value: ({ + key + } as const) + }; + }; + static getType = ({ + key + }: CamelCasedProperties["get_type"]>): QueryMsg => { + return { + get_type: ({ + key + } as const) + }; + }; + static allKeys = (): QueryMsg => { + return { + all_keys: ({} as const) + }; + }; + static ownerKeys = ({ + owner + }: CamelCasedProperties["owner_keys"]>): QueryMsg => { + return { + owner_keys: ({ + owner + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.1/PrimitiveContractTs.types.ts b/packages/adocodegen/src/primitive/2.0.1/PrimitiveContractTs.types.ts new file mode 100644 index 0000000..a8c987f --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.1/PrimitiveContractTs.types.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type PrimitiveRestriction = "private" | "public" | "restricted"; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + restriction: PrimitiveRestriction; +} +export type ExecuteMsg = { + set_value: { + key?: string | null; + value: Primitive; + }; +} | { + delete_value: { + key?: string | null; + }; +} | { + update_restriction: { + restriction: PrimitiveRestriction; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Primitive = { + uint128: Uint128; +} | { + decimal: Decimal; +} | { + coin: Coin; +} | { + addr: Addr; +} | { + string: string; +} | { + bool: boolean; +} | { + binary: Binary; +}; +export type Uint128 = string; +export type Decimal = string; +export type Addr = string; +export type Binary = string; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_value: { + key?: string | null; + }; +} | { + get_type: { + key?: string | null; + }; +} | { + all_keys: {}; +} | { + owner_keys: { + owner: AndrAddr; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export type ArrayOfString = string[]; +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetTypeResponse { + value_type: string; +} +export interface GetValueResponse { + key: string; + value: Primitive; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type PrimitiveContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.2-beta.1/PrimitiveContractTs.client.ts b/packages/adocodegen/src/primitive/2.0.2-beta.1/PrimitiveContractTs.client.ts new file mode 100644 index 0000000..b057b7e --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.2-beta.1/PrimitiveContractTs.client.ts @@ -0,0 +1,350 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ArrayOfString, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetTypeResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +export interface PrimitiveContractTsReadOnlyInterface { + contractAddress: string; + getValue: ({ + key + }: { + key?: string; + }) => Promise; + getType: ({ + key + }: { + key?: string; + }) => Promise; + allKeys: () => Promise; + ownerKeys: ({ + owner + }: { + owner: AndrAddr; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class PrimitiveContractTsQueryClient implements PrimitiveContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getValue = this.getValue.bind(this); + this.getType = this.getType.bind(this); + this.allKeys = this.allKeys.bind(this); + this.ownerKeys = this.ownerKeys.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getValue = async ({ + key + }: { + key?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_value: { + key + } + }); + }; + getType = async ({ + key + }: { + key?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_type: { + key + } + }); + }; + allKeys = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_keys: {} + }); + }; + ownerKeys = async ({ + owner + }: { + owner: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_keys: { + owner + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface PrimitiveContractTsInterface { + contractAddress: string; + sender: string; + setValue: ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deleteValue: ({ + key + }: { + key?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class PrimitiveContractTsClient implements PrimitiveContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setValue = this.setValue.bind(this); + this.deleteValue = this.deleteValue.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setValue = async ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_value: { + key, + value + } + }, fee, memo, _funds); + }; + deleteValue = async ({ + key + }: { + key?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delete_value: { + key + } + }, fee, memo, _funds); + }; + updateRestriction = async ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.2-beta.1/PrimitiveContractTs.message-builder.ts b/packages/adocodegen/src/primitive/2.0.2-beta.1/PrimitiveContractTs.message-builder.ts new file mode 100644 index 0000000..84b7ad5 --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.2-beta.1/PrimitiveContractTs.message-builder.ts @@ -0,0 +1,216 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ArrayOfString, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetTypeResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class PrimitiveContractTsExecuteMsgBuilder { + static setValue = ({ + key, + value + }: CamelCasedProperties["set_value"]>): ExecuteMsg => { + return { + set_value: ({ + key, + value + } as const) + }; + }; + static deleteValue = ({ + key + }: CamelCasedProperties["delete_value"]>): ExecuteMsg => { + return { + delete_value: ({ + key + } as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class PrimitiveContractTsQueryMsgBuilder { + static getValue = ({ + key + }: CamelCasedProperties["get_value"]>): QueryMsg => { + return { + get_value: ({ + key + } as const) + }; + }; + static getType = ({ + key + }: CamelCasedProperties["get_type"]>): QueryMsg => { + return { + get_type: ({ + key + } as const) + }; + }; + static allKeys = (): QueryMsg => { + return { + all_keys: ({} as const) + }; + }; + static ownerKeys = ({ + owner + }: CamelCasedProperties["owner_keys"]>): QueryMsg => { + return { + owner_keys: ({ + owner + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.2-beta.1/PrimitiveContractTs.types.ts b/packages/adocodegen/src/primitive/2.0.2-beta.1/PrimitiveContractTs.types.ts new file mode 100644 index 0000000..5bb6995 --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.2-beta.1/PrimitiveContractTs.types.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type PrimitiveRestriction = "private" | "public" | "restricted"; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + restriction: PrimitiveRestriction; +} +export type ExecuteMsg = { + set_value: { + key?: string | null; + value: Primitive; + }; +} | { + delete_value: { + key?: string | null; + }; +} | { + update_restriction: { + restriction: PrimitiveRestriction; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Primitive = { + uint128: Uint128; +} | { + decimal: Decimal; +} | { + coin: Coin; +} | { + addr: Addr; +} | { + string: string; +} | { + bool: boolean; +} | { + binary: Binary; +}; +export type Uint128 = string; +export type Decimal = string; +export type Addr = string; +export type Binary = string; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_value: { + key?: string | null; + }; +} | { + get_type: { + key?: string | null; + }; +} | { + all_keys: {}; +} | { + owner_keys: { + owner: AndrAddr; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export type ArrayOfString = string[]; +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetTypeResponse { + value_type: string; +} +export interface GetValueResponse { + key: string; + value: Primitive; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type PrimitiveContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.2/PrimitiveContractTs.client.ts b/packages/adocodegen/src/primitive/2.0.2/PrimitiveContractTs.client.ts new file mode 100644 index 0000000..b057b7e --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.2/PrimitiveContractTs.client.ts @@ -0,0 +1,350 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ArrayOfString, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetTypeResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +export interface PrimitiveContractTsReadOnlyInterface { + contractAddress: string; + getValue: ({ + key + }: { + key?: string; + }) => Promise; + getType: ({ + key + }: { + key?: string; + }) => Promise; + allKeys: () => Promise; + ownerKeys: ({ + owner + }: { + owner: AndrAddr; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class PrimitiveContractTsQueryClient implements PrimitiveContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getValue = this.getValue.bind(this); + this.getType = this.getType.bind(this); + this.allKeys = this.allKeys.bind(this); + this.ownerKeys = this.ownerKeys.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getValue = async ({ + key + }: { + key?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_value: { + key + } + }); + }; + getType = async ({ + key + }: { + key?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_type: { + key + } + }); + }; + allKeys = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_keys: {} + }); + }; + ownerKeys = async ({ + owner + }: { + owner: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner_keys: { + owner + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface PrimitiveContractTsInterface { + contractAddress: string; + sender: string; + setValue: ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deleteValue: ({ + key + }: { + key?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class PrimitiveContractTsClient implements PrimitiveContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setValue = this.setValue.bind(this); + this.deleteValue = this.deleteValue.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setValue = async ({ + key, + value + }: { + key?: string; + value: Primitive; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_value: { + key, + value + } + }, fee, memo, _funds); + }; + deleteValue = async ({ + key + }: { + key?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delete_value: { + key + } + }, fee, memo, _funds); + }; + updateRestriction = async ({ + restriction + }: { + restriction: PrimitiveRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.2/PrimitiveContractTs.message-builder.ts b/packages/adocodegen/src/primitive/2.0.2/PrimitiveContractTs.message-builder.ts new file mode 100644 index 0000000..84b7ad5 --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.2/PrimitiveContractTs.message-builder.ts @@ -0,0 +1,216 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { PrimitiveRestriction, InstantiateMsg, ExecuteMsg, Primitive, Uint128, Decimal, Addr, Binary, AndrAddr, ReplyOn, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Coin, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, ArrayOfString, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetTypeResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./PrimitiveContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class PrimitiveContractTsExecuteMsgBuilder { + static setValue = ({ + key, + value + }: CamelCasedProperties["set_value"]>): ExecuteMsg => { + return { + set_value: ({ + key, + value + } as const) + }; + }; + static deleteValue = ({ + key + }: CamelCasedProperties["delete_value"]>): ExecuteMsg => { + return { + delete_value: ({ + key + } as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class PrimitiveContractTsQueryMsgBuilder { + static getValue = ({ + key + }: CamelCasedProperties["get_value"]>): QueryMsg => { + return { + get_value: ({ + key + } as const) + }; + }; + static getType = ({ + key + }: CamelCasedProperties["get_type"]>): QueryMsg => { + return { + get_type: ({ + key + } as const) + }; + }; + static allKeys = (): QueryMsg => { + return { + all_keys: ({} as const) + }; + }; + static ownerKeys = ({ + owner + }: CamelCasedProperties["owner_keys"]>): QueryMsg => { + return { + owner_keys: ({ + owner + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/primitive/2.0.2/PrimitiveContractTs.types.ts b/packages/adocodegen/src/primitive/2.0.2/PrimitiveContractTs.types.ts new file mode 100644 index 0000000..5bb6995 --- /dev/null +++ b/packages/adocodegen/src/primitive/2.0.2/PrimitiveContractTs.types.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type PrimitiveRestriction = "private" | "public" | "restricted"; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + restriction: PrimitiveRestriction; +} +export type ExecuteMsg = { + set_value: { + key?: string | null; + value: Primitive; + }; +} | { + delete_value: { + key?: string | null; + }; +} | { + update_restriction: { + restriction: PrimitiveRestriction; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Primitive = { + uint128: Uint128; +} | { + decimal: Decimal; +} | { + coin: Coin; +} | { + addr: Addr; +} | { + string: string; +} | { + bool: boolean; +} | { + binary: Binary; +}; +export type Uint128 = string; +export type Decimal = string; +export type Addr = string; +export type Binary = string; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_value: { + key?: string | null; + }; +} | { + get_type: { + key?: string | null; + }; +} | { + all_keys: {}; +} | { + owner_keys: { + owner: AndrAddr; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export type ArrayOfString = string[]; +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetTypeResponse { + value_type: string; +} +export interface GetValueResponse { + key: string; + value: Primitive; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type PrimitiveContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/0.2.1/RateLimitingWithdrawalsContractTs.client.ts b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.1/RateLimitingWithdrawalsContractTs.client.ts new file mode 100644 index 0000000..a586506 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.1/RateLimitingWithdrawalsContractTs.client.ts @@ -0,0 +1,412 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, Module, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +export interface RateLimitingWithdrawalsContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class RateLimitingWithdrawalsContractTsQueryClient implements RateLimitingWithdrawalsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface RateLimitingWithdrawalsContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RateLimitingWithdrawalsContractTsClient implements RateLimitingWithdrawalsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/0.2.1/RateLimitingWithdrawalsContractTs.message-builder.ts b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.1/RateLimitingWithdrawalsContractTs.message-builder.ts new file mode 100644 index 0000000..245570a --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.1/RateLimitingWithdrawalsContractTs.message-builder.ts @@ -0,0 +1,251 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, Module, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RateLimitingWithdrawalsContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class RateLimitingWithdrawalsContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/0.2.1/RateLimitingWithdrawalsContractTs.types.ts b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.1/RateLimitingWithdrawalsContractTs.types.ts new file mode 100644 index 0000000..e1d1a39 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.1/RateLimitingWithdrawalsContractTs.types.ts @@ -0,0 +1,225 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressPercent[]; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type ArrayOfString = string[]; +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RateLimitingWithdrawalsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/0.2.16/RateLimitingWithdrawalsContractTs.client.ts b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.16/RateLimitingWithdrawalsContractTs.client.ts new file mode 100644 index 0000000..bebf379 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.16/RateLimitingWithdrawalsContractTs.client.ts @@ -0,0 +1,353 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, Module, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +export interface RateLimitingWithdrawalsContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + module: ({ + id + }: { + id: Uint64; + }) => Promise; + moduleIds: () => Promise; +} +export class RateLimitingWithdrawalsContractTsQueryClient implements RateLimitingWithdrawalsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.module = this.module.bind(this); + this.moduleIds = this.moduleIds.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + module = async ({ + id + }: { + id: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module: { + id + } + }); + }; + moduleIds = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + module_ids: {} + }); + }; +} +export interface RateLimitingWithdrawalsContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerModule: ({ + module + }: { + module: Module; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deregisterModule: ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + alterModule: ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RateLimitingWithdrawalsContractTsClient implements RateLimitingWithdrawalsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.registerModule = this.registerModule.bind(this); + this.deregisterModule = this.deregisterModule.bind(this); + this.alterModule = this.alterModule.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + registerModule = async ({ + module + }: { + module: Module; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_module: { + module + } + }, fee, memo, _funds); + }; + deregisterModule = async ({ + moduleIdx + }: { + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deregister_module: { + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; + alterModule = async ({ + module, + moduleIdx + }: { + module: Module; + moduleIdx: Uint64; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + alter_module: { + module, + module_idx: moduleIdx + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/0.2.16/RateLimitingWithdrawalsContractTs.message-builder.ts b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.16/RateLimitingWithdrawalsContractTs.message-builder.ts new file mode 100644 index 0000000..849ac37 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.16/RateLimitingWithdrawalsContractTs.message-builder.ts @@ -0,0 +1,217 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, Module, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, ArrayOfString, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RateLimitingWithdrawalsContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static registerModule = ({ + module + }: CamelCasedProperties["register_module"]>): ExecuteMsg => { + return { + register_module: ({ + module + } as const) + }; + }; + static deregisterModule = ({ + moduleIdx + }: CamelCasedProperties["deregister_module"]>): ExecuteMsg => { + return { + deregister_module: ({ + module_idx: moduleIdx + } as const) + }; + }; + static alterModule = ({ + module, + moduleIdx + }: CamelCasedProperties["alter_module"]>): ExecuteMsg => { + return { + alter_module: ({ + module, + module_idx: moduleIdx + } as const) + }; + }; +} +export abstract class RateLimitingWithdrawalsContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static module = ({ + id + }: CamelCasedProperties["module"]>): QueryMsg => { + return { + module: ({ + id + } as const) + }; + }; + static moduleIds = (): QueryMsg => { + return { + module_ids: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/0.2.16/RateLimitingWithdrawalsContractTs.types.ts b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.16/RateLimitingWithdrawalsContractTs.types.ts new file mode 100644 index 0000000..d07ac75 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/0.2.16/RateLimitingWithdrawalsContractTs.types.ts @@ -0,0 +1,232 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + register_module: { + module: Module; + }; +} | { + deregister_module: { + module_idx: Uint64; + }; +} | { + alter_module: { + module: Module; + module_idx: Uint64; + }; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + module: { + id: Uint64; + }; +} | { + module_ids: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressPercent[]; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export type ArrayOfString = string[]; +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RateLimitingWithdrawalsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.0/RateLimitingWithdrawalsContractTs.client.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.0/RateLimitingWithdrawalsContractTs.client.ts new file mode 100644 index 0000000..4f493ad --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.0/RateLimitingWithdrawalsContractTs.client.ts @@ -0,0 +1,263 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, MinimumFrequency, Milliseconds, InstantiateMsg, CoinAndLimit, ExecuteMsg, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, Timestamp, Uint64, AccountDetails, AppContractResponse, BlockHeightResponse, CoinAllowance, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +export interface RateLimitingWithdrawalsContractTsReadOnlyInterface { + contractAddress: string; + coinAllowanceDetails: () => Promise; + accountDetails: ({ + account + }: { + account: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class RateLimitingWithdrawalsContractTsQueryClient implements RateLimitingWithdrawalsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.coinAllowanceDetails = this.coinAllowanceDetails.bind(this); + this.accountDetails = this.accountDetails.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + coinAllowanceDetails = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + coin_allowance_details: {} + }); + }; + accountDetails = async ({ + account + }: { + account: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + account_details: { + account + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface RateLimitingWithdrawalsContractTsInterface { + contractAddress: string; + sender: string; + deposits: ({ + recipient + }: { + recipient?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawFunds: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RateLimitingWithdrawalsContractTsClient implements RateLimitingWithdrawalsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.deposits = this.deposits.bind(this); + this.withdrawFunds = this.withdrawFunds.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + deposits = async ({ + recipient + }: { + recipient?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposits: { + recipient + } + }, fee, memo, _funds); + }; + withdrawFunds = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_funds: { + amount + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.0/RateLimitingWithdrawalsContractTs.message-builder.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.0/RateLimitingWithdrawalsContractTs.message-builder.ts new file mode 100644 index 0000000..1f2d923 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.0/RateLimitingWithdrawalsContractTs.message-builder.ts @@ -0,0 +1,160 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, MinimumFrequency, Milliseconds, InstantiateMsg, CoinAndLimit, ExecuteMsg, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, Timestamp, Uint64, AccountDetails, AppContractResponse, BlockHeightResponse, CoinAllowance, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RateLimitingWithdrawalsContractTsExecuteMsgBuilder { + static deposits = ({ + recipient + }: CamelCasedProperties["deposits"]>): ExecuteMsg => { + return { + deposits: ({ + recipient + } as const) + }; + }; + static withdrawFunds = ({ + amount + }: CamelCasedProperties["withdraw_funds"]>): ExecuteMsg => { + return { + withdraw_funds: ({ + amount + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class RateLimitingWithdrawalsContractTsQueryMsgBuilder { + static coinAllowanceDetails = (): QueryMsg => { + return { + coin_allowance_details: ({} as const) + }; + }; + static accountDetails = ({ + account + }: CamelCasedProperties["account_details"]>): QueryMsg => { + return { + account_details: ({ + account + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.0/RateLimitingWithdrawalsContractTs.types.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.0/RateLimitingWithdrawalsContractTs.types.ts new file mode 100644 index 0000000..b631fed --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.0/RateLimitingWithdrawalsContractTs.types.ts @@ -0,0 +1,207 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type MinimumFrequency = { + time: { + time: Milliseconds; + }; +}; +export type Milliseconds = number; +export interface InstantiateMsg { + allowed_coin: CoinAndLimit; + kernel_address: string; + minimal_withdrawal_frequency: MinimumFrequency; + owner?: string | null; +} +export interface CoinAndLimit { + coin: string; + limit: Uint128; +} +export type ExecuteMsg = { + deposits: { + recipient?: string | null; + }; +} | { + withdraw_funds: { + amount: Uint128; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + coin_allowance_details: {}; +} | { + account_details: { + account: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export type Timestamp = Uint64; +export type Uint64 = string; +export interface AccountDetails { + balance: Uint128; + latest_withdrawal?: Timestamp | null; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface CoinAllowance { + coin: string; + limit: Uint128; + minimal_withdrawal_frequency: Milliseconds; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RateLimitingWithdrawalsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.1/RateLimitingWithdrawalsContractTs.client.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.1/RateLimitingWithdrawalsContractTs.client.ts new file mode 100644 index 0000000..d77e370 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.1/RateLimitingWithdrawalsContractTs.client.ts @@ -0,0 +1,263 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, MinimumFrequency, Milliseconds, InstantiateMsg, CoinAndLimit, ExecuteMsg, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, Timestamp, Uint64, AccountDetails, AppContractResponse, BlockHeightResponse, CoinAllowance, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +export interface RateLimitingWithdrawalsContractTsReadOnlyInterface { + contractAddress: string; + coinAllowanceDetails: () => Promise; + accountDetails: ({ + account + }: { + account: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class RateLimitingWithdrawalsContractTsQueryClient implements RateLimitingWithdrawalsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.coinAllowanceDetails = this.coinAllowanceDetails.bind(this); + this.accountDetails = this.accountDetails.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + coinAllowanceDetails = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + coin_allowance_details: {} + }); + }; + accountDetails = async ({ + account + }: { + account: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + account_details: { + account + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface RateLimitingWithdrawalsContractTsInterface { + contractAddress: string; + sender: string; + deposit: ({ + recipient + }: { + recipient?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RateLimitingWithdrawalsContractTsClient implements RateLimitingWithdrawalsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.deposit = this.deposit.bind(this); + this.withdraw = this.withdraw.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + deposit = async ({ + recipient + }: { + recipient?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit: { + recipient + } + }, fee, memo, _funds); + }; + withdraw = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: { + amount + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.1/RateLimitingWithdrawalsContractTs.message-builder.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.1/RateLimitingWithdrawalsContractTs.message-builder.ts new file mode 100644 index 0000000..d4eb6a9 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.1/RateLimitingWithdrawalsContractTs.message-builder.ts @@ -0,0 +1,160 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, MinimumFrequency, Milliseconds, InstantiateMsg, CoinAndLimit, ExecuteMsg, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, Timestamp, Uint64, AccountDetails, AppContractResponse, BlockHeightResponse, CoinAllowance, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RateLimitingWithdrawalsContractTsExecuteMsgBuilder { + static deposit = ({ + recipient + }: CamelCasedProperties["deposit"]>): ExecuteMsg => { + return { + deposit: ({ + recipient + } as const) + }; + }; + static withdraw = ({ + amount + }: CamelCasedProperties["withdraw"]>): ExecuteMsg => { + return { + withdraw: ({ + amount + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class RateLimitingWithdrawalsContractTsQueryMsgBuilder { + static coinAllowanceDetails = (): QueryMsg => { + return { + coin_allowance_details: ({} as const) + }; + }; + static accountDetails = ({ + account + }: CamelCasedProperties["account_details"]>): QueryMsg => { + return { + account_details: ({ + account + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.1/RateLimitingWithdrawalsContractTs.types.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.1/RateLimitingWithdrawalsContractTs.types.ts new file mode 100644 index 0000000..fd14206 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.1/RateLimitingWithdrawalsContractTs.types.ts @@ -0,0 +1,207 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type MinimumFrequency = { + time: { + time: Milliseconds; + }; +}; +export type Milliseconds = number; +export interface InstantiateMsg { + allowed_coin: CoinAndLimit; + kernel_address: string; + minimal_withdrawal_frequency: MinimumFrequency; + owner?: string | null; +} +export interface CoinAndLimit { + coin: string; + limit: Uint128; +} +export type ExecuteMsg = { + deposit: { + recipient?: string | null; + }; +} | { + withdraw: { + amount: Uint128; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + coin_allowance_details: {}; +} | { + account_details: { + account: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export type Timestamp = Uint64; +export type Uint64 = string; +export interface AccountDetails { + balance: Uint128; + latest_withdrawal?: Timestamp | null; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface CoinAllowance { + coin: string; + limit: Uint128; + minimal_withdrawal_frequency: Milliseconds; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RateLimitingWithdrawalsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2-beta.1/RateLimitingWithdrawalsContractTs.client.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2-beta.1/RateLimitingWithdrawalsContractTs.client.ts new file mode 100644 index 0000000..d77e370 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2-beta.1/RateLimitingWithdrawalsContractTs.client.ts @@ -0,0 +1,263 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, MinimumFrequency, Milliseconds, InstantiateMsg, CoinAndLimit, ExecuteMsg, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, Timestamp, Uint64, AccountDetails, AppContractResponse, BlockHeightResponse, CoinAllowance, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +export interface RateLimitingWithdrawalsContractTsReadOnlyInterface { + contractAddress: string; + coinAllowanceDetails: () => Promise; + accountDetails: ({ + account + }: { + account: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class RateLimitingWithdrawalsContractTsQueryClient implements RateLimitingWithdrawalsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.coinAllowanceDetails = this.coinAllowanceDetails.bind(this); + this.accountDetails = this.accountDetails.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + coinAllowanceDetails = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + coin_allowance_details: {} + }); + }; + accountDetails = async ({ + account + }: { + account: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + account_details: { + account + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface RateLimitingWithdrawalsContractTsInterface { + contractAddress: string; + sender: string; + deposit: ({ + recipient + }: { + recipient?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RateLimitingWithdrawalsContractTsClient implements RateLimitingWithdrawalsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.deposit = this.deposit.bind(this); + this.withdraw = this.withdraw.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + deposit = async ({ + recipient + }: { + recipient?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit: { + recipient + } + }, fee, memo, _funds); + }; + withdraw = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: { + amount + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2-beta.1/RateLimitingWithdrawalsContractTs.message-builder.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2-beta.1/RateLimitingWithdrawalsContractTs.message-builder.ts new file mode 100644 index 0000000..d4eb6a9 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2-beta.1/RateLimitingWithdrawalsContractTs.message-builder.ts @@ -0,0 +1,160 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, MinimumFrequency, Milliseconds, InstantiateMsg, CoinAndLimit, ExecuteMsg, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, Timestamp, Uint64, AccountDetails, AppContractResponse, BlockHeightResponse, CoinAllowance, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RateLimitingWithdrawalsContractTsExecuteMsgBuilder { + static deposit = ({ + recipient + }: CamelCasedProperties["deposit"]>): ExecuteMsg => { + return { + deposit: ({ + recipient + } as const) + }; + }; + static withdraw = ({ + amount + }: CamelCasedProperties["withdraw"]>): ExecuteMsg => { + return { + withdraw: ({ + amount + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class RateLimitingWithdrawalsContractTsQueryMsgBuilder { + static coinAllowanceDetails = (): QueryMsg => { + return { + coin_allowance_details: ({} as const) + }; + }; + static accountDetails = ({ + account + }: CamelCasedProperties["account_details"]>): QueryMsg => { + return { + account_details: ({ + account + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2-beta.1/RateLimitingWithdrawalsContractTs.types.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2-beta.1/RateLimitingWithdrawalsContractTs.types.ts new file mode 100644 index 0000000..26ccfb6 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2-beta.1/RateLimitingWithdrawalsContractTs.types.ts @@ -0,0 +1,207 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type MinimumFrequency = { + time: { + time: Milliseconds; + }; +}; +export type Milliseconds = number; +export interface InstantiateMsg { + allowed_coin: CoinAndLimit; + kernel_address: string; + minimal_withdrawal_frequency: MinimumFrequency; + owner?: string | null; +} +export interface CoinAndLimit { + coin: string; + limit: Uint128; +} +export type ExecuteMsg = { + deposit: { + recipient?: string | null; + }; +} | { + withdraw: { + amount: Uint128; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + coin_allowance_details: {}; +} | { + account_details: { + account: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export type Timestamp = Uint64; +export type Uint64 = string; +export interface AccountDetails { + balance: Uint128; + latest_withdrawal?: Timestamp | null; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface CoinAllowance { + coin: string; + limit: Uint128; + minimal_withdrawal_frequency: Milliseconds; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RateLimitingWithdrawalsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2/RateLimitingWithdrawalsContractTs.client.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2/RateLimitingWithdrawalsContractTs.client.ts new file mode 100644 index 0000000..d77e370 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2/RateLimitingWithdrawalsContractTs.client.ts @@ -0,0 +1,263 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Uint128, MinimumFrequency, Milliseconds, InstantiateMsg, CoinAndLimit, ExecuteMsg, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, Timestamp, Uint64, AccountDetails, AppContractResponse, BlockHeightResponse, CoinAllowance, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +export interface RateLimitingWithdrawalsContractTsReadOnlyInterface { + contractAddress: string; + coinAllowanceDetails: () => Promise; + accountDetails: ({ + account + }: { + account: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class RateLimitingWithdrawalsContractTsQueryClient implements RateLimitingWithdrawalsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.coinAllowanceDetails = this.coinAllowanceDetails.bind(this); + this.accountDetails = this.accountDetails.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + coinAllowanceDetails = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + coin_allowance_details: {} + }); + }; + accountDetails = async ({ + account + }: { + account: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + account_details: { + account + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface RateLimitingWithdrawalsContractTsInterface { + contractAddress: string; + sender: string; + deposit: ({ + recipient + }: { + recipient?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: ({ + amount + }: { + amount: Uint128; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RateLimitingWithdrawalsContractTsClient implements RateLimitingWithdrawalsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.deposit = this.deposit.bind(this); + this.withdraw = this.withdraw.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + deposit = async ({ + recipient + }: { + recipient?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit: { + recipient + } + }, fee, memo, _funds); + }; + withdraw = async ({ + amount + }: { + amount: Uint128; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: { + amount + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2/RateLimitingWithdrawalsContractTs.message-builder.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2/RateLimitingWithdrawalsContractTs.message-builder.ts new file mode 100644 index 0000000..d4eb6a9 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2/RateLimitingWithdrawalsContractTs.message-builder.ts @@ -0,0 +1,160 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Uint128, MinimumFrequency, Milliseconds, InstantiateMsg, CoinAndLimit, ExecuteMsg, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, Timestamp, Uint64, AccountDetails, AppContractResponse, BlockHeightResponse, CoinAllowance, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RateLimitingWithdrawalsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RateLimitingWithdrawalsContractTsExecuteMsgBuilder { + static deposit = ({ + recipient + }: CamelCasedProperties["deposit"]>): ExecuteMsg => { + return { + deposit: ({ + recipient + } as const) + }; + }; + static withdraw = ({ + amount + }: CamelCasedProperties["withdraw"]>): ExecuteMsg => { + return { + withdraw: ({ + amount + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class RateLimitingWithdrawalsContractTsQueryMsgBuilder { + static coinAllowanceDetails = (): QueryMsg => { + return { + coin_allowance_details: ({} as const) + }; + }; + static accountDetails = ({ + account + }: CamelCasedProperties["account_details"]>): QueryMsg => { + return { + account_details: ({ + account + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2/RateLimitingWithdrawalsContractTs.types.ts b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2/RateLimitingWithdrawalsContractTs.types.ts new file mode 100644 index 0000000..26ccfb6 --- /dev/null +++ b/packages/adocodegen/src/rate-limiting-withdrawals/2.0.2/RateLimitingWithdrawalsContractTs.types.ts @@ -0,0 +1,207 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Uint128 = string; +export type MinimumFrequency = { + time: { + time: Milliseconds; + }; +}; +export type Milliseconds = number; +export interface InstantiateMsg { + allowed_coin: CoinAndLimit; + kernel_address: string; + minimal_withdrawal_frequency: MinimumFrequency; + owner?: string | null; +} +export interface CoinAndLimit { + coin: string; + limit: Uint128; +} +export type ExecuteMsg = { + deposit: { + recipient?: string | null; + }; +} | { + withdraw: { + amount: Uint128; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + coin_allowance_details: {}; +} | { + account_details: { + account: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export type Timestamp = Uint64; +export type Uint64 = string; +export interface AccountDetails { + balance: Uint128; + latest_withdrawal?: Timestamp | null; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface CoinAllowance { + coin: string; + limit: Uint128; + minimal_withdrawal_frequency: Milliseconds; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RateLimitingWithdrawalsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rates/0.2.1/RatesContractTs.client.ts b/packages/adocodegen/src/rates/0.2.1/RatesContractTs.client.ts new file mode 100644 index 0000000..103b9fd --- /dev/null +++ b/packages/adocodegen/src/rates/0.2.1/RatesContractTs.client.ts @@ -0,0 +1,315 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Rate, Uint128, Decimal, AndrAddr, Binary, InstantiateMsg, RateInfo, Coin, PercentRate, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, AndromedaHook, Funds, Cw20Coin, BalanceResponse, BlockHeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, PaymentsResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RatesContractTs.types"; +export interface RatesContractTsReadOnlyInterface { + contractAddress: string; + payments: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + andrHook: (andromedaHook: AndromedaHook) => Promise; +} +export class RatesContractTsQueryClient implements RatesContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.payments = this.payments.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.andrHook = this.andrHook.bind(this); + } + + payments = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + payments: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + andrHook = async (andromedaHook: AndromedaHook): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + andr_hook: andromedaHook + }); + }; +} +export interface RatesContractTsInterface { + contractAddress: string; + sender: string; + updateRates: ({ + rates + }: { + rates: RateInfo[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RatesContractTsClient implements RatesContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRates = this.updateRates.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + updateRates = async ({ + rates + }: { + rates: RateInfo[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_rates: { + rates + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rates/0.2.1/RatesContractTs.message-builder.ts b/packages/adocodegen/src/rates/0.2.1/RatesContractTs.message-builder.ts new file mode 100644 index 0000000..7e8b8f3 --- /dev/null +++ b/packages/adocodegen/src/rates/0.2.1/RatesContractTs.message-builder.ts @@ -0,0 +1,189 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Rate, Uint128, Decimal, AndrAddr, Binary, InstantiateMsg, RateInfo, Coin, PercentRate, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, AndromedaHook, Funds, Cw20Coin, BalanceResponse, BlockHeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, PaymentsResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RatesContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RatesContractTsExecuteMsgBuilder { + static updateRates = ({ + rates + }: CamelCasedProperties["update_rates"]>): ExecuteMsg => { + return { + update_rates: ({ + rates + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class RatesContractTsQueryMsgBuilder { + static payments = (): QueryMsg => { + return { + payments: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static andrHook = (andromedaHook: AndromedaHook): QueryMsg => { + return { + andr_hook: andromedaHook + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rates/0.2.1/RatesContractTs.types.ts b/packages/adocodegen/src/rates/0.2.1/RatesContractTs.types.ts new file mode 100644 index 0000000..ed57868 --- /dev/null +++ b/packages/adocodegen/src/rates/0.2.1/RatesContractTs.types.ts @@ -0,0 +1,229 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Rate = { + flat: Coin; +} | { + percent: PercentRate; +}; +export type Uint128 = string; +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + rates: RateInfo[]; +} +export interface RateInfo { + description?: string | null; + is_additive: boolean; + rate: Rate; + recipients: Recipient[]; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface PercentRate { + percent: Decimal; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_rates: { + rates: RateInfo[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + payments: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + andr_hook: AndromedaHook; +}; +export type AndromedaHook = { + on_execute: { + payload: Binary; + sender: string; + }; +} | { + on_funds_transfer: { + amount: Funds; + payload: Binary; + sender: string; + }; +} | { + on_token_transfer: { + recipient: string; + sender: string; + token_id: string; + }; +}; +export type Funds = { + native: Coin; +} | { + cw20: Cw20Coin; +}; +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface PaymentsResponse { + payments: RateInfo[]; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RatesContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rates/0.2.16/RatesContractTs.client.ts b/packages/adocodegen/src/rates/0.2.16/RatesContractTs.client.ts new file mode 100644 index 0000000..6fe4628 --- /dev/null +++ b/packages/adocodegen/src/rates/0.2.16/RatesContractTs.client.ts @@ -0,0 +1,256 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Rate, Uint128, Decimal, AndrAddr, Binary, InstantiateMsg, RateInfo, Coin, PercentRate, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, AndromedaHook, Funds, Cw20Coin, BalanceResponse, BlockHeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, PaymentsResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RatesContractTs.types"; +export interface RatesContractTsReadOnlyInterface { + contractAddress: string; + payments: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + andrHook: (andromedaHook: AndromedaHook) => Promise; +} +export class RatesContractTsQueryClient implements RatesContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.payments = this.payments.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.andrHook = this.andrHook.bind(this); + } + + payments = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + payments: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + andrHook = async (andromedaHook: AndromedaHook): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + andr_hook: andromedaHook + }); + }; +} +export interface RatesContractTsInterface { + contractAddress: string; + sender: string; + updateRates: ({ + rates + }: { + rates: RateInfo[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RatesContractTsClient implements RatesContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRates = this.updateRates.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRates = async ({ + rates + }: { + rates: RateInfo[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_rates: { + rates + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rates/0.2.16/RatesContractTs.message-builder.ts b/packages/adocodegen/src/rates/0.2.16/RatesContractTs.message-builder.ts new file mode 100644 index 0000000..f61d145 --- /dev/null +++ b/packages/adocodegen/src/rates/0.2.16/RatesContractTs.message-builder.ts @@ -0,0 +1,155 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Rate, Uint128, Decimal, AndrAddr, Binary, InstantiateMsg, RateInfo, Coin, PercentRate, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, AndromedaHook, Funds, Cw20Coin, BalanceResponse, BlockHeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, PaymentsResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./RatesContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RatesContractTsExecuteMsgBuilder { + static updateRates = ({ + rates + }: CamelCasedProperties["update_rates"]>): ExecuteMsg => { + return { + update_rates: ({ + rates + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class RatesContractTsQueryMsgBuilder { + static payments = (): QueryMsg => { + return { + payments: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static andrHook = (andromedaHook: AndromedaHook): QueryMsg => { + return { + andr_hook: andromedaHook + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rates/0.2.16/RatesContractTs.types.ts b/packages/adocodegen/src/rates/0.2.16/RatesContractTs.types.ts new file mode 100644 index 0000000..5308f03 --- /dev/null +++ b/packages/adocodegen/src/rates/0.2.16/RatesContractTs.types.ts @@ -0,0 +1,236 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Rate = { + flat: Coin; +} | { + percent: PercentRate; +}; +export type Uint128 = string; +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + rates: RateInfo[]; +} +export interface RateInfo { + description?: string | null; + is_additive: boolean; + rate: Rate; + recipients: Recipient[]; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface PercentRate { + percent: Decimal; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_rates: { + rates: RateInfo[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + payments: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + andr_hook: AndromedaHook; +}; +export type AndromedaHook = { + on_execute: { + payload: Binary; + sender: string; + }; +} | { + on_funds_transfer: { + amount: Funds; + payload: Binary; + sender: string; + }; +} | { + on_token_transfer: { + recipient: string; + sender: string; + token_id: string; + }; +}; +export type Funds = { + native: Coin; +} | { + cw20: Cw20Coin; +}; +export interface Cw20Coin { + address: string; + amount: Uint128; +} +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface PaymentsResponse { + payments: RateInfo[]; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RatesContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rates/2.0.0/RatesContractTs.client.ts b/packages/adocodegen/src/rates/2.0.0/RatesContractTs.client.ts new file mode 100644 index 0000000..aabd519 --- /dev/null +++ b/packages/adocodegen/src/rates/2.0.0/RatesContractTs.client.ts @@ -0,0 +1,275 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { LocalRateType, AndrAddr, Binary, LocalRateValue, Decimal, Uint128, InstantiateMsg, LocalRate, Recipient, PercentRate, Coin, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, RatesQueryMessage, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, RateResponse, NullableRate, TypeResponse, VersionResponse } from "./RatesContractTs.types"; +export interface RatesContractTsReadOnlyInterface { + contractAddress: string; + rate: ({ + action + }: { + action: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: (ratesQueryMessage: RatesQueryMessage) => Promise; +} +export class RatesContractTsQueryClient implements RatesContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.rate = this.rate.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + } + + rate = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rate: { + action + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async (ratesQueryMessage: RatesQueryMessage): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: ratesQueryMessage + }); + }; +} +export interface RatesContractTsInterface { + contractAddress: string; + sender: string; + setRate: ({ + action, + rate + }: { + action: string; + rate: LocalRate; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRate: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RatesContractTsClient implements RatesContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setRate = this.setRate.bind(this); + this.removeRate = this.removeRate.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setRate = async ({ + action, + rate + }: { + action: string; + rate: LocalRate; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_rate: { + action, + rate + } + }, fee, memo, _funds); + }; + removeRate = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_rate: { + action + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rates/2.0.0/RatesContractTs.message-builder.ts b/packages/adocodegen/src/rates/2.0.0/RatesContractTs.message-builder.ts new file mode 100644 index 0000000..90ccefe --- /dev/null +++ b/packages/adocodegen/src/rates/2.0.0/RatesContractTs.message-builder.ts @@ -0,0 +1,167 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { LocalRateType, AndrAddr, Binary, LocalRateValue, Decimal, Uint128, InstantiateMsg, LocalRate, Recipient, PercentRate, Coin, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, RatesQueryMessage, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, RateResponse, NullableRate, TypeResponse, VersionResponse } from "./RatesContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RatesContractTsExecuteMsgBuilder { + static setRate = ({ + action, + rate + }: CamelCasedProperties["set_rate"]>): ExecuteMsg => { + return { + set_rate: ({ + action, + rate + } as const) + }; + }; + static removeRate = ({ + action + }: CamelCasedProperties["remove_rate"]>): ExecuteMsg => { + return { + remove_rate: ({ + action + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class RatesContractTsQueryMsgBuilder { + static rate = ({ + action + }: CamelCasedProperties["rate"]>): QueryMsg => { + return { + rate: ({ + action + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = (ratesQueryMessage: RatesQueryMessage): QueryMsg => { + return { + rates: ratesQueryMessage + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rates/2.0.0/RatesContractTs.types.ts b/packages/adocodegen/src/rates/2.0.0/RatesContractTs.types.ts new file mode 100644 index 0000000..4340851 --- /dev/null +++ b/packages/adocodegen/src/rates/2.0.0/RatesContractTs.types.ts @@ -0,0 +1,235 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type LocalRateType = "additive" | "deductive"; +export type AndrAddr = string; +export type Binary = string; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export type Uint128 = string; +export interface InstantiateMsg { + action: string; + kernel_address: string; + owner?: string | null; + rate: LocalRate; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type ExecuteMsg = { + set_rate: { + action: string; + rate: LocalRate; + }; +} | { + remove_rate: { + action: string; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + rate: { + action: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: RatesQueryMessage; +}; +export type RatesQueryMessage = { + get_rate: { + action: string; + }; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface RateResponse { + rate: LocalRate; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RatesContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rates/2.0.1-beta.1/RatesContractTs.client.ts b/packages/adocodegen/src/rates/2.0.1-beta.1/RatesContractTs.client.ts new file mode 100644 index 0000000..bae5f78 --- /dev/null +++ b/packages/adocodegen/src/rates/2.0.1-beta.1/RatesContractTs.client.ts @@ -0,0 +1,292 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { LocalRateType, AndrAddr, Binary, LocalRateValue, Decimal, Uint128, InstantiateMsg, LocalRate, Recipient, PercentRate, Coin, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, RateResponse, NullableRate, TypeResponse, VersionResponse } from "./RatesContractTs.types"; +export interface RatesContractTsReadOnlyInterface { + contractAddress: string; + rate: ({ + action + }: { + action: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class RatesContractTsQueryClient implements RatesContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.rate = this.rate.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + rate = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rate: { + action + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface RatesContractTsInterface { + contractAddress: string; + sender: string; + setRate: ({ + action, + rate + }: { + action: string; + rate: LocalRate; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRate: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RatesContractTsClient implements RatesContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setRate = this.setRate.bind(this); + this.removeRate = this.removeRate.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setRate = async ({ + action, + rate + }: { + action: string; + rate: LocalRate; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_rate: { + action, + rate + } + }, fee, memo, _funds); + }; + removeRate = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_rate: { + action + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rates/2.0.1-beta.1/RatesContractTs.message-builder.ts b/packages/adocodegen/src/rates/2.0.1-beta.1/RatesContractTs.message-builder.ts new file mode 100644 index 0000000..7e877d2 --- /dev/null +++ b/packages/adocodegen/src/rates/2.0.1-beta.1/RatesContractTs.message-builder.ts @@ -0,0 +1,178 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { LocalRateType, AndrAddr, Binary, LocalRateValue, Decimal, Uint128, InstantiateMsg, LocalRate, Recipient, PercentRate, Coin, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, RateResponse, NullableRate, TypeResponse, VersionResponse } from "./RatesContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RatesContractTsExecuteMsgBuilder { + static setRate = ({ + action, + rate + }: CamelCasedProperties["set_rate"]>): ExecuteMsg => { + return { + set_rate: ({ + action, + rate + } as const) + }; + }; + static removeRate = ({ + action + }: CamelCasedProperties["remove_rate"]>): ExecuteMsg => { + return { + remove_rate: ({ + action + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class RatesContractTsQueryMsgBuilder { + static rate = ({ + action + }: CamelCasedProperties["rate"]>): QueryMsg => { + return { + rate: ({ + action + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rates/2.0.1-beta.1/RatesContractTs.types.ts b/packages/adocodegen/src/rates/2.0.1-beta.1/RatesContractTs.types.ts new file mode 100644 index 0000000..4baa65e --- /dev/null +++ b/packages/adocodegen/src/rates/2.0.1-beta.1/RatesContractTs.types.ts @@ -0,0 +1,237 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type LocalRateType = "additive" | "deductive"; +export type AndrAddr = string; +export type Binary = string; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export type Uint128 = string; +export interface InstantiateMsg { + action: string; + kernel_address: string; + owner?: string | null; + rate: LocalRate; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type ExecuteMsg = { + set_rate: { + action: string; + rate: LocalRate; + }; +} | { + remove_rate: { + action: string; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + rate: { + action: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface RateResponse { + rate: LocalRate; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RatesContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/rates/2.0.1/RatesContractTs.client.ts b/packages/adocodegen/src/rates/2.0.1/RatesContractTs.client.ts new file mode 100644 index 0000000..bae5f78 --- /dev/null +++ b/packages/adocodegen/src/rates/2.0.1/RatesContractTs.client.ts @@ -0,0 +1,292 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { LocalRateType, AndrAddr, Binary, LocalRateValue, Decimal, Uint128, InstantiateMsg, LocalRate, Recipient, PercentRate, Coin, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, RateResponse, NullableRate, TypeResponse, VersionResponse } from "./RatesContractTs.types"; +export interface RatesContractTsReadOnlyInterface { + contractAddress: string; + rate: ({ + action + }: { + action: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class RatesContractTsQueryClient implements RatesContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.rate = this.rate.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + rate = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rate: { + action + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface RatesContractTsInterface { + contractAddress: string; + sender: string; + setRate: ({ + action, + rate + }: { + action: string; + rate: LocalRate; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRate: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class RatesContractTsClient implements RatesContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setRate = this.setRate.bind(this); + this.removeRate = this.removeRate.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setRate = async ({ + action, + rate + }: { + action: string; + rate: LocalRate; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_rate: { + action, + rate + } + }, fee, memo, _funds); + }; + removeRate = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_rate: { + action + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rates/2.0.1/RatesContractTs.message-builder.ts b/packages/adocodegen/src/rates/2.0.1/RatesContractTs.message-builder.ts new file mode 100644 index 0000000..7e877d2 --- /dev/null +++ b/packages/adocodegen/src/rates/2.0.1/RatesContractTs.message-builder.ts @@ -0,0 +1,178 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { LocalRateType, AndrAddr, Binary, LocalRateValue, Decimal, Uint128, InstantiateMsg, LocalRate, Recipient, PercentRate, Coin, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, RateResponse, NullableRate, TypeResponse, VersionResponse } from "./RatesContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class RatesContractTsExecuteMsgBuilder { + static setRate = ({ + action, + rate + }: CamelCasedProperties["set_rate"]>): ExecuteMsg => { + return { + set_rate: ({ + action, + rate + } as const) + }; + }; + static removeRate = ({ + action + }: CamelCasedProperties["remove_rate"]>): ExecuteMsg => { + return { + remove_rate: ({ + action + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class RatesContractTsQueryMsgBuilder { + static rate = ({ + action + }: CamelCasedProperties["rate"]>): QueryMsg => { + return { + rate: ({ + action + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/rates/2.0.1/RatesContractTs.types.ts b/packages/adocodegen/src/rates/2.0.1/RatesContractTs.types.ts new file mode 100644 index 0000000..4baa65e --- /dev/null +++ b/packages/adocodegen/src/rates/2.0.1/RatesContractTs.types.ts @@ -0,0 +1,237 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type LocalRateType = "additive" | "deductive"; +export type AndrAddr = string; +export type Binary = string; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export type Uint128 = string; +export interface InstantiateMsg { + action: string; + kernel_address: string; + owner?: string | null; + rate: LocalRate; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type ExecuteMsg = { + set_rate: { + action: string; + rate: LocalRate; + }; +} | { + remove_rate: { + action: string; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + rate: { + action: string; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface RateResponse { + rate: LocalRate; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type RatesContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/set-amount-splitter/1.0.1-beta.1/SetAmountSplitterContractTs.client.ts b/packages/adocodegen/src/set-amount-splitter/1.0.1-beta.1/SetAmountSplitterContractTs.client.ts new file mode 100644 index 0000000..779a2bd --- /dev/null +++ b/packages/adocodegen/src/set-amount-splitter/1.0.1-beta.1/SetAmountSplitterContractTs.client.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SetAmountSplitterContractTs.types"; +export interface SetAmountSplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class SetAmountSplitterContractTsQueryClient implements SetAmountSplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface SetAmountSplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class SetAmountSplitterContractTsClient implements SetAmountSplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/set-amount-splitter/1.0.1-beta.1/SetAmountSplitterContractTs.message-builder.ts b/packages/adocodegen/src/set-amount-splitter/1.0.1-beta.1/SetAmountSplitterContractTs.message-builder.ts new file mode 100644 index 0000000..c7f4da2 --- /dev/null +++ b/packages/adocodegen/src/set-amount-splitter/1.0.1-beta.1/SetAmountSplitterContractTs.message-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SetAmountSplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class SetAmountSplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class SetAmountSplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/set-amount-splitter/1.0.1-beta.1/SetAmountSplitterContractTs.types.ts b/packages/adocodegen/src/set-amount-splitter/1.0.1-beta.1/SetAmountSplitterContractTs.types.ts new file mode 100644 index 0000000..8d4ebba --- /dev/null +++ b/packages/adocodegen/src/set-amount-splitter/1.0.1-beta.1/SetAmountSplitterContractTs.types.ts @@ -0,0 +1,202 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: Expiry | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: Milliseconds; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Milliseconds; + recipients: AddressPercent[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type SetAmountSplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/set-amount-splitter/1.0.1/SetAmountSplitterContractTs.client.ts b/packages/adocodegen/src/set-amount-splitter/1.0.1/SetAmountSplitterContractTs.client.ts new file mode 100644 index 0000000..779a2bd --- /dev/null +++ b/packages/adocodegen/src/set-amount-splitter/1.0.1/SetAmountSplitterContractTs.client.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SetAmountSplitterContractTs.types"; +export interface SetAmountSplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class SetAmountSplitterContractTsQueryClient implements SetAmountSplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface SetAmountSplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class SetAmountSplitterContractTsClient implements SetAmountSplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/set-amount-splitter/1.0.1/SetAmountSplitterContractTs.message-builder.ts b/packages/adocodegen/src/set-amount-splitter/1.0.1/SetAmountSplitterContractTs.message-builder.ts new file mode 100644 index 0000000..c7f4da2 --- /dev/null +++ b/packages/adocodegen/src/set-amount-splitter/1.0.1/SetAmountSplitterContractTs.message-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SetAmountSplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class SetAmountSplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class SetAmountSplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/set-amount-splitter/1.0.1/SetAmountSplitterContractTs.types.ts b/packages/adocodegen/src/set-amount-splitter/1.0.1/SetAmountSplitterContractTs.types.ts new file mode 100644 index 0000000..8d4ebba --- /dev/null +++ b/packages/adocodegen/src/set-amount-splitter/1.0.1/SetAmountSplitterContractTs.types.ts @@ -0,0 +1,202 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: Expiry | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: Milliseconds; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Milliseconds; + recipients: AddressPercent[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type SetAmountSplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/shunting/0.2.0/ShuntingContractTs.client.ts b/packages/adocodegen/src/shunting/0.2.0/ShuntingContractTs.client.ts new file mode 100644 index 0000000..776da5e --- /dev/null +++ b/packages/adocodegen/src/shunting/0.2.0/ShuntingContractTs.client.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, EvaluateParam, EvaluateRefParam, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ShuntingResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./ShuntingContractTs.types"; +export interface ShuntingContractTsReadOnlyInterface { + contractAddress: string; + evaluate: ({ + params + }: { + params: EvaluateParam[]; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class ShuntingContractTsQueryClient implements ShuntingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.evaluate = this.evaluate.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + evaluate = async ({ + params + }: { + params: EvaluateParam[]; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + evaluate: { + params + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface ShuntingContractTsInterface { + contractAddress: string; + sender: string; + updateExpressions: ({ + expressions + }: { + expressions: string[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class ShuntingContractTsClient implements ShuntingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateExpressions = this.updateExpressions.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + updateExpressions = async ({ + expressions + }: { + expressions: string[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_expressions: { + expressions + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/shunting/0.2.0/ShuntingContractTs.message-builder.ts b/packages/adocodegen/src/shunting/0.2.0/ShuntingContractTs.message-builder.ts new file mode 100644 index 0000000..cebc892 --- /dev/null +++ b/packages/adocodegen/src/shunting/0.2.0/ShuntingContractTs.message-builder.ts @@ -0,0 +1,165 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, EvaluateParam, EvaluateRefParam, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ShuntingResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./ShuntingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class ShuntingContractTsExecuteMsgBuilder { + static updateExpressions = ({ + expressions + }: CamelCasedProperties["update_expressions"]>): ExecuteMsg => { + return { + update_expressions: ({ + expressions + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class ShuntingContractTsQueryMsgBuilder { + static evaluate = ({ + params + }: CamelCasedProperties["evaluate"]>): QueryMsg => { + return { + evaluate: ({ + params + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/shunting/0.2.0/ShuntingContractTs.types.ts b/packages/adocodegen/src/shunting/0.2.0/ShuntingContractTs.types.ts new file mode 100644 index 0000000..5583e1b --- /dev/null +++ b/packages/adocodegen/src/shunting/0.2.0/ShuntingContractTs.types.ts @@ -0,0 +1,241 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + expressions: string[]; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + update_expressions: { + expressions: string[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + evaluate: { + params: EvaluateParam[]; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type EvaluateParam = { + value: string; +} | { + reference: EvaluateRefParam; +}; +export interface EvaluateRefParam { + accessor: string; + contract: Addr; + msg: string; +} +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ShuntingResponse { + result: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type ShuntingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/shunting/0.2.1-beta.1/ShuntingContractTs.client.ts b/packages/adocodegen/src/shunting/0.2.1-beta.1/ShuntingContractTs.client.ts new file mode 100644 index 0000000..776da5e --- /dev/null +++ b/packages/adocodegen/src/shunting/0.2.1-beta.1/ShuntingContractTs.client.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, EvaluateParam, EvaluateRefParam, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ShuntingResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./ShuntingContractTs.types"; +export interface ShuntingContractTsReadOnlyInterface { + contractAddress: string; + evaluate: ({ + params + }: { + params: EvaluateParam[]; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class ShuntingContractTsQueryClient implements ShuntingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.evaluate = this.evaluate.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + evaluate = async ({ + params + }: { + params: EvaluateParam[]; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + evaluate: { + params + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface ShuntingContractTsInterface { + contractAddress: string; + sender: string; + updateExpressions: ({ + expressions + }: { + expressions: string[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class ShuntingContractTsClient implements ShuntingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateExpressions = this.updateExpressions.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + updateExpressions = async ({ + expressions + }: { + expressions: string[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_expressions: { + expressions + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/shunting/0.2.1-beta.1/ShuntingContractTs.message-builder.ts b/packages/adocodegen/src/shunting/0.2.1-beta.1/ShuntingContractTs.message-builder.ts new file mode 100644 index 0000000..cebc892 --- /dev/null +++ b/packages/adocodegen/src/shunting/0.2.1-beta.1/ShuntingContractTs.message-builder.ts @@ -0,0 +1,165 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, EvaluateParam, EvaluateRefParam, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ShuntingResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./ShuntingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class ShuntingContractTsExecuteMsgBuilder { + static updateExpressions = ({ + expressions + }: CamelCasedProperties["update_expressions"]>): ExecuteMsg => { + return { + update_expressions: ({ + expressions + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class ShuntingContractTsQueryMsgBuilder { + static evaluate = ({ + params + }: CamelCasedProperties["evaluate"]>): QueryMsg => { + return { + evaluate: ({ + params + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/shunting/0.2.1-beta.1/ShuntingContractTs.types.ts b/packages/adocodegen/src/shunting/0.2.1-beta.1/ShuntingContractTs.types.ts new file mode 100644 index 0000000..40685fa --- /dev/null +++ b/packages/adocodegen/src/shunting/0.2.1-beta.1/ShuntingContractTs.types.ts @@ -0,0 +1,241 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + expressions: string[]; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + update_expressions: { + expressions: string[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + evaluate: { + params: EvaluateParam[]; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type EvaluateParam = { + value: string; +} | { + reference: EvaluateRefParam; +}; +export interface EvaluateRefParam { + accessor: string; + contract: Addr; + msg: string; +} +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ShuntingResponse { + result: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type ShuntingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/shunting/0.2.1/ShuntingContractTs.client.ts b/packages/adocodegen/src/shunting/0.2.1/ShuntingContractTs.client.ts new file mode 100644 index 0000000..776da5e --- /dev/null +++ b/packages/adocodegen/src/shunting/0.2.1/ShuntingContractTs.client.ts @@ -0,0 +1,270 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, EvaluateParam, EvaluateRefParam, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ShuntingResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./ShuntingContractTs.types"; +export interface ShuntingContractTsReadOnlyInterface { + contractAddress: string; + evaluate: ({ + params + }: { + params: EvaluateParam[]; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class ShuntingContractTsQueryClient implements ShuntingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.evaluate = this.evaluate.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + evaluate = async ({ + params + }: { + params: EvaluateParam[]; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + evaluate: { + params + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface ShuntingContractTsInterface { + contractAddress: string; + sender: string; + updateExpressions: ({ + expressions + }: { + expressions: string[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class ShuntingContractTsClient implements ShuntingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateExpressions = this.updateExpressions.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + updateExpressions = async ({ + expressions + }: { + expressions: string[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_expressions: { + expressions + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/shunting/0.2.1/ShuntingContractTs.message-builder.ts b/packages/adocodegen/src/shunting/0.2.1/ShuntingContractTs.message-builder.ts new file mode 100644 index 0000000..cebc892 --- /dev/null +++ b/packages/adocodegen/src/shunting/0.2.1/ShuntingContractTs.message-builder.ts @@ -0,0 +1,165 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, EvaluateParam, EvaluateRefParam, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, ShuntingResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./ShuntingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class ShuntingContractTsExecuteMsgBuilder { + static updateExpressions = ({ + expressions + }: CamelCasedProperties["update_expressions"]>): ExecuteMsg => { + return { + update_expressions: ({ + expressions + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class ShuntingContractTsQueryMsgBuilder { + static evaluate = ({ + params + }: CamelCasedProperties["evaluate"]>): QueryMsg => { + return { + evaluate: ({ + params + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/shunting/0.2.1/ShuntingContractTs.types.ts b/packages/adocodegen/src/shunting/0.2.1/ShuntingContractTs.types.ts new file mode 100644 index 0000000..40685fa --- /dev/null +++ b/packages/adocodegen/src/shunting/0.2.1/ShuntingContractTs.types.ts @@ -0,0 +1,241 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + expressions: string[]; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + update_expressions: { + expressions: string[]; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + evaluate: { + params: EvaluateParam[]; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export type EvaluateParam = { + value: string; +} | { + reference: EvaluateRefParam; +}; +export interface EvaluateRefParam { + accessor: string; + contract: Addr; + msg: string; +} +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface ShuntingResponse { + result: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type ShuntingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/0.2.16/SplitterContractTs.client.ts b/packages/adocodegen/src/splitter/0.2.16/SplitterContractTs.client.ts new file mode 100644 index 0000000..d8e6110 --- /dev/null +++ b/packages/adocodegen/src/splitter/0.2.16/SplitterContractTs.client.ts @@ -0,0 +1,273 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SplitterContractTs.types"; +export interface SplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class SplitterContractTsQueryClient implements SplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface SplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class SplitterContractTsClient implements SplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/0.2.16/SplitterContractTs.message-builder.ts b/packages/adocodegen/src/splitter/0.2.16/SplitterContractTs.message-builder.ts new file mode 100644 index 0000000..1c80583 --- /dev/null +++ b/packages/adocodegen/src/splitter/0.2.16/SplitterContractTs.message-builder.ts @@ -0,0 +1,166 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class SplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class SplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/0.2.16/SplitterContractTs.types.ts b/packages/adocodegen/src/splitter/0.2.16/SplitterContractTs.types.ts new file mode 100644 index 0000000..d4a527b --- /dev/null +++ b/packages/adocodegen/src/splitter/0.2.16/SplitterContractTs.types.ts @@ -0,0 +1,208 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressPercent[]; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type SplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/0.2.3/SplitterContractTs.client.ts b/packages/adocodegen/src/splitter/0.2.3/SplitterContractTs.client.ts new file mode 100644 index 0000000..4627dc8 --- /dev/null +++ b/packages/adocodegen/src/splitter/0.2.3/SplitterContractTs.client.ts @@ -0,0 +1,332 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SplitterContractTs.types"; +export interface SplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class SplitterContractTsQueryClient implements SplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface SplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class SplitterContractTsClient implements SplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/0.2.3/SplitterContractTs.message-builder.ts b/packages/adocodegen/src/splitter/0.2.3/SplitterContractTs.message-builder.ts new file mode 100644 index 0000000..7e11c16 --- /dev/null +++ b/packages/adocodegen/src/splitter/0.2.3/SplitterContractTs.message-builder.ts @@ -0,0 +1,200 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class SplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class SplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/0.2.3/SplitterContractTs.types.ts b/packages/adocodegen/src/splitter/0.2.3/SplitterContractTs.types.ts new file mode 100644 index 0000000..7bfeff2 --- /dev/null +++ b/packages/adocodegen/src/splitter/0.2.3/SplitterContractTs.types.ts @@ -0,0 +1,201 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressPercent[]; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type SplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/2.0.0/SplitterContractTs.client.ts b/packages/adocodegen/src/splitter/2.0.0/SplitterContractTs.client.ts new file mode 100644 index 0000000..b86edb3 --- /dev/null +++ b/packages/adocodegen/src/splitter/2.0.0/SplitterContractTs.client.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SplitterContractTs.types"; +export interface SplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class SplitterContractTsQueryClient implements SplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface SplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class SplitterContractTsClient implements SplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/2.0.0/SplitterContractTs.message-builder.ts b/packages/adocodegen/src/splitter/2.0.0/SplitterContractTs.message-builder.ts new file mode 100644 index 0000000..55efd1b --- /dev/null +++ b/packages/adocodegen/src/splitter/2.0.0/SplitterContractTs.message-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class SplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class SplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/2.0.0/SplitterContractTs.types.ts b/packages/adocodegen/src/splitter/2.0.0/SplitterContractTs.types.ts new file mode 100644 index 0000000..18ad218 --- /dev/null +++ b/packages/adocodegen/src/splitter/2.0.0/SplitterContractTs.types.ts @@ -0,0 +1,202 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: Expiry | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: Milliseconds; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Milliseconds; + recipients: AddressPercent[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type SplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/2.1.1-beta.1/SplitterContractTs.client.ts b/packages/adocodegen/src/splitter/2.1.1-beta.1/SplitterContractTs.client.ts new file mode 100644 index 0000000..b86edb3 --- /dev/null +++ b/packages/adocodegen/src/splitter/2.1.1-beta.1/SplitterContractTs.client.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SplitterContractTs.types"; +export interface SplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class SplitterContractTsQueryClient implements SplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface SplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class SplitterContractTsClient implements SplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/2.1.1-beta.1/SplitterContractTs.message-builder.ts b/packages/adocodegen/src/splitter/2.1.1-beta.1/SplitterContractTs.message-builder.ts new file mode 100644 index 0000000..55efd1b --- /dev/null +++ b/packages/adocodegen/src/splitter/2.1.1-beta.1/SplitterContractTs.message-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class SplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class SplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/2.1.1-beta.1/SplitterContractTs.types.ts b/packages/adocodegen/src/splitter/2.1.1-beta.1/SplitterContractTs.types.ts new file mode 100644 index 0000000..de48f86 --- /dev/null +++ b/packages/adocodegen/src/splitter/2.1.1-beta.1/SplitterContractTs.types.ts @@ -0,0 +1,202 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: Expiry | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: Milliseconds; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Milliseconds; + recipients: AddressPercent[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type SplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/2.1.1/SplitterContractTs.client.ts b/packages/adocodegen/src/splitter/2.1.1/SplitterContractTs.client.ts new file mode 100644 index 0000000..b86edb3 --- /dev/null +++ b/packages/adocodegen/src/splitter/2.1.1/SplitterContractTs.client.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SplitterContractTs.types"; +export interface SplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class SplitterContractTsQueryClient implements SplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface SplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class SplitterContractTsClient implements SplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressPercent[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: Milliseconds; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/2.1.1/SplitterContractTs.message-builder.ts b/packages/adocodegen/src/splitter/2.1.1/SplitterContractTs.message-builder.ts new file mode 100644 index 0000000..55efd1b --- /dev/null +++ b/packages/adocodegen/src/splitter/2.1.1/SplitterContractTs.message-builder.ts @@ -0,0 +1,154 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Expiry, Milliseconds, Decimal, AndrAddr, Binary, InstantiateMsg, AddressPercent, Recipient, ExecuteMsg, ReplyOn, Uint128, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./SplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class SplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class SplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/splitter/2.1.1/SplitterContractTs.types.ts b/packages/adocodegen/src/splitter/2.1.1/SplitterContractTs.types.ts new file mode 100644 index 0000000..de48f86 --- /dev/null +++ b/packages/adocodegen/src/splitter/2.1.1/SplitterContractTs.types.ts @@ -0,0 +1,202 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Decimal = string; +export type AndrAddr = string; +export type Binary = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: Expiry | null; + owner?: string | null; + recipients: AddressPercent[]; +} +export interface AddressPercent { + percent: Decimal; + recipient: Recipient; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressPercent[]; + }; +} | { + update_lock: { + lock_time: Milliseconds; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Milliseconds; + recipients: AddressPercent[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type SplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/string-storage/1.0.1-beta.1/StringStorageContractTs.client.ts b/packages/adocodegen/src/string-storage/1.0.1-beta.1/StringStorageContractTs.client.ts new file mode 100644 index 0000000..454c77e --- /dev/null +++ b/packages/adocodegen/src/string-storage/1.0.1-beta.1/StringStorageContractTs.client.ts @@ -0,0 +1,291 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { StringStorageRestriction, InstantiateMsg, ExecuteMsg, StringStorage, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDataOwnerResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./StringStorageContractTs.types"; +export interface StringStorageContractTsReadOnlyInterface { + contractAddress: string; + getValue: () => Promise; + getDataOwner: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class StringStorageContractTsQueryClient implements StringStorageContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getValue = this.getValue.bind(this); + this.getDataOwner = this.getDataOwner.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getValue = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_value: {} + }); + }; + getDataOwner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_data_owner: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface StringStorageContractTsInterface { + contractAddress: string; + sender: string; + setValue: ({ + value + }: { + value: StringStorage; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deleteValue: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: StringStorageRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class StringStorageContractTsClient implements StringStorageContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setValue = this.setValue.bind(this); + this.deleteValue = this.deleteValue.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setValue = async ({ + value + }: { + value: StringStorage; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_value: { + value + } + }, fee, memo, _funds); + }; + deleteValue = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delete_value: {} + }, fee, memo, _funds); + }; + updateRestriction = async ({ + restriction + }: { + restriction: StringStorageRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/string-storage/1.0.1-beta.1/StringStorageContractTs.message-builder.ts b/packages/adocodegen/src/string-storage/1.0.1-beta.1/StringStorageContractTs.message-builder.ts new file mode 100644 index 0000000..3dbdebe --- /dev/null +++ b/packages/adocodegen/src/string-storage/1.0.1-beta.1/StringStorageContractTs.message-builder.ts @@ -0,0 +1,180 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { StringStorageRestriction, InstantiateMsg, ExecuteMsg, StringStorage, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDataOwnerResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./StringStorageContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class StringStorageContractTsExecuteMsgBuilder { + static setValue = ({ + value + }: CamelCasedProperties["set_value"]>): ExecuteMsg => { + return { + set_value: ({ + value + } as const) + }; + }; + static deleteValue = (): ExecuteMsg => { + return { + delete_value: ({} as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class StringStorageContractTsQueryMsgBuilder { + static getValue = (): QueryMsg => { + return { + get_value: ({} as const) + }; + }; + static getDataOwner = (): QueryMsg => { + return { + get_data_owner: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/string-storage/1.0.1-beta.1/StringStorageContractTs.types.ts b/packages/adocodegen/src/string-storage/1.0.1-beta.1/StringStorageContractTs.types.ts new file mode 100644 index 0000000..e5962e1 --- /dev/null +++ b/packages/adocodegen/src/string-storage/1.0.1-beta.1/StringStorageContractTs.types.ts @@ -0,0 +1,244 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type StringStorageRestriction = "private" | "public" | "restricted"; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + restriction: StringStorageRestriction; +} +export type ExecuteMsg = { + set_value: { + value: StringStorage; + }; +} | { + delete_value: {}; +} | { + update_restriction: { + restriction: StringStorageRestriction; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type StringStorage = { + string: string; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_value: {}; +} | { + get_data_owner: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetDataOwnerResponse { + owner: AndrAddr; +} +export interface GetValueResponse { + value: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type StringStorageContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/string-storage/1.0.1/StringStorageContractTs.client.ts b/packages/adocodegen/src/string-storage/1.0.1/StringStorageContractTs.client.ts new file mode 100644 index 0000000..454c77e --- /dev/null +++ b/packages/adocodegen/src/string-storage/1.0.1/StringStorageContractTs.client.ts @@ -0,0 +1,291 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { StringStorageRestriction, InstantiateMsg, ExecuteMsg, StringStorage, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDataOwnerResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./StringStorageContractTs.types"; +export interface StringStorageContractTsReadOnlyInterface { + contractAddress: string; + getValue: () => Promise; + getDataOwner: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class StringStorageContractTsQueryClient implements StringStorageContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getValue = this.getValue.bind(this); + this.getDataOwner = this.getDataOwner.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getValue = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_value: {} + }); + }; + getDataOwner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_data_owner: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface StringStorageContractTsInterface { + contractAddress: string; + sender: string; + setValue: ({ + value + }: { + value: StringStorage; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deleteValue: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRestriction: ({ + restriction + }: { + restriction: StringStorageRestriction; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class StringStorageContractTsClient implements StringStorageContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.setValue = this.setValue.bind(this); + this.deleteValue = this.deleteValue.bind(this); + this.updateRestriction = this.updateRestriction.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + setValue = async ({ + value + }: { + value: StringStorage; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_value: { + value + } + }, fee, memo, _funds); + }; + deleteValue = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delete_value: {} + }, fee, memo, _funds); + }; + updateRestriction = async ({ + restriction + }: { + restriction: StringStorageRestriction; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_restriction: { + restriction + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/string-storage/1.0.1/StringStorageContractTs.message-builder.ts b/packages/adocodegen/src/string-storage/1.0.1/StringStorageContractTs.message-builder.ts new file mode 100644 index 0000000..3dbdebe --- /dev/null +++ b/packages/adocodegen/src/string-storage/1.0.1/StringStorageContractTs.message-builder.ts @@ -0,0 +1,180 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { StringStorageRestriction, InstantiateMsg, ExecuteMsg, StringStorage, AndrAddr, ReplyOn, Uint128, Binary, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetDataOwnerResponse, GetValueResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./StringStorageContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class StringStorageContractTsExecuteMsgBuilder { + static setValue = ({ + value + }: CamelCasedProperties["set_value"]>): ExecuteMsg => { + return { + set_value: ({ + value + } as const) + }; + }; + static deleteValue = (): ExecuteMsg => { + return { + delete_value: ({} as const) + }; + }; + static updateRestriction = ({ + restriction + }: CamelCasedProperties["update_restriction"]>): ExecuteMsg => { + return { + update_restriction: ({ + restriction + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class StringStorageContractTsQueryMsgBuilder { + static getValue = (): QueryMsg => { + return { + get_value: ({} as const) + }; + }; + static getDataOwner = (): QueryMsg => { + return { + get_data_owner: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/string-storage/1.0.1/StringStorageContractTs.types.ts b/packages/adocodegen/src/string-storage/1.0.1/StringStorageContractTs.types.ts new file mode 100644 index 0000000..e5962e1 --- /dev/null +++ b/packages/adocodegen/src/string-storage/1.0.1/StringStorageContractTs.types.ts @@ -0,0 +1,244 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type StringStorageRestriction = "private" | "public" | "restricted"; +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; + restriction: StringStorageRestriction; +} +export type ExecuteMsg = { + set_value: { + value: StringStorage; + }; +} | { + delete_value: {}; +} | { + update_restriction: { + restriction: StringStorageRestriction; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type StringStorage = { + string: string; +}; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Uint128 = string; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_value: {}; +} | { + get_data_owner: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetDataOwnerResponse { + owner: AndrAddr; +} +export interface GetValueResponse { + value: string; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type StringStorageContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/0.2.1/TimelockContractTs.client.ts b/packages/adocodegen/src/timelock/0.2.1/TimelockContractTs.client.ts new file mode 100644 index 0000000..dca3321 --- /dev/null +++ b/packages/adocodegen/src/timelock/0.2.1/TimelockContractTs.client.ts @@ -0,0 +1,404 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, EscrowCondition, Expiration, Timestamp, Uint64, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, Permission, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, BalanceResponse, BlockHeightResponse, GetLockedFundsResponse, Escrow, GetLockedFundsForRecipientResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./TimelockContractTs.types"; +export interface TimelockContractTsReadOnlyInterface { + contractAddress: string; + getLockedFunds: ({ + owner, + recipient + }: { + owner: string; + recipient: string; + }) => Promise; + getLockedFundsForRecipient: ({ + limit, + recipient, + startAfter + }: { + limit?: number; + recipient: string; + startAfter?: string; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class TimelockContractTsQueryClient implements TimelockContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getLockedFunds = this.getLockedFunds.bind(this); + this.getLockedFundsForRecipient = this.getLockedFundsForRecipient.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getLockedFunds = async ({ + owner, + recipient + }: { + owner: string; + recipient: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_locked_funds: { + owner, + recipient + } + }); + }; + getLockedFundsForRecipient = async ({ + limit, + recipient, + startAfter + }: { + limit?: number; + recipient: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_locked_funds_for_recipient: { + limit, + recipient, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface TimelockContractTsInterface { + contractAddress: string; + sender: string; + holdFunds: ({ + condition, + recipient + }: { + condition?: EscrowCondition; + recipient?: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + releaseFunds: ({ + limit, + recipientAddr, + startAfter + }: { + limit?: number; + recipientAddr?: string; + startAfter?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + releaseSpecificFunds: ({ + owner, + recipientAddr + }: { + owner: string; + recipientAddr?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class TimelockContractTsClient implements TimelockContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.holdFunds = this.holdFunds.bind(this); + this.releaseFunds = this.releaseFunds.bind(this); + this.releaseSpecificFunds = this.releaseSpecificFunds.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + holdFunds = async ({ + condition, + recipient + }: { + condition?: EscrowCondition; + recipient?: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + hold_funds: { + condition, + recipient + } + }, fee, memo, _funds); + }; + releaseFunds = async ({ + limit, + recipientAddr, + startAfter + }: { + limit?: number; + recipientAddr?: string; + startAfter?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release_funds: { + limit, + recipient_addr: recipientAddr, + start_after: startAfter + } + }, fee, memo, _funds); + }; + releaseSpecificFunds = async ({ + owner, + recipientAddr + }: { + owner: string; + recipientAddr?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release_specific_funds: { + owner, + recipient_addr: recipientAddr + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/0.2.1/TimelockContractTs.message-builder.ts b/packages/adocodegen/src/timelock/0.2.1/TimelockContractTs.message-builder.ts new file mode 100644 index 0000000..fceb8a4 --- /dev/null +++ b/packages/adocodegen/src/timelock/0.2.1/TimelockContractTs.message-builder.ts @@ -0,0 +1,237 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, EscrowCondition, Expiration, Timestamp, Uint64, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, Permission, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, BalanceResponse, BlockHeightResponse, GetLockedFundsResponse, Escrow, GetLockedFundsForRecipientResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./TimelockContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class TimelockContractTsExecuteMsgBuilder { + static holdFunds = ({ + condition, + recipient + }: CamelCasedProperties["hold_funds"]>): ExecuteMsg => { + return { + hold_funds: ({ + condition, + recipient + } as const) + }; + }; + static releaseFunds = ({ + limit, + recipientAddr, + startAfter + }: CamelCasedProperties["release_funds"]>): ExecuteMsg => { + return { + release_funds: ({ + limit, + recipient_addr: recipientAddr, + start_after: startAfter + } as const) + }; + }; + static releaseSpecificFunds = ({ + owner, + recipientAddr + }: CamelCasedProperties["release_specific_funds"]>): ExecuteMsg => { + return { + release_specific_funds: ({ + owner, + recipient_addr: recipientAddr + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class TimelockContractTsQueryMsgBuilder { + static getLockedFunds = ({ + owner, + recipient + }: CamelCasedProperties["get_locked_funds"]>): QueryMsg => { + return { + get_locked_funds: ({ + owner, + recipient + } as const) + }; + }; + static getLockedFundsForRecipient = ({ + limit, + recipient, + startAfter + }: CamelCasedProperties["get_locked_funds_for_recipient"]>): QueryMsg => { + return { + get_locked_funds_for_recipient: ({ + limit, + recipient, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/0.2.1/TimelockContractTs.types.ts b/packages/adocodegen/src/timelock/0.2.1/TimelockContractTs.types.ts new file mode 100644 index 0000000..47dc4ca --- /dev/null +++ b/packages/adocodegen/src/timelock/0.2.1/TimelockContractTs.types.ts @@ -0,0 +1,225 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + hold_funds: { + condition?: EscrowCondition | null; + recipient?: Recipient | null; + }; +} | { + release_funds: { + limit?: number | null; + recipient_addr?: string | null; + start_after?: string | null; + }; +} | { + release_specific_funds: { + owner: string; + recipient_addr?: string | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type EscrowCondition = { + expiration: Expiration; +} | { + minimum_funds: Coin[]; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + get_locked_funds: { + owner: string; + recipient: string; + }; +} | { + get_locked_funds_for_recipient: { + limit?: number | null; + recipient: string; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetLockedFundsResponse { + funds?: Escrow | null; +} +export interface Escrow { + coins: Coin[]; + condition?: EscrowCondition | null; + recipient: Recipient; + recipient_addr: string; +} +export interface GetLockedFundsForRecipientResponse { + funds: Escrow[]; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type TimelockContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/0.2.16/TimelockContractTs.client.ts b/packages/adocodegen/src/timelock/0.2.16/TimelockContractTs.client.ts new file mode 100644 index 0000000..9b09798 --- /dev/null +++ b/packages/adocodegen/src/timelock/0.2.16/TimelockContractTs.client.ts @@ -0,0 +1,345 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, EscrowCondition, Expiration, Timestamp, Uint64, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, BalanceResponse, BlockHeightResponse, GetLockedFundsResponse, Escrow, GetLockedFundsForRecipientResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./TimelockContractTs.types"; +export interface TimelockContractTsReadOnlyInterface { + contractAddress: string; + getLockedFunds: ({ + owner, + recipient + }: { + owner: string; + recipient: string; + }) => Promise; + getLockedFundsForRecipient: ({ + limit, + recipient, + startAfter + }: { + limit?: number; + recipient: string; + startAfter?: string; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class TimelockContractTsQueryClient implements TimelockContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getLockedFunds = this.getLockedFunds.bind(this); + this.getLockedFundsForRecipient = this.getLockedFundsForRecipient.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getLockedFunds = async ({ + owner, + recipient + }: { + owner: string; + recipient: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_locked_funds: { + owner, + recipient + } + }); + }; + getLockedFundsForRecipient = async ({ + limit, + recipient, + startAfter + }: { + limit?: number; + recipient: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_locked_funds_for_recipient: { + limit, + recipient, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface TimelockContractTsInterface { + contractAddress: string; + sender: string; + holdFunds: ({ + condition, + recipient + }: { + condition?: EscrowCondition; + recipient?: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + releaseFunds: ({ + limit, + recipientAddr, + startAfter + }: { + limit?: number; + recipientAddr?: string; + startAfter?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + releaseSpecificFunds: ({ + owner, + recipientAddr + }: { + owner: string; + recipientAddr?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class TimelockContractTsClient implements TimelockContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.holdFunds = this.holdFunds.bind(this); + this.releaseFunds = this.releaseFunds.bind(this); + this.releaseSpecificFunds = this.releaseSpecificFunds.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + holdFunds = async ({ + condition, + recipient + }: { + condition?: EscrowCondition; + recipient?: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + hold_funds: { + condition, + recipient + } + }, fee, memo, _funds); + }; + releaseFunds = async ({ + limit, + recipientAddr, + startAfter + }: { + limit?: number; + recipientAddr?: string; + startAfter?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release_funds: { + limit, + recipient_addr: recipientAddr, + start_after: startAfter + } + }, fee, memo, _funds); + }; + releaseSpecificFunds = async ({ + owner, + recipientAddr + }: { + owner: string; + recipientAddr?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release_specific_funds: { + owner, + recipient_addr: recipientAddr + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/0.2.16/TimelockContractTs.message-builder.ts b/packages/adocodegen/src/timelock/0.2.16/TimelockContractTs.message-builder.ts new file mode 100644 index 0000000..91c32a2 --- /dev/null +++ b/packages/adocodegen/src/timelock/0.2.16/TimelockContractTs.message-builder.ts @@ -0,0 +1,203 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, InstantiateMsg, Module, ExecuteMsg, EscrowCondition, Expiration, Timestamp, Uint64, Uint128, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, QueryMsg, BalanceResponse, BlockHeightResponse, GetLockedFundsResponse, Escrow, GetLockedFundsForRecipientResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./TimelockContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class TimelockContractTsExecuteMsgBuilder { + static holdFunds = ({ + condition, + recipient + }: CamelCasedProperties["hold_funds"]>): ExecuteMsg => { + return { + hold_funds: ({ + condition, + recipient + } as const) + }; + }; + static releaseFunds = ({ + limit, + recipientAddr, + startAfter + }: CamelCasedProperties["release_funds"]>): ExecuteMsg => { + return { + release_funds: ({ + limit, + recipient_addr: recipientAddr, + start_after: startAfter + } as const) + }; + }; + static releaseSpecificFunds = ({ + owner, + recipientAddr + }: CamelCasedProperties["release_specific_funds"]>): ExecuteMsg => { + return { + release_specific_funds: ({ + owner, + recipient_addr: recipientAddr + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class TimelockContractTsQueryMsgBuilder { + static getLockedFunds = ({ + owner, + recipient + }: CamelCasedProperties["get_locked_funds"]>): QueryMsg => { + return { + get_locked_funds: ({ + owner, + recipient + } as const) + }; + }; + static getLockedFundsForRecipient = ({ + limit, + recipient, + startAfter + }: CamelCasedProperties["get_locked_funds_for_recipient"]>): QueryMsg => { + return { + get_locked_funds_for_recipient: ({ + limit, + recipient, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/0.2.16/TimelockContractTs.types.ts b/packages/adocodegen/src/timelock/0.2.16/TimelockContractTs.types.ts new file mode 100644 index 0000000..4873704 --- /dev/null +++ b/packages/adocodegen/src/timelock/0.2.16/TimelockContractTs.types.ts @@ -0,0 +1,232 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export interface InstantiateMsg { + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export type ExecuteMsg = { + hold_funds: { + condition?: EscrowCondition | null; + recipient?: Recipient | null; + }; +} | { + release_funds: { + limit?: number | null; + recipient_addr?: string | null; + start_after?: string | null; + }; +} | { + release_specific_funds: { + owner: string; + recipient_addr?: string | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type EscrowCondition = { + expiration: Expiration; +} | { + minimum_funds: Coin[]; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Uint128 = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export type QueryMsg = { + get_locked_funds: { + owner: string; + recipient: string; + }; +} | { + get_locked_funds_for_recipient: { + limit?: number | null; + recipient: string; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetLockedFundsResponse { + funds?: Escrow | null; +} +export interface Escrow { + coins: Coin[]; + condition?: EscrowCondition | null; + recipient: Recipient; + recipient_addr: string; +} +export interface GetLockedFundsForRecipientResponse { + funds: Escrow[]; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type TimelockContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/2.0.0/TimelockContractTs.client.ts b/packages/adocodegen/src/timelock/2.0.0/TimelockContractTs.client.ts new file mode 100644 index 0000000..f27e32b --- /dev/null +++ b/packages/adocodegen/src/timelock/2.0.0/TimelockContractTs.client.ts @@ -0,0 +1,356 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, EscrowCondition, Milliseconds, Uint128, AndrAddr, Binary, ReplyOn, OwnershipMessage, Expiry, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetLockedFundsResponse, Escrow, GetLockedFundsForRecipientResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./TimelockContractTs.types"; +export interface TimelockContractTsReadOnlyInterface { + contractAddress: string; + getLockedFunds: ({ + owner, + recipient + }: { + owner: string; + recipient: string; + }) => Promise; + getLockedFundsForRecipient: ({ + limit, + recipient, + startAfter + }: { + limit?: number; + recipient: string; + startAfter?: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class TimelockContractTsQueryClient implements TimelockContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getLockedFunds = this.getLockedFunds.bind(this); + this.getLockedFundsForRecipient = this.getLockedFundsForRecipient.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getLockedFunds = async ({ + owner, + recipient + }: { + owner: string; + recipient: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_locked_funds: { + owner, + recipient + } + }); + }; + getLockedFundsForRecipient = async ({ + limit, + recipient, + startAfter + }: { + limit?: number; + recipient: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_locked_funds_for_recipient: { + limit, + recipient, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface TimelockContractTsInterface { + contractAddress: string; + sender: string; + holdFunds: ({ + condition, + recipient + }: { + condition?: EscrowCondition; + recipient?: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + releaseFunds: ({ + limit, + recipientAddr, + startAfter + }: { + limit?: number; + recipientAddr?: string; + startAfter?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + releaseSpecificFunds: ({ + owner, + recipientAddr + }: { + owner: string; + recipientAddr?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class TimelockContractTsClient implements TimelockContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.holdFunds = this.holdFunds.bind(this); + this.releaseFunds = this.releaseFunds.bind(this); + this.releaseSpecificFunds = this.releaseSpecificFunds.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + holdFunds = async ({ + condition, + recipient + }: { + condition?: EscrowCondition; + recipient?: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + hold_funds: { + condition, + recipient + } + }, fee, memo, _funds); + }; + releaseFunds = async ({ + limit, + recipientAddr, + startAfter + }: { + limit?: number; + recipientAddr?: string; + startAfter?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release_funds: { + limit, + recipient_addr: recipientAddr, + start_after: startAfter + } + }, fee, memo, _funds); + }; + releaseSpecificFunds = async ({ + owner, + recipientAddr + }: { + owner: string; + recipientAddr?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release_specific_funds: { + owner, + recipient_addr: recipientAddr + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/2.0.0/TimelockContractTs.message-builder.ts b/packages/adocodegen/src/timelock/2.0.0/TimelockContractTs.message-builder.ts new file mode 100644 index 0000000..7cc5d19 --- /dev/null +++ b/packages/adocodegen/src/timelock/2.0.0/TimelockContractTs.message-builder.ts @@ -0,0 +1,212 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, EscrowCondition, Milliseconds, Uint128, AndrAddr, Binary, ReplyOn, OwnershipMessage, Expiry, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetLockedFundsResponse, Escrow, GetLockedFundsForRecipientResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./TimelockContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class TimelockContractTsExecuteMsgBuilder { + static holdFunds = ({ + condition, + recipient + }: CamelCasedProperties["hold_funds"]>): ExecuteMsg => { + return { + hold_funds: ({ + condition, + recipient + } as const) + }; + }; + static releaseFunds = ({ + limit, + recipientAddr, + startAfter + }: CamelCasedProperties["release_funds"]>): ExecuteMsg => { + return { + release_funds: ({ + limit, + recipient_addr: recipientAddr, + start_after: startAfter + } as const) + }; + }; + static releaseSpecificFunds = ({ + owner, + recipientAddr + }: CamelCasedProperties["release_specific_funds"]>): ExecuteMsg => { + return { + release_specific_funds: ({ + owner, + recipient_addr: recipientAddr + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class TimelockContractTsQueryMsgBuilder { + static getLockedFunds = ({ + owner, + recipient + }: CamelCasedProperties["get_locked_funds"]>): QueryMsg => { + return { + get_locked_funds: ({ + owner, + recipient + } as const) + }; + }; + static getLockedFundsForRecipient = ({ + limit, + recipient, + startAfter + }: CamelCasedProperties["get_locked_funds_for_recipient"]>): QueryMsg => { + return { + get_locked_funds_for_recipient: ({ + limit, + recipient, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/2.0.0/TimelockContractTs.types.ts b/packages/adocodegen/src/timelock/2.0.0/TimelockContractTs.types.ts new file mode 100644 index 0000000..b19a24b --- /dev/null +++ b/packages/adocodegen/src/timelock/2.0.0/TimelockContractTs.types.ts @@ -0,0 +1,263 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + hold_funds: { + condition?: EscrowCondition | null; + recipient?: Recipient | null; + }; +} | { + release_funds: { + limit?: number | null; + recipient_addr?: string | null; + start_after?: string | null; + }; +} | { + release_specific_funds: { + owner: string; + recipient_addr?: string | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type EscrowCondition = { + expiration: Milliseconds; +} | { + minimum_funds: Coin[]; +}; +export type Milliseconds = number; +export type Uint128 = string; +export type AndrAddr = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_locked_funds: { + owner: string; + recipient: string; + }; +} | { + get_locked_funds_for_recipient: { + limit?: number | null; + recipient: string; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetLockedFundsResponse { + funds?: Escrow | null; +} +export interface Escrow { + coins: Coin[]; + condition?: EscrowCondition | null; + recipient: Recipient; + recipient_addr: string; +} +export interface GetLockedFundsForRecipientResponse { + funds: Escrow[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type TimelockContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/2.0.2-beta.1/TimelockContractTs.client.ts b/packages/adocodegen/src/timelock/2.0.2-beta.1/TimelockContractTs.client.ts new file mode 100644 index 0000000..52a34e2 --- /dev/null +++ b/packages/adocodegen/src/timelock/2.0.2-beta.1/TimelockContractTs.client.ts @@ -0,0 +1,356 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, EscrowCondition, Expiry, Milliseconds, Uint128, AndrAddr, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetLockedFundsResponse, Escrow, GetLockedFundsForRecipientResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./TimelockContractTs.types"; +export interface TimelockContractTsReadOnlyInterface { + contractAddress: string; + getLockedFunds: ({ + owner, + recipient + }: { + owner: string; + recipient: string; + }) => Promise; + getLockedFundsForRecipient: ({ + limit, + recipient, + startAfter + }: { + limit?: number; + recipient: string; + startAfter?: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class TimelockContractTsQueryClient implements TimelockContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getLockedFunds = this.getLockedFunds.bind(this); + this.getLockedFundsForRecipient = this.getLockedFundsForRecipient.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getLockedFunds = async ({ + owner, + recipient + }: { + owner: string; + recipient: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_locked_funds: { + owner, + recipient + } + }); + }; + getLockedFundsForRecipient = async ({ + limit, + recipient, + startAfter + }: { + limit?: number; + recipient: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_locked_funds_for_recipient: { + limit, + recipient, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface TimelockContractTsInterface { + contractAddress: string; + sender: string; + holdFunds: ({ + condition, + recipient + }: { + condition?: EscrowCondition; + recipient?: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + releaseFunds: ({ + limit, + recipientAddr, + startAfter + }: { + limit?: number; + recipientAddr?: string; + startAfter?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + releaseSpecificFunds: ({ + owner, + recipientAddr + }: { + owner: string; + recipientAddr?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class TimelockContractTsClient implements TimelockContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.holdFunds = this.holdFunds.bind(this); + this.releaseFunds = this.releaseFunds.bind(this); + this.releaseSpecificFunds = this.releaseSpecificFunds.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + holdFunds = async ({ + condition, + recipient + }: { + condition?: EscrowCondition; + recipient?: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + hold_funds: { + condition, + recipient + } + }, fee, memo, _funds); + }; + releaseFunds = async ({ + limit, + recipientAddr, + startAfter + }: { + limit?: number; + recipientAddr?: string; + startAfter?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release_funds: { + limit, + recipient_addr: recipientAddr, + start_after: startAfter + } + }, fee, memo, _funds); + }; + releaseSpecificFunds = async ({ + owner, + recipientAddr + }: { + owner: string; + recipientAddr?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release_specific_funds: { + owner, + recipient_addr: recipientAddr + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/2.0.2-beta.1/TimelockContractTs.message-builder.ts b/packages/adocodegen/src/timelock/2.0.2-beta.1/TimelockContractTs.message-builder.ts new file mode 100644 index 0000000..2599fa4 --- /dev/null +++ b/packages/adocodegen/src/timelock/2.0.2-beta.1/TimelockContractTs.message-builder.ts @@ -0,0 +1,212 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, EscrowCondition, Expiry, Milliseconds, Uint128, AndrAddr, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetLockedFundsResponse, Escrow, GetLockedFundsForRecipientResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./TimelockContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class TimelockContractTsExecuteMsgBuilder { + static holdFunds = ({ + condition, + recipient + }: CamelCasedProperties["hold_funds"]>): ExecuteMsg => { + return { + hold_funds: ({ + condition, + recipient + } as const) + }; + }; + static releaseFunds = ({ + limit, + recipientAddr, + startAfter + }: CamelCasedProperties["release_funds"]>): ExecuteMsg => { + return { + release_funds: ({ + limit, + recipient_addr: recipientAddr, + start_after: startAfter + } as const) + }; + }; + static releaseSpecificFunds = ({ + owner, + recipientAddr + }: CamelCasedProperties["release_specific_funds"]>): ExecuteMsg => { + return { + release_specific_funds: ({ + owner, + recipient_addr: recipientAddr + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class TimelockContractTsQueryMsgBuilder { + static getLockedFunds = ({ + owner, + recipient + }: CamelCasedProperties["get_locked_funds"]>): QueryMsg => { + return { + get_locked_funds: ({ + owner, + recipient + } as const) + }; + }; + static getLockedFundsForRecipient = ({ + limit, + recipient, + startAfter + }: CamelCasedProperties["get_locked_funds_for_recipient"]>): QueryMsg => { + return { + get_locked_funds_for_recipient: ({ + limit, + recipient, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/2.0.2-beta.1/TimelockContractTs.types.ts b/packages/adocodegen/src/timelock/2.0.2-beta.1/TimelockContractTs.types.ts new file mode 100644 index 0000000..3a8e01b --- /dev/null +++ b/packages/adocodegen/src/timelock/2.0.2-beta.1/TimelockContractTs.types.ts @@ -0,0 +1,263 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + hold_funds: { + condition?: EscrowCondition | null; + recipient?: Recipient | null; + }; +} | { + release_funds: { + limit?: number | null; + recipient_addr?: string | null; + start_after?: string | null; + }; +} | { + release_specific_funds: { + owner: string; + recipient_addr?: string | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type EscrowCondition = { + expiration: Expiry; +} | { + minimum_funds: Coin[]; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Uint128 = string; +export type AndrAddr = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_locked_funds: { + owner: string; + recipient: string; + }; +} | { + get_locked_funds_for_recipient: { + limit?: number | null; + recipient: string; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetLockedFundsResponse { + funds?: Escrow | null; +} +export interface Escrow { + coins: Coin[]; + condition?: EscrowCondition | null; + recipient: Recipient; + recipient_addr: string; +} +export interface GetLockedFundsForRecipientResponse { + funds: Escrow[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type TimelockContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/2.0.2/TimelockContractTs.client.ts b/packages/adocodegen/src/timelock/2.0.2/TimelockContractTs.client.ts new file mode 100644 index 0000000..52a34e2 --- /dev/null +++ b/packages/adocodegen/src/timelock/2.0.2/TimelockContractTs.client.ts @@ -0,0 +1,356 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, EscrowCondition, Expiry, Milliseconds, Uint128, AndrAddr, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetLockedFundsResponse, Escrow, GetLockedFundsForRecipientResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./TimelockContractTs.types"; +export interface TimelockContractTsReadOnlyInterface { + contractAddress: string; + getLockedFunds: ({ + owner, + recipient + }: { + owner: string; + recipient: string; + }) => Promise; + getLockedFundsForRecipient: ({ + limit, + recipient, + startAfter + }: { + limit?: number; + recipient: string; + startAfter?: string; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class TimelockContractTsQueryClient implements TimelockContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getLockedFunds = this.getLockedFunds.bind(this); + this.getLockedFundsForRecipient = this.getLockedFundsForRecipient.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + getLockedFunds = async ({ + owner, + recipient + }: { + owner: string; + recipient: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_locked_funds: { + owner, + recipient + } + }); + }; + getLockedFundsForRecipient = async ({ + limit, + recipient, + startAfter + }: { + limit?: number; + recipient: string; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_locked_funds_for_recipient: { + limit, + recipient, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface TimelockContractTsInterface { + contractAddress: string; + sender: string; + holdFunds: ({ + condition, + recipient + }: { + condition?: EscrowCondition; + recipient?: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + releaseFunds: ({ + limit, + recipientAddr, + startAfter + }: { + limit?: number; + recipientAddr?: string; + startAfter?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + releaseSpecificFunds: ({ + owner, + recipientAddr + }: { + owner: string; + recipientAddr?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class TimelockContractTsClient implements TimelockContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.holdFunds = this.holdFunds.bind(this); + this.releaseFunds = this.releaseFunds.bind(this); + this.releaseSpecificFunds = this.releaseSpecificFunds.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + holdFunds = async ({ + condition, + recipient + }: { + condition?: EscrowCondition; + recipient?: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + hold_funds: { + condition, + recipient + } + }, fee, memo, _funds); + }; + releaseFunds = async ({ + limit, + recipientAddr, + startAfter + }: { + limit?: number; + recipientAddr?: string; + startAfter?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release_funds: { + limit, + recipient_addr: recipientAddr, + start_after: startAfter + } + }, fee, memo, _funds); + }; + releaseSpecificFunds = async ({ + owner, + recipientAddr + }: { + owner: string; + recipientAddr?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + release_specific_funds: { + owner, + recipient_addr: recipientAddr + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/2.0.2/TimelockContractTs.message-builder.ts b/packages/adocodegen/src/timelock/2.0.2/TimelockContractTs.message-builder.ts new file mode 100644 index 0000000..2599fa4 --- /dev/null +++ b/packages/adocodegen/src/timelock/2.0.2/TimelockContractTs.message-builder.ts @@ -0,0 +1,212 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, EscrowCondition, Expiry, Milliseconds, Uint128, AndrAddr, Binary, ReplyOn, OwnershipMessage, Addr, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, Coin, Recipient, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, LocalRate, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, GetLockedFundsResponse, Escrow, GetLockedFundsForRecipientResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, TypeResponse, VersionResponse } from "./TimelockContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class TimelockContractTsExecuteMsgBuilder { + static holdFunds = ({ + condition, + recipient + }: CamelCasedProperties["hold_funds"]>): ExecuteMsg => { + return { + hold_funds: ({ + condition, + recipient + } as const) + }; + }; + static releaseFunds = ({ + limit, + recipientAddr, + startAfter + }: CamelCasedProperties["release_funds"]>): ExecuteMsg => { + return { + release_funds: ({ + limit, + recipient_addr: recipientAddr, + start_after: startAfter + } as const) + }; + }; + static releaseSpecificFunds = ({ + owner, + recipientAddr + }: CamelCasedProperties["release_specific_funds"]>): ExecuteMsg => { + return { + release_specific_funds: ({ + owner, + recipient_addr: recipientAddr + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class TimelockContractTsQueryMsgBuilder { + static getLockedFunds = ({ + owner, + recipient + }: CamelCasedProperties["get_locked_funds"]>): QueryMsg => { + return { + get_locked_funds: ({ + owner, + recipient + } as const) + }; + }; + static getLockedFundsForRecipient = ({ + limit, + recipient, + startAfter + }: CamelCasedProperties["get_locked_funds_for_recipient"]>): QueryMsg => { + return { + get_locked_funds_for_recipient: ({ + limit, + recipient, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/timelock/2.0.2/TimelockContractTs.types.ts b/packages/adocodegen/src/timelock/2.0.2/TimelockContractTs.types.ts new file mode 100644 index 0000000..3a8e01b --- /dev/null +++ b/packages/adocodegen/src/timelock/2.0.2/TimelockContractTs.types.ts @@ -0,0 +1,263 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + hold_funds: { + condition?: EscrowCondition | null; + recipient?: Recipient | null; + }; +} | { + release_funds: { + limit?: number | null; + recipient_addr?: string | null; + start_after?: string | null; + }; +} | { + release_specific_funds: { + owner: string; + recipient_addr?: string | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type EscrowCondition = { + expiration: Expiry; +} | { + minimum_funds: Coin[]; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Uint128 = string; +export type AndrAddr = string; +export type Binary = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + get_locked_funds: { + owner: string; + recipient: string; + }; +} | { + get_locked_funds_for_recipient: { + limit?: number | null; + recipient: string; + start_after?: string | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetLockedFundsResponse { + funds?: Escrow | null; +} +export interface Escrow { + coins: Coin[]; + condition?: EscrowCondition | null; + recipient: Recipient; + recipient_addr: string; +} +export interface GetLockedFundsForRecipientResponse { + funds: Escrow[]; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type TimelockContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/validator-staking/0.2.0/ValidatorStakingContractTs.client.ts b/packages/adocodegen/src/validator-staking/0.2.0/ValidatorStakingContractTs.client.ts new file mode 100644 index 0000000..a9024d9 --- /dev/null +++ b/packages/adocodegen/src/validator-staking/0.2.0/ValidatorStakingContractTs.client.ts @@ -0,0 +1,328 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Addr, InstantiateMsg, ExecuteMsg, Uint128, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableFullDelegation, FullDelegation, TypeResponse, NullableArrayOfUnstakingTokens, Timestamp, Uint64, UnstakingTokens, VersionResponse } from "./ValidatorStakingContractTs.types"; +export interface ValidatorStakingContractTsReadOnlyInterface { + contractAddress: string; + stakedTokens: ({ + validator + }: { + validator?: Addr; + }) => Promise; + unstakedTokens: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class ValidatorStakingContractTsQueryClient implements ValidatorStakingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.stakedTokens = this.stakedTokens.bind(this); + this.unstakedTokens = this.unstakedTokens.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + stakedTokens = async ({ + validator + }: { + validator?: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staked_tokens: { + validator + } + }); + }; + unstakedTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + unstaked_tokens: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface ValidatorStakingContractTsInterface { + contractAddress: string; + sender: string; + stake: ({ + validator + }: { + validator?: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unstake: ({ + amount, + validator + }: { + amount?: Uint128; + validator?: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + recipient, + validator + }: { + recipient?: AndrAddr; + validator?: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawFunds: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class ValidatorStakingContractTsClient implements ValidatorStakingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.stake = this.stake.bind(this); + this.unstake = this.unstake.bind(this); + this.claim = this.claim.bind(this); + this.withdrawFunds = this.withdrawFunds.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + stake = async ({ + validator + }: { + validator?: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + stake: { + validator + } + }, fee, memo, _funds); + }; + unstake = async ({ + amount, + validator + }: { + amount?: Uint128; + validator?: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unstake: { + amount, + validator + } + }, fee, memo, _funds); + }; + claim = async ({ + recipient, + validator + }: { + recipient?: AndrAddr; + validator?: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + recipient, + validator + } + }, fee, memo, _funds); + }; + withdrawFunds = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_funds: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/validator-staking/0.2.0/ValidatorStakingContractTs.message-builder.ts b/packages/adocodegen/src/validator-staking/0.2.0/ValidatorStakingContractTs.message-builder.ts new file mode 100644 index 0000000..bc33d22 --- /dev/null +++ b/packages/adocodegen/src/validator-staking/0.2.0/ValidatorStakingContractTs.message-builder.ts @@ -0,0 +1,201 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, InstantiateMsg, ExecuteMsg, Uint128, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableFullDelegation, FullDelegation, TypeResponse, NullableArrayOfUnstakingTokens, Timestamp, Uint64, UnstakingTokens, VersionResponse } from "./ValidatorStakingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class ValidatorStakingContractTsExecuteMsgBuilder { + static stake = ({ + validator + }: CamelCasedProperties["stake"]>): ExecuteMsg => { + return { + stake: ({ + validator + } as const) + }; + }; + static unstake = ({ + amount, + validator + }: CamelCasedProperties["unstake"]>): ExecuteMsg => { + return { + unstake: ({ + amount, + validator + } as const) + }; + }; + static claim = ({ + recipient, + validator + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + recipient, + validator + } as const) + }; + }; + static withdrawFunds = (): ExecuteMsg => { + return { + withdraw_funds: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class ValidatorStakingContractTsQueryMsgBuilder { + static stakedTokens = ({ + validator + }: CamelCasedProperties["staked_tokens"]>): QueryMsg => { + return { + staked_tokens: ({ + validator + } as const) + }; + }; + static unstakedTokens = (): QueryMsg => { + return { + unstaked_tokens: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/validator-staking/0.2.0/ValidatorStakingContractTs.types.ts b/packages/adocodegen/src/validator-staking/0.2.0/ValidatorStakingContractTs.types.ts new file mode 100644 index 0000000..7025ac2 --- /dev/null +++ b/packages/adocodegen/src/validator-staking/0.2.0/ValidatorStakingContractTs.types.ts @@ -0,0 +1,259 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Addr = string; +export interface InstantiateMsg { + default_validator: Addr; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + stake: { + validator?: Addr | null; + }; +} | { + unstake: { + amount?: Uint128 | null; + validator?: Addr | null; + }; +} | { + claim: { + recipient?: AndrAddr | null; + validator?: Addr | null; + }; +} | { + withdraw_funds: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Uint128 = string; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + staked_tokens: { + validator?: Addr | null; + }; +} | { + unstaked_tokens: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export type NullableFullDelegation = FullDelegation | null; +export interface FullDelegation { + accumulated_rewards: Coin[]; + amount: Coin; + can_redelegate: Coin; + delegator: Addr; + validator: string; + [k: string]: unknown; +} +export interface TypeResponse { + ado_type: string; +} +export type NullableArrayOfUnstakingTokens = UnstakingTokens[] | null; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface UnstakingTokens { + fund: Coin; + payout_at: Timestamp; + [k: string]: unknown; +} +export interface VersionResponse { + version: string; +} +export type ValidatorStakingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/validator-staking/0.2.1-beta.1/ValidatorStakingContractTs.client.ts b/packages/adocodegen/src/validator-staking/0.2.1-beta.1/ValidatorStakingContractTs.client.ts new file mode 100644 index 0000000..a9024d9 --- /dev/null +++ b/packages/adocodegen/src/validator-staking/0.2.1-beta.1/ValidatorStakingContractTs.client.ts @@ -0,0 +1,328 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Addr, InstantiateMsg, ExecuteMsg, Uint128, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableFullDelegation, FullDelegation, TypeResponse, NullableArrayOfUnstakingTokens, Timestamp, Uint64, UnstakingTokens, VersionResponse } from "./ValidatorStakingContractTs.types"; +export interface ValidatorStakingContractTsReadOnlyInterface { + contractAddress: string; + stakedTokens: ({ + validator + }: { + validator?: Addr; + }) => Promise; + unstakedTokens: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class ValidatorStakingContractTsQueryClient implements ValidatorStakingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.stakedTokens = this.stakedTokens.bind(this); + this.unstakedTokens = this.unstakedTokens.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + stakedTokens = async ({ + validator + }: { + validator?: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staked_tokens: { + validator + } + }); + }; + unstakedTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + unstaked_tokens: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface ValidatorStakingContractTsInterface { + contractAddress: string; + sender: string; + stake: ({ + validator + }: { + validator?: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unstake: ({ + amount, + validator + }: { + amount?: Uint128; + validator?: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + recipient, + validator + }: { + recipient?: AndrAddr; + validator?: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawFunds: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class ValidatorStakingContractTsClient implements ValidatorStakingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.stake = this.stake.bind(this); + this.unstake = this.unstake.bind(this); + this.claim = this.claim.bind(this); + this.withdrawFunds = this.withdrawFunds.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + stake = async ({ + validator + }: { + validator?: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + stake: { + validator + } + }, fee, memo, _funds); + }; + unstake = async ({ + amount, + validator + }: { + amount?: Uint128; + validator?: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unstake: { + amount, + validator + } + }, fee, memo, _funds); + }; + claim = async ({ + recipient, + validator + }: { + recipient?: AndrAddr; + validator?: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + recipient, + validator + } + }, fee, memo, _funds); + }; + withdrawFunds = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_funds: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/validator-staking/0.2.1-beta.1/ValidatorStakingContractTs.message-builder.ts b/packages/adocodegen/src/validator-staking/0.2.1-beta.1/ValidatorStakingContractTs.message-builder.ts new file mode 100644 index 0000000..bc33d22 --- /dev/null +++ b/packages/adocodegen/src/validator-staking/0.2.1-beta.1/ValidatorStakingContractTs.message-builder.ts @@ -0,0 +1,201 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, InstantiateMsg, ExecuteMsg, Uint128, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableFullDelegation, FullDelegation, TypeResponse, NullableArrayOfUnstakingTokens, Timestamp, Uint64, UnstakingTokens, VersionResponse } from "./ValidatorStakingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class ValidatorStakingContractTsExecuteMsgBuilder { + static stake = ({ + validator + }: CamelCasedProperties["stake"]>): ExecuteMsg => { + return { + stake: ({ + validator + } as const) + }; + }; + static unstake = ({ + amount, + validator + }: CamelCasedProperties["unstake"]>): ExecuteMsg => { + return { + unstake: ({ + amount, + validator + } as const) + }; + }; + static claim = ({ + recipient, + validator + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + recipient, + validator + } as const) + }; + }; + static withdrawFunds = (): ExecuteMsg => { + return { + withdraw_funds: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class ValidatorStakingContractTsQueryMsgBuilder { + static stakedTokens = ({ + validator + }: CamelCasedProperties["staked_tokens"]>): QueryMsg => { + return { + staked_tokens: ({ + validator + } as const) + }; + }; + static unstakedTokens = (): QueryMsg => { + return { + unstaked_tokens: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/validator-staking/0.2.1-beta.1/ValidatorStakingContractTs.types.ts b/packages/adocodegen/src/validator-staking/0.2.1-beta.1/ValidatorStakingContractTs.types.ts new file mode 100644 index 0000000..87279da --- /dev/null +++ b/packages/adocodegen/src/validator-staking/0.2.1-beta.1/ValidatorStakingContractTs.types.ts @@ -0,0 +1,259 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Addr = string; +export interface InstantiateMsg { + default_validator: Addr; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + stake: { + validator?: Addr | null; + }; +} | { + unstake: { + amount?: Uint128 | null; + validator?: Addr | null; + }; +} | { + claim: { + recipient?: AndrAddr | null; + validator?: Addr | null; + }; +} | { + withdraw_funds: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Uint128 = string; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + staked_tokens: { + validator?: Addr | null; + }; +} | { + unstaked_tokens: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export type NullableFullDelegation = FullDelegation | null; +export interface FullDelegation { + accumulated_rewards: Coin[]; + amount: Coin; + can_redelegate: Coin; + delegator: Addr; + validator: string; + [k: string]: unknown; +} +export interface TypeResponse { + ado_type: string; +} +export type NullableArrayOfUnstakingTokens = UnstakingTokens[] | null; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface UnstakingTokens { + fund: Coin; + payout_at: Timestamp; + [k: string]: unknown; +} +export interface VersionResponse { + version: string; +} +export type ValidatorStakingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/validator-staking/0.2.3-beta.1/ValidatorStakingContractTs.client.ts b/packages/adocodegen/src/validator-staking/0.2.3-beta.1/ValidatorStakingContractTs.client.ts new file mode 100644 index 0000000..0d21167 --- /dev/null +++ b/packages/adocodegen/src/validator-staking/0.2.3-beta.1/ValidatorStakingContractTs.client.ts @@ -0,0 +1,355 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { Addr, InstantiateMsg, ExecuteMsg, Uint128, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableFullDelegation, FullDelegation, TypeResponse, NullableArrayOfUnstakingTokens, Timestamp, Uint64, UnstakingTokens, VersionResponse } from "./ValidatorStakingContractTs.types"; +export interface ValidatorStakingContractTsReadOnlyInterface { + contractAddress: string; + stakedTokens: ({ + validator + }: { + validator?: Addr; + }) => Promise; + unstakedTokens: () => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; + rates: ({ + action + }: { + action: string; + }) => Promise; + allRates: () => Promise; +} +export class ValidatorStakingContractTsQueryClient implements ValidatorStakingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.stakedTokens = this.stakedTokens.bind(this); + this.unstakedTokens = this.unstakedTokens.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + this.rates = this.rates.bind(this); + this.allRates = this.allRates.bind(this); + } + + stakedTokens = async ({ + validator + }: { + validator?: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + staked_tokens: { + validator + } + }); + }; + unstakedTokens = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + unstaked_tokens: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; + rates = async ({ + action + }: { + action: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + rates: { + action + } + }); + }; + allRates = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_rates: {} + }); + }; +} +export interface ValidatorStakingContractTsInterface { + contractAddress: string; + sender: string; + stake: ({ + validator + }: { + validator?: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + unstake: ({ + amount, + validator + }: { + amount?: Uint128; + validator?: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claim: ({ + validator + }: { + validator?: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawFunds: ({ + denom, + recipient + }: { + denom?: string; + recipient?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateDefaultValidator: ({ + validator + }: { + validator: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + rates: (ratesMessage: RatesMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class ValidatorStakingContractTsClient implements ValidatorStakingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.stake = this.stake.bind(this); + this.unstake = this.unstake.bind(this); + this.claim = this.claim.bind(this); + this.withdrawFunds = this.withdrawFunds.bind(this); + this.updateDefaultValidator = this.updateDefaultValidator.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.rates = this.rates.bind(this); + } + + stake = async ({ + validator + }: { + validator?: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + stake: { + validator + } + }, fee, memo, _funds); + }; + unstake = async ({ + amount, + validator + }: { + amount?: Uint128; + validator?: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + unstake: { + amount, + validator + } + }, fee, memo, _funds); + }; + claim = async ({ + validator + }: { + validator?: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + validator + } + }, fee, memo, _funds); + }; + withdrawFunds = async ({ + denom, + recipient + }: { + denom?: string; + recipient?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_funds: { + denom, + recipient + } + }, fee, memo, _funds); + }; + updateDefaultValidator = async ({ + validator + }: { + validator: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_default_validator: { + validator + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + rates = async (ratesMessage: RatesMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + rates: ratesMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/validator-staking/0.2.3-beta.1/ValidatorStakingContractTs.message-builder.ts b/packages/adocodegen/src/validator-staking/0.2.3-beta.1/ValidatorStakingContractTs.message-builder.ts new file mode 100644 index 0000000..7cecd06 --- /dev/null +++ b/packages/adocodegen/src/validator-staking/0.2.3-beta.1/ValidatorStakingContractTs.message-builder.ts @@ -0,0 +1,218 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { Addr, InstantiateMsg, ExecuteMsg, Uint128, AndrAddr, ReplyOn, Binary, OwnershipMessage, Expiry, Milliseconds, PermissioningMessage, Permission, LocalPermission, RatesMessage, Rate, LocalRateType, LocalRateValue, Decimal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, LocalRate, Recipient, PercentRate, QueryMsg, ADOBaseVersionResponse, AllRatesResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, NullableRate, NullableFullDelegation, FullDelegation, TypeResponse, NullableArrayOfUnstakingTokens, Timestamp, Uint64, UnstakingTokens, VersionResponse } from "./ValidatorStakingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class ValidatorStakingContractTsExecuteMsgBuilder { + static stake = ({ + validator + }: CamelCasedProperties["stake"]>): ExecuteMsg => { + return { + stake: ({ + validator + } as const) + }; + }; + static unstake = ({ + amount, + validator + }: CamelCasedProperties["unstake"]>): ExecuteMsg => { + return { + unstake: ({ + amount, + validator + } as const) + }; + }; + static claim = ({ + validator + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + validator + } as const) + }; + }; + static withdrawFunds = ({ + denom, + recipient + }: CamelCasedProperties["withdraw_funds"]>): ExecuteMsg => { + return { + withdraw_funds: ({ + denom, + recipient + } as const) + }; + }; + static updateDefaultValidator = ({ + validator + }: CamelCasedProperties["update_default_validator"]>): ExecuteMsg => { + return { + update_default_validator: ({ + validator + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static rates = (ratesMessage: RatesMessage): ExecuteMsg => { + return { + rates: ratesMessage + }; + }; +} +export abstract class ValidatorStakingContractTsQueryMsgBuilder { + static stakedTokens = ({ + validator + }: CamelCasedProperties["staked_tokens"]>): QueryMsg => { + return { + staked_tokens: ({ + validator + } as const) + }; + }; + static unstakedTokens = (): QueryMsg => { + return { + unstaked_tokens: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; + static rates = ({ + action + }: CamelCasedProperties["rates"]>): QueryMsg => { + return { + rates: ({ + action + } as const) + }; + }; + static allRates = (): QueryMsg => { + return { + all_rates: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/validator-staking/0.2.3-beta.1/ValidatorStakingContractTs.types.ts b/packages/adocodegen/src/validator-staking/0.2.3-beta.1/ValidatorStakingContractTs.types.ts new file mode 100644 index 0000000..76f97c6 --- /dev/null +++ b/packages/adocodegen/src/validator-staking/0.2.3-beta.1/ValidatorStakingContractTs.types.ts @@ -0,0 +1,265 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type Addr = string; +export interface InstantiateMsg { + default_validator: Addr; + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + stake: { + validator?: Addr | null; + }; +} | { + unstake: { + amount?: Uint128 | null; + validator?: Addr | null; + }; +} | { + claim: { + validator?: Addr | null; + }; +} | { + withdraw_funds: { + denom?: string | null; + recipient?: AndrAddr | null; + }; +} | { + update_default_validator: { + validator: Addr; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + rates: RatesMessage; +}; +export type Uint128 = string; +export type AndrAddr = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type Binary = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export type RatesMessage = { + set_rate: { + action: string; + rate: Rate; + }; +} | { + remove_rate: { + action: string; + }; +}; +export type Rate = { + local: LocalRate; +} | { + contract: AndrAddr; +}; +export type LocalRateType = "additive" | "deductive"; +export type LocalRateValue = { + percent: PercentRate; +} | { + flat: Coin; +}; +export type Decimal = string; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export interface LocalRate { + description?: string | null; + rate_type: LocalRateType; + recipients: Recipient[]; + value: LocalRateValue; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface PercentRate { + percent: Decimal; +} +export type QueryMsg = { + staked_tokens: { + validator?: Addr | null; + }; +} | { + unstaked_tokens: {}; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +} | { + rates: { + action: string; + }; +} | { + all_rates: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AllRatesResponse { + all_rates: [string, Rate][]; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export type NullableRate = Rate | null; +export type NullableFullDelegation = FullDelegation | null; +export interface FullDelegation { + accumulated_rewards: Coin[]; + amount: Coin; + can_redelegate: Coin; + delegator: Addr; + validator: string; + [k: string]: unknown; +} +export interface TypeResponse { + ado_type: string; +} +export type NullableArrayOfUnstakingTokens = UnstakingTokens[] | null; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface UnstakingTokens { + fund: Coin; + payout_at: Timestamp; + [k: string]: unknown; +} +export interface VersionResponse { + version: string; +} +export type ValidatorStakingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vault/0.2.0/VaultContractTs.client.ts b/packages/adocodegen/src/vault/0.2.0/VaultContractTs.client.ts new file mode 100644 index 0000000..fe76182 --- /dev/null +++ b/packages/adocodegen/src/vault/0.2.0/VaultContractTs.client.ts @@ -0,0 +1,421 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, Binary, StrategyType, WithdrawalType, Uint128, Decimal, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, Recipient, Withdrawal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VaultContractTs.types"; +export interface VaultContractTsReadOnlyInterface { + contractAddress: string; + vaultBalance: ({ + address, + denom, + strategy + }: { + address: AndrAddr; + denom?: string; + strategy?: StrategyType; + }) => Promise; + strategyAddress: ({ + strategy + }: { + strategy: StrategyType; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class VaultContractTsQueryClient implements VaultContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.vaultBalance = this.vaultBalance.bind(this); + this.strategyAddress = this.strategyAddress.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + vaultBalance = async ({ + address, + denom, + strategy + }: { + address: AndrAddr; + denom?: string; + strategy?: StrategyType; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vault_balance: { + address, + denom, + strategy + } + }); + }; + strategyAddress = async ({ + strategy + }: { + strategy: StrategyType; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + strategy_address: { + strategy + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface VaultContractTsInterface { + contractAddress: string; + sender: string; + withdrawVault: ({ + recipient, + strategy, + withdrawals + }: { + recipient?: Recipient; + strategy?: StrategyType; + withdrawals: Withdrawal[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateStrategy: ({ + address, + strategy + }: { + address: AndrAddr; + strategy: StrategyType; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deposit: ({ + msg, + recipient + }: { + msg?: Binary; + recipient?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: ({ + recipient, + tokensToWithdraw + }: { + recipient?: Recipient; + tokensToWithdraw?: Withdrawal[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VaultContractTsClient implements VaultContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.withdrawVault = this.withdrawVault.bind(this); + this.updateStrategy = this.updateStrategy.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + this.deposit = this.deposit.bind(this); + this.withdraw = this.withdraw.bind(this); + } + + withdrawVault = async ({ + recipient, + strategy, + withdrawals + }: { + recipient?: Recipient; + strategy?: StrategyType; + withdrawals: Withdrawal[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_vault: { + recipient, + strategy, + withdrawals + } + }, fee, memo, _funds); + }; + updateStrategy = async ({ + address, + strategy + }: { + address: AndrAddr; + strategy: StrategyType; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_strategy: { + address, + strategy + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; + deposit = async ({ + msg, + recipient + }: { + msg?: Binary; + recipient?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit: { + msg, + recipient + } + }, fee, memo, _funds); + }; + withdraw = async ({ + recipient, + tokensToWithdraw + }: { + recipient?: Recipient; + tokensToWithdraw?: Withdrawal[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: { + recipient, + tokens_to_withdraw: tokensToWithdraw + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vault/0.2.0/VaultContractTs.message-builder.ts b/packages/adocodegen/src/vault/0.2.0/VaultContractTs.message-builder.ts new file mode 100644 index 0000000..d0e4ab7 --- /dev/null +++ b/packages/adocodegen/src/vault/0.2.0/VaultContractTs.message-builder.ts @@ -0,0 +1,248 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, Binary, StrategyType, WithdrawalType, Uint128, Decimal, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, Recipient, Withdrawal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VaultContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VaultContractTsExecuteMsgBuilder { + static withdrawVault = ({ + recipient, + strategy, + withdrawals + }: CamelCasedProperties["withdraw_vault"]>): ExecuteMsg => { + return { + withdraw_vault: ({ + recipient, + strategy, + withdrawals + } as const) + }; + }; + static updateStrategy = ({ + address, + strategy + }: CamelCasedProperties["update_strategy"]>): ExecuteMsg => { + return { + update_strategy: ({ + address, + strategy + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; + static deposit = ({ + msg, + recipient + }: CamelCasedProperties["deposit"]>): ExecuteMsg => { + return { + deposit: ({ + msg, + recipient + } as const) + }; + }; + static withdraw = ({ + recipient, + tokensToWithdraw + }: CamelCasedProperties["withdraw"]>): ExecuteMsg => { + return { + withdraw: ({ + recipient, + tokens_to_withdraw: tokensToWithdraw + } as const) + }; + }; +} +export abstract class VaultContractTsQueryMsgBuilder { + static vaultBalance = ({ + address, + denom, + strategy + }: CamelCasedProperties["vault_balance"]>): QueryMsg => { + return { + vault_balance: ({ + address, + denom, + strategy + } as const) + }; + }; + static strategyAddress = ({ + strategy + }: CamelCasedProperties["strategy_address"]>): QueryMsg => { + return { + strategy_address: ({ + strategy + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vault/0.2.0/VaultContractTs.types.ts b/packages/adocodegen/src/vault/0.2.0/VaultContractTs.types.ts new file mode 100644 index 0000000..ac15fdc --- /dev/null +++ b/packages/adocodegen/src/vault/0.2.0/VaultContractTs.types.ts @@ -0,0 +1,217 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + withdraw_vault: { + recipient?: Recipient | null; + strategy?: StrategyType | null; + withdrawals: Withdrawal[]; + }; +} | { + update_strategy: { + address: AndrAddr; + strategy: StrategyType; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + deposit: { + msg?: Binary | null; + recipient?: AndrAddr | null; + }; +} | { + withdraw: { + recipient?: Recipient | null; + tokens_to_withdraw?: Withdrawal[] | null; + }; +}; +export type AndrAddr = string; +export type Binary = string; +export type StrategyType = "anchor"; +export type WithdrawalType = { + amount: Uint128; +} | { + percentage: Decimal; +}; +export type Uint128 = string; +export type Decimal = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface Withdrawal { + token: string; + withdrawal_type?: WithdrawalType | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + vault_balance: { + address: AndrAddr; + denom?: string | null; + strategy?: StrategyType | null; + }; +} | { + strategy_address: { + strategy: StrategyType; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type VaultContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vault/0.2.16/VaultContractTs.client.ts b/packages/adocodegen/src/vault/0.2.16/VaultContractTs.client.ts new file mode 100644 index 0000000..c2933df --- /dev/null +++ b/packages/adocodegen/src/vault/0.2.16/VaultContractTs.client.ts @@ -0,0 +1,362 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, Binary, StrategyType, WithdrawalType, Uint128, Decimal, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, Recipient, Withdrawal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VaultContractTs.types"; +export interface VaultContractTsReadOnlyInterface { + contractAddress: string; + vaultBalance: ({ + address, + denom, + strategy + }: { + address: AndrAddr; + denom?: string; + strategy?: StrategyType; + }) => Promise; + strategyAddress: ({ + strategy + }: { + strategy: StrategyType; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class VaultContractTsQueryClient implements VaultContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.vaultBalance = this.vaultBalance.bind(this); + this.strategyAddress = this.strategyAddress.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + vaultBalance = async ({ + address, + denom, + strategy + }: { + address: AndrAddr; + denom?: string; + strategy?: StrategyType; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vault_balance: { + address, + denom, + strategy + } + }); + }; + strategyAddress = async ({ + strategy + }: { + strategy: StrategyType; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + strategy_address: { + strategy + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface VaultContractTsInterface { + contractAddress: string; + sender: string; + withdrawVault: ({ + recipient, + strategy, + withdrawals + }: { + recipient?: Recipient; + strategy?: StrategyType; + withdrawals: Withdrawal[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateStrategy: ({ + address, + strategy + }: { + address: AndrAddr; + strategy: StrategyType; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deposit: ({ + msg, + recipient + }: { + msg?: Binary; + recipient?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: ({ + recipient, + tokensToWithdraw + }: { + recipient?: Recipient; + tokensToWithdraw?: Withdrawal[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VaultContractTsClient implements VaultContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.withdrawVault = this.withdrawVault.bind(this); + this.updateStrategy = this.updateStrategy.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + this.deposit = this.deposit.bind(this); + this.withdraw = this.withdraw.bind(this); + } + + withdrawVault = async ({ + recipient, + strategy, + withdrawals + }: { + recipient?: Recipient; + strategy?: StrategyType; + withdrawals: Withdrawal[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_vault: { + recipient, + strategy, + withdrawals + } + }, fee, memo, _funds); + }; + updateStrategy = async ({ + address, + strategy + }: { + address: AndrAddr; + strategy: StrategyType; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_strategy: { + address, + strategy + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; + deposit = async ({ + msg, + recipient + }: { + msg?: Binary; + recipient?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit: { + msg, + recipient + } + }, fee, memo, _funds); + }; + withdraw = async ({ + recipient, + tokensToWithdraw + }: { + recipient?: Recipient; + tokensToWithdraw?: Withdrawal[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: { + recipient, + tokens_to_withdraw: tokensToWithdraw + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vault/0.2.16/VaultContractTs.message-builder.ts b/packages/adocodegen/src/vault/0.2.16/VaultContractTs.message-builder.ts new file mode 100644 index 0000000..556021a --- /dev/null +++ b/packages/adocodegen/src/vault/0.2.16/VaultContractTs.message-builder.ts @@ -0,0 +1,214 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, Binary, StrategyType, WithdrawalType, Uint128, Decimal, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, Recipient, Withdrawal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VaultContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VaultContractTsExecuteMsgBuilder { + static withdrawVault = ({ + recipient, + strategy, + withdrawals + }: CamelCasedProperties["withdraw_vault"]>): ExecuteMsg => { + return { + withdraw_vault: ({ + recipient, + strategy, + withdrawals + } as const) + }; + }; + static updateStrategy = ({ + address, + strategy + }: CamelCasedProperties["update_strategy"]>): ExecuteMsg => { + return { + update_strategy: ({ + address, + strategy + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; + static deposit = ({ + msg, + recipient + }: CamelCasedProperties["deposit"]>): ExecuteMsg => { + return { + deposit: ({ + msg, + recipient + } as const) + }; + }; + static withdraw = ({ + recipient, + tokensToWithdraw + }: CamelCasedProperties["withdraw"]>): ExecuteMsg => { + return { + withdraw: ({ + recipient, + tokens_to_withdraw: tokensToWithdraw + } as const) + }; + }; +} +export abstract class VaultContractTsQueryMsgBuilder { + static vaultBalance = ({ + address, + denom, + strategy + }: CamelCasedProperties["vault_balance"]>): QueryMsg => { + return { + vault_balance: ({ + address, + denom, + strategy + } as const) + }; + }; + static strategyAddress = ({ + strategy + }: CamelCasedProperties["strategy_address"]>): QueryMsg => { + return { + strategy_address: ({ + strategy + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vault/0.2.16/VaultContractTs.types.ts b/packages/adocodegen/src/vault/0.2.16/VaultContractTs.types.ts new file mode 100644 index 0000000..49fe095 --- /dev/null +++ b/packages/adocodegen/src/vault/0.2.16/VaultContractTs.types.ts @@ -0,0 +1,224 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + withdraw_vault: { + recipient?: Recipient | null; + strategy?: StrategyType | null; + withdrawals: Withdrawal[]; + }; +} | { + update_strategy: { + address: AndrAddr; + strategy: StrategyType; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +} | { + deposit: { + msg?: Binary | null; + recipient?: AndrAddr | null; + }; +} | { + withdraw: { + recipient?: Recipient | null; + tokens_to_withdraw?: Withdrawal[] | null; + }; +}; +export type AndrAddr = string; +export type Binary = string; +export type StrategyType = "anchor"; +export type WithdrawalType = { + amount: Uint128; +} | { + percentage: Decimal; +}; +export type Uint128 = string; +export type Decimal = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface Withdrawal { + token: string; + withdrawal_type?: WithdrawalType | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + vault_balance: { + address: AndrAddr; + denom?: string | null; + strategy?: StrategyType | null; + }; +} | { + strategy_address: { + strategy: StrategyType; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type VaultContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vault/1.1.0/VaultContractTs.client.ts b/packages/adocodegen/src/vault/1.1.0/VaultContractTs.client.ts new file mode 100644 index 0000000..0898972 --- /dev/null +++ b/packages/adocodegen/src/vault/1.1.0/VaultContractTs.client.ts @@ -0,0 +1,342 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, AndrAddr, Binary, StrategyType, WithdrawalType, Uint128, Decimal, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, Recipient, Withdrawal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, StrategyAddressResponse, TypeResponse, VersionResponse } from "./VaultContractTs.types"; +export interface VaultContractTsReadOnlyInterface { + contractAddress: string; + vaultBalance: ({ + address, + denom, + strategy + }: { + address: AndrAddr; + denom?: string; + strategy?: StrategyType; + }) => Promise; + strategyAddress: ({ + strategy + }: { + strategy: StrategyType; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class VaultContractTsQueryClient implements VaultContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.vaultBalance = this.vaultBalance.bind(this); + this.strategyAddress = this.strategyAddress.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + vaultBalance = async ({ + address, + denom, + strategy + }: { + address: AndrAddr; + denom?: string; + strategy?: StrategyType; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vault_balance: { + address, + denom, + strategy + } + }); + }; + strategyAddress = async ({ + strategy + }: { + strategy: StrategyType; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + strategy_address: { + strategy + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface VaultContractTsInterface { + contractAddress: string; + sender: string; + withdrawVault: ({ + recipient, + strategy, + withdrawals + }: { + recipient?: Recipient; + strategy?: StrategyType; + withdrawals: Withdrawal[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateStrategy: ({ + address, + strategy + }: { + address: AndrAddr; + strategy: StrategyType; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdraw: ({ + recipient, + tokensToWithdraw + }: { + recipient?: Recipient; + tokensToWithdraw?: Withdrawal[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + deposit: ({ + msg, + recipient + }: { + msg?: Binary; + recipient?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VaultContractTsClient implements VaultContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.withdrawVault = this.withdrawVault.bind(this); + this.updateStrategy = this.updateStrategy.bind(this); + this.withdraw = this.withdraw.bind(this); + this.deposit = this.deposit.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + withdrawVault = async ({ + recipient, + strategy, + withdrawals + }: { + recipient?: Recipient; + strategy?: StrategyType; + withdrawals: Withdrawal[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_vault: { + recipient, + strategy, + withdrawals + } + }, fee, memo, _funds); + }; + updateStrategy = async ({ + address, + strategy + }: { + address: AndrAddr; + strategy: StrategyType; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_strategy: { + address, + strategy + } + }, fee, memo, _funds); + }; + withdraw = async ({ + recipient, + tokensToWithdraw + }: { + recipient?: Recipient; + tokensToWithdraw?: Withdrawal[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw: { + recipient, + tokens_to_withdraw: tokensToWithdraw + } + }, fee, memo, _funds); + }; + deposit = async ({ + msg, + recipient + }: { + msg?: Binary; + recipient?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + deposit: { + msg, + recipient + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vault/1.1.0/VaultContractTs.message-builder.ts b/packages/adocodegen/src/vault/1.1.0/VaultContractTs.message-builder.ts new file mode 100644 index 0000000..0b4e821 --- /dev/null +++ b/packages/adocodegen/src/vault/1.1.0/VaultContractTs.message-builder.ts @@ -0,0 +1,202 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, AndrAddr, Binary, StrategyType, WithdrawalType, Uint128, Decimal, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, Recipient, Withdrawal, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, StrategyAddressResponse, TypeResponse, VersionResponse } from "./VaultContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VaultContractTsExecuteMsgBuilder { + static withdrawVault = ({ + recipient, + strategy, + withdrawals + }: CamelCasedProperties["withdraw_vault"]>): ExecuteMsg => { + return { + withdraw_vault: ({ + recipient, + strategy, + withdrawals + } as const) + }; + }; + static updateStrategy = ({ + address, + strategy + }: CamelCasedProperties["update_strategy"]>): ExecuteMsg => { + return { + update_strategy: ({ + address, + strategy + } as const) + }; + }; + static withdraw = ({ + recipient, + tokensToWithdraw + }: CamelCasedProperties["withdraw"]>): ExecuteMsg => { + return { + withdraw: ({ + recipient, + tokens_to_withdraw: tokensToWithdraw + } as const) + }; + }; + static deposit = ({ + msg, + recipient + }: CamelCasedProperties["deposit"]>): ExecuteMsg => { + return { + deposit: ({ + msg, + recipient + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class VaultContractTsQueryMsgBuilder { + static vaultBalance = ({ + address, + denom, + strategy + }: CamelCasedProperties["vault_balance"]>): QueryMsg => { + return { + vault_balance: ({ + address, + denom, + strategy + } as const) + }; + }; + static strategyAddress = ({ + strategy + }: CamelCasedProperties["strategy_address"]>): QueryMsg => { + return { + strategy_address: ({ + strategy + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vault/1.1.0/VaultContractTs.types.ts b/packages/adocodegen/src/vault/1.1.0/VaultContractTs.types.ts new file mode 100644 index 0000000..7bef9a7 --- /dev/null +++ b/packages/adocodegen/src/vault/1.1.0/VaultContractTs.types.ts @@ -0,0 +1,222 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + withdraw_vault: { + recipient?: Recipient | null; + strategy?: StrategyType | null; + withdrawals: Withdrawal[]; + }; +} | { + update_strategy: { + address: AndrAddr; + strategy: StrategyType; + }; +} | { + withdraw: { + recipient?: Recipient | null; + tokens_to_withdraw?: Withdrawal[] | null; + }; +} | { + deposit: { + msg?: Binary | null; + recipient?: AndrAddr | null; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type AndrAddr = string; +export type Binary = string; +export type StrategyType = "anchor"; +export type WithdrawalType = { + amount: Uint128; +} | { + percentage: Decimal; +}; +export type Uint128 = string; +export type Decimal = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export interface Withdrawal { + token: string; + withdrawal_type?: WithdrawalType | null; +} +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + vault_balance: { + address: AndrAddr; + denom?: string | null; + strategy?: StrategyType | null; + }; +} | { + strategy_address: { + strategy: StrategyType; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface StrategyAddressResponse { + address: string; + strategy: StrategyType; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type VaultContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/0.2.1/VestingContractTs.client.ts b/packages/adocodegen/src/vesting/0.2.1/VestingContractTs.client.ts new file mode 100644 index 0000000..427ee80 --- /dev/null +++ b/packages/adocodegen/src/vesting/0.2.1/VestingContractTs.client.ts @@ -0,0 +1,506 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, Binary, Duration, InstantiateMsg, Module, Recipient, ExecuteMsg, WithdrawalType, Uint128, Decimal, VoteOption, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BatchResponse, ArrayOfBatchResponse, BlockHeightResponse, Config, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VestingContractTs.types"; +export interface VestingContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + batch: ({ + id + }: { + id: number; + }) => Promise; + batches: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class VestingContractTsQueryClient implements VestingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.batch = this.batch.bind(this); + this.batches = this.batches.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + batch = async ({ + id + }: { + id: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + batch: { + id + } + }); + }; + batches = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + batches: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface VestingContractTsInterface { + contractAddress: string; + sender: string; + claim: ({ + batchId, + numberOfClaims + }: { + batchId: number; + numberOfClaims?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimAll: ({ + limit, + upToTime + }: { + limit?: number; + upToTime?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + createBatch: ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: { + lockupDuration?: number; + releaseAmount: WithdrawalType; + releaseUnit: number; + validatorToDelegateTo?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + delegate: ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + redelegate: ({ + amount, + from, + to + }: { + amount?: Uint128; + from: string; + to: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + undelegate: ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + vote: ({ + proposalId, + vote + }: { + proposalId: number; + vote: VoteOption; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VestingContractTsClient implements VestingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.claim = this.claim.bind(this); + this.claimAll = this.claimAll.bind(this); + this.createBatch = this.createBatch.bind(this); + this.delegate = this.delegate.bind(this); + this.redelegate = this.redelegate.bind(this); + this.undelegate = this.undelegate.bind(this); + this.withdrawRewards = this.withdrawRewards.bind(this); + this.vote = this.vote.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + claim = async ({ + batchId, + numberOfClaims + }: { + batchId: number; + numberOfClaims?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + batch_id: batchId, + number_of_claims: numberOfClaims + } + }, fee, memo, _funds); + }; + claimAll = async ({ + limit, + upToTime + }: { + limit?: number; + upToTime?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_all: { + limit, + up_to_time: upToTime + } + }, fee, memo, _funds); + }; + createBatch = async ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: { + lockupDuration?: number; + releaseAmount: WithdrawalType; + releaseUnit: number; + validatorToDelegateTo?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create_batch: { + lockup_duration: lockupDuration, + release_amount: releaseAmount, + release_unit: releaseUnit, + validator_to_delegate_to: validatorToDelegateTo + } + }, fee, memo, _funds); + }; + delegate = async ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delegate: { + amount, + validator + } + }, fee, memo, _funds); + }; + redelegate = async ({ + amount, + from, + to + }: { + amount?: Uint128; + from: string; + to: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + redelegate: { + amount, + from, + to + } + }, fee, memo, _funds); + }; + undelegate = async ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + undelegate: { + amount, + validator + } + }, fee, memo, _funds); + }; + withdrawRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_rewards: {} + }, fee, memo, _funds); + }; + vote = async ({ + proposalId, + vote + }: { + proposalId: number; + vote: VoteOption; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + vote: { + proposal_id: proposalId, + vote + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/0.2.1/VestingContractTs.message-builder.ts b/packages/adocodegen/src/vesting/0.2.1/VestingContractTs.message-builder.ts new file mode 100644 index 0000000..717b984 --- /dev/null +++ b/packages/adocodegen/src/vesting/0.2.1/VestingContractTs.message-builder.ts @@ -0,0 +1,299 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, Binary, Duration, InstantiateMsg, Module, Recipient, ExecuteMsg, WithdrawalType, Uint128, Decimal, VoteOption, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BatchResponse, ArrayOfBatchResponse, BlockHeightResponse, Config, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VestingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VestingContractTsExecuteMsgBuilder { + static claim = ({ + batchId, + numberOfClaims + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + batch_id: batchId, + number_of_claims: numberOfClaims + } as const) + }; + }; + static claimAll = ({ + limit, + upToTime + }: CamelCasedProperties["claim_all"]>): ExecuteMsg => { + return { + claim_all: ({ + limit, + up_to_time: upToTime + } as const) + }; + }; + static createBatch = ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: CamelCasedProperties["create_batch"]>): ExecuteMsg => { + return { + create_batch: ({ + lockup_duration: lockupDuration, + release_amount: releaseAmount, + release_unit: releaseUnit, + validator_to_delegate_to: validatorToDelegateTo + } as const) + }; + }; + static delegate = ({ + amount, + validator + }: CamelCasedProperties["delegate"]>): ExecuteMsg => { + return { + delegate: ({ + amount, + validator + } as const) + }; + }; + static redelegate = ({ + amount, + from, + to + }: CamelCasedProperties["redelegate"]>): ExecuteMsg => { + return { + redelegate: ({ + amount, + from, + to + } as const) + }; + }; + static undelegate = ({ + amount, + validator + }: CamelCasedProperties["undelegate"]>): ExecuteMsg => { + return { + undelegate: ({ + amount, + validator + } as const) + }; + }; + static withdrawRewards = (): ExecuteMsg => { + return { + withdraw_rewards: ({} as const) + }; + }; + static vote = ({ + proposalId, + vote + }: CamelCasedProperties["vote"]>): ExecuteMsg => { + return { + vote: ({ + proposal_id: proposalId, + vote + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class VestingContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static batch = ({ + id + }: CamelCasedProperties["batch"]>): QueryMsg => { + return { + batch: ({ + id + } as const) + }; + }; + static batches = ({ + limit, + startAfter + }: CamelCasedProperties["batches"]>): QueryMsg => { + return { + batches: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/0.2.1/VestingContractTs.types.ts b/packages/adocodegen/src/vesting/0.2.1/VestingContractTs.types.ts new file mode 100644 index 0000000..aaac7ba --- /dev/null +++ b/packages/adocodegen/src/vesting/0.2.1/VestingContractTs.types.ts @@ -0,0 +1,266 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type Binary = string; +export type Duration = { + height: number; +} | { + time: number; +}; +export interface InstantiateMsg { + denom: string; + is_multi_batch_enabled: boolean; + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; + recipient: Recipient; + unbonding_duration: Duration; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + claim: { + batch_id: number; + number_of_claims?: number | null; + }; +} | { + claim_all: { + limit?: number | null; + up_to_time?: number | null; + }; +} | { + create_batch: { + lockup_duration?: number | null; + release_amount: WithdrawalType; + release_unit: number; + validator_to_delegate_to?: string | null; + }; +} | { + delegate: { + amount?: Uint128 | null; + validator: string; + }; +} | { + redelegate: { + amount?: Uint128 | null; + from: string; + to: string; + }; +} | { + undelegate: { + amount?: Uint128 | null; + validator: string; + }; +} | { + withdraw_rewards: {}; +} | { + vote: { + proposal_id: number; + vote: VoteOption; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type WithdrawalType = { + amount: Uint128; +} | { + percentage: Decimal; +}; +export type Uint128 = string; +export type Decimal = string; +export type VoteOption = "yes" | "no" | "abstain" | "no_with_veto"; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + batch: { + id: number; + }; +} | { + batches: { + limit?: number | null; + start_after?: number | null; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BatchResponse { + amount: Uint128; + amount_available_to_claim: Uint128; + amount_claimed: Uint128; + id: number; + last_claimed_release_time: number; + lockup_end: number; + number_of_available_claims: Uint128; + release_amount: WithdrawalType; + release_unit: number; +} +export type ArrayOfBatchResponse = BatchResponse[]; +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + denom: string; + is_multi_batch_enabled: boolean; + recipient: Recipient; + unbonding_duration: Duration; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type VestingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/0.2.16/VestingContractTs.client.ts b/packages/adocodegen/src/vesting/0.2.16/VestingContractTs.client.ts new file mode 100644 index 0000000..bb24bd7 --- /dev/null +++ b/packages/adocodegen/src/vesting/0.2.16/VestingContractTs.client.ts @@ -0,0 +1,447 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, Binary, Duration, InstantiateMsg, Module, Recipient, ExecuteMsg, WithdrawalType, Uint128, Decimal, VoteOption, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BatchResponse, ArrayOfBatchResponse, BlockHeightResponse, Config, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VestingContractTs.types"; +export interface VestingContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + batch: ({ + id + }: { + id: number; + }) => Promise; + batches: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class VestingContractTsQueryClient implements VestingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.batch = this.batch.bind(this); + this.batches = this.batches.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + batch = async ({ + id + }: { + id: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + batch: { + id + } + }); + }; + batches = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + batches: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface VestingContractTsInterface { + contractAddress: string; + sender: string; + claim: ({ + batchId, + numberOfClaims + }: { + batchId: number; + numberOfClaims?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimAll: ({ + limit, + upToTime + }: { + limit?: number; + upToTime?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + createBatch: ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: { + lockupDuration?: number; + releaseAmount: WithdrawalType; + releaseUnit: number; + validatorToDelegateTo?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + delegate: ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + redelegate: ({ + amount, + from, + to + }: { + amount?: Uint128; + from: string; + to: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + undelegate: ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + vote: ({ + proposalId, + vote + }: { + proposalId: number; + vote: VoteOption; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VestingContractTsClient implements VestingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.claim = this.claim.bind(this); + this.claimAll = this.claimAll.bind(this); + this.createBatch = this.createBatch.bind(this); + this.delegate = this.delegate.bind(this); + this.redelegate = this.redelegate.bind(this); + this.undelegate = this.undelegate.bind(this); + this.withdrawRewards = this.withdrawRewards.bind(this); + this.vote = this.vote.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + claim = async ({ + batchId, + numberOfClaims + }: { + batchId: number; + numberOfClaims?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + batch_id: batchId, + number_of_claims: numberOfClaims + } + }, fee, memo, _funds); + }; + claimAll = async ({ + limit, + upToTime + }: { + limit?: number; + upToTime?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_all: { + limit, + up_to_time: upToTime + } + }, fee, memo, _funds); + }; + createBatch = async ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: { + lockupDuration?: number; + releaseAmount: WithdrawalType; + releaseUnit: number; + validatorToDelegateTo?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create_batch: { + lockup_duration: lockupDuration, + release_amount: releaseAmount, + release_unit: releaseUnit, + validator_to_delegate_to: validatorToDelegateTo + } + }, fee, memo, _funds); + }; + delegate = async ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delegate: { + amount, + validator + } + }, fee, memo, _funds); + }; + redelegate = async ({ + amount, + from, + to + }: { + amount?: Uint128; + from: string; + to: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + redelegate: { + amount, + from, + to + } + }, fee, memo, _funds); + }; + undelegate = async ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + undelegate: { + amount, + validator + } + }, fee, memo, _funds); + }; + withdrawRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_rewards: {} + }, fee, memo, _funds); + }; + vote = async ({ + proposalId, + vote + }: { + proposalId: number; + vote: VoteOption; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + vote: { + proposal_id: proposalId, + vote + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/0.2.16/VestingContractTs.message-builder.ts b/packages/adocodegen/src/vesting/0.2.16/VestingContractTs.message-builder.ts new file mode 100644 index 0000000..9613e1b --- /dev/null +++ b/packages/adocodegen/src/vesting/0.2.16/VestingContractTs.message-builder.ts @@ -0,0 +1,265 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, Binary, Duration, InstantiateMsg, Module, Recipient, ExecuteMsg, WithdrawalType, Uint128, Decimal, VoteOption, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BatchResponse, ArrayOfBatchResponse, BlockHeightResponse, Config, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VestingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VestingContractTsExecuteMsgBuilder { + static claim = ({ + batchId, + numberOfClaims + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + batch_id: batchId, + number_of_claims: numberOfClaims + } as const) + }; + }; + static claimAll = ({ + limit, + upToTime + }: CamelCasedProperties["claim_all"]>): ExecuteMsg => { + return { + claim_all: ({ + limit, + up_to_time: upToTime + } as const) + }; + }; + static createBatch = ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: CamelCasedProperties["create_batch"]>): ExecuteMsg => { + return { + create_batch: ({ + lockup_duration: lockupDuration, + release_amount: releaseAmount, + release_unit: releaseUnit, + validator_to_delegate_to: validatorToDelegateTo + } as const) + }; + }; + static delegate = ({ + amount, + validator + }: CamelCasedProperties["delegate"]>): ExecuteMsg => { + return { + delegate: ({ + amount, + validator + } as const) + }; + }; + static redelegate = ({ + amount, + from, + to + }: CamelCasedProperties["redelegate"]>): ExecuteMsg => { + return { + redelegate: ({ + amount, + from, + to + } as const) + }; + }; + static undelegate = ({ + amount, + validator + }: CamelCasedProperties["undelegate"]>): ExecuteMsg => { + return { + undelegate: ({ + amount, + validator + } as const) + }; + }; + static withdrawRewards = (): ExecuteMsg => { + return { + withdraw_rewards: ({} as const) + }; + }; + static vote = ({ + proposalId, + vote + }: CamelCasedProperties["vote"]>): ExecuteMsg => { + return { + vote: ({ + proposal_id: proposalId, + vote + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class VestingContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static batch = ({ + id + }: CamelCasedProperties["batch"]>): QueryMsg => { + return { + batch: ({ + id + } as const) + }; + }; + static batches = ({ + limit, + startAfter + }: CamelCasedProperties["batches"]>): QueryMsg => { + return { + batches: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/0.2.16/VestingContractTs.types.ts b/packages/adocodegen/src/vesting/0.2.16/VestingContractTs.types.ts new file mode 100644 index 0000000..c8270ce --- /dev/null +++ b/packages/adocodegen/src/vesting/0.2.16/VestingContractTs.types.ts @@ -0,0 +1,273 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type Binary = string; +export type Duration = { + height: number; +} | { + time: number; +}; +export interface InstantiateMsg { + denom: string; + is_multi_batch_enabled: boolean; + kernel_address: string; + modules?: Module[] | null; + owner?: string | null; + recipient: Recipient; + unbonding_duration: Duration; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + claim: { + batch_id: number; + number_of_claims?: number | null; + }; +} | { + claim_all: { + limit?: number | null; + up_to_time?: number | null; + }; +} | { + create_batch: { + lockup_duration?: number | null; + release_amount: WithdrawalType; + release_unit: number; + validator_to_delegate_to?: string | null; + }; +} | { + delegate: { + amount?: Uint128 | null; + validator: string; + }; +} | { + redelegate: { + amount?: Uint128 | null; + from: string; + to: string; + }; +} | { + undelegate: { + amount?: Uint128 | null; + validator: string; + }; +} | { + withdraw_rewards: {}; +} | { + vote: { + proposal_id: number; + vote: VoteOption; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type WithdrawalType = { + amount: Uint128; +} | { + percentage: Decimal; +}; +export type Uint128 = string; +export type Decimal = string; +export type VoteOption = "yes" | "no" | "abstain" | "no_with_veto"; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + batch: { + id: number; + }; +} | { + batches: { + limit?: number | null; + start_after?: number | null; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BatchResponse { + amount: Uint128; + amount_available_to_claim: Uint128; + amount_claimed: Uint128; + id: number; + last_claimed_release_time: number; + lockup_end: number; + number_of_available_claims: Uint128; + release_amount: WithdrawalType; + release_unit: number; +} +export type ArrayOfBatchResponse = BatchResponse[]; +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + denom: string; + is_multi_batch_enabled: boolean; + recipient: Recipient; + unbonding_duration: Duration; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type VestingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/2.0.0/VestingContractTs.client.ts b/packages/adocodegen/src/vesting/2.0.0/VestingContractTs.client.ts new file mode 100644 index 0000000..5ebc4e7 --- /dev/null +++ b/packages/adocodegen/src/vesting/2.0.0/VestingContractTs.client.ts @@ -0,0 +1,427 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, Binary, Duration, InstantiateMsg, Recipient, ExecuteMsg, WithdrawalType, Uint128, Decimal, VoteOption, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BatchResponse, ArrayOfBatchResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VestingContractTs.types"; +export interface VestingContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + batch: ({ + id + }: { + id: number; + }) => Promise; + batches: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class VestingContractTsQueryClient implements VestingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.batch = this.batch.bind(this); + this.batches = this.batches.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + batch = async ({ + id + }: { + id: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + batch: { + id + } + }); + }; + batches = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + batches: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface VestingContractTsInterface { + contractAddress: string; + sender: string; + claim: ({ + batchId, + numberOfClaims + }: { + batchId: number; + numberOfClaims?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimAll: ({ + limit, + upToTime + }: { + limit?: number; + upToTime?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + createBatch: ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: { + lockupDuration?: number; + releaseAmount: WithdrawalType; + releaseUnit: number; + validatorToDelegateTo?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + delegate: ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + redelegate: ({ + amount, + from, + to + }: { + amount?: Uint128; + from: string; + to: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + undelegate: ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + vote: ({ + proposalId, + vote + }: { + proposalId: number; + vote: VoteOption; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VestingContractTsClient implements VestingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.claim = this.claim.bind(this); + this.claimAll = this.claimAll.bind(this); + this.createBatch = this.createBatch.bind(this); + this.delegate = this.delegate.bind(this); + this.redelegate = this.redelegate.bind(this); + this.undelegate = this.undelegate.bind(this); + this.withdrawRewards = this.withdrawRewards.bind(this); + this.vote = this.vote.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + claim = async ({ + batchId, + numberOfClaims + }: { + batchId: number; + numberOfClaims?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + batch_id: batchId, + number_of_claims: numberOfClaims + } + }, fee, memo, _funds); + }; + claimAll = async ({ + limit, + upToTime + }: { + limit?: number; + upToTime?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_all: { + limit, + up_to_time: upToTime + } + }, fee, memo, _funds); + }; + createBatch = async ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: { + lockupDuration?: number; + releaseAmount: WithdrawalType; + releaseUnit: number; + validatorToDelegateTo?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create_batch: { + lockup_duration: lockupDuration, + release_amount: releaseAmount, + release_unit: releaseUnit, + validator_to_delegate_to: validatorToDelegateTo + } + }, fee, memo, _funds); + }; + delegate = async ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delegate: { + amount, + validator + } + }, fee, memo, _funds); + }; + redelegate = async ({ + amount, + from, + to + }: { + amount?: Uint128; + from: string; + to: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + redelegate: { + amount, + from, + to + } + }, fee, memo, _funds); + }; + undelegate = async ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + undelegate: { + amount, + validator + } + }, fee, memo, _funds); + }; + withdrawRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_rewards: {} + }, fee, memo, _funds); + }; + vote = async ({ + proposalId, + vote + }: { + proposalId: number; + vote: VoteOption; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + vote: { + proposal_id: proposalId, + vote + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/2.0.0/VestingContractTs.message-builder.ts b/packages/adocodegen/src/vesting/2.0.0/VestingContractTs.message-builder.ts new file mode 100644 index 0000000..63fae78 --- /dev/null +++ b/packages/adocodegen/src/vesting/2.0.0/VestingContractTs.message-builder.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, Binary, Duration, InstantiateMsg, Recipient, ExecuteMsg, WithdrawalType, Uint128, Decimal, VoteOption, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BatchResponse, ArrayOfBatchResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VestingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VestingContractTsExecuteMsgBuilder { + static claim = ({ + batchId, + numberOfClaims + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + batch_id: batchId, + number_of_claims: numberOfClaims + } as const) + }; + }; + static claimAll = ({ + limit, + upToTime + }: CamelCasedProperties["claim_all"]>): ExecuteMsg => { + return { + claim_all: ({ + limit, + up_to_time: upToTime + } as const) + }; + }; + static createBatch = ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: CamelCasedProperties["create_batch"]>): ExecuteMsg => { + return { + create_batch: ({ + lockup_duration: lockupDuration, + release_amount: releaseAmount, + release_unit: releaseUnit, + validator_to_delegate_to: validatorToDelegateTo + } as const) + }; + }; + static delegate = ({ + amount, + validator + }: CamelCasedProperties["delegate"]>): ExecuteMsg => { + return { + delegate: ({ + amount, + validator + } as const) + }; + }; + static redelegate = ({ + amount, + from, + to + }: CamelCasedProperties["redelegate"]>): ExecuteMsg => { + return { + redelegate: ({ + amount, + from, + to + } as const) + }; + }; + static undelegate = ({ + amount, + validator + }: CamelCasedProperties["undelegate"]>): ExecuteMsg => { + return { + undelegate: ({ + amount, + validator + } as const) + }; + }; + static withdrawRewards = (): ExecuteMsg => { + return { + withdraw_rewards: ({} as const) + }; + }; + static vote = ({ + proposalId, + vote + }: CamelCasedProperties["vote"]>): ExecuteMsg => { + return { + vote: ({ + proposal_id: proposalId, + vote + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class VestingContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static batch = ({ + id + }: CamelCasedProperties["batch"]>): QueryMsg => { + return { + batch: ({ + id + } as const) + }; + }; + static batches = ({ + limit, + startAfter + }: CamelCasedProperties["batches"]>): QueryMsg => { + return { + batches: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/2.0.0/VestingContractTs.types.ts b/packages/adocodegen/src/vesting/2.0.0/VestingContractTs.types.ts new file mode 100644 index 0000000..63a37c6 --- /dev/null +++ b/packages/adocodegen/src/vesting/2.0.0/VestingContractTs.types.ts @@ -0,0 +1,261 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type Binary = string; +export type Duration = { + height: number; +} | { + time: number; +}; +export interface InstantiateMsg { + denom: string; + is_multi_batch_enabled: boolean; + kernel_address: string; + owner?: string | null; + recipient: Recipient; + unbonding_duration: Duration; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + claim: { + batch_id: number; + number_of_claims?: number | null; + }; +} | { + claim_all: { + limit?: number | null; + up_to_time?: number | null; + }; +} | { + create_batch: { + lockup_duration?: number | null; + release_amount: WithdrawalType; + release_unit: number; + validator_to_delegate_to?: string | null; + }; +} | { + delegate: { + amount?: Uint128 | null; + validator: string; + }; +} | { + redelegate: { + amount?: Uint128 | null; + from: string; + to: string; + }; +} | { + undelegate: { + amount?: Uint128 | null; + validator: string; + }; +} | { + withdraw_rewards: {}; +} | { + vote: { + proposal_id: number; + vote: VoteOption; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type WithdrawalType = { + amount: Uint128; +} | { + percentage: Decimal; +}; +export type Uint128 = string; +export type Decimal = string; +export type VoteOption = "yes" | "no" | "abstain" | "no_with_veto"; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + batch: { + id: number; + }; +} | { + batches: { + limit?: number | null; + start_after?: number | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BatchResponse { + amount: Uint128; + amount_available_to_claim: Uint128; + amount_claimed: Uint128; + id: number; + last_claimed_release_time: number; + lockup_end: number; + number_of_available_claims: Uint128; + release_amount: WithdrawalType; + release_unit: number; +} +export type ArrayOfBatchResponse = BatchResponse[]; +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + denom: string; + is_multi_batch_enabled: boolean; + recipient: Recipient; + unbonding_duration: Duration; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type VestingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/2.0.1-beta.1/VestingContractTs.client.ts b/packages/adocodegen/src/vesting/2.0.1-beta.1/VestingContractTs.client.ts new file mode 100644 index 0000000..5ebc4e7 --- /dev/null +++ b/packages/adocodegen/src/vesting/2.0.1-beta.1/VestingContractTs.client.ts @@ -0,0 +1,427 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, Binary, Duration, InstantiateMsg, Recipient, ExecuteMsg, WithdrawalType, Uint128, Decimal, VoteOption, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BatchResponse, ArrayOfBatchResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VestingContractTs.types"; +export interface VestingContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + batch: ({ + id + }: { + id: number; + }) => Promise; + batches: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class VestingContractTsQueryClient implements VestingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.batch = this.batch.bind(this); + this.batches = this.batches.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + batch = async ({ + id + }: { + id: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + batch: { + id + } + }); + }; + batches = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + batches: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface VestingContractTsInterface { + contractAddress: string; + sender: string; + claim: ({ + batchId, + numberOfClaims + }: { + batchId: number; + numberOfClaims?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimAll: ({ + limit, + upToTime + }: { + limit?: number; + upToTime?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + createBatch: ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: { + lockupDuration?: number; + releaseAmount: WithdrawalType; + releaseUnit: number; + validatorToDelegateTo?: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + delegate: ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + redelegate: ({ + amount, + from, + to + }: { + amount?: Uint128; + from: string; + to: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + undelegate: ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + withdrawRewards: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + vote: ({ + proposalId, + vote + }: { + proposalId: number; + vote: VoteOption; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VestingContractTsClient implements VestingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.claim = this.claim.bind(this); + this.claimAll = this.claimAll.bind(this); + this.createBatch = this.createBatch.bind(this); + this.delegate = this.delegate.bind(this); + this.redelegate = this.redelegate.bind(this); + this.undelegate = this.undelegate.bind(this); + this.withdrawRewards = this.withdrawRewards.bind(this); + this.vote = this.vote.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + claim = async ({ + batchId, + numberOfClaims + }: { + batchId: number; + numberOfClaims?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + batch_id: batchId, + number_of_claims: numberOfClaims + } + }, fee, memo, _funds); + }; + claimAll = async ({ + limit, + upToTime + }: { + limit?: number; + upToTime?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_all: { + limit, + up_to_time: upToTime + } + }, fee, memo, _funds); + }; + createBatch = async ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: { + lockupDuration?: number; + releaseAmount: WithdrawalType; + releaseUnit: number; + validatorToDelegateTo?: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create_batch: { + lockup_duration: lockupDuration, + release_amount: releaseAmount, + release_unit: releaseUnit, + validator_to_delegate_to: validatorToDelegateTo + } + }, fee, memo, _funds); + }; + delegate = async ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + delegate: { + amount, + validator + } + }, fee, memo, _funds); + }; + redelegate = async ({ + amount, + from, + to + }: { + amount?: Uint128; + from: string; + to: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + redelegate: { + amount, + from, + to + } + }, fee, memo, _funds); + }; + undelegate = async ({ + amount, + validator + }: { + amount?: Uint128; + validator: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + undelegate: { + amount, + validator + } + }, fee, memo, _funds); + }; + withdrawRewards = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + withdraw_rewards: {} + }, fee, memo, _funds); + }; + vote = async ({ + proposalId, + vote + }: { + proposalId: number; + vote: VoteOption; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + vote: { + proposal_id: proposalId, + vote + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/2.0.1-beta.1/VestingContractTs.message-builder.ts b/packages/adocodegen/src/vesting/2.0.1-beta.1/VestingContractTs.message-builder.ts new file mode 100644 index 0000000..63fae78 --- /dev/null +++ b/packages/adocodegen/src/vesting/2.0.1-beta.1/VestingContractTs.message-builder.ts @@ -0,0 +1,253 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, Binary, Duration, InstantiateMsg, Recipient, ExecuteMsg, WithdrawalType, Uint128, Decimal, VoteOption, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BatchResponse, ArrayOfBatchResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VestingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VestingContractTsExecuteMsgBuilder { + static claim = ({ + batchId, + numberOfClaims + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + batch_id: batchId, + number_of_claims: numberOfClaims + } as const) + }; + }; + static claimAll = ({ + limit, + upToTime + }: CamelCasedProperties["claim_all"]>): ExecuteMsg => { + return { + claim_all: ({ + limit, + up_to_time: upToTime + } as const) + }; + }; + static createBatch = ({ + lockupDuration, + releaseAmount, + releaseUnit, + validatorToDelegateTo + }: CamelCasedProperties["create_batch"]>): ExecuteMsg => { + return { + create_batch: ({ + lockup_duration: lockupDuration, + release_amount: releaseAmount, + release_unit: releaseUnit, + validator_to_delegate_to: validatorToDelegateTo + } as const) + }; + }; + static delegate = ({ + amount, + validator + }: CamelCasedProperties["delegate"]>): ExecuteMsg => { + return { + delegate: ({ + amount, + validator + } as const) + }; + }; + static redelegate = ({ + amount, + from, + to + }: CamelCasedProperties["redelegate"]>): ExecuteMsg => { + return { + redelegate: ({ + amount, + from, + to + } as const) + }; + }; + static undelegate = ({ + amount, + validator + }: CamelCasedProperties["undelegate"]>): ExecuteMsg => { + return { + undelegate: ({ + amount, + validator + } as const) + }; + }; + static withdrawRewards = (): ExecuteMsg => { + return { + withdraw_rewards: ({} as const) + }; + }; + static vote = ({ + proposalId, + vote + }: CamelCasedProperties["vote"]>): ExecuteMsg => { + return { + vote: ({ + proposal_id: proposalId, + vote + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class VestingContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static batch = ({ + id + }: CamelCasedProperties["batch"]>): QueryMsg => { + return { + batch: ({ + id + } as const) + }; + }; + static batches = ({ + limit, + startAfter + }: CamelCasedProperties["batches"]>): QueryMsg => { + return { + batches: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/2.0.1-beta.1/VestingContractTs.types.ts b/packages/adocodegen/src/vesting/2.0.1-beta.1/VestingContractTs.types.ts new file mode 100644 index 0000000..12b6548 --- /dev/null +++ b/packages/adocodegen/src/vesting/2.0.1-beta.1/VestingContractTs.types.ts @@ -0,0 +1,261 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type Binary = string; +export type Duration = { + height: number; +} | { + time: number; +}; +export interface InstantiateMsg { + denom: string; + is_multi_batch_enabled: boolean; + kernel_address: string; + owner?: string | null; + recipient: Recipient; + unbonding_duration: Duration; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + claim: { + batch_id: number; + number_of_claims?: number | null; + }; +} | { + claim_all: { + limit?: number | null; + up_to_time?: number | null; + }; +} | { + create_batch: { + lockup_duration?: number | null; + release_amount: WithdrawalType; + release_unit: number; + validator_to_delegate_to?: string | null; + }; +} | { + delegate: { + amount?: Uint128 | null; + validator: string; + }; +} | { + redelegate: { + amount?: Uint128 | null; + from: string; + to: string; + }; +} | { + undelegate: { + amount?: Uint128 | null; + validator: string; + }; +} | { + withdraw_rewards: {}; +} | { + vote: { + proposal_id: number; + vote: VoteOption; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type WithdrawalType = { + amount: Uint128; +} | { + percentage: Decimal; +}; +export type Uint128 = string; +export type Decimal = string; +export type VoteOption = "yes" | "no" | "abstain" | "no_with_veto"; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + batch: { + id: number; + }; +} | { + batches: { + limit?: number | null; + start_after?: number | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BatchResponse { + amount: Uint128; + amount_available_to_claim: Uint128; + amount_claimed: Uint128; + id: number; + last_claimed_release_time: number; + lockup_end: number; + number_of_available_claims: Uint128; + release_amount: WithdrawalType; + release_unit: number; +} +export type ArrayOfBatchResponse = BatchResponse[]; +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + denom: string; + is_multi_batch_enabled: boolean; + recipient: Recipient; + unbonding_duration: Duration; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type VestingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/3.0.2-beta.1/VestingContractTs.client.ts b/packages/adocodegen/src/vesting/3.0.2-beta.1/VestingContractTs.client.ts new file mode 100644 index 0000000..1763adf --- /dev/null +++ b/packages/adocodegen/src/vesting/3.0.2-beta.1/VestingContractTs.client.ts @@ -0,0 +1,322 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, Binary, Duration, InstantiateMsg, Recipient, ExecuteMsg, WithdrawalType, Uint128, Decimal, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BatchResponse, ArrayOfBatchResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VestingContractTs.types"; +export interface VestingContractTsReadOnlyInterface { + contractAddress: string; + config: () => Promise; + batch: ({ + id + }: { + id: number; + }) => Promise; + batches: ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class VestingContractTsQueryClient implements VestingContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.config = this.config.bind(this); + this.batch = this.batch.bind(this); + this.batches = this.batches.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {} + }); + }; + batch = async ({ + id + }: { + id: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + batch: { + id + } + }); + }; + batches = async ({ + limit, + startAfter + }: { + limit?: number; + startAfter?: number; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + batches: { + limit, + start_after: startAfter + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface VestingContractTsInterface { + contractAddress: string; + sender: string; + claim: ({ + batchId, + numberOfClaims + }: { + batchId: number; + numberOfClaims?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + claimAll: ({ + limit, + upToTime + }: { + limit?: number; + upToTime?: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + createBatch: ({ + lockupDuration, + releaseAmount, + releaseUnit + }: { + lockupDuration?: number; + releaseAmount: WithdrawalType; + releaseUnit: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VestingContractTsClient implements VestingContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.claim = this.claim.bind(this); + this.claimAll = this.claimAll.bind(this); + this.createBatch = this.createBatch.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + claim = async ({ + batchId, + numberOfClaims + }: { + batchId: number; + numberOfClaims?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim: { + batch_id: batchId, + number_of_claims: numberOfClaims + } + }, fee, memo, _funds); + }; + claimAll = async ({ + limit, + upToTime + }: { + limit?: number; + upToTime?: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + claim_all: { + limit, + up_to_time: upToTime + } + }, fee, memo, _funds); + }; + createBatch = async ({ + lockupDuration, + releaseAmount, + releaseUnit + }: { + lockupDuration?: number; + releaseAmount: WithdrawalType; + releaseUnit: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + create_batch: { + lockup_duration: lockupDuration, + release_amount: releaseAmount, + release_unit: releaseUnit + } + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/3.0.2-beta.1/VestingContractTs.message-builder.ts b/packages/adocodegen/src/vesting/3.0.2-beta.1/VestingContractTs.message-builder.ts new file mode 100644 index 0000000..13f17eb --- /dev/null +++ b/packages/adocodegen/src/vesting/3.0.2-beta.1/VestingContractTs.message-builder.ts @@ -0,0 +1,192 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, Binary, Duration, InstantiateMsg, Recipient, ExecuteMsg, WithdrawalType, Uint128, Decimal, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BatchResponse, ArrayOfBatchResponse, BlockHeightResponse, Config, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./VestingContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VestingContractTsExecuteMsgBuilder { + static claim = ({ + batchId, + numberOfClaims + }: CamelCasedProperties["claim"]>): ExecuteMsg => { + return { + claim: ({ + batch_id: batchId, + number_of_claims: numberOfClaims + } as const) + }; + }; + static claimAll = ({ + limit, + upToTime + }: CamelCasedProperties["claim_all"]>): ExecuteMsg => { + return { + claim_all: ({ + limit, + up_to_time: upToTime + } as const) + }; + }; + static createBatch = ({ + lockupDuration, + releaseAmount, + releaseUnit + }: CamelCasedProperties["create_batch"]>): ExecuteMsg => { + return { + create_batch: ({ + lockup_duration: lockupDuration, + release_amount: releaseAmount, + release_unit: releaseUnit + } as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class VestingContractTsQueryMsgBuilder { + static config = (): QueryMsg => { + return { + config: ({} as const) + }; + }; + static batch = ({ + id + }: CamelCasedProperties["batch"]>): QueryMsg => { + return { + batch: ({ + id + } as const) + }; + }; + static batches = ({ + limit, + startAfter + }: CamelCasedProperties["batches"]>): QueryMsg => { + return { + batches: ({ + limit, + start_after: startAfter + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vesting/3.0.2-beta.1/VestingContractTs.types.ts b/packages/adocodegen/src/vesting/3.0.2-beta.1/VestingContractTs.types.ts new file mode 100644 index 0000000..0c25bdc --- /dev/null +++ b/packages/adocodegen/src/vesting/3.0.2-beta.1/VestingContractTs.types.ts @@ -0,0 +1,235 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type Binary = string; +export type Duration = { + height: number; +} | { + time: number; +}; +export interface InstantiateMsg { + denom: string; + is_multi_batch_enabled: boolean; + kernel_address: string; + owner?: string | null; + recipient: Recipient; + unbonding_duration: Duration; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + claim: { + batch_id: number; + number_of_claims?: number | null; + }; +} | { + claim_all: { + limit?: number | null; + up_to_time?: number | null; + }; +} | { + create_batch: { + lockup_duration?: number | null; + release_amount: WithdrawalType; + release_unit: number; + }; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type WithdrawalType = { + amount: Uint128; +} | { + percentage: Decimal; +}; +export type Uint128 = string; +export type Decimal = string; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + config: {}; +} | { + batch: { + id: number; + }; +} | { + batches: { + limit?: number | null; + start_after?: number | null; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BatchResponse { + amount: Uint128; + amount_available_to_claim: Uint128; + amount_claimed: Uint128; + id: number; + last_claimed_release_time: number; + lockup_end: number; + number_of_available_claims: Uint128; + release_amount: WithdrawalType; + release_unit: number; +} +export type ArrayOfBatchResponse = BatchResponse[]; +export interface BlockHeightResponse { + block_height: number; +} +export interface Config { + denom: string; + is_multi_batch_enabled: boolean; + recipient: Recipient; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type VestingContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vfs/0.2.16/VfsContractTs.client.ts b/packages/adocodegen/src/vfs/0.2.16/VfsContractTs.client.ts new file mode 100644 index 0000000..cba1aac --- /dev/null +++ b/packages/adocodegen/src/vfs/0.2.16/VfsContractTs.client.ts @@ -0,0 +1,325 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, Addr, AndrAddr, QueryMsg, String, KernelAddressResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPathDetails, PathDetails, TypeResponse, VersionResponse } from "./VfsContractTs.types"; +export interface VfsContractTsReadOnlyInterface { + contractAddress: string; + resolvePath: ({ + path + }: { + path: AndrAddr; + }) => Promise; + subDir: ({ + limit, + max, + min, + path + }: { + limit?: number; + max?: Addr[][]; + min?: Addr[][]; + path: AndrAddr; + }) => Promise; + paths: ({ + addr + }: { + addr: Addr; + }) => Promise; + getUsername: ({ + address + }: { + address: Addr; + }) => Promise; + getLibrary: ({ + address + }: { + address: Addr; + }) => Promise; + resolveSymlink: ({ + path + }: { + path: AndrAddr; + }) => Promise; + version: () => Promise; + type: () => Promise; + owner: () => Promise; + kernelAddress: () => Promise; +} +export class VfsContractTsQueryClient implements VfsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.resolvePath = this.resolvePath.bind(this); + this.subDir = this.subDir.bind(this); + this.paths = this.paths.bind(this); + this.getUsername = this.getUsername.bind(this); + this.getLibrary = this.getLibrary.bind(this); + this.resolveSymlink = this.resolveSymlink.bind(this); + this.version = this.version.bind(this); + this.type = this.type.bind(this); + this.owner = this.owner.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + } + + resolvePath = async ({ + path + }: { + path: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + resolve_path: { + path + } + }); + }; + subDir = async ({ + limit, + max, + min, + path + }: { + limit?: number; + max?: Addr[][]; + min?: Addr[][]; + path: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sub_dir: { + limit, + max, + min, + path + } + }); + }; + paths = async ({ + addr + }: { + addr: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + paths: { + addr + } + }); + }; + getUsername = async ({ + address + }: { + address: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_username: { + address + } + }); + }; + getLibrary = async ({ + address + }: { + address: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_library: { + address + } + }); + }; + resolveSymlink = async ({ + path + }: { + path: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + resolve_symlink: { + path + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; +} +export interface VfsContractTsInterface { + contractAddress: string; + sender: string; + addPath: ({ + address, + name, + parentAddress + }: { + address: Addr; + name: string; + parentAddress?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addSymlink: ({ + name, + parentAddress, + symlink + }: { + name: string; + parentAddress?: AndrAddr; + symlink: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addChild: ({ + name, + parentAddress + }: { + name: string; + parentAddress: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerUser: ({ + address, + username + }: { + address?: Addr; + username: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerLibrary: ({ + libAddress, + libName + }: { + libAddress: Addr; + libName: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerUserCrossChain: ({ + address, + chain + }: { + address: string; + chain: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VfsContractTsClient implements VfsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addPath = this.addPath.bind(this); + this.addSymlink = this.addSymlink.bind(this); + this.addChild = this.addChild.bind(this); + this.registerUser = this.registerUser.bind(this); + this.registerLibrary = this.registerLibrary.bind(this); + this.registerUserCrossChain = this.registerUserCrossChain.bind(this); + } + + addPath = async ({ + address, + name, + parentAddress + }: { + address: Addr; + name: string; + parentAddress?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_path: { + address, + name, + parent_address: parentAddress + } + }, fee, memo, _funds); + }; + addSymlink = async ({ + name, + parentAddress, + symlink + }: { + name: string; + parentAddress?: AndrAddr; + symlink: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_symlink: { + name, + parent_address: parentAddress, + symlink + } + }, fee, memo, _funds); + }; + addChild = async ({ + name, + parentAddress + }: { + name: string; + parentAddress: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_child: { + name, + parent_address: parentAddress + } + }, fee, memo, _funds); + }; + registerUser = async ({ + address, + username + }: { + address?: Addr; + username: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_user: { + address, + username + } + }, fee, memo, _funds); + }; + registerLibrary = async ({ + libAddress, + libName + }: { + libAddress: Addr; + libName: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_library: { + lib_address: libAddress, + lib_name: libName + } + }, fee, memo, _funds); + }; + registerUserCrossChain = async ({ + address, + chain + }: { + address: string; + chain: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_user_cross_chain: { + address, + chain + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vfs/0.2.16/VfsContractTs.message-builder.ts b/packages/adocodegen/src/vfs/0.2.16/VfsContractTs.message-builder.ts new file mode 100644 index 0000000..d32c374 --- /dev/null +++ b/packages/adocodegen/src/vfs/0.2.16/VfsContractTs.message-builder.ts @@ -0,0 +1,186 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, Addr, AndrAddr, QueryMsg, String, KernelAddressResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPathDetails, PathDetails, TypeResponse, VersionResponse } from "./VfsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VfsContractTsExecuteMsgBuilder { + static addPath = ({ + address, + name, + parentAddress + }: CamelCasedProperties["add_path"]>): ExecuteMsg => { + return { + add_path: ({ + address, + name, + parent_address: parentAddress + } as const) + }; + }; + static addSymlink = ({ + name, + parentAddress, + symlink + }: CamelCasedProperties["add_symlink"]>): ExecuteMsg => { + return { + add_symlink: ({ + name, + parent_address: parentAddress, + symlink + } as const) + }; + }; + static addChild = ({ + name, + parentAddress + }: CamelCasedProperties["add_child"]>): ExecuteMsg => { + return { + add_child: ({ + name, + parent_address: parentAddress + } as const) + }; + }; + static registerUser = ({ + address, + username + }: CamelCasedProperties["register_user"]>): ExecuteMsg => { + return { + register_user: ({ + address, + username + } as const) + }; + }; + static registerLibrary = ({ + libAddress, + libName + }: CamelCasedProperties["register_library"]>): ExecuteMsg => { + return { + register_library: ({ + lib_address: libAddress, + lib_name: libName + } as const) + }; + }; + static registerUserCrossChain = ({ + address, + chain + }: CamelCasedProperties["register_user_cross_chain"]>): ExecuteMsg => { + return { + register_user_cross_chain: ({ + address, + chain + } as const) + }; + }; +} +export abstract class VfsContractTsQueryMsgBuilder { + static resolvePath = ({ + path + }: CamelCasedProperties["resolve_path"]>): QueryMsg => { + return { + resolve_path: ({ + path + } as const) + }; + }; + static subDir = ({ + limit, + max, + min, + path + }: CamelCasedProperties["sub_dir"]>): QueryMsg => { + return { + sub_dir: ({ + limit, + max, + min, + path + } as const) + }; + }; + static paths = ({ + addr + }: CamelCasedProperties["paths"]>): QueryMsg => { + return { + paths: ({ + addr + } as const) + }; + }; + static getUsername = ({ + address + }: CamelCasedProperties["get_username"]>): QueryMsg => { + return { + get_username: ({ + address + } as const) + }; + }; + static getLibrary = ({ + address + }: CamelCasedProperties["get_library"]>): QueryMsg => { + return { + get_library: ({ + address + } as const) + }; + }; + static resolveSymlink = ({ + path + }: CamelCasedProperties["resolve_symlink"]>): QueryMsg => { + return { + resolve_symlink: ({ + path + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vfs/0.2.16/VfsContractTs.types.ts b/packages/adocodegen/src/vfs/0.2.16/VfsContractTs.types.ts new file mode 100644 index 0000000..c61a30c --- /dev/null +++ b/packages/adocodegen/src/vfs/0.2.16/VfsContractTs.types.ts @@ -0,0 +1,101 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + add_path: { + address: Addr; + name: string; + parent_address?: AndrAddr | null; + }; +} | { + add_symlink: { + name: string; + parent_address?: AndrAddr | null; + symlink: AndrAddr; + }; +} | { + add_child: { + name: string; + parent_address: AndrAddr; + }; +} | { + register_user: { + address?: Addr | null; + username: string; + }; +} | { + register_library: { + lib_address: Addr; + lib_name: string; + }; +} | { + register_user_cross_chain: { + address: string; + chain: string; + }; +}; +export type Addr = string; +export type AndrAddr = string; +export type QueryMsg = { + resolve_path: { + path: AndrAddr; + }; +} | { + sub_dir: { + limit?: number | null; + max?: [Addr, string] | null; + min?: [Addr, string] | null; + path: AndrAddr; + }; +} | { + paths: { + addr: Addr; + }; +} | { + get_username: { + address: Addr; + }; +} | { + get_library: { + address: Addr; + }; +} | { + resolve_symlink: { + path: AndrAddr; + }; +} | { + version: {}; +} | { + type: {}; +} | { + owner: {}; +} | { + kernel_address: {}; +}; +export type String = string; +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPathDetails = PathDetails[]; +export interface PathDetails { + address: Addr; + name: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type VfsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vfs/0.2.2/VfsContractTs.client.ts b/packages/adocodegen/src/vfs/0.2.2/VfsContractTs.client.ts new file mode 100644 index 0000000..3d78714 --- /dev/null +++ b/packages/adocodegen/src/vfs/0.2.2/VfsContractTs.client.ts @@ -0,0 +1,282 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, Addr, AndrAddr, QueryMsg, String, ArrayOfString, ArrayOfPathDetails, PathDetails } from "./VfsContractTs.types"; +export interface VfsContractTsReadOnlyInterface { + contractAddress: string; + resolvePath: ({ + path + }: { + path: AndrAddr; + }) => Promise; + subDir: ({ + path + }: { + path: AndrAddr; + }) => Promise; + paths: ({ + addr + }: { + addr: Addr; + }) => Promise; + getUsername: ({ + address + }: { + address: Addr; + }) => Promise; + getLibrary: ({ + address + }: { + address: Addr; + }) => Promise; + resolveSymlink: ({ + path + }: { + path: AndrAddr; + }) => Promise; +} +export class VfsContractTsQueryClient implements VfsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.resolvePath = this.resolvePath.bind(this); + this.subDir = this.subDir.bind(this); + this.paths = this.paths.bind(this); + this.getUsername = this.getUsername.bind(this); + this.getLibrary = this.getLibrary.bind(this); + this.resolveSymlink = this.resolveSymlink.bind(this); + } + + resolvePath = async ({ + path + }: { + path: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + resolve_path: { + path + } + }); + }; + subDir = async ({ + path + }: { + path: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sub_dir: { + path + } + }); + }; + paths = async ({ + addr + }: { + addr: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + paths: { + addr + } + }); + }; + getUsername = async ({ + address + }: { + address: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_username: { + address + } + }); + }; + getLibrary = async ({ + address + }: { + address: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_library: { + address + } + }); + }; + resolveSymlink = async ({ + path + }: { + path: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + resolve_symlink: { + path + } + }); + }; +} +export interface VfsContractTsInterface { + contractAddress: string; + sender: string; + addPath: ({ + address, + name, + parentAddress + }: { + address: Addr; + name: string; + parentAddress?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addSymlink: ({ + name, + parentAddress, + symlink + }: { + name: string; + parentAddress?: AndrAddr; + symlink: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addParentPath: ({ + name, + parentAddress + }: { + name: string; + parentAddress: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerUser: ({ + address, + username + }: { + address?: Addr; + username: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerLibrary: ({ + libAddress, + libName + }: { + libAddress: Addr; + libName: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerUserCrossChain: ({ + address, + chain + }: { + address: string; + chain: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VfsContractTsClient implements VfsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addPath = this.addPath.bind(this); + this.addSymlink = this.addSymlink.bind(this); + this.addParentPath = this.addParentPath.bind(this); + this.registerUser = this.registerUser.bind(this); + this.registerLibrary = this.registerLibrary.bind(this); + this.registerUserCrossChain = this.registerUserCrossChain.bind(this); + } + + addPath = async ({ + address, + name, + parentAddress + }: { + address: Addr; + name: string; + parentAddress?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_path: { + address, + name, + parent_address: parentAddress + } + }, fee, memo, _funds); + }; + addSymlink = async ({ + name, + parentAddress, + symlink + }: { + name: string; + parentAddress?: AndrAddr; + symlink: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_symlink: { + name, + parent_address: parentAddress, + symlink + } + }, fee, memo, _funds); + }; + addParentPath = async ({ + name, + parentAddress + }: { + name: string; + parentAddress: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_parent_path: { + name, + parent_address: parentAddress + } + }, fee, memo, _funds); + }; + registerUser = async ({ + address, + username + }: { + address?: Addr; + username: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_user: { + address, + username + } + }, fee, memo, _funds); + }; + registerLibrary = async ({ + libAddress, + libName + }: { + libAddress: Addr; + libName: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_library: { + lib_address: libAddress, + lib_name: libName + } + }, fee, memo, _funds); + }; + registerUserCrossChain = async ({ + address, + chain + }: { + address: string; + chain: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_user_cross_chain: { + address, + chain + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vfs/0.2.2/VfsContractTs.message-builder.ts b/packages/adocodegen/src/vfs/0.2.2/VfsContractTs.message-builder.ts new file mode 100644 index 0000000..5c9263f --- /dev/null +++ b/packages/adocodegen/src/vfs/0.2.2/VfsContractTs.message-builder.ts @@ -0,0 +1,160 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, Addr, AndrAddr, QueryMsg, String, ArrayOfString, ArrayOfPathDetails, PathDetails } from "./VfsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VfsContractTsExecuteMsgBuilder { + static addPath = ({ + address, + name, + parentAddress + }: CamelCasedProperties["add_path"]>): ExecuteMsg => { + return { + add_path: ({ + address, + name, + parent_address: parentAddress + } as const) + }; + }; + static addSymlink = ({ + name, + parentAddress, + symlink + }: CamelCasedProperties["add_symlink"]>): ExecuteMsg => { + return { + add_symlink: ({ + name, + parent_address: parentAddress, + symlink + } as const) + }; + }; + static addParentPath = ({ + name, + parentAddress + }: CamelCasedProperties["add_parent_path"]>): ExecuteMsg => { + return { + add_parent_path: ({ + name, + parent_address: parentAddress + } as const) + }; + }; + static registerUser = ({ + address, + username + }: CamelCasedProperties["register_user"]>): ExecuteMsg => { + return { + register_user: ({ + address, + username + } as const) + }; + }; + static registerLibrary = ({ + libAddress, + libName + }: CamelCasedProperties["register_library"]>): ExecuteMsg => { + return { + register_library: ({ + lib_address: libAddress, + lib_name: libName + } as const) + }; + }; + static registerUserCrossChain = ({ + address, + chain + }: CamelCasedProperties["register_user_cross_chain"]>): ExecuteMsg => { + return { + register_user_cross_chain: ({ + address, + chain + } as const) + }; + }; +} +export abstract class VfsContractTsQueryMsgBuilder { + static resolvePath = ({ + path + }: CamelCasedProperties["resolve_path"]>): QueryMsg => { + return { + resolve_path: ({ + path + } as const) + }; + }; + static subDir = ({ + path + }: CamelCasedProperties["sub_dir"]>): QueryMsg => { + return { + sub_dir: ({ + path + } as const) + }; + }; + static paths = ({ + addr + }: CamelCasedProperties["paths"]>): QueryMsg => { + return { + paths: ({ + addr + } as const) + }; + }; + static getUsername = ({ + address + }: CamelCasedProperties["get_username"]>): QueryMsg => { + return { + get_username: ({ + address + } as const) + }; + }; + static getLibrary = ({ + address + }: CamelCasedProperties["get_library"]>): QueryMsg => { + return { + get_library: ({ + address + } as const) + }; + }; + static resolveSymlink = ({ + path + }: CamelCasedProperties["resolve_symlink"]>): QueryMsg => { + return { + resolve_symlink: ({ + path + } as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vfs/0.2.2/VfsContractTs.types.ts b/packages/adocodegen/src/vfs/0.2.2/VfsContractTs.types.ts new file mode 100644 index 0000000..cad38c2 --- /dev/null +++ b/packages/adocodegen/src/vfs/0.2.2/VfsContractTs.types.ts @@ -0,0 +1,78 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + add_path: { + address: Addr; + name: string; + parent_address?: AndrAddr | null; + }; +} | { + add_symlink: { + name: string; + parent_address?: AndrAddr | null; + symlink: AndrAddr; + }; +} | { + add_parent_path: { + name: string; + parent_address: AndrAddr; + }; +} | { + register_user: { + address?: Addr | null; + username: string; + }; +} | { + register_library: { + lib_address: Addr; + lib_name: string; + }; +} | { + register_user_cross_chain: { + address: string; + chain: string; + }; +}; +export type Addr = string; +export type AndrAddr = string; +export type QueryMsg = { + resolve_path: { + path: AndrAddr; + }; +} | { + sub_dir: { + path: AndrAddr; + }; +} | { + paths: { + addr: Addr; + }; +} | { + get_username: { + address: Addr; + }; +} | { + get_library: { + address: Addr; + }; +} | { + resolve_symlink: { + path: AndrAddr; + }; +}; +export type String = string; +export type ArrayOfString = string[]; +export type ArrayOfPathDetails = PathDetails[]; +export interface PathDetails { + address: Addr; + name: string; +} +export type VfsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/vfs/1.1.1/VfsContractTs.client.ts b/packages/adocodegen/src/vfs/1.1.1/VfsContractTs.client.ts new file mode 100644 index 0000000..824d08a --- /dev/null +++ b/packages/adocodegen/src/vfs/1.1.1/VfsContractTs.client.ts @@ -0,0 +1,332 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { Coin, StdFee } from "@cosmjs/amino"; +import { InstantiateMsg, ExecuteMsg, Addr, AndrAddr, OwnershipMessage, Expiry, Milliseconds, QueryMsg, SubDirBound, String, KernelAddressResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPathDetails, PathDetails, TypeResponse, VersionResponse } from "./VfsContractTs.types"; +export interface VfsContractTsReadOnlyInterface { + contractAddress: string; + resolvePath: ({ + path + }: { + path: AndrAddr; + }) => Promise; + subDir: ({ + limit, + max, + min, + path + }: { + limit?: number; + max?: SubDirBound; + min?: SubDirBound; + path: AndrAddr; + }) => Promise; + paths: ({ + addr + }: { + addr: Addr; + }) => Promise; + getUsername: ({ + address + }: { + address: Addr; + }) => Promise; + getLibrary: ({ + address + }: { + address: Addr; + }) => Promise; + resolveSymlink: ({ + path + }: { + path: AndrAddr; + }) => Promise; + version: () => Promise; + type: () => Promise; + owner: () => Promise; + kernelAddress: () => Promise; +} +export class VfsContractTsQueryClient implements VfsContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.resolvePath = this.resolvePath.bind(this); + this.subDir = this.subDir.bind(this); + this.paths = this.paths.bind(this); + this.getUsername = this.getUsername.bind(this); + this.getLibrary = this.getLibrary.bind(this); + this.resolveSymlink = this.resolveSymlink.bind(this); + this.version = this.version.bind(this); + this.type = this.type.bind(this); + this.owner = this.owner.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + } + + resolvePath = async ({ + path + }: { + path: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + resolve_path: { + path + } + }); + }; + subDir = async ({ + limit, + max, + min, + path + }: { + limit?: number; + max?: SubDirBound; + min?: SubDirBound; + path: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + sub_dir: { + limit, + max, + min, + path + } + }); + }; + paths = async ({ + addr + }: { + addr: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + paths: { + addr + } + }); + }; + getUsername = async ({ + address + }: { + address: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_username: { + address + } + }); + }; + getLibrary = async ({ + address + }: { + address: Addr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_library: { + address + } + }); + }; + resolveSymlink = async ({ + path + }: { + path: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + resolve_symlink: { + path + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; +} +export interface VfsContractTsInterface { + contractAddress: string; + sender: string; + addPath: ({ + address, + name, + parentAddress + }: { + address: Addr; + name: string; + parentAddress?: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addSymlink: ({ + name, + parentAddress, + symlink + }: { + name: string; + parentAddress?: AndrAddr; + symlink: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addChild: ({ + name, + parentAddress + }: { + name: string; + parentAddress: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerUser: ({ + address, + username + }: { + address?: Addr; + username: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerLibrary: ({ + libAddress, + libName + }: { + libAddress: Addr; + libName: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + registerUserCrossChain: ({ + address, + chain + }: { + address: string; + chain: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class VfsContractTsClient implements VfsContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.addPath = this.addPath.bind(this); + this.addSymlink = this.addSymlink.bind(this); + this.addChild = this.addChild.bind(this); + this.registerUser = this.registerUser.bind(this); + this.registerLibrary = this.registerLibrary.bind(this); + this.registerUserCrossChain = this.registerUserCrossChain.bind(this); + this.ownership = this.ownership.bind(this); + } + + addPath = async ({ + address, + name, + parentAddress + }: { + address: Addr; + name: string; + parentAddress?: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_path: { + address, + name, + parent_address: parentAddress + } + }, fee, memo, _funds); + }; + addSymlink = async ({ + name, + parentAddress, + symlink + }: { + name: string; + parentAddress?: AndrAddr; + symlink: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_symlink: { + name, + parent_address: parentAddress, + symlink + } + }, fee, memo, _funds); + }; + addChild = async ({ + name, + parentAddress + }: { + name: string; + parentAddress: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_child: { + name, + parent_address: parentAddress + } + }, fee, memo, _funds); + }; + registerUser = async ({ + address, + username + }: { + address?: Addr; + username: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_user: { + address, + username + } + }, fee, memo, _funds); + }; + registerLibrary = async ({ + libAddress, + libName + }: { + libAddress: Addr; + libName: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_library: { + lib_address: libAddress, + lib_name: libName + } + }, fee, memo, _funds); + }; + registerUserCrossChain = async ({ + address, + chain + }: { + address: string; + chain: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + register_user_cross_chain: { + address, + chain + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vfs/1.1.1/VfsContractTs.message-builder.ts b/packages/adocodegen/src/vfs/1.1.1/VfsContractTs.message-builder.ts new file mode 100644 index 0000000..e349464 --- /dev/null +++ b/packages/adocodegen/src/vfs/1.1.1/VfsContractTs.message-builder.ts @@ -0,0 +1,191 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { InstantiateMsg, ExecuteMsg, Addr, AndrAddr, OwnershipMessage, Expiry, Milliseconds, QueryMsg, SubDirBound, String, KernelAddressResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPathDetails, PathDetails, TypeResponse, VersionResponse } from "./VfsContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class VfsContractTsExecuteMsgBuilder { + static addPath = ({ + address, + name, + parentAddress + }: CamelCasedProperties["add_path"]>): ExecuteMsg => { + return { + add_path: ({ + address, + name, + parent_address: parentAddress + } as const) + }; + }; + static addSymlink = ({ + name, + parentAddress, + symlink + }: CamelCasedProperties["add_symlink"]>): ExecuteMsg => { + return { + add_symlink: ({ + name, + parent_address: parentAddress, + symlink + } as const) + }; + }; + static addChild = ({ + name, + parentAddress + }: CamelCasedProperties["add_child"]>): ExecuteMsg => { + return { + add_child: ({ + name, + parent_address: parentAddress + } as const) + }; + }; + static registerUser = ({ + address, + username + }: CamelCasedProperties["register_user"]>): ExecuteMsg => { + return { + register_user: ({ + address, + username + } as const) + }; + }; + static registerLibrary = ({ + libAddress, + libName + }: CamelCasedProperties["register_library"]>): ExecuteMsg => { + return { + register_library: ({ + lib_address: libAddress, + lib_name: libName + } as const) + }; + }; + static registerUserCrossChain = ({ + address, + chain + }: CamelCasedProperties["register_user_cross_chain"]>): ExecuteMsg => { + return { + register_user_cross_chain: ({ + address, + chain + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; +} +export abstract class VfsContractTsQueryMsgBuilder { + static resolvePath = ({ + path + }: CamelCasedProperties["resolve_path"]>): QueryMsg => { + return { + resolve_path: ({ + path + } as const) + }; + }; + static subDir = ({ + limit, + max, + min, + path + }: CamelCasedProperties["sub_dir"]>): QueryMsg => { + return { + sub_dir: ({ + limit, + max, + min, + path + } as const) + }; + }; + static paths = ({ + addr + }: CamelCasedProperties["paths"]>): QueryMsg => { + return { + paths: ({ + addr + } as const) + }; + }; + static getUsername = ({ + address + }: CamelCasedProperties["get_username"]>): QueryMsg => { + return { + get_username: ({ + address + } as const) + }; + }; + static getLibrary = ({ + address + }: CamelCasedProperties["get_library"]>): QueryMsg => { + return { + get_library: ({ + address + } as const) + }; + }; + static resolveSymlink = ({ + path + }: CamelCasedProperties["resolve_symlink"]>): QueryMsg => { + return { + resolve_symlink: ({ + path + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/vfs/1.1.1/VfsContractTs.types.ts b/packages/adocodegen/src/vfs/1.1.1/VfsContractTs.types.ts new file mode 100644 index 0000000..88c8029 --- /dev/null +++ b/packages/adocodegen/src/vfs/1.1.1/VfsContractTs.types.ts @@ -0,0 +1,119 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export interface InstantiateMsg { + kernel_address: string; + owner?: string | null; +} +export type ExecuteMsg = { + add_path: { + address: Addr; + name: string; + parent_address?: AndrAddr | null; + }; +} | { + add_symlink: { + name: string; + parent_address?: AndrAddr | null; + symlink: AndrAddr; + }; +} | { + add_child: { + name: string; + parent_address: AndrAddr; + }; +} | { + register_user: { + address?: Addr | null; + username: string; + }; +} | { + register_library: { + lib_address: Addr; + lib_name: string; + }; +} | { + register_user_cross_chain: { + address: string; + chain: string; + }; +} | { + ownership: OwnershipMessage; +}; +export type Addr = string; +export type AndrAddr = string; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type QueryMsg = { + resolve_path: { + path: AndrAddr; + }; +} | { + sub_dir: { + limit?: number | null; + max?: SubDirBound | null; + min?: SubDirBound | null; + path: AndrAddr; + }; +} | { + paths: { + addr: Addr; + }; +} | { + get_username: { + address: Addr; + }; +} | { + get_library: { + address: Addr; + }; +} | { + resolve_symlink: { + path: AndrAddr; + }; +} | { + version: {}; +} | { + type: {}; +} | { + owner: {}; +} | { + kernel_address: {}; +}; +export interface SubDirBound { + address: Addr; + name: string; +} +export type String = string; +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPathDetails = PathDetails[]; +export interface PathDetails { + address: Addr; + name: string; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type VfsContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/0.2.1/WeightedDistributionSplitterContractTs.client.ts b/packages/adocodegen/src/weighted-distribution-splitter/0.2.1/WeightedDistributionSplitterContractTs.client.ts new file mode 100644 index 0000000..499aa1e --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/0.2.1/WeightedDistributionSplitterContractTs.client.ts @@ -0,0 +1,400 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, Binary, Uint128, InstantiateMsg, Module, AddressWeight, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, GetUserWeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./WeightedDistributionSplitterContractTs.types"; +export interface WeightedDistributionSplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + getUserWeight: ({ + user + }: { + user: Recipient; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class WeightedDistributionSplitterContractTsQueryClient implements WeightedDistributionSplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.getUserWeight = this.getUserWeight.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + getUserWeight = async ({ + user + }: { + user: Recipient; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_user_weight: { + user + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface WeightedDistributionSplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressWeight[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRecipientWeight: ({ + recipient + }: { + recipient: AddressWeight; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addRecipient: ({ + recipient + }: { + recipient: AddressWeight; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRecipient: ({ + recipient + }: { + recipient: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + setPermission: ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removePermission: ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissionAction: ({ + action + }: { + action: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class WeightedDistributionSplitterContractTsClient implements WeightedDistributionSplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateRecipientWeight = this.updateRecipientWeight.bind(this); + this.addRecipient = this.addRecipient.bind(this); + this.removeRecipient = this.removeRecipient.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.setPermission = this.setPermission.bind(this); + this.removePermission = this.removePermission.bind(this); + this.permissionAction = this.permissionAction.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressWeight[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateRecipientWeight = async ({ + recipient + }: { + recipient: AddressWeight; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipient_weight: { + recipient + } + }, fee, memo, _funds); + }; + addRecipient = async ({ + recipient + }: { + recipient: AddressWeight; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_recipient: { + recipient + } + }, fee, memo, _funds); + }; + removeRecipient = async ({ + recipient + }: { + recipient: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_recipient: { + recipient + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + setPermission = async ({ + action, + actor, + permission + }: { + action: string; + actor: AndrAddr; + permission: Permission; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + set_permission: { + action, + actor, + permission + } + }, fee, memo, _funds); + }; + removePermission = async ({ + action, + actor + }: { + action: string; + actor: AndrAddr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_permission: { + action, + actor + } + }, fee, memo, _funds); + }; + permissionAction = async ({ + action + }: { + action: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permission_action: { + action + } + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/0.2.1/WeightedDistributionSplitterContractTs.message-builder.ts b/packages/adocodegen/src/weighted-distribution-splitter/0.2.1/WeightedDistributionSplitterContractTs.message-builder.ts new file mode 100644 index 0000000..b589219 --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/0.2.1/WeightedDistributionSplitterContractTs.message-builder.ts @@ -0,0 +1,244 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, Binary, Uint128, InstantiateMsg, Module, AddressWeight, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, GetUserWeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./WeightedDistributionSplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class WeightedDistributionSplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateRecipientWeight = ({ + recipient + }: CamelCasedProperties["update_recipient_weight"]>): ExecuteMsg => { + return { + update_recipient_weight: ({ + recipient + } as const) + }; + }; + static addRecipient = ({ + recipient + }: CamelCasedProperties["add_recipient"]>): ExecuteMsg => { + return { + add_recipient: ({ + recipient + } as const) + }; + }; + static removeRecipient = ({ + recipient + }: CamelCasedProperties["remove_recipient"]>): ExecuteMsg => { + return { + remove_recipient: ({ + recipient + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static setPermission = ({ + action, + actor, + permission + }: CamelCasedProperties["set_permission"]>): ExecuteMsg => { + return { + set_permission: ({ + action, + actor, + permission + } as const) + }; + }; + static removePermission = ({ + action, + actor + }: CamelCasedProperties["remove_permission"]>): ExecuteMsg => { + return { + remove_permission: ({ + action, + actor + } as const) + }; + }; + static permissionAction = ({ + action + }: CamelCasedProperties["permission_action"]>): ExecuteMsg => { + return { + permission_action: ({ + action + } as const) + }; + }; +} +export abstract class WeightedDistributionSplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static getUserWeight = ({ + user + }: CamelCasedProperties["get_user_weight"]>): QueryMsg => { + return { + get_user_weight: ({ + user + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/0.2.1/WeightedDistributionSplitterContractTs.types.ts b/packages/adocodegen/src/weighted-distribution-splitter/0.2.1/WeightedDistributionSplitterContractTs.types.ts new file mode 100644 index 0000000..ff6a7d5 --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/0.2.1/WeightedDistributionSplitterContractTs.types.ts @@ -0,0 +1,226 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type Binary = string; +export type Uint128 = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + modules?: Module[] | null; + owner?: string | null; + recipients: AddressWeight[]; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export interface AddressWeight { + recipient: Recipient; + weight: Uint128; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressWeight[]; + }; +} | { + update_recipient_weight: { + recipient: AddressWeight; + }; +} | { + add_recipient: { + recipient: AddressWeight; + }; +} | { + remove_recipient: { + recipient: Recipient; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + get_user_weight: { + user: Recipient; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressWeight[]; +} +export interface GetUserWeightResponse { + total_weight: Uint128; + weight: Uint128; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type WeightedDistributionSplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/0.2.16/WeightedDistributionSplitterContractTs.client.ts b/packages/adocodegen/src/weighted-distribution-splitter/0.2.16/WeightedDistributionSplitterContractTs.client.ts new file mode 100644 index 0000000..f5fbbbf --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/0.2.16/WeightedDistributionSplitterContractTs.client.ts @@ -0,0 +1,341 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, Binary, Uint128, InstantiateMsg, Module, AddressWeight, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, GetUserWeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./WeightedDistributionSplitterContractTs.types"; +export interface WeightedDistributionSplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + getUserWeight: ({ + user + }: { + user: Recipient; + }) => Promise; + owner: () => Promise; + operators: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + isOperator: ({ + address + }: { + address: string; + }) => Promise; + version: () => Promise; + balance: ({ + address + }: { + address: AndrAddr; + }) => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class WeightedDistributionSplitterContractTsQueryClient implements WeightedDistributionSplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.getUserWeight = this.getUserWeight.bind(this); + this.owner = this.owner.bind(this); + this.operators = this.operators.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.isOperator = this.isOperator.bind(this); + this.version = this.version.bind(this); + this.balance = this.balance.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + getUserWeight = async ({ + user + }: { + user: Recipient; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_user_weight: { + user + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + operators = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + operators: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + isOperator = async ({ + address + }: { + address: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + is_operator: { + address + } + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + balance = async ({ + address + }: { + address: AndrAddr; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + balance: { + address + } + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface WeightedDistributionSplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressWeight[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRecipientWeight: ({ + recipient + }: { + recipient: AddressWeight; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addRecipient: ({ + recipient + }: { + recipient: AddressWeight; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRecipient: ({ + recipient + }: { + recipient: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class WeightedDistributionSplitterContractTsClient implements WeightedDistributionSplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateRecipientWeight = this.updateRecipientWeight.bind(this); + this.addRecipient = this.addRecipient.bind(this); + this.removeRecipient = this.removeRecipient.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressWeight[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateRecipientWeight = async ({ + recipient + }: { + recipient: AddressWeight; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipient_weight: { + recipient + } + }, fee, memo, _funds); + }; + addRecipient = async ({ + recipient + }: { + recipient: AddressWeight; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_recipient: { + recipient + } + }, fee, memo, _funds); + }; + removeRecipient = async ({ + recipient + }: { + recipient: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_recipient: { + recipient + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/0.2.16/WeightedDistributionSplitterContractTs.message-builder.ts b/packages/adocodegen/src/weighted-distribution-splitter/0.2.16/WeightedDistributionSplitterContractTs.message-builder.ts new file mode 100644 index 0000000..5b2b6b0 --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/0.2.16/WeightedDistributionSplitterContractTs.message-builder.ts @@ -0,0 +1,210 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, Binary, Uint128, InstantiateMsg, Module, AddressWeight, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiration, Timestamp, Uint64, Addr, PermissioningMessage, Permission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, BalanceResponse, BlockHeightResponse, GetSplitterConfigResponse, Splitter, GetUserWeightResponse, IsOperatorResponse, KernelAddressResponse, OperatorsResponse, PublisherResponse, ContractOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./WeightedDistributionSplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class WeightedDistributionSplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateRecipientWeight = ({ + recipient + }: CamelCasedProperties["update_recipient_weight"]>): ExecuteMsg => { + return { + update_recipient_weight: ({ + recipient + } as const) + }; + }; + static addRecipient = ({ + recipient + }: CamelCasedProperties["add_recipient"]>): ExecuteMsg => { + return { + add_recipient: ({ + recipient + } as const) + }; + }; + static removeRecipient = ({ + recipient + }: CamelCasedProperties["remove_recipient"]>): ExecuteMsg => { + return { + remove_recipient: ({ + recipient + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class WeightedDistributionSplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static getUserWeight = ({ + user + }: CamelCasedProperties["get_user_weight"]>): QueryMsg => { + return { + get_user_weight: ({ + user + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static operators = (): QueryMsg => { + return { + operators: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static isOperator = ({ + address + }: CamelCasedProperties["is_operator"]>): QueryMsg => { + return { + is_operator: ({ + address + } as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static balance = ({ + address + }: CamelCasedProperties["balance"]>): QueryMsg => { + return { + balance: ({ + address + } as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/0.2.16/WeightedDistributionSplitterContractTs.types.ts b/packages/adocodegen/src/weighted-distribution-splitter/0.2.16/WeightedDistributionSplitterContractTs.types.ts new file mode 100644 index 0000000..4cd9ddc --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/0.2.16/WeightedDistributionSplitterContractTs.types.ts @@ -0,0 +1,233 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type Binary = string; +export type Uint128 = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + modules?: Module[] | null; + owner?: string | null; + recipients: AddressWeight[]; +} +export interface Module { + address: AndrAddr; + is_mutable: boolean; + name?: string | null; +} +export interface AddressWeight { + recipient: Recipient; + weight: Uint128; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressWeight[]; + }; +} | { + update_recipient_weight: { + recipient: AddressWeight; + }; +} | { + add_recipient: { + recipient: AddressWeight; + }; +} | { + remove_recipient: { + recipient: Recipient; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiration | null; + new_owner: Addr; + }; +} | { + update_operators: { + new_operators: Addr[]; + }; +}; +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + blacklisted: Expiration | null; +} | { + limited: { + expiration?: Expiration | null; + uses: number; + }; +} | { + whitelisted: Expiration | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + get_user_weight: { + user: Recipient; + }; +} | { + owner: {}; +} | { + operators: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + is_operator: { + address: string; + }; +} | { + version: {}; +} | { + balance: { + address: AndrAddr; + }; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface BalanceResponse { + amount: Coin; + [k: string]: unknown; +} +export interface BlockHeightResponse { + block_height: number; +} +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressWeight[]; +} +export interface GetUserWeightResponse { + total_weight: Uint128; + weight: Uint128; +} +export interface IsOperatorResponse { + is_operator: boolean; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface OperatorsResponse { + operators: string[]; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type WeightedDistributionSplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/2.0.0/WeightedDistributionSplitterContractTs.client.ts b/packages/adocodegen/src/weighted-distribution-splitter/2.0.0/WeightedDistributionSplitterContractTs.client.ts new file mode 100644 index 0000000..b208985 --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/2.0.0/WeightedDistributionSplitterContractTs.client.ts @@ -0,0 +1,321 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, Binary, Uint128, InstantiateMsg, AddressWeight, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Expiration, Timestamp, Uint64, GetSplitterConfigResponse, Splitter, GetUserWeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./WeightedDistributionSplitterContractTs.types"; +export interface WeightedDistributionSplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + getUserWeight: ({ + user + }: { + user: Recipient; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class WeightedDistributionSplitterContractTsQueryClient implements WeightedDistributionSplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.getUserWeight = this.getUserWeight.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + getUserWeight = async ({ + user + }: { + user: Recipient; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_user_weight: { + user + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface WeightedDistributionSplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressWeight[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRecipientWeight: ({ + recipient + }: { + recipient: AddressWeight; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addRecipient: ({ + recipient + }: { + recipient: AddressWeight; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRecipient: ({ + recipient + }: { + recipient: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class WeightedDistributionSplitterContractTsClient implements WeightedDistributionSplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateRecipientWeight = this.updateRecipientWeight.bind(this); + this.addRecipient = this.addRecipient.bind(this); + this.removeRecipient = this.removeRecipient.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressWeight[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateRecipientWeight = async ({ + recipient + }: { + recipient: AddressWeight; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipient_weight: { + recipient + } + }, fee, memo, _funds); + }; + addRecipient = async ({ + recipient + }: { + recipient: AddressWeight; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_recipient: { + recipient + } + }, fee, memo, _funds); + }; + removeRecipient = async ({ + recipient + }: { + recipient: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_recipient: { + recipient + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/2.0.0/WeightedDistributionSplitterContractTs.message-builder.ts b/packages/adocodegen/src/weighted-distribution-splitter/2.0.0/WeightedDistributionSplitterContractTs.message-builder.ts new file mode 100644 index 0000000..7514495 --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/2.0.0/WeightedDistributionSplitterContractTs.message-builder.ts @@ -0,0 +1,198 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, Binary, Uint128, InstantiateMsg, AddressWeight, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Expiration, Timestamp, Uint64, GetSplitterConfigResponse, Splitter, GetUserWeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./WeightedDistributionSplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class WeightedDistributionSplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateRecipientWeight = ({ + recipient + }: CamelCasedProperties["update_recipient_weight"]>): ExecuteMsg => { + return { + update_recipient_weight: ({ + recipient + } as const) + }; + }; + static addRecipient = ({ + recipient + }: CamelCasedProperties["add_recipient"]>): ExecuteMsg => { + return { + add_recipient: ({ + recipient + } as const) + }; + }; + static removeRecipient = ({ + recipient + }: CamelCasedProperties["remove_recipient"]>): ExecuteMsg => { + return { + remove_recipient: ({ + recipient + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class WeightedDistributionSplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static getUserWeight = ({ + user + }: CamelCasedProperties["get_user_weight"]>): QueryMsg => { + return { + get_user_weight: ({ + user + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/2.0.0/WeightedDistributionSplitterContractTs.types.ts b/packages/adocodegen/src/weighted-distribution-splitter/2.0.0/WeightedDistributionSplitterContractTs.types.ts new file mode 100644 index 0000000..6acd283 --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/2.0.0/WeightedDistributionSplitterContractTs.types.ts @@ -0,0 +1,230 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type Binary = string; +export type Uint128 = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + owner?: string | null; + recipients: AddressWeight[]; +} +export interface AddressWeight { + recipient: Recipient; + weight: Uint128; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressWeight[]; + }; +} | { + update_recipient_weight: { + recipient: AddressWeight; + }; +} | { + add_recipient: { + recipient: AddressWeight; + }; +} | { + remove_recipient: { + recipient: Recipient; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actor: AndrAddr; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actor: AndrAddr; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + get_user_weight: { + user: Recipient; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressWeight[]; +} +export interface GetUserWeightResponse { + total_weight: Uint128; + weight: Uint128; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type WeightedDistributionSplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/2.0.1-beta.1/WeightedDistributionSplitterContractTs.client.ts b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1-beta.1/WeightedDistributionSplitterContractTs.client.ts new file mode 100644 index 0000000..b208985 --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1-beta.1/WeightedDistributionSplitterContractTs.client.ts @@ -0,0 +1,321 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, Binary, Uint128, InstantiateMsg, AddressWeight, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Expiration, Timestamp, Uint64, GetSplitterConfigResponse, Splitter, GetUserWeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./WeightedDistributionSplitterContractTs.types"; +export interface WeightedDistributionSplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + getUserWeight: ({ + user + }: { + user: Recipient; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class WeightedDistributionSplitterContractTsQueryClient implements WeightedDistributionSplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.getUserWeight = this.getUserWeight.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + getUserWeight = async ({ + user + }: { + user: Recipient; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_user_weight: { + user + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface WeightedDistributionSplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressWeight[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRecipientWeight: ({ + recipient + }: { + recipient: AddressWeight; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addRecipient: ({ + recipient + }: { + recipient: AddressWeight; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRecipient: ({ + recipient + }: { + recipient: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class WeightedDistributionSplitterContractTsClient implements WeightedDistributionSplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateRecipientWeight = this.updateRecipientWeight.bind(this); + this.addRecipient = this.addRecipient.bind(this); + this.removeRecipient = this.removeRecipient.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressWeight[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateRecipientWeight = async ({ + recipient + }: { + recipient: AddressWeight; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipient_weight: { + recipient + } + }, fee, memo, _funds); + }; + addRecipient = async ({ + recipient + }: { + recipient: AddressWeight; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_recipient: { + recipient + } + }, fee, memo, _funds); + }; + removeRecipient = async ({ + recipient + }: { + recipient: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_recipient: { + recipient + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/2.0.1-beta.1/WeightedDistributionSplitterContractTs.message-builder.ts b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1-beta.1/WeightedDistributionSplitterContractTs.message-builder.ts new file mode 100644 index 0000000..7514495 --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1-beta.1/WeightedDistributionSplitterContractTs.message-builder.ts @@ -0,0 +1,198 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, Binary, Uint128, InstantiateMsg, AddressWeight, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Expiration, Timestamp, Uint64, GetSplitterConfigResponse, Splitter, GetUserWeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./WeightedDistributionSplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class WeightedDistributionSplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateRecipientWeight = ({ + recipient + }: CamelCasedProperties["update_recipient_weight"]>): ExecuteMsg => { + return { + update_recipient_weight: ({ + recipient + } as const) + }; + }; + static addRecipient = ({ + recipient + }: CamelCasedProperties["add_recipient"]>): ExecuteMsg => { + return { + add_recipient: ({ + recipient + } as const) + }; + }; + static removeRecipient = ({ + recipient + }: CamelCasedProperties["remove_recipient"]>): ExecuteMsg => { + return { + remove_recipient: ({ + recipient + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class WeightedDistributionSplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static getUserWeight = ({ + user + }: CamelCasedProperties["get_user_weight"]>): QueryMsg => { + return { + get_user_weight: ({ + user + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/2.0.1-beta.1/WeightedDistributionSplitterContractTs.types.ts b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1-beta.1/WeightedDistributionSplitterContractTs.types.ts new file mode 100644 index 0000000..381d95c --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1-beta.1/WeightedDistributionSplitterContractTs.types.ts @@ -0,0 +1,230 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type Binary = string; +export type Uint128 = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + owner?: string | null; + recipients: AddressWeight[]; +} +export interface AddressWeight { + recipient: Recipient; + weight: Uint128; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressWeight[]; + }; +} | { + update_recipient_weight: { + recipient: AddressWeight; + }; +} | { + add_recipient: { + recipient: AddressWeight; + }; +} | { + remove_recipient: { + recipient: Recipient; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + get_user_weight: { + user: Recipient; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressWeight[]; +} +export interface GetUserWeightResponse { + total_weight: Uint128; + weight: Uint128; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type WeightedDistributionSplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/2.0.1/WeightedDistributionSplitterContractTs.client.ts b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1/WeightedDistributionSplitterContractTs.client.ts new file mode 100644 index 0000000..b208985 --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1/WeightedDistributionSplitterContractTs.client.ts @@ -0,0 +1,321 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; +import { StdFee } from "@cosmjs/amino"; +import { AndrAddr, Binary, Uint128, InstantiateMsg, AddressWeight, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Expiration, Timestamp, Uint64, GetSplitterConfigResponse, Splitter, GetUserWeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./WeightedDistributionSplitterContractTs.types"; +export interface WeightedDistributionSplitterContractTsReadOnlyInterface { + contractAddress: string; + getSplitterConfig: () => Promise; + getUserWeight: ({ + user + }: { + user: Recipient; + }) => Promise; + owner: () => Promise; + ownershipRequest: () => Promise; + type: () => Promise; + kernelAddress: () => Promise; + appContract: () => Promise; + originalPublisher: () => Promise; + blockHeightUponCreation: () => Promise; + version: () => Promise; + aDOBaseVersion: () => Promise; + permissions: ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }) => Promise; + permissionedActions: () => Promise; +} +export class WeightedDistributionSplitterContractTsQueryClient implements WeightedDistributionSplitterContractTsReadOnlyInterface { + client: CosmWasmClient; + contractAddress: string; + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client; + this.contractAddress = contractAddress; + this.getSplitterConfig = this.getSplitterConfig.bind(this); + this.getUserWeight = this.getUserWeight.bind(this); + this.owner = this.owner.bind(this); + this.ownershipRequest = this.ownershipRequest.bind(this); + this.type = this.type.bind(this); + this.kernelAddress = this.kernelAddress.bind(this); + this.appContract = this.appContract.bind(this); + this.originalPublisher = this.originalPublisher.bind(this); + this.blockHeightUponCreation = this.blockHeightUponCreation.bind(this); + this.version = this.version.bind(this); + this.aDOBaseVersion = this.aDOBaseVersion.bind(this); + this.permissions = this.permissions.bind(this); + this.permissionedActions = this.permissionedActions.bind(this); + } + + getSplitterConfig = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_splitter_config: {} + }); + }; + getUserWeight = async ({ + user + }: { + user: Recipient; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + get_user_weight: { + user + } + }); + }; + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {} + }); + }; + ownershipRequest = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + ownership_request: {} + }); + }; + type = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + type: {} + }); + }; + kernelAddress = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + kernel_address: {} + }); + }; + appContract = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + app_contract: {} + }); + }; + originalPublisher = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + original_publisher: {} + }); + }; + blockHeightUponCreation = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + block_height_upon_creation: {} + }); + }; + version = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + version: {} + }); + }; + aDOBaseVersion = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + a_d_o_base_version: {} + }); + }; + permissions = async ({ + actor, + limit, + startAfter + }: { + actor: string; + limit?: number; + startAfter?: string; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissions: { + actor, + limit, + start_after: startAfter + } + }); + }; + permissionedActions = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + permissioned_actions: {} + }); + }; +} +export interface WeightedDistributionSplitterContractTsInterface { + contractAddress: string; + sender: string; + updateRecipients: ({ + recipients + }: { + recipients: AddressWeight[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateRecipientWeight: ({ + recipient + }: { + recipient: AddressWeight; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + addRecipient: ({ + recipient + }: { + recipient: AddressWeight; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + removeRecipient: ({ + recipient + }: { + recipient: Recipient; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateLock: ({ + lockTime + }: { + lockTime: number; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + send: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ampReceive: ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + ownership: (ownershipMessage: OwnershipMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateKernelAddress: ({ + address + }: { + address: Addr; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + updateAppContract: ({ + address + }: { + address: string; + }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; + permissioning: (permissioningMessage: PermissioningMessage, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; +} +export class WeightedDistributionSplitterContractTsClient implements WeightedDistributionSplitterContractTsInterface { + client: SigningCosmWasmClient; + sender: string; + contractAddress: string; + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + this.client = client; + this.sender = sender; + this.contractAddress = contractAddress; + this.updateRecipients = this.updateRecipients.bind(this); + this.updateRecipientWeight = this.updateRecipientWeight.bind(this); + this.addRecipient = this.addRecipient.bind(this); + this.removeRecipient = this.removeRecipient.bind(this); + this.updateLock = this.updateLock.bind(this); + this.send = this.send.bind(this); + this.ampReceive = this.ampReceive.bind(this); + this.ownership = this.ownership.bind(this); + this.updateKernelAddress = this.updateKernelAddress.bind(this); + this.updateAppContract = this.updateAppContract.bind(this); + this.permissioning = this.permissioning.bind(this); + } + + updateRecipients = async ({ + recipients + }: { + recipients: AddressWeight[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipients: { + recipients + } + }, fee, memo, _funds); + }; + updateRecipientWeight = async ({ + recipient + }: { + recipient: AddressWeight; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_recipient_weight: { + recipient + } + }, fee, memo, _funds); + }; + addRecipient = async ({ + recipient + }: { + recipient: AddressWeight; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + add_recipient: { + recipient + } + }, fee, memo, _funds); + }; + removeRecipient = async ({ + recipient + }: { + recipient: Recipient; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + remove_recipient: { + recipient + } + }, fee, memo, _funds); + }; + updateLock = async ({ + lockTime + }: { + lockTime: number; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_lock: { + lock_time: lockTime + } + }, fee, memo, _funds); + }; + send = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + send: {} + }, fee, memo, _funds); + }; + ampReceive = async ({ + ctx, + messages + }: { + ctx: AMPCtx; + messages: AMPMsg[]; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + amp_receive: { + ctx, + messages + } + }, fee, memo, _funds); + }; + ownership = async (ownershipMessage: OwnershipMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + ownership: ownershipMessage + }, fee, memo, _funds); + }; + updateKernelAddress = async ({ + address + }: { + address: Addr; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_kernel_address: { + address + } + }, fee, memo, _funds); + }; + updateAppContract = async ({ + address + }: { + address: string; + }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + update_app_contract: { + address + } + }, fee, memo, _funds); + }; + permissioning = async (permissioningMessage: PermissioningMessage, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { + return await this.client.execute(this.sender, this.contractAddress, { + permissioning: permissioningMessage + }, fee, memo, _funds); + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/2.0.1/WeightedDistributionSplitterContractTs.message-builder.ts b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1/WeightedDistributionSplitterContractTs.message-builder.ts new file mode 100644 index 0000000..7514495 --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1/WeightedDistributionSplitterContractTs.message-builder.ts @@ -0,0 +1,198 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +import { AndrAddr, Binary, Uint128, InstantiateMsg, AddressWeight, Recipient, ExecuteMsg, ReplyOn, OwnershipMessage, Expiry, Milliseconds, Addr, PermissioningMessage, Permission, LocalPermission, AMPPkt, AMPCtx, AMPMsg, AMPMsgConfig, IBCConfig, Coin, QueryMsg, ADOBaseVersionResponse, AppContractResponse, BlockHeightResponse, Expiration, Timestamp, Uint64, GetSplitterConfigResponse, Splitter, GetUserWeightResponse, KernelAddressResponse, PublisherResponse, ContractOwnerResponse, ContractPotentialOwnerResponse, ArrayOfString, ArrayOfPermissionInfo, PermissionInfo, TypeResponse, VersionResponse } from "./WeightedDistributionSplitterContractTs.types"; +import { CamelCasedProperties } from "type-fest"; +export abstract class WeightedDistributionSplitterContractTsExecuteMsgBuilder { + static updateRecipients = ({ + recipients + }: CamelCasedProperties["update_recipients"]>): ExecuteMsg => { + return { + update_recipients: ({ + recipients + } as const) + }; + }; + static updateRecipientWeight = ({ + recipient + }: CamelCasedProperties["update_recipient_weight"]>): ExecuteMsg => { + return { + update_recipient_weight: ({ + recipient + } as const) + }; + }; + static addRecipient = ({ + recipient + }: CamelCasedProperties["add_recipient"]>): ExecuteMsg => { + return { + add_recipient: ({ + recipient + } as const) + }; + }; + static removeRecipient = ({ + recipient + }: CamelCasedProperties["remove_recipient"]>): ExecuteMsg => { + return { + remove_recipient: ({ + recipient + } as const) + }; + }; + static updateLock = ({ + lockTime + }: CamelCasedProperties["update_lock"]>): ExecuteMsg => { + return { + update_lock: ({ + lock_time: lockTime + } as const) + }; + }; + static send = (): ExecuteMsg => { + return { + send: ({} as const) + }; + }; + static ampReceive = ({ + ctx, + messages + }: CamelCasedProperties["amp_receive"]>): ExecuteMsg => { + return { + amp_receive: ({ + ctx, + messages + } as const) + }; + }; + static ownership = (ownershipMessage: OwnershipMessage): ExecuteMsg => { + return { + ownership: ownershipMessage + }; + }; + static updateKernelAddress = ({ + address + }: CamelCasedProperties["update_kernel_address"]>): ExecuteMsg => { + return { + update_kernel_address: ({ + address + } as const) + }; + }; + static updateAppContract = ({ + address + }: CamelCasedProperties["update_app_contract"]>): ExecuteMsg => { + return { + update_app_contract: ({ + address + } as const) + }; + }; + static permissioning = (permissioningMessage: PermissioningMessage): ExecuteMsg => { + return { + permissioning: permissioningMessage + }; + }; +} +export abstract class WeightedDistributionSplitterContractTsQueryMsgBuilder { + static getSplitterConfig = (): QueryMsg => { + return { + get_splitter_config: ({} as const) + }; + }; + static getUserWeight = ({ + user + }: CamelCasedProperties["get_user_weight"]>): QueryMsg => { + return { + get_user_weight: ({ + user + } as const) + }; + }; + static owner = (): QueryMsg => { + return { + owner: ({} as const) + }; + }; + static ownershipRequest = (): QueryMsg => { + return { + ownership_request: ({} as const) + }; + }; + static type = (): QueryMsg => { + return { + type: ({} as const) + }; + }; + static kernelAddress = (): QueryMsg => { + return { + kernel_address: ({} as const) + }; + }; + static appContract = (): QueryMsg => { + return { + app_contract: ({} as const) + }; + }; + static originalPublisher = (): QueryMsg => { + return { + original_publisher: ({} as const) + }; + }; + static blockHeightUponCreation = (): QueryMsg => { + return { + block_height_upon_creation: ({} as const) + }; + }; + static version = (): QueryMsg => { + return { + version: ({} as const) + }; + }; + static aDOBaseVersion = (): QueryMsg => { + return { + a_d_o_base_version: ({} as const) + }; + }; + static permissions = ({ + actor, + limit, + startAfter + }: CamelCasedProperties["permissions"]>): QueryMsg => { + return { + permissions: ({ + actor, + limit, + start_after: startAfter + } as const) + }; + }; + static permissionedActions = (): QueryMsg => { + return { + permissioned_actions: ({} as const) + }; + }; +} \ No newline at end of file diff --git a/packages/adocodegen/src/weighted-distribution-splitter/2.0.1/WeightedDistributionSplitterContractTs.types.ts b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1/WeightedDistributionSplitterContractTs.types.ts new file mode 100644 index 0000000..381d95c --- /dev/null +++ b/packages/adocodegen/src/weighted-distribution-splitter/2.0.1/WeightedDistributionSplitterContractTs.types.ts @@ -0,0 +1,230 @@ +/** +* This file was automatically generated by @cosmwasm/ts-codegen@0.35.7. +* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, +* and run the @cosmwasm/ts-codegen generate command to regenerate this file. +*/ + +export type AndrAddr = string; +export type Binary = string; +export type Uint128 = string; +export interface InstantiateMsg { + kernel_address: string; + lock_time?: number | null; + owner?: string | null; + recipients: AddressWeight[]; +} +export interface AddressWeight { + recipient: Recipient; + weight: Uint128; +} +export interface Recipient { + address: AndrAddr; + ibc_recovery_address?: AndrAddr | null; + msg?: Binary | null; +} +export type ExecuteMsg = { + update_recipients: { + recipients: AddressWeight[]; + }; +} | { + update_recipient_weight: { + recipient: AddressWeight; + }; +} | { + add_recipient: { + recipient: AddressWeight; + }; +} | { + remove_recipient: { + recipient: Recipient; + }; +} | { + update_lock: { + lock_time: number; + }; +} | { + send: {}; +} | { + amp_receive: AMPPkt; +} | { + ownership: OwnershipMessage; +} | { + update_kernel_address: { + address: Addr; + }; +} | { + update_app_contract: { + address: string; + }; +} | { + permissioning: PermissioningMessage; +}; +export type ReplyOn = "always" | "error" | "success" | "never"; +export type OwnershipMessage = ("revoke_ownership_offer" | "accept_ownership" | "disown") | { + update_owner: { + expiration?: Expiry | null; + new_owner: Addr; + }; +}; +export type Expiry = { + from_now: Milliseconds; +} | { + at_time: Milliseconds; +}; +export type Milliseconds = number; +export type Addr = string; +export type PermissioningMessage = { + set_permission: { + action: string; + actors: AndrAddr[]; + permission: Permission; + }; +} | { + remove_permission: { + action: string; + actors: AndrAddr[]; + }; +} | { + permission_action: { + action: string; + }; +} | { + disable_action_permissioning: { + action: string; + }; +}; +export type Permission = { + local: LocalPermission; +} | { + contract: AndrAddr; +}; +export type LocalPermission = { + blacklisted: Expiry | null; +} | { + limited: { + expiration?: Expiry | null; + uses: number; + }; +} | { + whitelisted: Expiry | null; +}; +export interface AMPPkt { + ctx: AMPCtx; + messages: AMPMsg[]; +} +export interface AMPCtx { + id: number; + origin: string; + origin_username?: AndrAddr | null; + previous_sender: string; +} +export interface AMPMsg { + config: AMPMsgConfig; + funds: Coin[]; + message: Binary; + recipient: AndrAddr; +} +export interface AMPMsgConfig { + direct: boolean; + exit_at_error: boolean; + gas_limit?: number | null; + ibc_config?: IBCConfig | null; + reply_on: ReplyOn; +} +export interface IBCConfig { + recovery_addr?: AndrAddr | null; +} +export interface Coin { + amount: Uint128; + denom: string; + [k: string]: unknown; +} +export type QueryMsg = { + get_splitter_config: {}; +} | { + get_user_weight: { + user: Recipient; + }; +} | { + owner: {}; +} | { + ownership_request: {}; +} | { + type: {}; +} | { + kernel_address: {}; +} | { + app_contract: {}; +} | { + original_publisher: {}; +} | { + block_height_upon_creation: {}; +} | { + version: {}; +} | { + a_d_o_base_version: {}; +} | { + permissions: { + actor: string; + limit?: number | null; + start_after?: string | null; + }; +} | { + permissioned_actions: {}; +}; +export interface ADOBaseVersionResponse { + version: string; +} +export interface AppContractResponse { + app_contract: Addr; +} +export interface BlockHeightResponse { + block_height: number; +} +export type Expiration = { + at_height: number; +} | { + at_time: Timestamp; +} | { + never: {}; +}; +export type Timestamp = Uint64; +export type Uint64 = string; +export interface GetSplitterConfigResponse { + config: Splitter; +} +export interface Splitter { + lock: Expiration; + recipients: AddressWeight[]; +} +export interface GetUserWeightResponse { + total_weight: Uint128; + weight: Uint128; +} +export interface KernelAddressResponse { + kernel_address: Addr; +} +export interface PublisherResponse { + original_publisher: string; +} +export interface ContractOwnerResponse { + owner: string; +} +export interface ContractPotentialOwnerResponse { + expiration?: Milliseconds | null; + potential_owner?: Addr | null; +} +export type ArrayOfString = string[]; +export type ArrayOfPermissionInfo = PermissionInfo[]; +export interface PermissionInfo { + action: string; + actor: string; + permission: Permission; +} +export interface TypeResponse { + ado_type: string; +} +export interface VersionResponse { + version: string; +} +export type WeightedDistributionSplitterContractTsExecuteMsg = ExecuteMsg; \ No newline at end of file diff --git a/packages/andrjs/CHANGELOG.md b/packages/andrjs/CHANGELOG.md index 3f47424..0a9bce5 100644 --- a/packages/andrjs/CHANGELOG.md +++ b/packages/andrjs/CHANGELOG.md @@ -1,5 +1,11 @@ # @andromedaprotocol/andromeda.js +## 2.0.0-beta.1 + +### Patch Changes + +- Fix: Ether wallet now apply Bech32 prefix properly + ## 2.0.0-beta.0 ### Major Changes diff --git a/packages/andrjs/package.json b/packages/andrjs/package.json index 0cb658b..5fc4c41 100644 --- a/packages/andrjs/package.json +++ b/packages/andrjs/package.json @@ -1,6 +1,6 @@ { "name": "@andromedaprotocol/andromeda.js", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "repository": { "type": "git", "url": "git+https://github.com/andromedaprotocol/andromeda-cli.git" diff --git a/packages/andrjs/src/wallets/EtherWallet.ts b/packages/andrjs/src/wallets/EtherWallet.ts index fda2d05..1786a88 100644 --- a/packages/andrjs/src/wallets/EtherWallet.ts +++ b/packages/andrjs/src/wallets/EtherWallet.ts @@ -40,6 +40,6 @@ export default class EtherWallet extends Wallet { Buffer.from(mnemonicOrPrivKey.replace("0x", ""), "hex") ); } - return await DirectEthSecp256k1Wallet.fromKey(privKeyArray); + return await DirectEthSecp256k1Wallet.fromKey(privKeyArray, this.prefix); } } diff --git a/packages/cli/CHANGELOG.md b/packages/cli/CHANGELOG.md index 9764e12..7fa155e 100644 --- a/packages/cli/CHANGELOG.md +++ b/packages/cli/CHANGELOG.md @@ -1,5 +1,12 @@ # @andromedaprotocol/cli +## 2.0.0-beta.1 + +### Patch Changes + +- Updated dependencies + - @andromedaprotocol/andromeda.js@2.0.0-beta.1 + ## 2.0.0-beta.0 ### Major Changes diff --git a/packages/cli/package.json b/packages/cli/package.json index bc900d4..e0f9314 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -1,6 +1,6 @@ { "name": "@andromedaprotocol/cli", - "version": "2.0.0-beta.0", + "version": "2.0.0-beta.1", "repository": { "type": "git", "url": "git+https://github.com/andromedaprotocol/andromeda-cli.git"