UNPKG

ecash-lib

Version:

Library for eCash transaction building

56 lines 2.46 kB
import { GenesisInfo } from './common.js'; /** LOKAD ID for ALP as string */ export declare const ALP_LOKAD_ID_STR = "SLP2"; /** LOKAD ID for ALP */ export declare const ALP_LOKAD_ID: Uint8Array; /** ALP standard token type number */ export declare const ALP_STANDARD = 0; export type AlpTokenType_Number = typeof ALP_STANDARD; /** Supported ALP token types */ export interface AlpTokenType { protocol: 'ALP'; type: AlpTokenType_Type; number: number; } /** Possible ALP token types returned by chronik */ export type AlpTokenType_Type = 'ALP_TOKEN_TYPE_STANDARD' | 'ALP_TOKEN_TYPE_UNKNOWN'; /** ALP limits lengths/sizes to this number, e.g. the number of outputs */ export declare const ALP_MAX_SIZE = 127; export declare const ALP_TOKEN_TYPE_STANDARD: AlpTokenType; /** * Although ALP_MAX_SIZE is 127, in practice we can only * handle 29 ALP outputs in a single OP_RETURN given the curent * 223-byte OP_RETURN size limit, and even this assumes * we are only working with 1 ALP token. * * For example an ALP tx that sends multiple tokens cannot support * 29 token outputs as the instructions will require more than 223 * bytes in the OP_RETURN. * * So, this is an upper bound on ALP outputs per current mempool * acceptance rules */ export declare const ALP_POLICY_MAX_OUTPUTS = 29; /** Mint data specifying mint amounts (in atoms) and batons of a GENESIS/MINT tx */ export interface MintData { /** * Array of amounts in atoms to be minted by this tx, each having their own tx output. */ atomsArray: bigint[]; /** Number of mint batons to create, each having their own tx output. */ numBatons: number; } /** Build an ALP GENESIS pushdata section, creating a new ALP token */ export declare function alpGenesis(tokenType: number, genesisInfo: GenesisInfo, mintData: MintData): Uint8Array; /** * Build an ALP MINT pushdata section, creating new ALP tokens and mint batons * of the given token ID. **/ export declare function alpMint(tokenId: string, tokenType: number, mintData: MintData): Uint8Array; /** * Build an ALP SEND pushdata section, moving ALP tokens to different outputs **/ export declare function alpSend(tokenId: string, tokenType: number, sendAtomsArray: bigint[]): Uint8Array; /** Build an ALP BURN pushdata section, intentionally burning ALP tokens. */ export declare function alpBurn(tokenId: string, tokenType: number, burnAtoms: bigint): Uint8Array; //# sourceMappingURL=alp.d.ts.map