Skip to main content
BETA
HomeIntegration BuilderAPI ReferenceGuidesChangelog
View Mirror World on Github
Join the Discord server

Language:

JavaScript SDK API Reference

On this page you will find the full JavaScript API reference for the JavaScript SDK. It covers the following topics:

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 chainConfig
mirrorworld.chainConfig = Solana("mainnet-beta")
// Access the Solana service APIs
mirrorworld.Solana.Asset.buyNFT(/* ... */)

Solana.Asset | API Reference

Solana.Wallet | API Reference

Solana.Metadata | API Reference

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 chainConfig
mirrorworld.chainConfig = Polygon("mumbai-mainnet")
// Access the Polygon service APIs
mirrorworld.Polygon.Asset.buyNFT(/* ... */)

Polygon.Asset | API Reference

Polygon.Wallet | API Reference

Polygon.Metadata | API Reference

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 chainConfig
mirrorworld.chainConfig = BNBChain("bnb-mainnet")
// Access the BNBChain service APIs
mirrorworld.BNBChain.Asset.buyNFT(/* ... */)

BNBChain.Asset | API Reference

BNBChain.Wallet | API Reference

BNBChain.Metadata | API Reference

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 the
mirrorworld.chainConfig = Ethereum("mainnet")
// Access the Ethereum service APIs
mirrorworld.Ethereum.Asset.buyNFT(/* ... */)

Ethereum.Asset | API Reference

Ethereum.Wallet | API Reference

Ethereum.Metadata | API Reference

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 the
mirrorworld.chainConfig = SUI("mainnet")
// Access the SUI service APIs
mirrorworld.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.

Wallet | SUI JS API Reference

The wallet module contains all APIs related to the assets you own, such as viewing and transferring tokens.

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

Copyright © Mirror World, Inc. 2023
On this page

Home

Integration

Guides

API Reference

Changelog