You have the capability to oversee and control your BEP-721 and BEP-1155 standard non-fungible tokens (NFTs) through a Zebec safe.
Usage
Initializing the ZebecMultisigStream
To use the ZebecMultisigStream class, you need to initialize an instance of it by providing a signer or provider and, optionally, the contract address. Here's how you can do that:
import { ZebecMultisigStream } from'zebec-multisig-stream';// Your Ethereum provider or signerconstproviderOrSigner=...;// Optionally, specify the contract address (default is CORE_CONTRACT_ADDRESS)constcontractAddress=...;constzebecStream=newZebecMultisigStream(providerOrSigner, contractAddress);
Depositing ERC-721 Tokens
The depositERC721 method allows you to deposit an ERC-721 token into a safe address. It takes the tokenId, tokenAddress, and safeAddress as parameters and returns a transaction response.
consttokenId=123; // The ERC-721 token IDconsttokenAddress='0x...'; // The ERC-721 token contract addressconstsafeAddress='0x...'; // The destination safe addressconsttransactionResponse=awaitzebecStream.depositERC721(tokenId, tokenAddress, safeAddress);console.log(transactionResponse);
Depositing ERC-1155 Tokens
The depositERC1155 method allows you to deposit ERC-1155 tokens into a safe address. It takes the tokenId, tokenAddress, safeAddress, and amount as parameters and returns a transaction Response.
consttokenId=123; // The ERC-1155 token IDconsttokenAddress='0x...'; // The ERC-1155 token contract addressconstsafeAddress='0x...'; // The destination safe addressconstamount=5; // The amount of tokens to depositconsttransactionResponse=awaitzebecStream.depositERC1155(tokenId, tokenAddress, safeAddress, amount);console.log(transactionResponse);
Transferring ERC-721 Tokens
The transferERC721 method generates transaction data to transfer an ERC-721 token from a safe address to a recipient address. It takes the tokenId, tokenAddress, to, and safeAddress as parameters.
consttokenId=123; // The ERC-721 token IDconsttokenAddress='0x...'; // The ERC-721 token contract addressconstto='0x...'; // The recipient addressconstsafeAddress='0x...'; // The source safe address// The Safe SDK can utilize this transactionData to initiate and execute multi-signature transactions.consttransactionData=zebecStream.transferERC721(tokenId, tokenAddress, to, safeAddress);console.log(transactionData);
Transferring ERC-1155 Tokens
The transferERC1155 method generates transaction data to transfer ERC-1155 tokens from a safe address to a recipient address. It takes the tokenAddress, tokenIds, amounts, to, and safeAddress as parameters.
consttokenAddress='0x...'; // The ERC-1155 token contract addressconsttokenIds= [123,456]; // An array of ERC-1155 token IDsconstamounts= [5,10]; // An array of corresponding token amountsconstto='0x...'; // The recipient addressconstsafeAddress='0x...'; // The source safe address// The Safe SDK can utilize this transactionData to initiate and execute multi-signature transactions.consttransactionData=zebecStream.transferERC1155(tokenAddress, tokenIds, amounts, to, safeAddress);console.log(transactionData);