@@ -79,11 +79,11 @@ export function GasCards({ id }: { id: string }) {
)}
- {n.name || `Token #${n.tokenId}`}
+ {n.metadata.name || `Token #${n.tokenId}`}
- {n.description && (
+ {n.metadata.description && (
- {n.description}
+ {n.metadata.description}
)}
diff --git a/app/src/lib/types.ts b/app/src/lib/types.ts
index 83aa8da..2ba64e4 100644
--- a/app/src/lib/types.ts
+++ b/app/src/lib/types.ts
@@ -75,10 +75,22 @@ export interface Contract {
address: string;
}
-export interface Nft {
- tokenId: string;
- tokenUri: string;
- name: string;
+export interface Gas {
+ description: string;
image: string;
+ name: string;
+}
+
+export interface Configuration {
description: string;
+ image: string;
+ name: string;
+ configuration_image_url: string;
+ crossplane_version: string;
+ image_sha: string;
+}
+
+export interface Nft
{
+ tokenId: string;
+ metadata: T;
}
diff --git a/generated/Cw2981Configuration.client.ts b/generated/Cw2981Configuration.client.ts
new file mode 100644
index 0000000..c73c86c
--- /dev/null
+++ b/generated/Cw2981Configuration.client.ts
@@ -0,0 +1,689 @@
+/**
+ * This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
+ * DO 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 {
+ Binary,
+ Expiration,
+ Action,
+ Metadata,
+ Empty,
+ Cw2981QueryMsg,
+ AllNftInfoResponseForCw2981QueryMsg,
+ OwnerOfResponse,
+ NftInfoResponseForCw2981QueryMsg,
+ OperatorsResponse,
+ TokensResponse,
+ ApprovalResponse,
+ ApprovalsResponse,
+ ContractInfoResponse,
+ Null,
+ MinterResponse,
+ NumTokensResponse,
+ OperatorResponse,
+ OwnershipForString,
+} from "./Cw2981Configuration.types";
+export interface Cw2981ConfigurationReadOnlyInterface {
+ contractAddress: string;
+ ownerOf: ({
+ includeExpired,
+ tokenId,
+ }: {
+ includeExpired?: boolean;
+ tokenId: string;
+ }) => Promise;
+ approval: ({
+ includeExpired,
+ spender,
+ tokenId,
+ }: {
+ includeExpired?: boolean;
+ spender: string;
+ tokenId: string;
+ }) => Promise;
+ approvals: ({
+ includeExpired,
+ tokenId,
+ }: {
+ includeExpired?: boolean;
+ tokenId: string;
+ }) => Promise;
+ operator: ({
+ includeExpired,
+ operator,
+ owner,
+ }: {
+ includeExpired?: boolean;
+ operator: string;
+ owner: string;
+ }) => Promise;
+ allOperators: ({
+ includeExpired,
+ limit,
+ owner,
+ startAfter,
+ }: {
+ includeExpired?: boolean;
+ limit?: number;
+ owner: string;
+ startAfter?: string;
+ }) => Promise;
+ numTokens: () => Promise;
+ contractInfo: () => 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;
+ minter: () => Promise;
+ extension: ({ msg }: { msg: Cw2981QueryMsg }) => Promise;
+ ownership: () => Promise;
+}
+export class Cw2981ConfigurationQueryClient
+ implements Cw2981ConfigurationReadOnlyInterface
+{
+ client: CosmWasmClient;
+ contractAddress: string;
+ constructor(client: CosmWasmClient, contractAddress: string) {
+ this.client = client;
+ this.contractAddress = contractAddress;
+ this.ownerOf = this.ownerOf.bind(this);
+ this.approval = this.approval.bind(this);
+ this.approvals = this.approvals.bind(this);
+ this.operator = this.operator.bind(this);
+ this.allOperators = this.allOperators.bind(this);
+ this.numTokens = this.numTokens.bind(this);
+ this.contractInfo = this.contractInfo.bind(this);
+ 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.minter = this.minter.bind(this);
+ this.extension = this.extension.bind(this);
+ this.ownership = this.ownership.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,
+ },
+ });
+ };
+ 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,
+ },
+ });
+ };
+ operator = async ({
+ includeExpired,
+ operator,
+ owner,
+ }: {
+ includeExpired?: boolean;
+ operator: string;
+ owner: string;
+ }): Promise => {
+ return this.client.queryContractSmart(this.contractAddress, {
+ operator: {
+ include_expired: includeExpired,
+ operator,
+ owner,
+ },
+ });
+ };
+ allOperators = async ({
+ includeExpired,
+ limit,
+ 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: {},
+ });
+ };
+ contractInfo = async (): Promise => {
+ return this.client.queryContractSmart(this.contractAddress, {
+ contract_info: {},
+ });
+ };
+ 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,
+ },
+ });
+ };
+ minter = async (): Promise => {
+ return this.client.queryContractSmart(this.contractAddress, {
+ minter: {},
+ });
+ };
+ extension = async ({ msg }: { msg: Cw2981QueryMsg }): Promise => {
+ return this.client.queryContractSmart(this.contractAddress, {
+ extension: {
+ msg,
+ },
+ });
+ };
+ ownership = async (): Promise => {
+ return this.client.queryContractSmart(this.contractAddress, {
+ ownership: {},
+ });
+ };
+}
+export interface Cw2981ConfigurationInterface
+ extends Cw2981ConfigurationReadOnlyInterface {
+ contractAddress: string;
+ sender: string;
+ 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;
+ mint: (
+ {
+ extension,
+ owner,
+ tokenId,
+ tokenUri,
+ }: {
+ extension?: Metadata;
+ owner: string;
+ tokenId: string;
+ tokenUri?: string;
+ },
+ fee?: number | StdFee | "auto",
+ memo?: string,
+ _funds?: Coin[],
+ ) => Promise;
+ burn: (
+ {
+ tokenId,
+ }: {
+ tokenId: string;
+ },
+ fee?: number | StdFee | "auto",
+ memo?: string,
+ _funds?: Coin[],
+ ) => Promise;
+ extension: (args: { msg: Cw2981QueryMsg }) => Promise;
+ updateOwnership: (
+ action: Action,
+ fee?: number | StdFee | "auto",
+ memo?: string,
+ _funds?: Coin[],
+ ) => Promise;
+}
+export class Cw2981ConfigurationClient
+ extends Cw2981ConfigurationQueryClient
+ implements Cw2981ConfigurationInterface
+{
+ client: SigningCosmWasmClient;
+ sender: string;
+ contractAddress: string;
+ constructor(
+ client: SigningCosmWasmClient,
+ sender: string,
+ contractAddress: string,
+ ) {
+ super(client, contractAddress);
+ this.client = client;
+ this.sender = sender;
+ this.contractAddress = contractAddress;
+ this.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.mint = this.mint.bind(this);
+ this.burn = this.burn.bind(this);
+ this.extension = this.extension.bind(this);
+ this.updateOwnership = this.updateOwnership.bind(this);
+ }
+ 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,
+ );
+ };
+ mint = async (
+ {
+ extension,
+ owner,
+ tokenId,
+ tokenUri,
+ }: {
+ extension?: Metadata;
+ 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,
+ );
+ };
+ 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,
+ );
+ };
+ extensionExecute = async (
+ { msg }: { msg: Empty },
+ fee: number | StdFee | "auto" = "auto",
+ memo?: string,
+ _funds?: Coin[],
+ ): Promise => {
+ return await this.client.execute(
+ this.sender,
+ this.contractAddress,
+ {
+ extension: { msg },
+ },
+ fee,
+ memo,
+ _funds,
+ );
+ };
+ updateOwnership = async (
+ action: Action,
+ fee: number | StdFee | "auto" = "auto",
+ memo?: string,
+ _funds?: Coin[],
+ ): Promise => {
+ return await this.client.execute(
+ this.sender,
+ this.contractAddress,
+ {
+ update_ownership: action,
+ },
+ fee,
+ memo,
+ _funds,
+ );
+ };
+}
diff --git a/generated/Cw2981Configuration.types.ts b/generated/Cw2981Configuration.types.ts
new file mode 100644
index 0000000..99a8574
--- /dev/null
+++ b/generated/Cw2981Configuration.types.ts
@@ -0,0 +1,250 @@
+/**
+ * This file was automatically generated by @cosmwasm/ts-codegen@1.11.1.
+ * 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 {
+ minter: string;
+ name: string;
+ symbol: string;
+}
+export type ExecuteMsg =
+ | {
+ 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;
+ };
+ }
+ | {
+ mint: {
+ extension?: Metadata | null;
+ owner: string;
+ token_id: string;
+ token_uri?: string | null;
+ };
+ }
+ | {
+ burn: {
+ token_id: string;
+ };
+ }
+ | {
+ extension: {
+ msg: Empty;
+ };
+ }
+ | {
+ update_ownership: Action;
+ };
+export type Binary = string;
+export type Expiration =
+ | {
+ at_height: number;
+ }
+ | {
+ at_time: Timestamp;
+ }
+ | {
+ never: {};
+ };
+export type Timestamp = Uint64;
+export type Uint64 = string;
+export type Action =
+ | {
+ transfer_ownership: {
+ expiry?: Expiration | null;
+ new_owner: string;
+ };
+ }
+ | "accept_ownership"
+ | "renounce_ownership";
+export interface Metadata {
+ animation_url?: string | null;
+ attributes?: Trait[] | null;
+ background_color?: string | null;
+ configuration_image_url: string;
+ crossplane_version: string;
+ description?: string | null;
+ external_url?: string | null;
+ image?: string | null;
+ image_data?: string | null;
+ image_sha: string;
+ name?: string | null;
+ royalty_payment_address?: string | null;
+ royalty_percentage?: number | null;
+ youtube_url?: string | null;
+}
+export interface Trait {
+ display_type?: string | null;
+ trait_type: string;
+ value: string;
+}
+export interface Empty {
+ [k: string]: unknown;
+}
+export type QueryMsg =
+ | {
+ owner_of: {
+ include_expired?: boolean | null;
+ token_id: string;
+ };
+ }
+ | {
+ approval: {
+ include_expired?: boolean | null;
+ spender: string;
+ token_id: string;
+ };
+ }
+ | {
+ approvals: {
+ include_expired?: boolean | null;
+ token_id: string;
+ };
+ }
+ | {
+ operator: {
+ include_expired?: boolean | null;
+ operator: string;
+ owner: string;
+ };
+ }
+ | {
+ all_operators: {
+ include_expired?: boolean | null;
+ limit?: number | null;
+ owner: string;
+ start_after?: string | null;
+ };
+ }
+ | {
+ num_tokens: {};
+ }
+ | {
+ contract_info: {};
+ }
+ | {
+ 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;
+ };
+ }
+ | {
+ minter: {};
+ }
+ | {
+ extension: {
+ msg: Cw2981QueryMsg;
+ };
+ }
+ | {
+ ownership: {};
+ };
+export type Cw2981QueryMsg =
+ | {
+ royalty_info: {
+ sale_price: Uint128;
+ token_id: string;
+ };
+ }
+ | {
+ check_royalties: {};
+ };
+export type Uint128 = string;
+export interface AllNftInfoResponseForCw2981QueryMsg {
+ access: OwnerOfResponse;
+ info: NftInfoResponseForCw2981QueryMsg;
+}
+export interface OwnerOfResponse {
+ approvals: Approval[];
+ owner: string;
+}
+export interface Approval {
+ expires: Expiration;
+ spender: string;
+}
+export interface NftInfoResponseForCw2981QueryMsg {
+ extension: Cw2981QueryMsg;
+ token_uri?: string | null;
+}
+export interface OperatorsResponse {
+ operators: Approval[];
+}
+export interface TokensResponse {
+ tokens: string[];
+}
+export interface ApprovalResponse {
+ approval: Approval;
+}
+export interface ApprovalsResponse {
+ approvals: Approval[];
+}
+export interface ContractInfoResponse {
+ name: string;
+ symbol: string;
+}
+export type Null = null;
+export interface MinterResponse {
+ minter?: string | null;
+}
+export interface NumTokensResponse {
+ count: number;
+}
+export interface OperatorResponse {
+ approval: Approval;
+}
+export interface OwnershipForString {
+ owner?: string | null;
+ pending_expiry?: Expiration | null;
+ pending_owner?: string | null;
+}