UNPKG

meta-contract

Version:

Meta Contract SDK

49 lines (48 loc) 2.21 kB
import { ContractAdapter } from '../../common/ContractAdapter'; import { Bytes, FunctionCall, Int, PubKey, Ripemd160, Sig, SigHashPreimage } from '../../scryptlib'; import * as nftProto from '../contract-proto/nft.proto'; import { NFT_OP_TYPE } from '../contract-proto/nft.proto'; export declare class Nft extends ContractAdapter { constuctParams: { unlockContractCodeHashArray: Bytes[]; }; private _formatedDataPart; constructor(constuctParams: { unlockContractCodeHashArray: Bytes[]; }, version?: number); clone(): Nft; setFormatedDataPart(dataPart: nftProto.FormatedDataPart): void; getFormatedDataPart(): nftProto.FormatedDataPart; unlock({ txPreimage, prevouts, prevNftInputIndex, prevNftAddress, nftTxHeader, nftTxInputProof, prevNftTxProof, genesisScript, contractInputIndex, contractTxProof, amountCheckHashIndex, amountCheckInputIndex, amountCheckTxProof, amountCheckScrypt, senderPubKey, senderSig, receiverAddress, nftOutputSatoshis, opReturnScript, changeAddress, changeSatoshis, operation, }: { txPreimage: SigHashPreimage; prevouts: Bytes; prevNftInputIndex: number; prevNftAddress: Bytes; nftTxHeader: Bytes; nftTxInputProof: Bytes; prevNftTxProof: Bytes; genesisScript: Bytes; contractInputIndex: number; contractTxProof: Bytes; amountCheckHashIndex: number; amountCheckInputIndex: number; amountCheckTxProof: Bytes; amountCheckScrypt: Bytes; senderPubKey?: PubKey; senderSig?: Sig; receiverAddress?: Bytes; nftOutputSatoshis?: Int; opReturnScript?: Bytes; changeAddress?: Ripemd160; changeSatoshis?: Int; operation: NFT_OP_TYPE; }): FunctionCall; } export declare class NftFactory { static lockingScriptSize: number; static getLockingScriptSize(): number; static createContract(unlockContractCodeHashArray: Bytes[], version?: number): Nft; static getDummyInstance(): Nft; static calLockingScriptSize(): number; static calUnlockingScriptSize(bsvInputLen: number, genesisScript: Bytes, opreturnData: any, operation: NFT_OP_TYPE): number; }