sbtc-bridge-lib
Version:
Library for sBTC Bridge web client and API apps
32 lines (31 loc) • 1.96 kB
TypeScript
import * as btc from '@scure/btc-signer';
import type { Transaction } from '@scure/btc-signer';
import type { BridgeTransactionType, DepositPayloadUIType, UTXO } from './types/sbtc_types.js';
export declare const revealPayment = 10001;
export declare const dust = 500;
/**
* buildDepositTransaction:Transaction
* @param network (testnet|mainnet)
* @param sbtcWalletPublicKey - the sbtc wallet public to sending the deposit to
* @param uiPayload:DepositPayloadUIType
* - uiPayload.principal - stacks address or contract principal to mint to
* - uiPayload.amountSats - amount in sats of sBTC to mint (and bitcoin to deposit)
* - uiPayload.bitcoinAddress - address for users change - the users cardinal/payment address
* - uiPayload.paymentPublicKey - public key for users change - the users cardinal/payment public key (only needed for xverse)
* - btcFeeRates current fee rate estimates - see endpoint /bridge-api/testnet/v1/sbtc/init-ui
* - utxos the users utxos to spend from - from mempool/blockstream
* @returns Transaction from @scure/btc-signer
*/
export declare function buildDepositTransaction(network: string, sbtcWalletPublicKey: string, uiPayload: DepositPayloadUIType, btcFeeRates: any, utxos: Array<UTXO>): Transaction;
/**
* @param network
* @param uiPayload
* @param btcFeeRates
* @param utxos:Array<UTXO>
* @param commitTxAddress
* @returns Transaction from @scure/btc-signer
*/
export declare function buildDepositTransactionOpDrop(network: string, uiPayload: DepositPayloadUIType, btcFeeRates: any, utxos: Array<UTXO>, commitTxAddress: string): btc.Transaction;
export declare function getBridgeDeposit(network: string, uiPayload: DepositPayloadUIType, originator: string): BridgeTransactionType;
export declare function getBridgeDepositOpDrop(network: string, sbtcWalletPublicKey: string, uiPayload: DepositPayloadUIType, originator: string): BridgeTransactionType;
export declare function maxCommit(addressInfo: any): any;