Describes all the information about a built-in chain. Also contains some helper information for generating NFT marketplace links (currently OpenSea).
Defines the interface necessary for registering a new chain in a web3 wallet. Especifically tested with MetaMask.
Hexadecimal representation of a chain ID.
Requests the web3 wallet to add a chain to the wallet and switch to it.
Web3 connectivity external provider. In the case of MetaMask
this is the object injected into window.ethereum
.
The full specification of the chain to add.
Promise that will be fulfilled when the switch is complete (e.g. after user approves it).
Gets the information about the built-in chain with the specified chain ID.
ID of the chain to get information about.
The built-in chain information or null
if it's not built-in.
Returns whether the chain with the specified ID is built-in.
Chain ID to check.
Boolean representing whether the chain is built-in.
Gets a list of the built-in chains IDs.
List of built-in chain IDs in hexadecimal format.
Requests the web3 wallet to switch the current chain to the specified one.
Web3 connectivity external provider. In the case of MetaMask
this is the object injected into window.ethereum
.
The ID of the chain to switch to.
Promise that will be fulfilled when the switch is complete (e.g. after user approves it).
Composes switchChain and addChain to switch to the specified chain if it is already configured or otherwise add it to the wallet and then switch to it.
Web3 connectivity external provider. In the case of MetaMask
this is the object injected into window.ethereum
.
The full specification of the chain to switch to or add.
Object with a single added
field indicating whether the chain was
switched to or added. An exception is thrown if the operation is unsucessful
(e.g. the user rejects the request in the wallet).
Normalizes any representation of a chain ID into a hexadecimal string, in a format supported by web3 wallets.
Chain ID to normalize.
Normalized hexadecimal string representing the chain ID.
Converts any representation of a chain ID into its numerical ID.
Chain ID to convert.
Numerical ID of the chain.
Generated using TypeDoc
This package provides some helper utilities for switching between different Ethereum-compatible chains. It also describes the SDK built-in chains, in which it already has a deployed smart contract.
The current built-in chains are Polygon Mainnet and Polygon Testnet (Mumbai).
A built-in chain is one that we have already deployed an ERC-721 contract that implements the Video NFT ABI. Those can be used as a default contract with which to mint a Video NFT.
When using a built-in chain you don't need to provide a contract address on the calls to the Web3 minter for minting an NFT. You can still provide one anyway if you wish to use your own contract, but it does need to implement the Video NFT ABI for the SDK to work properly.
You can also use custom chains that are not built-in, but you will need always to provide your contract address to the Web3 minter functions and handle any NFT marketplace URLs or integrations.