From 82c94b5b1432392e2e9cc740e2e81b2bf2e375ba Mon Sep 17 00:00:00 2001 From: Norman Meier Date: Sat, 20 Apr 2024 18:07:04 +0200 Subject: [PATCH] chore: regen client Signed-off-by: Norman Meier --- .../Cw721Membership.client.ts | 98 ++++++++++++------- .../cw721-membership/Cw721Membership.types.ts | 23 +++-- 2 files changed, 75 insertions(+), 46 deletions(-) diff --git a/packages/contracts-clients/cw721-membership/Cw721Membership.client.ts b/packages/contracts-clients/cw721-membership/Cw721Membership.client.ts index ccea6a42c8..b84125f0b8 100644 --- a/packages/contracts-clients/cw721-membership/Cw721Membership.client.ts +++ b/packages/contracts-clients/cw721-membership/Cw721Membership.client.ts @@ -6,26 +6,35 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { StdFee } from "@cosmjs/amino"; -import { InstantiateMsg, ExecuteMsg, ExecMsg, Uint64, Uint128, Binary, MembershipConfig, Coin, QueryMsg, QueryMsg1, Cw2981QueryMsg, AdminFundsResponse, Expiration, Timestamp, AllNftInfoResponseForMetadata, OwnerOfResponse, Approval, NftInfoResponseForMetadata, Metadata, Trait, TokensResponse, Addr, ChannelResponse, ChannelFundsResponse, Config, ContractInfoResponse, Cw2981Response, CheckRoyaltiesResponse, RoyaltiesInfoResponse, NumTokensResponse, SubscriptionResponse, Subscription } from "./Cw721Membership.types"; +import { InstantiateMsg, ExecuteMsg, ExecMsg, Uint64, Uint128, Binary, MembershipConfig, Coin, QueryMsg, QueryMsg1, Cw2981QueryMsg, AdminFundsResponse, Expiration, Timestamp, AllNftInfoResponseForMetadata, OwnerOfResponse, Approval, NftInfoResponseForMetadata, Metadata, Trait, TokensResponse, Addr, ChannelResponse, ChannelFundsResponse, ArrayOfUint64, Config, ContractInfoResponse, Cw2981Response, CheckRoyaltiesResponse, RoyaltiesInfoResponse, NumTokensResponse, SubscriptionResponse, Subscription } from "./Cw721Membership.types"; export interface Cw721MembershipReadOnlyInterface { contractAddress: string; config: () => Promise; channel: ({ - channelAddr + channelId }: { - channelAddr: string; + channelId: Uint64; }) => Promise; + channelsByOwner: ({ + limit, + ownerAddress, + startAfter + }: { + limit?: number; + ownerAddress: string; + startAfter?: Uint64; + }) => Promise; adminFunds: () => Promise; channelFunds: ({ - channelAddr + channelId }: { - channelAddr: string; + channelId: Uint64; }) => Promise; subscription: ({ - channelAddr, + channelId, subAddr }: { - channelAddr: string; + channelId: Uint64; subAddr: string; }) => Promise; extension: ({ @@ -80,6 +89,7 @@ export class Cw721MembershipQueryClient implements Cw721MembershipReadOnlyInterf this.contractAddress = contractAddress; this.config = this.config.bind(this); this.channel = this.channel.bind(this); + this.channelsByOwner = this.channelsByOwner.bind(this); this.adminFunds = this.adminFunds.bind(this); this.channelFunds = this.channelFunds.bind(this); this.subscription = this.subscription.bind(this); @@ -99,13 +109,30 @@ export class Cw721MembershipQueryClient implements Cw721MembershipReadOnlyInterf }); }; channel = async ({ - channelAddr + channelId }: { - channelAddr: string; + channelId: Uint64; }): Promise => { return this.client.queryContractSmart(this.contractAddress, { channel: { - channel_addr: channelAddr + channel_id: channelId + } + }); + }; + channelsByOwner = async ({ + limit, + ownerAddress, + startAfter + }: { + limit?: number; + ownerAddress: string; + startAfter?: Uint64; + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + channels_by_owner: { + limit, + owner_address: ownerAddress, + start_after: startAfter } }); }; @@ -115,26 +142,26 @@ export class Cw721MembershipQueryClient implements Cw721MembershipReadOnlyInterf }); }; channelFunds = async ({ - channelAddr + channelId }: { - channelAddr: string; + channelId: Uint64; }): Promise => { return this.client.queryContractSmart(this.contractAddress, { channel_funds: { - channel_addr: channelAddr + channel_id: channelId } }); }; subscription = async ({ - channelAddr, + channelId, subAddr }: { - channelAddr: string; + channelId: Uint64; subAddr: string; }): Promise => { return this.client.queryContractSmart(this.contractAddress, { subscription: { - channel_addr: channelAddr, + channel_id: channelId, sub_addr: subAddr } }); @@ -246,22 +273,20 @@ export interface Cw721MembershipInterface extends Cw721MembershipReadOnlyInterfa updateChannel: ({ id, membershipsConfig, - owner, tradeRoyaltiesAddr, tradeRoyaltiesPer10k }: { id: Uint64; membershipsConfig?: MembershipConfig[]; - owner?: string; tradeRoyaltiesAddr?: string; tradeRoyaltiesPer10k?: number; }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; subscribe: ({ - channelAddr, + channelId, membershipKind, recipientAddr }: { - channelAddr: string; + channelId: Uint64; membershipKind: number; recipientAddr: string; }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; @@ -281,11 +306,11 @@ export interface Cw721MembershipInterface extends Cw721MembershipReadOnlyInterfa symbol?: string; }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; updateChannelMintPlatformFee: ({ - channelAddr, + channelId, mintRoyalties }: { - channelAddr: string; - mintRoyalties: number; + channelId: Uint64; + mintRoyalties?: number; }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; withdrawMintPlatformFee: ({ destinationAddr @@ -293,10 +318,10 @@ export interface Cw721MembershipInterface extends Cw721MembershipReadOnlyInterfa destinationAddr?: string; }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; withdrawMintFunds: ({ - channelAddr, + channelId, destinationAddr }: { - channelAddr: string; + channelId: Uint64; destinationAddr?: string; }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; transferNft: ({ @@ -363,13 +388,11 @@ export class Cw721MembershipClient extends Cw721MembershipQueryClient implements updateChannel = async ({ id, membershipsConfig, - owner, tradeRoyaltiesAddr, tradeRoyaltiesPer10k }: { id: Uint64; membershipsConfig?: MembershipConfig[]; - owner?: string; tradeRoyaltiesAddr?: string; tradeRoyaltiesPer10k?: number; }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { @@ -377,24 +400,23 @@ export class Cw721MembershipClient extends Cw721MembershipQueryClient implements update_channel: { id, memberships_config: membershipsConfig, - owner, trade_royalties_addr: tradeRoyaltiesAddr, trade_royalties_per10k: tradeRoyaltiesPer10k } }, fee, memo, _funds); }; subscribe = async ({ - channelAddr, + channelId, membershipKind, recipientAddr }: { - channelAddr: string; + channelId: Uint64; membershipKind: number; recipientAddr: string; }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { subscribe: { - channel_addr: channelAddr, + channel_id: channelId, membership_kind: membershipKind, recipient_addr: recipientAddr } @@ -427,15 +449,15 @@ export class Cw721MembershipClient extends Cw721MembershipQueryClient implements }, fee, memo, _funds); }; updateChannelMintPlatformFee = async ({ - channelAddr, + channelId, mintRoyalties }: { - channelAddr: string; - mintRoyalties: number; + channelId: Uint64; + mintRoyalties?: number; }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { update_channel_mint_platform_fee: { - channel_addr: channelAddr, + channel_id: channelId, mint_royalties: mintRoyalties } }, fee, memo, _funds); @@ -452,15 +474,15 @@ export class Cw721MembershipClient extends Cw721MembershipQueryClient implements }, fee, memo, _funds); }; withdrawMintFunds = async ({ - channelAddr, + channelId, destinationAddr }: { - channelAddr: string; + channelId: Uint64; destinationAddr?: string; }, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise => { return await this.client.execute(this.sender, this.contractAddress, { withdraw_mint_funds: { - channel_addr: channelAddr, + channel_id: channelId, destination_addr: destinationAddr } }, fee, memo, _funds); diff --git a/packages/contracts-clients/cw721-membership/Cw721Membership.types.ts b/packages/contracts-clients/cw721-membership/Cw721Membership.types.ts index 8c8d2497d4..0ec427afa0 100644 --- a/packages/contracts-clients/cw721-membership/Cw721Membership.types.ts +++ b/packages/contracts-clients/cw721-membership/Cw721Membership.types.ts @@ -25,14 +25,13 @@ export type ExecMsg = { update_channel: { id: Uint64; memberships_config?: MembershipConfig[] | null; - owner?: string | null; trade_royalties_addr?: string | null; trade_royalties_per10k?: number | null; [k: string]: unknown; }; } | { subscribe: { - channel_addr: string; + channel_id: Uint64; membership_kind: number; recipient_addr: string; [k: string]: unknown; @@ -49,8 +48,8 @@ export type ExecMsg = { }; } | { update_channel_mint_platform_fee: { - channel_addr: string; - mint_royalties: number; + channel_id: Uint64; + mint_royalties?: number | null; [k: string]: unknown; }; } | { @@ -60,7 +59,7 @@ export type ExecMsg = { }; } | { withdraw_mint_funds: { - channel_addr: string; + channel_id: Uint64; destination_addr?: string | null; [k: string]: unknown; }; @@ -106,7 +105,14 @@ export type QueryMsg1 = { }; } | { channel: { - channel_addr: string; + channel_id: Uint64; + [k: string]: unknown; + }; +} | { + channels_by_owner: { + limit?: number | null; + owner_address: string; + start_after?: Uint64 | null; [k: string]: unknown; }; } | { @@ -115,12 +121,12 @@ export type QueryMsg1 = { }; } | { channel_funds: { - channel_addr: string; + channel_id: Uint64; [k: string]: unknown; }; } | { subscription: { - channel_addr: string; + channel_id: Uint64; sub_addr: string; [k: string]: unknown; }; @@ -234,6 +240,7 @@ export interface ChannelResponse { export interface ChannelFundsResponse { funds: Coin[]; } +export type ArrayOfUint64 = Uint64[]; export interface Config { admin_addr: Addr; description: string;