Mint Note
A note can be minted by wallets (i.e. addresses).
A minted note is a non-fungible token (NFT) that is stored on the Crossbell blockchain. The wallet that minted the note is the owner of the NFT.
mintNote
Mints a note.
mintNote(characterId: BigNumberish, noteId: BigNumberish, toAddress: string, overrides?: Overrides): Promise<Result<{ contractAddress: string; tokenId: number; }, true>>
Usage
For example, to mint a note with characterId 42
and noteId 5
to the address 0x1234567890123456789012345678901234567890
:
const { data } = await contract.mintNote(
42, // characterId
5, // noteId
'0x1234567890123456789012345678901234567890', // toAddress
)
console.log(data.contractAddress) // e.g. 0xabc123def456abc123def456abc123def456abc1
console.log(data.tokenId) // e.g. 6
Now, the address 0x1234567890123456789012345678901234567890
owns the note NFT with contract address 0xabc123def456abc123def456abc123def456abc1
and token ID 6
(meaning that the note NFT is stored at the contract of address 0xabc123def456abc123def456abc123def456abc1
, and the minter is the 6th to mint).
Parameters
characterId
- Type: BigNumberish
The ID of the character who owns the note.
noteId
- Type: BigNumberish
The ID of the note to mint.
toAddress
- Type: string
The address to mint the note to.
Returns
interface Returns {
data: {
contractAddress: string
tokenId: number
}
transactionHash: string
}