UNPKG

meta-contract

Version:

Meta Contract SDK

54 lines (53 loc) 2.29 kB
import { ContractAdapter } from '../../common/ContractAdapter'; import { Bytes, FunctionCall, Int, 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, nftInputIndex, nftScript, prevouts, rabinMsg, rabinPaddingArray, rabinSigArray, rabinPubKeyIndexArray, rabinPubKeyVerifyArray, rabinPubKeyHashArray, nOutputs, nftOutputIndex, nftOutputAddress, nftOutputSatoshis, otherOutputArray, }: { txPreimage: SigHashPreimage; nftInputIndex: number; nftScript: Bytes; prevouts: Bytes; rabinMsg: Bytes; rabinPaddingArray: Bytes[]; rabinSigArray: Int[]; rabinPubKeyIndexArray: number[]; rabinPubKeyVerifyArray: Int[]; rabinPubKeyHashArray: Bytes; nOutputs: number; nftOutputIndex: 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; }