From a636b32d1fed428b281019f86bf9cb40c0ceb8d9 Mon Sep 17 00:00:00 2001 From: Norman Meier Date: Wed, 21 Feb 2024 21:27:25 +0100 Subject: [PATCH] feat: bring cosmwasm nft marketplace contract in monorepo history of previously called teritori-vault repo: commit 75a692533b9188587ebfa909c5576376b8d65999 Author: yieldoption <100329165+yieldoption@users.noreply.github.com> Date: Thu Nov 3 23:26:23 2022 -0400 gas optimization for nft vault contract (#6) commit 0794cc77e08e1bc72c7d914ea391208dba25b9ca Author: yieldoption <100329165+yieldoption@users.noreply.github.com> Date: Thu Nov 3 12:16:51 2022 -0400 fix royalty query (#5) commit f48c7fe8869f2d83dc61308ceb37c64d3bb7e4c6 Merge: 6d528f0 b11d308 Author: n0izn0iz Date: Thu Oct 6 18:14:13 2022 +0200 Merge pull request #4 from TERITORI/feature/royalty feature / royalty commit b11d3082666d4a4df3dcef08a4e69d327ebf3be9 Author: yieldoption Date: Wed Oct 5 22:02:29 2022 -0400 cargo fmt commit 6f284d07f205e3256d0a7db0c6da458f20aa38f3 Author: yieldoption Date: Wed Oct 5 22:00:09 2022 -0400 add cosmwasm binary commit 01e4bbdef8968af5c94d3708202ea372bf2bb424 Author: yieldoption Date: Wed Oct 5 21:58:16 2022 -0400 update schema commit 6ada5b2346d12f27a7680a69fc93df016898e0cc Author: yieldoption Date: Wed Oct 5 21:58:06 2022 -0400 implement royalty feature commit 6d528f06ee0d0a98daa5301578e495cf5386a62e Merge: e3a2d0e 68b85a8 Author: n0izn0iz Date: Tue Oct 4 16:24:19 2022 +0200 Merge pull request #3 from TERITORI/ci chore: add ci checks commit 68b85a80fdd602c22296eb6d8fe6703e7df6e943 Author: Norman Meier Date: Tue Oct 4 16:20:25 2022 +0200 chore: add ci checks Signed-off-by: Norman Meier commit e3a2d0e8f943445a44b085d1bbbac8f65d7e0d76 Author: yieldoption Date: Mon Sep 26 22:37:32 2022 -0400 add tests for nft vault contract commit a04e44fe54ed798d96659098914af72a0c36d8f5 Merge: 8aad97c 48f7ba2 Author: n0izn0iz Date: Tue Sep 13 01:00:08 2022 +0200 Merge pull request #2 from TERITORI/schema-and-deploy chore: generate schema and deploy commit 48f7ba2b07f6dcf220ff79b4ee9088e24b4b2c63 Author: Norman Meier Date: Mon Sep 12 22:13:25 2022 +0200 chore: generate schema and deploy Signed-off-by: Norman Meier commit 8aad97ceb33e93f5c605e930074019a80ed5abb1 Author: sarawut Date: Wed Jun 8 19:24:19 2022 +0700 upgrade cosmwasm version commit aef4da7c70376056cef6e2dc9f2a6a758a9012c7 Merge: c610270 c80a675 Author: Yannis Date: Thu Mar 10 18:04:51 2022 +0100 Merge pull request #1 from POPSmartContract/fixed fix receivenft hook, save process commit c80a675f2c92b2dea0f82e7a1ca050908ccfff26 Author: unknown Date: Thu Mar 10 12:01:30 2022 -0500 fix receivenft hook, save process commit c6102700dd3a51706bd2f2a1ba1a1b2be5ca2cdf Author: devstar Date: Wed Mar 2 00:15:54 2022 +0700 set initial price for deposit, transfer nft when buy commit 20f335c01e44779ce8781d83d2a62bdad3272d42 Author: devstar Date: Thu Feb 24 21:20:28 2022 +0700 add fee withdraw function, query_all_nft_list in vault commit 9963a9d7f413aed5942ee873283be6d0762ec533 Author: devstar Date: Tue Feb 22 01:00:06 2022 +0700 complete buy function, add more queries commit 2fbcdcf01d2b335baff30783d444e6df2098d016 Author: devstar Date: Thu Feb 10 20:08:30 2022 +0700 initial vault contract --- .github/workflows/rust.yml | 3 + Makefile | 70 +++++++++---------- cosmwasm-contracts/nft-marketplace | 1 + .../nftDetails/components/NFTSellInfo.tsx | 4 +- .../NftMarketplace.client.ts} | 10 +-- .../NftMarketplace.types.ts} | 0 .../nft-marketplace/index.ts | 2 + packages/hooks/useCancelNFTListing.ts | 4 +- packages/hooks/useNFTInfo.ts | 10 +-- packages/hooks/useVaultNFTInfo.ts | 4 +- packages/hooks/vault/useVaultConfig.ts | 4 +- packages/screens/CoreDAO/CoreDAOScreen.tsx | 4 +- .../screens/Marketplace/NFTDetailScreen.tsx | 6 +- packages/scripts/network-setup/deployLib.ts | 2 +- packages/scripts/vaultInfo.ts | 4 +- 15 files changed, 66 insertions(+), 62 deletions(-) create mode 160000 cosmwasm-contracts/nft-marketplace rename packages/contracts-clients/{teritori-nft-vault/TeritoriNftVault.client.ts => nft-marketplace/NftMarketplace.client.ts} (93%) rename packages/contracts-clients/{teritori-nft-vault/TeritoriNftVault.types.ts => nft-marketplace/NftMarketplace.types.ts} (100%) create mode 100644 packages/contracts-clients/nft-marketplace/index.ts diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index b10ce77b26..98d491bc62 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,6 +14,9 @@ jobs: - uses: dtolnay/rust-toolchain@stable + - name: Build + run: make build.rust + - name: Test run: make test.rust diff --git a/Makefile b/Makefile index eba4ac86f5..cf870d95e6 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,9 @@ BUNKER_MINTER_PACKAGE=teritori-bunker-minter GO?=go GOFMT?=$(shell $(GO) env GOROOT)/bin/gofmt +COSMWASM_CONTRACTS_DIR=cosmwasm-contracts +INTERNAL_COSMWASM_CONTRACTS=$(wildcard $(COSMWASM_CONTRACTS_DIR)/*) + TOKEN_REPO=teritori-nfts TOKEN_PACKAGE=teritori-nft SQUAD_STAKING_PACKAGE=teritori-squad-staking @@ -15,9 +18,6 @@ NAME_SERVICE_PACKAGE=teritori-name-service RIOTER_FOOTER_REPO=rioters-footer-nft RIOTER_FOOTER_PACKAGE=rioter-footer-nft -VAULT_REPO=teritori-vault -VAULT_PACKAGE=teritori-nft-vault - ADDR_LIST_REPO=cw_addr_list ADDR_LIST_PACKAGE=cw-address-list @@ -89,26 +89,13 @@ docker.backend: docker build . -f go/cmd/teritori-dapp-backend/Dockerfile -t teritori/teritori-dapp-backend:$(shell git rev-parse --short HEAD) .PHONY: generate.contracts-clients -generate.contracts-clients: $(CONTRACTS_CLIENTS_DIR)/$(BUNKER_MINTER_PACKAGE) $(CONTRACTS_CLIENTS_DIR)/$(NAME_SERVICE_PACKAGE) $(CONTRACTS_CLIENTS_DIR)/$(RIOTER_FOOTER_PACKAGE) $(CONTRACTS_CLIENTS_DIR)/$(TOKEN_PACKAGE) $(CONTRACTS_CLIENTS_DIR)/$(VAULT_PACKAGE) $(CONTRACTS_CLIENTS_DIR)/cw721-membership +generate.contracts-clients: generate.internal-contracts-clients $(CONTRACTS_CLIENTS_DIR)/$(BUNKER_MINTER_PACKAGE) $(CONTRACTS_CLIENTS_DIR)/$(NAME_SERVICE_PACKAGE) $(CONTRACTS_CLIENTS_DIR)/$(RIOTER_FOOTER_PACKAGE) $(CONTRACTS_CLIENTS_DIR)/$(TOKEN_PACKAGE) .PHONY: generate.go-networks generate.go-networks: node_modules validate-networks npx tsx packages/scripts/generateGoNetworks.ts | $(GOFMT) > go/pkg/networks/networks.gen.go npx tsx packages/scripts/codegen/generateGoNetworkFeatures.ts | $(GOFMT) > go/pkg/networks/features.gen.go -.PHONY/: $(CONTRACTS_CLIENTS_DIR)/cw721-membership -$(CONTRACTS_CLIENTS_DIR)/cw721-membership: node_modules - rm -fr $@ - cd cosmwasm-contracts/cw721-membership && cargo schema - npx cosmwasm-ts-codegen generate \ - --plugin client \ - --schema cosmwasm-contracts/cw721-membership/schema \ - --out $@ \ - --name cw721-membership \ - --no-bundle - npx tsx packages/scripts/makeTypescriptIndex $@ - touch $@ - .PHONY: $(CONTRACTS_CLIENTS_DIR)/$(BUNKER_MINTER_PACKAGE) $(CONTRACTS_CLIENTS_DIR)/$(BUNKER_MINTER_PACKAGE): node_modules rm -fr $(CANDYMACHINE_REPO) @@ -216,23 +203,6 @@ $(CONTRACTS_CLIENTS_DIR)/$(BREEDING_PACKAGE): node_modules go fmt ./go/pkg/contracts/breeding_minter_types rm -fr $(CANDYMACHINE_REPO) -.PHONY: $(CONTRACTS_CLIENTS_DIR)/$(VAULT_PACKAGE) -$(CONTRACTS_CLIENTS_DIR)/$(VAULT_PACKAGE): node_modules - rm -fr $(VAULT_REPO) - git clone git@github.com:TERITORI/$(VAULT_REPO).git - cd $(VAULT_REPO) && git checkout 75a692533b9188587ebfa909c5576376b8d65999 - rm -fr $@ - npx cosmwasm-ts-codegen generate \ - --plugin client \ - --schema $(VAULT_REPO)/contracts/nft-vault/schema \ - --out $@ \ - --name $(VAULT_PACKAGE) \ - --no-bundle - mkdir -p go/pkg/contracts/vault_types - go run github.com/a-h/generate/cmd/schema-generate@v0.0.0-20220105161013-96c14dfdfb60 -i $(VAULT_REPO)/contracts/nft-vault/schema/execute_msg.json -o go/pkg/contracts/vault_types/execute_msg.go -p vault_types - go fmt ./go/pkg/contracts/vault_types - rm -fr $(VAULT_REPO) - .PHONY: $(CONTRACTS_CLIENTS_DIR)/$(ADDR_LIST_PACKAGE) $(CONTRACTS_CLIENTS_DIR)/$(ADDR_LIST_PACKAGE): node_modules rm -fr $(ADDR_LIST_REPO) @@ -404,8 +374,36 @@ bump-app-build-number: .PHONY: test.rust test.rust: - cd cosmwasm-contracts/cw721-membership && cargo test + set -xeuo pipefail ; \ + for file in $(INTERNAL_COSMWASM_CONTRACTS); do \ + cd $${file} ; \ + cargo test ; \ + cd - ; \ + done .PHONY: build.rust build.rust: - cd cosmwasm-contracts/cw721-membership && cargo wasm + set -xeuo pipefail ; \ + for file in $(INTERNAL_COSMWASM_CONTRACTS); do \ + cd $${file} ; \ + cargo wasm ; \ + cd - ; \ + done + +.PHONY: generate.internal-contracts-clients +generate.internal-contracts-clients: node_modules + set -xeuo pipefail ; \ + for indir in $(INTERNAL_COSMWASM_CONTRACTS) ; do \ + (cd $${indir} && cargo schema && cd -) || exit 1 ; \ + pkgname="$$(basename $${indir})" ; \ + outdir="$(CONTRACTS_CLIENTS_DIR)/$${pkgname}" ; \ + rm -fr $${outdir} ; \ + npx cosmwasm-ts-codegen generate \ + --plugin client \ + --schema $${indir}/schema \ + --out $${outdir} \ + --name $${pkgname} \ + --no-bundle ; \ + npx tsx packages/scripts/makeTypescriptIndex $${outdir} ; \ + done + diff --git a/cosmwasm-contracts/nft-marketplace b/cosmwasm-contracts/nft-marketplace new file mode 160000 index 0000000000..75a692533b --- /dev/null +++ b/cosmwasm-contracts/nft-marketplace @@ -0,0 +1 @@ +Subproject commit 75a692533b9188587ebfa909c5576376b8d65999 diff --git a/packages/components/nftDetails/components/NFTSellInfo.tsx b/packages/components/nftDetails/components/NFTSellInfo.tsx index 768447e91c..ab88237b0d 100644 --- a/packages/components/nftDetails/components/NFTSellInfo.tsx +++ b/packages/components/nftDetails/components/NFTSellInfo.tsx @@ -1,7 +1,7 @@ import { Decimal } from "@cosmjs/math"; import { useQuery } from "@tanstack/react-query"; -import { TeritoriNftVaultQueryClient } from "../../../contracts-clients/teritori-nft-vault/TeritoriNftVault.client"; +import { NftMarketplaceQueryClient } from "../../../contracts-clients/nft-marketplace/NftMarketplace.client"; import { getNativeCurrency, getNetwork, @@ -78,7 +78,7 @@ const useVaultConfig = (networkId: string | undefined) => { } const cosmwasmClient = await mustGetNonSigningCosmWasmClient(network.id); - const vaultClient = new TeritoriNftVaultQueryClient( + const vaultClient = new NftMarketplaceQueryClient( cosmwasmClient, network.vaultContractAddress, ); diff --git a/packages/contracts-clients/teritori-nft-vault/TeritoriNftVault.client.ts b/packages/contracts-clients/nft-marketplace/NftMarketplace.client.ts similarity index 93% rename from packages/contracts-clients/teritori-nft-vault/TeritoriNftVault.client.ts rename to packages/contracts-clients/nft-marketplace/NftMarketplace.client.ts index 52b82eba5e..2fd67b2785 100644 --- a/packages/contracts-clients/teritori-nft-vault/TeritoriNftVault.client.ts +++ b/packages/contracts-clients/nft-marketplace/NftMarketplace.client.ts @@ -6,8 +6,8 @@ import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; import { Coin, StdFee } from "@cosmjs/amino"; -import { Uint128, AllNftsInVaultResponse, NFTInfo, ConfigResponse, ExecuteMsg, Binary, Cw721ReceiveMsg, InstantiateMsg, NftInfoResponse, NftListResponse, NftOwnerInfoResponse, NftQueryMsg, Cw2981QueryMsg, QueryMsg, RoyaltiesInfoResponse } from "./TeritoriNftVault.types"; -export interface TeritoriNftVaultReadOnlyInterface { +import { Uint128, AllNftsInVaultResponse, NFTInfo, ConfigResponse, ExecuteMsg, Binary, Cw721ReceiveMsg, InstantiateMsg, NftInfoResponse, NftListResponse, NftOwnerInfoResponse, NftQueryMsg, Cw2981QueryMsg, QueryMsg, RoyaltiesInfoResponse } from "./NftMarketplace.types"; +export interface NftMarketplaceReadOnlyInterface { contractAddress: string; config: () => Promise; nftInfo: ({ @@ -18,7 +18,7 @@ export interface TeritoriNftVaultReadOnlyInterface { nftTokenId: string; }) => Promise; } -export class TeritoriNftVaultQueryClient implements TeritoriNftVaultReadOnlyInterface { +export class NftMarketplaceQueryClient implements NftMarketplaceReadOnlyInterface { client: CosmWasmClient; contractAddress: string; @@ -49,7 +49,7 @@ export class TeritoriNftVaultQueryClient implements TeritoriNftVaultReadOnlyInte }); }; } -export interface TeritoriNftVaultInterface extends TeritoriNftVaultReadOnlyInterface { +export interface NftMarketplaceInterface extends NftMarketplaceReadOnlyInterface { contractAddress: string; sender: string; updateConfig: ({ @@ -95,7 +95,7 @@ export interface TeritoriNftVaultInterface extends TeritoriNftVaultReadOnlyInter }, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; withdrawFee: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise; } -export class TeritoriNftVaultClient extends TeritoriNftVaultQueryClient implements TeritoriNftVaultInterface { +export class NftMarketplaceClient extends NftMarketplaceQueryClient implements NftMarketplaceInterface { client: SigningCosmWasmClient; sender: string; contractAddress: string; diff --git a/packages/contracts-clients/teritori-nft-vault/TeritoriNftVault.types.ts b/packages/contracts-clients/nft-marketplace/NftMarketplace.types.ts similarity index 100% rename from packages/contracts-clients/teritori-nft-vault/TeritoriNftVault.types.ts rename to packages/contracts-clients/nft-marketplace/NftMarketplace.types.ts diff --git a/packages/contracts-clients/nft-marketplace/index.ts b/packages/contracts-clients/nft-marketplace/index.ts new file mode 100644 index 0000000000..107d66df4a --- /dev/null +++ b/packages/contracts-clients/nft-marketplace/index.ts @@ -0,0 +1,2 @@ +export * from "./NftMarketplace.client"; +export * from "./NftMarketplace.types"; \ No newline at end of file diff --git a/packages/hooks/useCancelNFTListing.ts b/packages/hooks/useCancelNFTListing.ts index d6af19d416..c68fb12a16 100644 --- a/packages/hooks/useCancelNFTListing.ts +++ b/packages/hooks/useCancelNFTListing.ts @@ -2,7 +2,7 @@ import { useCallback } from "react"; import useSelectedWallet from "./useSelectedWallet"; -import { TeritoriNftVaultClient } from "@/contracts-clients/teritori-nft-vault/TeritoriNftVault.client"; +import { NftMarketplaceClient } from "@/contracts-clients/nft-marketplace/NftMarketplace.client"; import { NFTVault__factory } from "@/evm-contracts-clients/teritori-nft-vault/NFTVault__factory"; import { getKeplrSigningCosmWasmClient, @@ -24,7 +24,7 @@ const teritoriCancelNFTListing = async ( throw new Error("network not supported"); } const cosmwasmClient = await getKeplrSigningCosmWasmClient(networkId); - const vaultClient = new TeritoriNftVaultClient( + const vaultClient = new NftMarketplaceClient( cosmwasmClient, sender, network.vaultContractAddress, diff --git a/packages/hooks/useNFTInfo.ts b/packages/hooks/useNFTInfo.ts index ab05936a34..4233b0f287 100644 --- a/packages/hooks/useNFTInfo.ts +++ b/packages/hooks/useNFTInfo.ts @@ -5,11 +5,11 @@ import { useBreedingConfig } from "./useBreedingConfig"; import { ConfigResponse as BreedingConfigResponse } from "../contracts-clients/teritori-breeding/TeritoriBreeding.types"; import { Metadata as Cw721MembershipMetadata } from "@/contracts-clients/cw721-membership"; +import { NftMarketplaceQueryClient } from "@/contracts-clients/nft-marketplace/NftMarketplace.client"; import { TeritoriBreedingQueryClient } from "@/contracts-clients/teritori-breeding/TeritoriBreeding.client"; import { TeritoriBunkerMinterQueryClient } from "@/contracts-clients/teritori-bunker-minter/TeritoriBunkerMinter.client"; import { TeritoriNameServiceQueryClient } from "@/contracts-clients/teritori-name-service/TeritoriNameService.client"; import { TeritoriNftQueryClient } from "@/contracts-clients/teritori-nft/TeritoriNft.client"; -import { TeritoriNftVaultQueryClient } from "@/contracts-clients/teritori-nft-vault/TeritoriNftVault.client"; import { TeritoriMinter__factory } from "@/evm-contracts-clients/teritori-bunker-minter/TeritoriMinter__factory"; import { TeritoriNft__factory } from "@/evm-contracts-clients/teritori-nft/TeritoriNft__factory"; import { NFTVault__factory } from "@/evm-contracts-clients/teritori-nft-vault/NFTVault__factory"; @@ -130,7 +130,7 @@ const getTNSNFTInfo = async ( // ======== Getting NFT owner const { owner } = await tnsClient.ownerOf({ tokenId }); // ======== Getting vault stuff (For selling) - const vaultClient = new TeritoriNftVaultQueryClient( + const vaultClient = new NftMarketplaceQueryClient( cosmwasmClient, network.vaultContractAddress, ); @@ -362,7 +362,7 @@ const getTeritoriBunkerNFTInfo = async ( // ======== Getting NFT metadata // ======== Getting vault stuff (For selling) - const vaultClient = new TeritoriNftVaultQueryClient( + const vaultClient = new NftMarketplaceQueryClient( cosmwasmClient, network.vaultContractAddress, ); @@ -472,7 +472,7 @@ const getTeritoriRiotBreedingNFTInfo = async ( // ======== Getting NFT metadata // ======== Getting vault stuff (For selling) - const vaultClient = new TeritoriNftVaultQueryClient( + const vaultClient = new NftMarketplaceQueryClient( cosmwasmClient, network.vaultContractAddress, ); @@ -600,7 +600,7 @@ const getNFTVaultInfo = async ( throw new Error("network not supported"); } const cosmwasmClient = await mustGetNonSigningCosmWasmClient(network.id); - const vaultClient = new TeritoriNftVaultQueryClient( + const vaultClient = new NftMarketplaceQueryClient( cosmwasmClient, network.vaultContractAddress, ); diff --git a/packages/hooks/useVaultNFTInfo.ts b/packages/hooks/useVaultNFTInfo.ts index 21af2a7fe7..7eecf9dea8 100644 --- a/packages/hooks/useVaultNFTInfo.ts +++ b/packages/hooks/useVaultNFTInfo.ts @@ -1,6 +1,6 @@ import { useQuery } from "@tanstack/react-query"; -import { TeritoriNftVaultQueryClient } from "@/contracts-clients/teritori-nft-vault/TeritoriNftVault.client"; +import { NftMarketplaceQueryClient } from "@/contracts-clients/nft-marketplace/NftMarketplace.client"; import { getCosmosNetwork, mustGetNonSigningCosmWasmClient, @@ -28,7 +28,7 @@ export const useVaultNFTInfo = (nftId: string | undefined) => { console.log("network nft info", network); const client = await mustGetNonSigningCosmWasmClient(network.id); - const vaultClient = new TeritoriNftVaultQueryClient( + const vaultClient = new NftMarketplaceQueryClient( client, network?.vaultContractAddress, ); diff --git a/packages/hooks/vault/useVaultConfig.ts b/packages/hooks/vault/useVaultConfig.ts index 342dc4685c..726478823d 100644 --- a/packages/hooks/vault/useVaultConfig.ts +++ b/packages/hooks/vault/useVaultConfig.ts @@ -1,6 +1,6 @@ import { useQuery } from "@tanstack/react-query"; -import { TeritoriNftVaultQueryClient } from "@/contracts-clients/teritori-nft-vault/TeritoriNftVault.client"; +import { NftMarketplaceQueryClient } from "@/contracts-clients/nft-marketplace/NftMarketplace.client"; import { getCosmosNetwork, mustGetNonSigningCosmWasmClient } from "@/networks"; export const useVaultConfig = (networkId: string) => { @@ -12,7 +12,7 @@ export const useVaultConfig = (networkId: string) => { return undefined; } const cosmwasmClient = await mustGetNonSigningCosmWasmClient(networkId); - const client = new TeritoriNftVaultQueryClient( + const client = new NftMarketplaceQueryClient( cosmwasmClient, network.vaultContractAddress, ); diff --git a/packages/screens/CoreDAO/CoreDAOScreen.tsx b/packages/screens/CoreDAO/CoreDAOScreen.tsx index 9874854910..4a934c5b35 100644 --- a/packages/screens/CoreDAO/CoreDAOScreen.tsx +++ b/packages/screens/CoreDAO/CoreDAOScreen.tsx @@ -12,8 +12,8 @@ import { ScreenContainer } from "@/components/ScreenContainer"; import { PrimaryButton } from "@/components/buttons/PrimaryButton"; import { SpacerColumn } from "@/components/spacer"; import { useFeedbacks } from "@/context/FeedbacksProvider"; +import { NftMarketplaceClient } from "@/contracts-clients/nft-marketplace/NftMarketplace.client"; import { TeritoriNameServiceQueryClient } from "@/contracts-clients/teritori-name-service/TeritoriNameService.client"; -import { TeritoriNftVaultClient } from "@/contracts-clients/teritori-nft-vault/TeritoriNftVault.client"; import { useDAOMakeProposal } from "@/hooks/dao/useDAOMakeProposal"; import { useFeedConfig } from "@/hooks/feed/useFeedConfig"; import { useBalances } from "@/hooks/useBalances"; @@ -177,7 +177,7 @@ const VaultManager: React.FC<{ networkId: string }> = ({ networkId }) => { const cosmWasmClient = await getKeplrSigningCosmWasmClient( selectedWallet.networkId, ); - const vaultClient = new TeritoriNftVaultClient( + const vaultClient = new NftMarketplaceClient( cosmWasmClient, selectedWallet.address, network.vaultContractAddress, diff --git a/packages/screens/Marketplace/NFTDetailScreen.tsx b/packages/screens/Marketplace/NFTDetailScreen.tsx index 173a5023a5..c81ad5734b 100644 --- a/packages/screens/Marketplace/NFTDetailScreen.tsx +++ b/packages/screens/Marketplace/NFTDetailScreen.tsx @@ -11,7 +11,7 @@ import { SpacerColumn } from "@/components/spacer"; import { Tabs } from "@/components/tabs/Tabs"; import { initialToastError, useFeedbacks } from "@/context/FeedbacksProvider"; import { Wallet } from "@/context/WalletsProvider"; -import { TeritoriNftVaultClient } from "@/contracts-clients/teritori-nft-vault/TeritoriNftVault.client"; +import { NftMarketplaceClient } from "@/contracts-clients/nft-marketplace/NftMarketplace.client"; import { NFTVault__factory } from "@/evm-contracts-clients/teritori-nft-vault/NFTVault__factory"; import { useMintEnded } from "@/hooks/collection/useMintEnded"; import { useCancelNFTListing } from "@/hooks/useCancelNFTListing"; @@ -163,7 +163,7 @@ const Content: React.FC<{ if (!cosmosNetwork.vaultContractAddress) { throw new Error("network not supported"); } - const vaultClient = new TeritoriNftVaultClient( + const vaultClient = new NftMarketplaceClient( client, sender, cosmosNetwork.vaultContractAddress, @@ -295,7 +295,7 @@ const teritoriBuy = async (wallet: Wallet, info: NFTInfo) => { throw new Error("network not supported"); } const signingCosmwasmClient = await getKeplrSigningCosmWasmClient(network.id); - const signingVaultClient = new TeritoriNftVaultClient( + const signingVaultClient = new NftMarketplaceClient( signingCosmwasmClient, wallet.address, network.vaultContractAddress, diff --git a/packages/scripts/network-setup/deployLib.ts b/packages/scripts/network-setup/deployLib.ts index 8eec9f1e62..e2a9bf0f46 100644 --- a/packages/scripts/network-setup/deployLib.ts +++ b/packages/scripts/network-setup/deployLib.ts @@ -5,6 +5,7 @@ import { bech32 } from "bech32"; import _, { cloneDeep } from "lodash"; import path from "path"; +import { InstantiateMsg as MarketplaceVaultInstantiateMsg } from "../../contracts-clients/nft-marketplace/NftMarketplace.types"; import { TeritoriNameServiceClient, TeritoriNameServiceQueryClient, @@ -14,7 +15,6 @@ import { ExecuteMsg as NameServiceExecuteMsg, InstantiateMsg as NameServiceInstantiateMsg, } from "../../contracts-clients/teritori-name-service/TeritoriNameService.types"; -import { InstantiateMsg as MarketplaceVaultInstantiateMsg } from "../../contracts-clients/teritori-nft-vault/TeritoriNftVault.types"; import { InstantiateMsg as SocialFeedInstantiateMsg } from "../../contracts-clients/teritori-social-feed/TeritoriSocialFeed.types"; import { CosmosNetworkInfo, diff --git a/packages/scripts/vaultInfo.ts b/packages/scripts/vaultInfo.ts index 61bc6451c5..9fc03420e4 100644 --- a/packages/scripts/vaultInfo.ts +++ b/packages/scripts/vaultInfo.ts @@ -1,4 +1,4 @@ -import { TeritoriNftVaultQueryClient } from "../contracts-clients/teritori-nft-vault/TeritoriNftVault.client"; +import { NftMarketplaceQueryClient } from "../contracts-clients/nft-marketplace/NftMarketplace.client"; import { mustGetNonSigningCosmWasmClient } from "../networks"; import { teritoriNetwork } from "../networks/teritori"; @@ -10,7 +10,7 @@ const main = async () => { console.log("contract address:", network.vaultContractAddress); - const client = new TeritoriNftVaultQueryClient( + const client = new NftMarketplaceQueryClient( await mustGetNonSigningCosmWasmClient(network.id), network.vaultContractAddress, );