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 signer
const providerOrSigner = ...;
// Optionally, specify the contract address (default is CORE_CONTRACT_ADDRESS)
const contractAddress = ...;
const zebecStream = new ZebecMultisigStream(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.
const tokenId = 123; // The ERC-721 token ID
const tokenAddress = '0x...'; // The ERC-721 token contract address
const safeAddress = '0x...'; // The destination safe address
const transactionResponse = await zebecStream.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.
const tokenId = 123; // The ERC-1155 token ID
const tokenAddress = '0x...'; // The ERC-1155 token contract address
const safeAddress = '0x...'; // The destination safe address
const amount = 5; // The amount of tokens to deposit
const transactionResponse = await zebecStream.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.
const tokenId = 123; // The ERC-721 token ID
const tokenAddress = '0x...'; // The ERC-721 token contract address
const to = '0x...'; // The recipient address
const safeAddress = '0x...'; // The source safe address
// The Safe SDK can utilize this transactionData to initiate and execute multi-signature transactions.
const transactionData = 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.
const tokenAddress = '0x...'; // The ERC-1155 token contract address
const tokenIds = [123, 456]; // An array of ERC-1155 token IDs
const amounts = [5, 10]; // An array of corresponding token amounts
const to = '0x...'; // The recipient address
const safeAddress = '0x...'; // The source safe address
// The Safe SDK can utilize this transactionData to initiate and execute multi-signature transactions.
const transactionData = zebecStream.transferERC1155(tokenAddress, tokenIds, amounts, to, safeAddress);
console.log(transactionData);