diff --git a/packages/state/contracts/Sg721Base.ts b/packages/state/contracts/Sg721Base.ts
new file mode 100644
index 000000000..e4f470f9f
--- /dev/null
+++ b/packages/state/contracts/Sg721Base.ts
@@ -0,0 +1,748 @@
+import { Coin, StdFee } from '@cosmjs/amino'
+import {
+ CosmWasmClient,
+ ExecuteInstruction,
+ ExecuteResult,
+ SigningCosmWasmClient,
+} from '@cosmjs/cosmwasm-stargate'
+
+import { Binary, Empty, Expiration } from '@dao-dao/types'
+import {
+ Action,
+ AllNftInfoResponse,
+ AllOperatorsResponse,
+ AllTokensResponse,
+ ApprovalResponse,
+ ApprovalsResponse,
+ CollectionInfoResponse,
+ ContractInfoResponse,
+ MinterResponse,
+ NftInfoResponse,
+ NumTokensResponse,
+ OwnerOfResponse,
+ TokensResponse,
+ UpdateCollectionInfoMsgForRoyaltyInfoResponse,
+} from '@dao-dao/types/contracts/Sg721Base'
+import { CHAIN_GAS_MULTIPLIER } from '@dao-dao/utils'
+export interface Sg721BaseReadOnlyInterface {
+ 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
+ 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
+ collectionInfo: () => Promise
+}
+export class Sg721BaseQueryClient implements Sg721BaseReadOnlyInterface {
+ 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.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.collectionInfo = this.collectionInfo.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,
+ },
+ })
+ }
+ 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: {},
+ })
+ }
+ collectionInfo = async (): Promise => {
+ return this.client.queryContractSmart(this.contractAddress, {
+ collection_info: {},
+ })
+ }
+}
+export interface Sg721BaseInterface extends Sg721BaseReadOnlyInterface {
+ 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: Empty
+ 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: (
+ {
+ msg,
+ }: {
+ msg: Empty
+ },
+ fee?: number | StdFee | 'auto',
+ memo?: string,
+ _funds?: Coin[]
+ ) => Promise
+ updateCollectionInfo: (
+ {
+ collectionInfo,
+ }: {
+ collectionInfo: UpdateCollectionInfoMsgForRoyaltyInfoResponse
+ },
+ fee?: number | StdFee | 'auto',
+ memo?: string,
+ _funds?: Coin[]
+ ) => Promise
+ updateStartTradingTime: (
+ fee?: number | StdFee | 'auto',
+ memo?: string,
+ _funds?: Coin[]
+ ) => Promise
+ updateOwnership: (
+ action: Action,
+ fee?: number | StdFee | 'auto',
+ memo?: string,
+ _funds?: Coin[]
+ ) => Promise
+}
+export class Sg721BaseClient
+ extends Sg721BaseQueryClient
+ implements Sg721BaseInterface
+{
+ 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.sendNftMultiple = this.sendNftMultiple.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.updateCollectionInfo = this.updateCollectionInfo.bind(this)
+ this.updateStartTradingTime = this.updateStartTradingTime.bind(this)
+ this.updateOwnership = this.updateOwnership.bind(this)
+ }
+
+ transferNft = async (
+ {
+ recipient,
+ tokenId,
+ }: {
+ recipient: string
+ tokenId: string
+ },
+ fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER,
+ 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' = CHAIN_GAS_MULTIPLIER,
+ memo?: string,
+ _funds?: Coin[]
+ ): Promise => {
+ return await this.client.execute(
+ this.sender,
+ this.contractAddress,
+ {
+ send_nft: {
+ contract,
+ msg,
+ token_id: tokenId,
+ },
+ },
+ fee,
+ memo,
+ _funds
+ )
+ }
+ sendNftMultiple = async (
+ {
+ contract,
+ msg,
+ tokenIds,
+ }: {
+ contract: string
+ msg: string
+ tokenIds: string[]
+ },
+ fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER,
+ memo?: string
+ ): Promise => {
+ let instructions: ExecuteInstruction[] = tokenIds.map((tokenId) => {
+ return {
+ contractAddress: this.contractAddress,
+ msg: {
+ send_nft: {
+ contract,
+ msg,
+ token_id: tokenId,
+ },
+ },
+ } as ExecuteInstruction
+ })
+
+ return await this.client.executeMultiple(
+ this.sender,
+ instructions,
+ fee,
+ memo
+ )
+ }
+ approve = async (
+ {
+ expires,
+ spender,
+ tokenId,
+ }: {
+ expires?: Expiration
+ spender: string
+ tokenId: string
+ },
+ fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER,
+ 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' = CHAIN_GAS_MULTIPLIER,
+ 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' = CHAIN_GAS_MULTIPLIER,
+ 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' = CHAIN_GAS_MULTIPLIER,
+ 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: Empty
+ owner: string
+ tokenId: string
+ tokenUri?: string
+ },
+ fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER,
+ 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' = CHAIN_GAS_MULTIPLIER,
+ memo?: string,
+ _funds?: Coin[]
+ ): Promise => {
+ return await this.client.execute(
+ this.sender,
+ this.contractAddress,
+ {
+ burn: {
+ token_id: tokenId,
+ },
+ },
+ fee,
+ memo,
+ _funds
+ )
+ }
+ extension = async (
+ {
+ msg,
+ }: {
+ msg: Empty
+ },
+ fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER,
+ memo?: string,
+ _funds?: Coin[]
+ ): Promise => {
+ return await this.client.execute(
+ this.sender,
+ this.contractAddress,
+ {
+ extension: {
+ msg,
+ },
+ },
+ fee,
+ memo,
+ _funds
+ )
+ }
+ updateCollectionInfo = async (
+ {
+ collectionInfo,
+ }: {
+ collectionInfo: UpdateCollectionInfoMsgForRoyaltyInfoResponse
+ },
+ fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER,
+ memo?: string,
+ _funds?: Coin[]
+ ): Promise => {
+ return await this.client.execute(
+ this.sender,
+ this.contractAddress,
+ {
+ update_collection_info: {
+ collection_info: collectionInfo,
+ },
+ },
+ fee,
+ memo,
+ _funds
+ )
+ }
+ updateStartTradingTime = async (
+ fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER,
+ memo?: string,
+ _funds?: Coin[]
+ ): Promise => {
+ return await this.client.execute(
+ this.sender,
+ this.contractAddress,
+ {
+ update_start_trading_time: {},
+ },
+ fee,
+ memo,
+ _funds
+ )
+ }
+ updateOwnership = async (
+ action: Action,
+ fee: number | StdFee | 'auto' = CHAIN_GAS_MULTIPLIER,
+ memo?: string,
+ _funds?: Coin[]
+ ): Promise => {
+ return await this.client.execute(
+ this.sender,
+ this.contractAddress,
+ {
+ update_ownership: action,
+ },
+ fee,
+ memo,
+ _funds
+ )
+ }
+}
diff --git a/packages/state/contracts/index.ts b/packages/state/contracts/index.ts
index 0ea807b96..d1f2b05af 100644
--- a/packages/state/contracts/index.ts
+++ b/packages/state/contracts/index.ts
@@ -26,6 +26,7 @@ export {
} from './PolytoneListener'
export { PolytoneNoteClient, PolytoneNoteQueryClient } from './PolytoneNote'
export { PolytoneProxyClient, PolytoneProxyQueryClient } from './PolytoneProxy'
+export { Sg721BaseClient, Sg721BaseQueryClient } from './Sg721Base'
export { WyndexFactoryClient, WyndexFactoryQueryClient } from './WyndexFactory'
export {
WyndexMultiHopClient,
diff --git a/packages/state/recoil/selectors/contracts/Sg721Base.ts b/packages/state/recoil/selectors/contracts/Sg721Base.ts
new file mode 100644
index 000000000..007c39b3b
--- /dev/null
+++ b/packages/state/recoil/selectors/contracts/Sg721Base.ts
@@ -0,0 +1,237 @@
+/**
+ * This file was automatically generated by @cosmwasm/ts-codegen@0.35.3.
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
+ * and run the @cosmwasm/ts-codegen generate command to regenerate this file.
+ */
+
+import { selectorFamily } from 'recoil'
+
+import { WithChainId } from '@dao-dao/types'
+import {
+ AllNftInfoResponse,
+ AllOperatorsResponse,
+ AllTokensResponse,
+ ApprovalResponse,
+ ApprovalsResponse,
+ CollectionInfoResponse,
+ ContractInfoResponse,
+ MinterResponse,
+ NftInfoResponse,
+ NumTokensResponse,
+ OwnerOfResponse,
+ TokensResponse,
+} from '@dao-dao/types/contracts/Sg721Base'
+
+import {
+ Sg721BaseClient,
+ Sg721BaseQueryClient,
+} from '../../../contracts/Sg721Base'
+import { signingCosmWasmClientAtom } from '../../atoms'
+import { cosmWasmClientForChainSelector } from '../chain'
+
+type QueryClientParams = WithChainId<{
+ contractAddress: string
+}>
+
+export const queryClient = selectorFamily<
+ Sg721BaseQueryClient,
+ QueryClientParams
+>({
+ key: 'sg721BaseQueryClient',
+ get:
+ ({ contractAddress, chainId }) =>
+ ({ get }) => {
+ const client = get(cosmWasmClientForChainSelector(chainId))
+ return new Sg721BaseQueryClient(client, contractAddress)
+ },
+ dangerouslyAllowMutability: true,
+})
+
+export type ExecuteClientParams = WithChainId<{
+ contractAddress: string
+ sender: string
+}>
+
+export const executeClient = selectorFamily<
+ Sg721BaseClient | undefined,
+ ExecuteClientParams
+>({
+ key: 'sg721BaseExecuteClient',
+ get:
+ ({ chainId, contractAddress, sender }) =>
+ ({ get }) => {
+ const client = get(signingCosmWasmClientAtom({ chainId }))
+ if (!client) return
+ return new Sg721BaseClient(client, sender, contractAddress)
+ },
+ dangerouslyAllowMutability: true,
+})
+
+export const ownerOfSelector = selectorFamily<
+ OwnerOfResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseOwnerOf',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.ownerOf(...params)
+ },
+})
+export const approvalSelector = selectorFamily<
+ ApprovalResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseApproval',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.approval(...params)
+ },
+})
+export const approvalsSelector = selectorFamily<
+ ApprovalsResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseApprovals',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.approvals(...params)
+ },
+})
+export const allOperatorsSelector = selectorFamily<
+ AllOperatorsResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseAllOperators',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.allOperators(...params)
+ },
+})
+export const numTokensSelector = selectorFamily<
+ NumTokensResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseNumTokens',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.numTokens(...params)
+ },
+})
+export const contractInfoSelector = selectorFamily<
+ ContractInfoResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseContractInfo',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.contractInfo(...params)
+ },
+})
+export const nftInfoSelector = selectorFamily<
+ NftInfoResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseNftInfo',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.nftInfo(...params)
+ },
+})
+export const allNftInfoSelector = selectorFamily<
+ AllNftInfoResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseAllNftInfo',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.allNftInfo(...params)
+ },
+})
+export const tokensSelector = selectorFamily<
+ TokensResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseTokens',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.tokens(...params)
+ },
+})
+export const allTokensSelector = selectorFamily<
+ AllTokensResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseAllTokens',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.allTokens(...params)
+ },
+})
+export const minterSelector = selectorFamily<
+ MinterResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseMinter',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.minter(...params)
+ },
+})
+export const collectionInfoSelector = selectorFamily<
+ CollectionInfoResponse,
+ QueryClientParams & {
+ params: Parameters
+ }
+>({
+ key: 'sg721BaseCollectionInfo',
+ get:
+ ({ params, ...queryClientParams }) =>
+ async ({ get }) => {
+ const client = get(queryClient(queryClientParams))
+ return await client.collectionInfo(...params)
+ },
+})
diff --git a/packages/state/recoil/selectors/contracts/index.ts b/packages/state/recoil/selectors/contracts/index.ts
index 8ff2b8a00..7da061bce 100644
--- a/packages/state/recoil/selectors/contracts/index.ts
+++ b/packages/state/recoil/selectors/contracts/index.ts
@@ -14,5 +14,6 @@ export * as DaoVotingNativeStakedSelectors from './DaoVotingNativeStaked'
export * as PolytoneListenerSelectors from './PolytoneListener'
export * as PolytoneNoteSelectors from './PolytoneNote'
export * as PolytoneProxySelectors from './PolytoneProxy'
+export * as Sg721BaseSelectors from './Sg721Base'
export * as WyndexFactorySelectors from './WyndexFactory'
export * as WyndexMultiHopSelectors from './WyndexMultiHop'
diff --git a/packages/stateful/actions/core/nfts/MintNft/InstantiateNftCollection.tsx b/packages/stateful/actions/core/nfts/MintNft/InstantiateNftCollection.tsx
index 4bda2a043..3c2739499 100644
--- a/packages/stateful/actions/core/nfts/MintNft/InstantiateNftCollection.tsx
+++ b/packages/stateful/actions/core/nfts/MintNft/InstantiateNftCollection.tsx
@@ -41,13 +41,28 @@ export const InstantiateNftCollection: ActionComponent = (props) => {
setInstantiating(true)
try {
- const { contractAddress } = await signingCosmWasmClient.instantiate(
- walletAddress,
- codeIds.Cw721Base,
- instantiateMsg,
- 'NFT Collection',
- CHAIN_GAS_MULTIPLIER
- )
+ const { contractAddress } = codeIds.Cw721Base
+ ? await signingCosmWasmClient.instantiate(
+ walletAddress,
+ codeIds.Cw721Base,
+ instantiateMsg,
+ 'NFT Collection',
+ CHAIN_GAS_MULTIPLIER
+ )
+ : codeIds.Sg721Base
+ ? await signingCosmWasmClient.instantiate(
+ walletAddress,
+ codeIds.Sg721Base,
+ instantiateMsg,
+ 'NFT Collection',
+ CHAIN_GAS_MULTIPLIER
+ )
+ : { contractAddress: undefined }
+
+ // Should never happen.
+ if (!contractAddress) {
+ throw new Error(t('error.loadingData'))
+ }
// Update action form data with address.
setValue(props.fieldNamePrefix + 'collectionAddress', contractAddress, {
@@ -73,6 +88,8 @@ export const InstantiateNftCollection: ActionComponent = (props) => {
} catch (err) {
console.error(err)
toast.error(processError(err))
+ } finally {
+ setInstantiating(false)
}
}
diff --git a/packages/stateful/actions/core/nfts/MintNft/stateless/InstantiateNftCollection.tsx b/packages/stateful/actions/core/nfts/MintNft/stateless/InstantiateNftCollection.tsx
index 3f9e1f519..a903ef029 100644
--- a/packages/stateful/actions/core/nfts/MintNft/stateless/InstantiateNftCollection.tsx
+++ b/packages/stateful/actions/core/nfts/MintNft/stateless/InstantiateNftCollection.tsx
@@ -68,6 +68,8 @@ export const InstantiateNftCollection: ActionComponent<
+ {/* TODO(stargaze): Add Stargaze collection info field on for sg721. */}
+
)}
-