@okxweb3/coin-bitcoin
Version:
@ok/coin-bitcoin is a Bitcoin SDK for building Web3 wallets and applications. It supports BTC, BSV, DOGE, LTC, and TBTC, enabling private key management, transaction signing, address generation, and inscriptions like BRC-20, Runes, CAT, and Atomicals.
12 lines (11 loc) • 1.2 kB
TypeScript
import { EcKeyService } from "../utils";
import { btc, GuardContract, TokenContract } from "../common";
import { CAT20State, ChangeInfo, GuardInfo, ProtocolState } from "@cat-protocol/cat-smartcontracts";
import { UTXO } from 'scrypt-ts';
export declare function createGuardContract(ecKey: EcKeyService, feeutxo: UTXO, feeRate: number, tokens: TokenContract[], tokenP2TR: string, changeAddress: btc.Address): {
commitTx: any;
contact: GuardContract;
guardTapScript: string;
};
export declare function unlockToken(ecKey: EcKeyService, tokenContract: TokenContract, tokenInputIndex: number, prevTokenTx: btc.Transaction, preTokenInputIndex: number, prevPrevTokenTx: btc.Transaction, guardInfo: GuardInfo, revealTx: btc.Transaction, minterP2TR: string, txCtx: any, verify: boolean, signature?: string, contractSpend?: boolean, contractInputIndex?: number): Promise<boolean>;
export declare function unlockGuard(guardContract: GuardContract, guardInfo: GuardInfo, guardInputIndex: number, newState: ProtocolState, revealTx: btc.Transaction, receiverTokenState: CAT20State, changeTokenState: null | CAT20State, changeInfo: ChangeInfo | null, txCtx: any, verify: boolean): Promise<boolean>;