Beta
Protected
contractConfigure royalties
Set your own royalties for the entire contract or per token
// royalties on the whole contract
contract.royalties.setDefaultRoyaltyInfo({
seller_fee_basis_points: 100, // 1%
fee_recipient: "0x..."
});
// override royalty for a particular token
contract.royalties.setTokenRoyaltyInfo(tokenId, {
seller_fee_basis_points: 500, // 5%
fee_recipient: "0x..."
});
Protected
storageTransfer an NFT
Rest
...args: [to: string, tokenId: BigNumberish]Transfer an NFT from the connected wallet to another wallet.
const walletAddress = "{{wallet_address}}";
const tokenId = 0;
await contract.transfer(walletAddress, tokenId);
Rest
...args: [to: string, tokenId: BigNumberish]Unwrap a wrapped token bundle, and retrieve its contents
Rest
...args: [wrappedTokenId: BigNumberish, recipientAddress?: string]await contract.unwrap(wrappedTokenId);
Rest
...args: [wrappedTokenId: BigNumberish, recipientAddress?: string]Wrap any number of ERC20/ERC721/ERC1155 tokens into a single wrapped token
Rest
...args: [contents: TokensToWrap, wrappedTokenMetadata: string | objectInputType<{ const tx = await contract.wrap({
erc20Tokens: [{
contractAddress: "0x...",
quantity: "0.8"
}],
erc721Tokens: [{
contractAddress: "0x...",
tokenId: "0"
}],
erc1155Tokens: [{
contractAddress: "0x...",
tokenId: "1",
quantity: "2"
}]
}, {
name: "Wrapped bundle",
description: "This is a wrapped bundle of tokens and NFTs",
image: "ipfs://...",
});
const receipt = tx.receipt(); // the transaction receipt
const wrappedTokenId = tx.id; // the id of the wrapped token bundle
Rest
...args: [contents: TokensToWrap, wrappedTokenMetadata: string | objectInputType<{ Static
contractGet NFT Balance
Get a wallets NFT balance (number of NFTs in this contract owned by the wallet).
const walletAddress = "{{wallet_address}}";
const balance = await contract.balanceOf(walletAddress);
console.log(balance);
Get all NFTs
Optional
queryParams: { optional filtering to only fetch a subset of results.
Optional
count?: numberOptional
start?: numberThe NFT metadata for all NFTs queried.
Get all the data associated with every NFT in this contract.
By default, returns the first 100 NFTs, use queryParams to fetch more.
const nfts = await contract.getAll();
console.log(nfts);
Get all NFTs owned by a specific wallet
Optional
walletAddress: stringthe wallet address to query, defaults to the connected wallet
Optional
queryParams: { optional filtering to only fetch a subset of results.
Optional
count?: numberOptional
start?: numberThe NFT metadata for all NFTs in the contract.
Get all the data associated with the NFTs owned by a specific wallet.
// Address of the wallet to get the NFTs of
const address = "{{wallet_address}}";
const nfts = await contract.getOwned(address);
console.log(nfts);
Get the contents of a wrapped token bundle
the id of the wrapped token bundle
const contents = await contract.getWrappedContents(wrappedTokenId);
console.log(contents.erc20Tokens);
console.log(contents.erc721Tokens);
console.log(contents.erc1155Tokens);
Private
toPRIVATE FUNCTIONS
Generated using TypeDoc
Multiwrap lets you wrap any number of ERC20, ERC721 and ERC1155 tokens you own into a single wrapped token bundle.
Example