UNPKG

@desig/web3

Version:

Desig: The Blockchain-Agnostic Multisig Solution

61 lines (60 loc) 1.79 kB
import { transaction } from '../../proto'; export declare enum TransactionType { tExtension = "tExtension", tReduction = "tReduction", nExtension = "nExtension", nReduction = "nReduction" } export declare class TransactionParser { constructor(); static selectors: Record<TransactionType, Uint8Array>; static parseType: (selector: Uint8Array) => TransactionType; verify: (buf: Uint8Array, gid?: Uint8Array) => Promise<{ txType: TransactionType; refgid: Uint8Array; t: number; n: number; }>; nExtension: { encode: (data: Omit<transaction.InExtension, 'selector'>) => Uint8Array; decode: (buf: Uint8Array) => { refgid: Uint8Array; t: any; n: any; k: Uint8Array; pubkey: Uint8Array; kr: Uint8Array; kzero: Uint8Array; }; }; nReduction: { encode: (data: Omit<transaction.InReduction, 'selector'>) => Uint8Array; decode: (buf: Uint8Array) => { refgid: Uint8Array; t: any; n: any; k: Uint8Array; }; }; tExtension: { encode: (data: Omit<transaction.ItExtension, 'selector'>) => Uint8Array; decode: (buf: Uint8Array) => { refgid: Uint8Array; t: any; n: any; }; }; tReduction: { encode: (data: Omit<transaction.ItReduction, 'selector'>) => Uint8Array; decode: (buf: Uint8Array) => { refgid: Uint8Array; t: any; n: any; }; }; } export declare class TZkProofParser { constructor(); encode: (data: transaction.IZKProof) => Uint8Array; decode: (buf: Uint8Array) => transaction.ZKProof; }