UNPKG

sensible-sdk

Version:

Sensible-SDK

60 lines (59 loc) 2.33 kB
/// <reference types="node" /> import * as proto from "../../common/protoheader"; import BN = require("../../bn.js"); export declare type MetaidOutpoint = { txid: string; index: number; }; export declare type SensibleID = { txid: string; index: number; }; export declare type FormatedDataPart = { metaidOutpoint?: MetaidOutpoint; genesisFlag?: GENESIS_FLAG; nftAddress?: string; totalSupply?: BN; tokenIndex?: BN; genesisHash?: string; rabinPubKeyHashArrayHash?: string; sensibleID?: SensibleID; protoVersion?: number; protoType?: proto.PROTO_TYPE; }; export declare const SIGNER_NUM = 5; export declare const SIGNER_VERIFY_NUM = 3; export declare enum NFT_OP_TYPE { TRANSFER = 1, UNLOCK_FROM_CONTRACT = 2 } export declare const PROTO_VERSION = 1; export declare enum GENESIS_FLAG { FALSE = 0, TRUE = 1 } export declare const GENESIS_TOKEN_ID: Buffer; export declare const EMPTY_ADDRESS: Buffer; export declare function getRabinPubKeyHashArrayHash(script: Buffer): string; export declare function getGenesisHash(script: Buffer): string; export declare function getTokenIndex(script: Buffer): BN; export declare function getNftID(script: Buffer): Buffer; export declare function getTotalSupply(script: Buffer): BN; export declare function getNftAddress(script: Buffer): string; export declare function getGenesisFlag(script: Buffer): number; export declare function getContractCode(script: Buffer): Buffer; export declare function getContractCodeHash(script: Buffer): Buffer; export declare function getMetaidOutpoint(script0: Buffer): { txid: string; index: number; }; export declare function getSensibleID(script0: Buffer): { txid: string; index: number; }; export declare function newDataPart({ metaidOutpoint, genesisFlag, nftAddress, totalSupply, tokenIndex, genesisHash, rabinPubKeyHashArrayHash, sensibleID, protoVersion, protoType, }: FormatedDataPart): Buffer; export declare function parseDataPart(scriptBuf: Buffer): FormatedDataPart; export declare function updateScript(scriptBuf: Buffer, dataPartObj: FormatedDataPart): Buffer; export declare function getQueryCodehash(script: Buffer): string; export declare function getQueryGenesis(script: Buffer): string; export declare function getQuerySensibleID(script0: Buffer): string;