UNPKG

meta-contract

Version:

Meta Contract SDK

51 lines (50 loc) 2.11 kB
import { ContractAdapter } from '../../common/ContractAdapter'; import { Bytes, FunctionCall, SigHashPreimage } from '../../scryptlib'; import * as unlockProto from '../contract-proto/nftUnlockContractCheck.proto'; export declare class NftUnlockContractCheck extends ContractAdapter { constuctParams: { unlockType: NFT_UNLOCK_CONTRACT_TYPE; }; private _formatedDataPart; constructor(constuctParams: { unlockType: NFT_UNLOCK_CONTRACT_TYPE; }); clone(): NftUnlockContractCheck; setFormatedDataPart(dataPart: unlockProto.FormatedDataPart): void; getFormatedDataPart(): unlockProto.FormatedDataPart; unlock({ txPreimage, prevouts, nftInputIndex, nftScript, nftTxHeader, nftTxHashProof, nftSatoshiBytes, nOutputs, txNftOutputIndex, nftOutputAddress, nftOutputSatoshis, otherOutputArray, }: { txPreimage: SigHashPreimage; prevouts: Bytes; nftInputIndex: number; nftScript: Bytes; nftTxHeader: Bytes; nftTxHashProof: Bytes; nftSatoshiBytes: Bytes; nOutputs: number; txNftOutputIndex: number; nftOutputAddress: Bytes; nftOutputSatoshis: number; otherOutputArray: Bytes; }): FunctionCall; } export declare enum NFT_UNLOCK_CONTRACT_TYPE { OUT_3 = 1, OUT_6 = 2, OUT_10 = 3, OUT_20 = 4, OUT_100 = 5, UNSUPPORT = 6 } export declare class NftUnlockContractCheckFactory { static unlockContractTypeInfos: { type: NFT_UNLOCK_CONTRACT_TYPE; out: number; lockingScriptSize: number; }[]; static getLockingScriptSize(unlockType: NFT_UNLOCK_CONTRACT_TYPE): number; static getOptimumType(outCount: number): NFT_UNLOCK_CONTRACT_TYPE; static createContract(unlockType: NFT_UNLOCK_CONTRACT_TYPE): NftUnlockContractCheck; static getDummyInstance(unlockType: NFT_UNLOCK_CONTRACT_TYPE): NftUnlockContractCheck; static calLockingScriptSize(unlockType: NFT_UNLOCK_CONTRACT_TYPE): number; static calUnlockingScriptSize(unlockType: NFT_UNLOCK_CONTRACT_TYPE, prevouts: Bytes, otherOutputArray: Bytes): number; }