UNPKG

scryptlib

Version:

Javascript SDK for integration of Bitcoin SV Smart Contracts written in sCrypt language.

29 lines (28 loc) 1.16 kB
import { AbstractContract, Arguments, bsv } from '.'; import { Bytes, Int, SupportedParamType, TypeResolver } from './scryptTypes'; export default class Stateful { static readonly CURRENT_STATE_VERSION: Int; static int2hex(n: Int): string; static hex2int(hex: string): bigint; static bool2hex(b: boolean): string; static hex2bool(hex: string): boolean; static bytes2hex(b: Bytes): string; static hex2bytes(hex: string): Bytes; static toHex(x: SupportedParamType, type: string): string; static serialize(x: SupportedParamType, type: string): string; /** * only used for state contract * @param args * @param isGenesis * @param finalTypeResolver * @returns */ static buildState(args: Arguments, isGenesis: boolean, resolver: TypeResolver): string; static buildDefaultStateArgs(contract: AbstractContract): Arguments; static deserializer(type: string, hex: string): SupportedParamType; static readBytes(br: bsv.encoding.BufferReader): { data: string; opcodenum: number; }; static parseStateHex(contract: AbstractContract, scriptHex: string): [boolean, Arguments]; }