@silvana-one/nft
Version:
Mina NFT library
39 lines (38 loc) • 1.19 kB
TypeScript
import { Field, PublicKey } from "o1js";
export { MinaAddress };
/**
/**
* The `MinaAddress` class represents a Mina address in the form of a Merkle tree. The address is converted to its
* hash and stored as a leaf in the Merkle tree. The root of the tree can be used as a compact representation
* of the address data in cryptographic proofs.
*/
declare class MinaAddress {
/**
* The original address.
*/
readonly address: PublicKey;
/**
* The hash of the address.
*/
readonly hash: Field;
/**
* Constructs a new `MinaAddress` instance by creating a Merkle tree from the given address.
* The address is converted to its hash and stored as a leaf in the tree.
*
* @param address - The address to be represented.
* @throws Will throw an error if the address is not a valid Mina address.
*/
constructor(address: PublicKey | string);
/**
* Returns the original address.
*
* @returns The public key.
*/
toPublicKey(): PublicKey;
/**
* Returns the base58 representation of the address.
*
* @returns The base58 representation of the address.
*/
toString(): string;
}