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
- 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 "@usemirrorworld/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.buyNFT
Solana.Asset.listNFT
Solana.Asset.cancelListing
Solana.Asset.transferNFT
Solana.Asset.createMarketplace
Solana.Asset.updateMarketplace
Solana.Asset.queryMarketplaces
Solana.Asset.queryAssetTransactionStatus
Solana.Asset.queryAssetMintsStatus
Solana.Asset.createVerifiedCollection
Solana.Asset.getCollections
Solana.Asset.getCollectionNFTs
Solana.Asset.mintNFT
Solana.Asset.updateNFTMetadata
Solana.Asset.verifyMintConfig
Solana.Asset.searchNFTsByMintAddresses
Solana.Asset.searchNFTsByCreatorAddresses
Solana.Asset.searchNFTsByUpdateAuthorityAddresses
Solana.Asset.searchNFTsByOwnerAddresses
Solana.Asset.searchNFTByMintAddress
Solana.Wallet
| API Reference
Solana.Wallet.fetchTokens
Solana.Wallet.fetchTransactions
Solana.Wallet.fetchTokensInWallet
Solana.Wallet.fetchTransactionsByWallet
Solana.Wallet.fetchTransactionBySignature
Solana.Wallet.transferSol
Solana.Wallet.transferSPLToken
Solana.Metadata
| API Reference
Solana.Metadata.fetchNFTInfo
Solana.Metadata.fetchNFTEvents
Solana.Metadata.fetchNFTsInfo
Solana.Metadata.searchCollectionNFT
Solana.Metadata.searchRecommendedNFTsInCollection
Solana.Metadata.searchMarketplaceEvents
Solana.Metadata.queryCollectionsInfo
Solana.Metadata.queryCollectionFilterMetadata
Solana.Metadata.queryCollectionSummary
Solana.Metadata.registerCollection
Polygon | JS API Reference
All Polygon service APIs on the Mirror World Smart SDK.
import { MirrorWorld, Polygon } from "@usemirrorworld/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.buyNFT
Polygon.Asset.listNFT
Polygon.Asset.cancelListing
Polygon.Asset.transferNFT
Polygon.Asset.createMarketplace
Polygon.Asset.updateMarketplace
Polygon.Asset.queryMarketplaces
Polygon.Asset.createCollection
Polygon.Asset.mintNFT
Polygon.Asset.verifyMintConfig
Polygon.Asset.getCollections
Polygon.Asset.getCollectionNFTs
Polygon.Asset.searchNFTsByOwnerAddresses
Polygon.Asset.searchNFT
Polygon.Asset.searchNFTs
Polygon.Wallet
| API Reference
Polygon.Wallet.fetchTokens
Polygon.Wallet.fetchTransactions
Polygon.Wallet.fetchWalletTransactions
Polygon.Wallet.fetchTransactionByHash
Polygon.Wallet.transferMATIC
Polygon.Wallet.transferERC20Token
Polygon.Wallet.fetchTokensInWallet
Polygon.Wallet.fetchTransactionsByWallet
Polygon.Wallet.personalSign
Polygon.Wallet.signTypedData
Polygon.Wallet.signTypedDataVersioned
Polygon.Wallet.signAndSendTransaction
Polygon.Metadata
| API Reference
Polygon.Metadata.fetchNFTInfo
Polygon.Metadata.fetchNFTEvents
Polygon.Metadata.fetchNFTsInfo
Polygon.Metadata.searchCollectionNFT
Polygon.Metadata.searchRecommendedNFTsInCollection
Polygon.Metadata.searchMarketplaceEvents
Polygon.Metadata.queryCollectionsInfo
Polygon.Metadata.queryCollectionFilterMetadata
Polygon.Metadata.queryCollectionSummary
Polygon.Metadata.registerCollection
BNBChain | JS API Reference
All BNBChain service APIs on the Mirror World Smart SDK.
import { MirrorWorld, BNBChain } from "@usemirrorworld/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.buyNFT
BNBChain.Asset.listNFT
BNBChain.Asset.cancelListing
BNBChain.Asset.transferNFT
BNBChain.Asset.createMarketplace
BNBChain.Asset.updateMarketplace
BNBChain.Asset.queryMarketplaces
BNBChain.Asset.createCollection
BNBChain.Asset.mintNFT
BNBChain.Asset.verifyMintConfig
BNBChain.Asset.getCollections
BNBChain.Asset.getCollectionNFTs
BNBChain.Asset.searchNFTsByOwnerAddresses
BNBChain.Asset.searchNFT
BNBChain.Asset.searchNFTs
BNBChain.Wallet
| API Reference
BNBChain.Wallet.fetchTokens
BNBChain.Wallet.fetchTransactions
BNBChain.Wallet.fetchWalletTransactions
BNBChain.Wallet.fetchTransactionByHash
BNBChain.Wallet.transferBNB
BNBChain.Wallet.transferBEP20Token
BNBChain.Wallet.fetchTokensInWallet
BNBChain.Wallet.fetchTransactionsByWallet
BNBChain.Wallet.personalSign
BNBChain.Wallet.signTypedData
BNBChain.Wallet.signTypedDataVersioned
BNBChain.Wallet.signAndSendTransaction
BNBChain.Metadata
| API Reference
BNBChain.Metadata.fetchNFTInfo
BNBChain.Metadata.fetchNFTEvents
BNBChain.Metadata.fetchNFTsInfo
BNBChain.Metadata.searchCollectionNFT
BNBChain.Metadata.searchRecommendedNFTsInCollection
BNBChain.Metadata.searchMarketplaceEvents
BNBChain.Metadata.queryCollectionsInfo
BNBChain.Metadata.queryCollectionFilterMetadata
BNBChain.Metadata.queryCollectionSummary
BNBChain.Metadata.registerCollection
Ethereum | JS API Reference
All Ethereum service APIs on the Mirror World Smart SDK.
import { MirrorWorld, Ethereum } from "@usemirrorworld/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.buyNFT
Ethereum.Asset.listNFT
Ethereum.Asset.cancelListing
Ethereum.Asset.transferNFT
Ethereum.Asset.createMarketplace
Ethereum.Asset.updateMarketplace
Ethereum.Asset.queryMarketplaces
Ethereum.Asset.createCollection
Ethereum.Asset.mintNFT
Ethereum.Asset.verifyMintConfig
Ethereum.Asset.getCollections
Ethereum.Asset.getCollectionNFTs
Ethereum.Asset.searchNFTsByOwnerAddresses
Ethereum.Asset.searchNFT
Ethereum.Asset.searchNFTs
Ethereum.Wallet
| API Reference
Ethereum.Wallet.fetchTokens
Ethereum.Wallet.fetchTransactions
Ethereum.Wallet.fetchWalletTransactions
Ethereum.Wallet.fetchTransactionByHash
Ethereum.Wallet.transferETH
Ethereum.Wallet.transferERC20Token
Ethereum.Wallet.fetchTokensInWallet
Ethereum.Wallet.fetchTransactionsByWallet
Ethereum.Wallet.personalSign
Ethereum.Wallet.signTypedData
Ethereum.Wallet.signTypedDataVersioned
Ethereum.Wallet.signAndSendTransaction
Ethereum.Metadata
| API Reference
Ethereum.Metadata.fetchNFTInfo
Ethereum.Metadata.fetchNFTEvents
Ethereum.Metadata.fetchNFTsInfo
Ethereum.Metadata.searchCollectionNFT
Ethereum.Metadata.searchRecommendedNFTsInCollection
Ethereum.Metadata.searchMarketplaceEvents
Ethereum.Metadata.queryCollectionsInfo
Ethereum.Metadata.queryCollectionFilterMetadata
Ethereum.Metadata.queryCollectionSummary
Ethereum.Metadata.registerCollection
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