UNPKG

charms-js

Version:

TypeScript SDK for decoding Bitcoin transactions containing Charms data

27 lines (26 loc) 784 B
import * as bitcoin from 'bitcoinjs-lib'; import { NormalizedSpell } from './types'; export interface Proof { [key: string]: any; } export declare class BitcoinTx { tx: bitcoin.Transaction; constructor(tx: bitcoin.Transaction); static fromHex(hex: string): BitcoinTx; extractAndVerifySpell(spellVk: string): NormalizedSpell; parseSpellAndProof(spellTxIn: bitcoin.TxInput): { spell: NormalizedSpell; proof: Proof; }; private spellWithIns; private verifyGroth16Sync; private verifyGroth16; private validateProofStructure; private validateSpellStructure; private getVerificationKeys; private convertProofToSnarkjs; private generatePublicValues; txOutsLen(): number; txId(): string; hex(): string; }