meta-contract
Version:
Meta Contract SDK
65 lines (64 loc) • 3.13 kB
TypeScript
import { ContractAdapter } from '../../common/ContractAdapter';
import { Bytes, FunctionCall, Int, PubKey, Sig, SigHashPreimage } from '../../scryptlib';
import * as ftProto from '../contract-proto/token.proto';
export declare class Token extends ContractAdapter {
private constuctParams;
private _formatedDataPart;
constructor(constuctParams: {
transferCheckCodeHashArray: Bytes[];
unlockContractCodeHashArray: Bytes[];
}, version?: number);
static fromASM(asm: string): import("mvc-scrypt/dist/contract.js").AbstractContract;
clone(): Token;
setFormatedDataPart(dataPart: ftProto.FormatedDataPart): void;
getFormatedDataPart(): ftProto.FormatedDataPart;
unlock({ txPreimage, prevouts, tokenInputIndex, prevTokenInputIndex, prevTokenAddress, prevTokenAmount, tokenTxHeader, tokenTxInputProof, prevTokenTxOutputProof, contractInputIndex, contractTxOutputProof, amountCheckHashIndex, amountCheckInputIndex, amountCheckTxOutputProofInfo, amountCheckScript, senderPubKey, senderSig, operation, }: {
txPreimage: SigHashPreimage;
prevouts: Bytes;
tokenInputIndex: number;
amountCheckHashIndex: number;
amountCheckInputIndex: number;
amountCheckTxOutputProofInfo: Bytes;
amountCheckScript: Bytes;
prevTokenInputIndex: number;
prevTokenAddress: Bytes;
prevTokenAmount: BigInt;
tokenTxHeader: Bytes;
tokenTxInputProof: Bytes;
prevTokenTxOutputProof: Bytes;
senderPubKey?: PubKey;
senderSig?: Sig;
contractInputIndex: number;
contractTxOutputProof: Bytes;
operation: ftProto.FT_OP_TYPE;
}): FunctionCall;
unlockOld({ txPreimage, tokenInputIndex, prevouts, rabinMsg, rabinPaddingArray, rabinSigArray, rabinPubKeyIndexArray, rabinPubKeyVerifyArray, rabinPubKeyHashArray, checkInputIndex, checkScriptTx, nReceivers, prevTokenAddress, prevTokenAmount, senderPubKey, senderSig, lockContractInputIndex, lockContractTx, operation, }: {
txPreimage: SigHashPreimage;
tokenInputIndex: number;
prevouts: Bytes;
rabinMsg: Bytes;
rabinPaddingArray: Bytes[];
rabinSigArray: Int[];
rabinPubKeyIndexArray: number[];
rabinPubKeyVerifyArray: Int[];
rabinPubKeyHashArray: Bytes;
checkInputIndex: number;
checkScriptTx: Bytes;
nReceivers: number;
prevTokenAddress: Bytes;
prevTokenAmount: Int;
senderPubKey?: PubKey;
senderSig?: Sig;
lockContractInputIndex?: number;
lockContractTx?: Bytes;
operation: ftProto.FT_OP_TYPE;
}): FunctionCall;
}
export declare class TokenFactory {
static lockingScriptSize: number;
static getLockingScriptSize(): number;
static createContract(transferCheckCodeHashArray: Bytes[], unlockContractCodeHashArray: Bytes[], version?: number): Token;
static getDummyInstance(): Token;
static calLockingScriptSize(): number;
static calUnlockingScriptSize(routeCheckContact: any, bsvInputLen: number, tokenInputLen: number, tokenOutputLen: number): number;
}