JavaScript SDK API Reference
On this page you will find the full JavaScript API reference for the JavaScript SDK. It covers the following topics:
- Configuration
- Authentication
- Solana Service Methods
- Polygon Service Methods
- BNB Chain Service Methods
- Ethereum Service Methods
- SUI Service Methods
- Accessors
- Events
For the integration guide please visit this page For the
Configuration Options | JS API Reference
For the JS SDK configuration options, please visit the configuration page
Authentication | JS API Reference
Solana | JS API Reference
All Solana service APIs on the Mirror World Smart SDK.
import { MirrorWorld, Solana } from "@mirrorworld/web3.js"const mirrorworld = new MirrorWorld({ apiKey: "YOUR_API_KEY", chainConfig: Solana("mainnet-beta"),})// Or dynamically set the chainConfigmirrorworld.chainConfig = Solana("mainnet-beta")// Access the Solana service APIsmirrorworld.Solana.Asset.buyNFT(/* ... */)
Solana.Asset | API Reference
Solana.Asset.buyNFTSolana.Asset.listNFTSolana.Asset.cancelListingSolana.Asset.transferNFTSolana.Asset.createMarketplaceSolana.Asset.updateMarketplaceSolana.Asset.queryMarketplacesSolana.Asset.queryAssetTransactionStatusSolana.Asset.queryAssetMintsStatusSolana.Asset.createVerifiedCollectionSolana.Asset.getCollectionsSolana.Asset.getCollectionNFTsSolana.Asset.mintNFTSolana.Asset.updateNFTMetadataSolana.Asset.verifyMintConfigSolana.Asset.searchNFTsByMintAddressesSolana.Asset.searchNFTsByCreatorAddressesSolana.Asset.searchNFTsByUpdateAuthorityAddressesSolana.Asset.searchNFTsByOwnerAddressesSolana.Asset.searchNFTByMintAddress
Solana.Wallet | API Reference
Solana.Wallet.fetchTokensSolana.Wallet.fetchTransactionsSolana.Wallet.fetchTokensInWalletSolana.Wallet.fetchTransactionsByWalletSolana.Wallet.fetchTransactionBySignatureSolana.Wallet.transferSolSolana.Wallet.transferSPLToken
Solana.Metadata | API Reference
Solana.Metadata.fetchNFTInfoSolana.Metadata.fetchNFTEventsSolana.Metadata.fetchNFTsInfoSolana.Metadata.searchCollectionNFTSolana.Metadata.searchRecommendedNFTsInCollectionSolana.Metadata.searchMarketplaceEventsSolana.Metadata.queryCollectionsInfoSolana.Metadata.queryCollectionFilterMetadataSolana.Metadata.queryCollectionSummarySolana.Metadata.registerCollection
Polygon | JS API Reference
All Polygon service APIs on the Mirror World Smart SDK.
import { MirrorWorld, Polygon } from "@mirrorworld/web3.js"const mirrorworld = new MirrorWorld({ apiKey: "YOUR_API_KEY", chainConfig: Polygon("mumbai-mainnet"),})// Or dynamically set the chainConfigmirrorworld.chainConfig = Polygon("mumbai-mainnet")// Access the Polygon service APIsmirrorworld.Polygon.Asset.buyNFT(/* ... */)
Polygon.Asset | API Reference
Polygon.Asset.buyNFTPolygon.Asset.listNFTPolygon.Asset.cancelListingPolygon.Asset.transferNFTPolygon.Asset.createMarketplacePolygon.Asset.updateMarketplacePolygon.Asset.queryMarketplacesPolygon.Asset.createCollectionPolygon.Asset.mintNFTPolygon.Asset.verifyMintConfigPolygon.Asset.getCollectionsPolygon.Asset.getCollectionNFTsPolygon.Asset.searchNFTsByOwnerAddressesPolygon.Asset.searchNFTPolygon.Asset.searchNFTs
Polygon.Wallet | API Reference
Polygon.Wallet.fetchTokensPolygon.Wallet.fetchTransactionsPolygon.Wallet.fetchWalletTransactionsPolygon.Wallet.fetchTransactionByHashPolygon.Wallet.transferMATICPolygon.Wallet.transferERC20TokenPolygon.Wallet.fetchTokensInWalletPolygon.Wallet.fetchTransactionsByWalletPolygon.Wallet.personalSignPolygon.Wallet.signTypedDataPolygon.Wallet.signTypedDataVersionedPolygon.Wallet.signAndSendTransaction
Polygon.Metadata | API Reference
Polygon.Metadata.fetchNFTInfoPolygon.Metadata.fetchNFTEventsPolygon.Metadata.fetchNFTsInfoPolygon.Metadata.searchCollectionNFTPolygon.Metadata.searchRecommendedNFTsInCollectionPolygon.Metadata.searchMarketplaceEventsPolygon.Metadata.queryCollectionsInfoPolygon.Metadata.queryCollectionFilterMetadataPolygon.Metadata.queryCollectionSummaryPolygon.Metadata.registerCollection
BNBChain | JS API Reference
All BNBChain service APIs on the Mirror World Smart SDK.
import { MirrorWorld, BNBChain } from "@mirrorworld/web3.js"const mirrorworld = new MirrorWorld({ apiKey: "YOUR_API_KEY", chainConfig: BNBChain("bnb-mainnet"),})// Or dynamically set the chainConfigmirrorworld.chainConfig = BNBChain("bnb-mainnet")// Access the BNBChain service APIsmirrorworld.BNBChain.Asset.buyNFT(/* ... */)
BNBChain.Asset | API Reference
BNBChain.Asset.buyNFTBNBChain.Asset.listNFTBNBChain.Asset.cancelListingBNBChain.Asset.transferNFTBNBChain.Asset.createMarketplaceBNBChain.Asset.updateMarketplaceBNBChain.Asset.queryMarketplacesBNBChain.Asset.createCollectionBNBChain.Asset.mintNFTBNBChain.Asset.verifyMintConfigBNBChain.Asset.getCollectionsBNBChain.Asset.getCollectionNFTsBNBChain.Asset.searchNFTsByOwnerAddressesBNBChain.Asset.searchNFTBNBChain.Asset.searchNFTs
BNBChain.Wallet | API Reference
BNBChain.Wallet.fetchTokensBNBChain.Wallet.fetchTransactionsBNBChain.Wallet.fetchWalletTransactionsBNBChain.Wallet.fetchTransactionByHashBNBChain.Wallet.transferBNBBNBChain.Wallet.transferBEP20TokenBNBChain.Wallet.fetchTokensInWalletBNBChain.Wallet.fetchTransactionsByWalletBNBChain.Wallet.personalSignBNBChain.Wallet.signTypedDataBNBChain.Wallet.signTypedDataVersionedBNBChain.Wallet.signAndSendTransaction
BNBChain.Metadata | API Reference
BNBChain.Metadata.fetchNFTInfoBNBChain.Metadata.fetchNFTEventsBNBChain.Metadata.fetchNFTsInfoBNBChain.Metadata.searchCollectionNFTBNBChain.Metadata.searchRecommendedNFTsInCollectionBNBChain.Metadata.searchMarketplaceEventsBNBChain.Metadata.queryCollectionsInfoBNBChain.Metadata.queryCollectionFilterMetadataBNBChain.Metadata.queryCollectionSummaryBNBChain.Metadata.registerCollection
Ethereum | JS API Reference
All Ethereum service APIs on the Mirror World Smart SDK.
import { MirrorWorld, Ethereum } from "@mirrorworld/web3.js"const mirrorworld = new MirrorWorld({ apiKey: "YOUR_API_KEY", chainConfig: Ethereum("mainnet"),})// Or dynamically set themirrorworld.chainConfig = Ethereum("mainnet")// Access the Ethereum service APIsmirrorworld.Ethereum.Asset.buyNFT(/* ... */)
Ethereum.Asset | API Reference
Ethereum.Asset.buyNFTEthereum.Asset.listNFTEthereum.Asset.cancelListingEthereum.Asset.transferNFTEthereum.Asset.createMarketplaceEthereum.Asset.updateMarketplaceEthereum.Asset.queryMarketplacesEthereum.Asset.createCollectionEthereum.Asset.mintNFTEthereum.Asset.verifyMintConfigEthereum.Asset.getCollectionsEthereum.Asset.getCollectionNFTsEthereum.Asset.searchNFTsByOwnerAddressesEthereum.Asset.searchNFTEthereum.Asset.searchNFTs
Ethereum.Wallet | API Reference
Ethereum.Wallet.fetchTokensEthereum.Wallet.fetchTransactionsEthereum.Wallet.fetchWalletTransactionsEthereum.Wallet.fetchTransactionByHashEthereum.Wallet.transferETHEthereum.Wallet.transferERC20TokenEthereum.Wallet.fetchTokensInWalletEthereum.Wallet.fetchTransactionsByWalletEthereum.Wallet.personalSignEthereum.Wallet.signTypedDataEthereum.Wallet.signTypedDataVersionedEthereum.Wallet.signAndSendTransaction
Ethereum.Metadata | API Reference
Ethereum.Metadata.fetchNFTInfoEthereum.Metadata.fetchNFTEventsEthereum.Metadata.fetchNFTsInfoEthereum.Metadata.searchCollectionNFTEthereum.Metadata.searchRecommendedNFTsInCollectionEthereum.Metadata.searchMarketplaceEventsEthereum.Metadata.queryCollectionsInfoEthereum.Metadata.queryCollectionFilterMetadataEthereum.Metadata.queryCollectionSummaryEthereum.Metadata.registerCollection
SUI | JS API Reference
Here are all the functional modules on the SUI chain and their methods. Click any API to view its description and usage instructions.
import { MirrorWorld, SUI } from "@mirrorworld/web3.js"const mirrorworld = new MirrorWorld({ apiKey: "YOUR_API_KEY", chainConfig: SUI("mainnet"),})// Or dynamically set themirrorworld.chainConfig = SUI("mainnet")// Access the SUI service APIsmirrorworld.value.SUI.Wallet.getTokens()
Asset | SUI JS API Reference
In the Asset module, you can perform operations related to on-chain assets, such as minting, listing, buying, and searching NFTs.
mirrorworld.value.SUI.Asset.getMintedCollectionsmirrorworld.value.SUI.Asset.getNFTOnCollectionmirrorworld.value.SUI.Asset.mintCollectionmirrorworld.value.SUI.Asset.mintNFTmirrorworld.value.SUI.Asset.queryNFTmirrorworld.value.SUI.Asset.searchNFTsByOwnermirrorworld.value.SUI.Asset.searchNFTs
Wallet | SUI JS API Reference
The wallet module contains all APIs related to the assets you own, such as viewing and transferring tokens.
mirrorworld.value.SUI.Wallet.getTransactionByDigestmirrorworld.value.SUI.Wallet.transferSUImirrorworld.value.SUI.Wallet.transferTokenmirrorworld.value.SUI.Wallet.getTokens
Accessors | JS
Events | JS
The SDK also emits events when specific events happen in the SDK
export type MirrorWorldEvents = { "login:email": UserWithWallet login: unknown logout: unknown ready: undefined "auth:refreshToken"?: string "update:user"?: undefined}
You can listen to these events using the on() method. For example, To listen
to the login:email event, we invoke the following event:
mirrorworld.on("login:email", (user) => { console.log("Logged in User", user)})
Edit this page on GitHub