sensible-sdk
Version:
Sensible-SDK
45 lines (44 loc) • 2.05 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[];
});
static fromASM(asm: string): any;
clone(): Token;
setFormatedDataPart(dataPart: ftProto.FormatedDataPart): void;
getFormatedDataPart(): ftProto.FormatedDataPart;
unlock({ 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[]): Token;
static getDummyInstance(): Token;
static calLockingScriptSize(): number;
static calUnlockingScriptSize(routeCheckContact: any, bsvInputLen: number, tokenInputLen: number, tokenOutputLen: number): number;
}