@bestinslot/wallet-kit 0.16.0-rc.0 → 0.16.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.js CHANGED
@@ -1,7 +1,7 @@
1
- import { F as eI, G as RA, H as f, I as tI, J as SI, K as UA, L as d, M as zA, N as mA, O as e, P as qA, Q as nI, R as pI, S as rI, T as sI, U as FI, V as KI, X as BA, f as XA, m as eA, Y as RI, c as UI, Z as qI, W as VI, a as lI, b as dI, d as xI, e as YI, h as JI, i as PI, j as vI, k as OI, s as uI, l as jI, n as bI, o as LI, p as TI, q as ZI, r as zI } from "./helpers-Dho-nzKc.js";
2
- import { B as WQ, v as _Q, w as $Q, u as AC, D as IC, t as gC, z as QC, x as CC, y as BC, A as EC, E as iC, C as DC } from "./helpers-Dho-nzKc.js";
3
- import { s as mI } from "./balances-DV6c-dIo.js";
4
- import { c as oC, b as aC, m as hC, a as GC } from "./balances-DV6c-dIo.js";
1
+ import { F as eI, G as RA, H as f, I as tI, J as SI, K as UA, L as d, M as zA, N as mA, O as e, P as qA, Q as nI, R as pI, S as rI, T as sI, U as FI, V as KI, X as BA, f as XA, m as eA, Y as RI, c as UI, Z as qI, W as VI, a as lI, b as dI, d as xI, e as YI, h as JI, i as PI, j as vI, k as OI, s as uI, l as jI, n as bI, o as LI, p as TI, q as ZI, r as zI } from "./helpers-DAaj_HTc.js";
2
+ import { B as WQ, v as _Q, w as $Q, u as AC, D as IC, t as gC, z as QC, x as CC, y as BC, A as EC, E as iC, C as DC } from "./helpers-DAaj_HTc.js";
3
+ import { s as mI } from "./balances-2g8Ls1xe.js";
4
+ import { c as oC, b as aC, m as hC, a as GC } from "./balances-2g8Ls1xe.js";
5
5
  var XI = eI();
6
6
  const VA = {
7
7
  messagePrefix: `Bitcoin Signed Message:
package/dist/react.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useSyncExternalStore as u, useCallback as r, useState as f } from "react";
2
- import { _ as c, f as t, m as l, k as n } from "./helpers-Dho-nzKc.js";
2
+ import { _ as c, f as t, m as l, k as n } from "./helpers-DAaj_HTc.js";
3
3
  function m() {
4
4
  const e = u(c, t, t), s = r((o) => l(o), []);
5
5
  return [e, s];
@@ -1,4 +1,4 @@
1
- import { O as f, N as K, i as P, P as W, Q as ke, R as ve, S as Me, T as Ie, h as Ae, L as x, M as N, $ as Ce, X as Y, a0 as Be, a1 as Ne, f as y, a2 as _e, K as _, a3 as Z, a4 as v, Z as $ } from "./helpers-Dho-nzKc.js";
1
+ import { O as f, N as K, i as P, P as W, Q as ke, R as ve, S as Me, T as Ie, h as Ae, L as x, M as N, $ as Ce, X as Y, a0 as Be, a1 as Ne, f as y, a2 as _e, K as _, a3 as Z, a4 as v, Z as $ } from "./helpers-DAaj_HTc.js";
2
2
  const J = 4294967295;
3
3
  let X = Math.floor(Math.random() * J);
4
4
  const ee = () => (X = (X + 1) % J, X), $e = () => typeof chrome < "u" && !!chrome.runtime && typeof chrome.runtime.connect == "function";
@@ -2,7 +2,7 @@ import { Brc20ProgWithdrawArgs, PrepareBrc20ProgWithdrawArgs, PreparedBrc20Withd
2
2
  import { Brc20SendQuote, SendAsBrc20Args, SendAsBrc20ProgArgs, SendAsBrc20ProgResult, SendAsBrc20Result } from '../core/brc20-send';
3
3
  import { TransactArgs, TransactResult } from '../core/brc20-transact';
4
4
  import { FrBtcResult, UnwrapBtcFromBrc20ProgArgs, WrapBtcToBrc20ProgArgs } from '../core/frbtc';
5
- import { BISWalletPurpose, PaymentOpts } from '../types/common';
5
+ import { BISWalletPurpose, CommitOpts, PaymentOpts } from '../types/common';
6
6
  export type { Brc20ProgWithdrawArgs, PrepareBrc20ProgWithdrawArgs, PreparedBrc20Withdraw, SendBrc20ProgWithdrawToSelfArgs, } from '../core/brc20-direct-withdraw';
7
7
  export type { Brc20AmountOptions, Brc20DeployOptions, Brc20PredeployOptions, Brc20PredeployResult, } from '../core/brc20-inscriptions';
8
8
  export { computeBrc20PredeployHash, deployBrc20Inscription, generateBrc20Salt, mintBrc20Inscription, predeployInscriptions, transferBrc20Inscription, } from '../core/brc20-inscriptions';
@@ -218,10 +218,11 @@ export interface InscribeAndSendToAddress {
218
218
  * @param dryRun A boolean indicating whether to perform a dry run of the transaction (i.e., simulate the transaction without actually sending it).
219
219
  * @param paymentOpts Optional extra payment output: when `paymentOpts.paymentAmount` is greater than 0, the transaction sends that many sats to `paymentOpts.paymentAddress` (funded by the connected wallet — e.g. a service fee). Omit, or pass a non-positive amount, for no extra payment.
220
220
  * @param walletType The type of wallet to use for the transaction, either 'payment' or 'ordinals'. If not specified, defaults to 'payment'.
221
+ * @param commitOpts Optional commit options: `inputs` are outputs of the payment address the commit spends ahead of any extra funding coin selection adds, and `minCommitFee` is the least absolute fee in sats the commit pays. Together they replace an earlier unconfirmed or dropped call package by spending its inputs at a higher fee (see `CommitOpts`). Omit for plain coin selection at the fee rate.
221
222
  * @returns The result of the smart contract call, which may vary depending on the wallet type and the specifics of the transaction. The exact structure of the result will depend on the implementation of the callSmartContractFromOrdinalsWallet and callSmartContractFromPaymentWallet functions.
222
- * @throws An error if an unsupported wallet type is specified or if there is an issue with the smart contract call.
223
+ * @throws An error if an unsupported wallet type is specified, if a commit input is malformed, not an output of the payment address with the given value, or listed with inscriptions, or if there is an issue with the smart contract call.
223
224
  */
224
- export declare function callSmartContract(contractAddress: string, calldataHex: string, estimatedGas: number, feeRate: number, postage: number | null, dryRun: boolean, paymentOpts?: PaymentOpts, walletType?: BISWalletPurpose): Promise<InscribeAndSendToOpReturn>;
225
+ export declare function callSmartContract(contractAddress: string, calldataHex: string, estimatedGas: number, feeRate: number, postage: number | null, dryRun: boolean, paymentOpts?: PaymentOpts, walletType?: BISWalletPurpose, commitOpts?: CommitOpts): Promise<InscribeAndSendToOpReturn>;
225
226
  /**
226
227
  * Calls a smart contract function by encoding the function call with the provided ABI, function name, and parameters, and then invoking the callSmartContract function to execute the transaction. This function serves as a higher-level abstraction for calling smart contract functions, allowing developers to specify the function and parameters in a more intuitive way without needing to manually encode the calldata.
227
228
  *
@@ -235,10 +236,11 @@ export declare function callSmartContract(contractAddress: string, calldataHex:
235
236
  * @param dryRun A boolean indicating whether to perform a dry run of the transaction (i.e., simulate the transaction without actually sending it). This can be useful for testing and debugging purposes to ensure that the function call is correctly encoded and that the transaction would succeed before actually sending it to the network.
236
237
  * @param paymentOpts Optional extra payment output: when `paymentOpts.paymentAmount` is greater than 0, the transaction sends that many sats to `paymentOpts.paymentAddress` (funded by the connected wallet — e.g. a service fee). Omit, or pass a non-positive amount, for no extra payment.
237
238
  * @param walletType The type of wallet to use for the transaction, either 'payment' or 'ordinals'. This parameter allows the caller to specify which wallet implementation to use when executing the smart contract call, providing flexibility in how the transaction is processed based on the capabilities and requirements of the chosen wallet type.
239
+ * @param commitOpts Optional commit options, as in `callSmartContract`: outputs of the payment address the commit spends, and the least fee it pays (see `CommitOpts`).
238
240
  * @returns The result of the smart contract call, which may vary depending on the wallet type and the specifics of the transaction. The exact structure of the result will depend on the implementation of the callSmartContractFromOrdinalsWallet and callSmartContractFromPaymentWallet functions, as well as the nature of the smart contract being called and the function being invoked.
239
241
  * @throws An error if the ABI is not an object, if the function name is not a string, if the parameters are not an array, if an unsupported wallet type is specified, or if there is an issue with the smart contract call.
240
242
  */
241
- export declare function callSmartContractAbi(contractAddress: string, abi: any, funcName: string, params: any, estimatedGas: number, feeRate: number, postage: number | null, dryRun: boolean, paymentOpts?: PaymentOpts, walletType?: BISWalletPurpose): Promise<InscribeAndSendToOpReturn>;
243
+ export declare function callSmartContractAbi(contractAddress: string, abi: any, funcName: string, params: any, estimatedGas: number, feeRate: number, postage: number | null, dryRun: boolean, paymentOpts?: PaymentOpts, walletType?: BISWalletPurpose, commitOpts?: CommitOpts): Promise<InscribeAndSendToOpReturn>;
242
244
  /**
243
245
  * Deploys a smart contract on BRC2.0 from the ordinals identity. The deploy is inscribed from the
244
246
  * ordinals address, so the contract's deployer is `getEvmAddressFromBitcoinAddress(ordinalsAddress)`.
@@ -5,6 +5,6 @@ export * as brc20 from './api/brc20';
5
5
  export * as mint from './api/mint';
6
6
  export * as balances from './api/balances';
7
7
  export * from './api/helpers';
8
- export type { PaymentOpts } from './types/common';
8
+ export type { CommitInput, CommitOpts, PaymentOpts } from './types/common';
9
9
  export * as bitcoinjs from 'bitcoinjs-lib';
10
10
  export * as Buff from '@cmdcode/buff-utils';
@@ -1,8 +1,8 @@
1
1
  import { SignProgressOptions } from './sign-progress';
2
2
  /**
3
- * Whether the connected wallet can prepare a BRC2.0 withdraw chain: it has separate payment and
4
- * ordinals addresses, and the ordinals address is `p2tr` or `p2wpkh`. A wallet whose one address
5
- * serves both roles may spend the held reveal output as a cardinal UTXO before the relay sends it.
3
+ * Whether the connected wallet can prepare a BRC2.0 withdraw chain: true for any connected wallet
4
+ * whose ordinals address is `p2tr` or `p2wpkh`, including a wallet whose one address serves as both
5
+ * payment and ordinals address.
6
6
  */
7
7
  export declare function canPrepareBrc20ProgWithdraw(): boolean;
8
8
  /**
@@ -53,6 +53,10 @@ export interface PreparedBrc20Withdraw {
53
53
  * `targetAddress` as its only input and output. The three are tested for mempool acceptance as one
54
54
  * package. Refuses a wallet `canPrepareBrc20ProgWithdraw` rejects.
55
55
  *
56
+ * The chain is handed to the backend with the withdraw order. The backend broadcasts the commit at
57
+ * once and holds the reveal and the send until the withdraw settles, so no revealed inscription
58
+ * waits at the user's address. The commit spends only cardinal UTXOs.
59
+ *
56
60
  * `onSignRequest` is called before each wallet prompt with `{ step, total }`; `total` is 2.
57
61
  */
58
62
  export declare function prepareBrc20ProgWithdraw(args: PrepareBrc20ProgWithdrawArgs): Promise<PreparedBrc20Withdraw>;
@@ -64,7 +68,8 @@ export interface SendBrc20ProgWithdrawToSelfArgs extends SignProgressOptions {
64
68
  }
65
69
  /**
66
70
  * Sends a withdraw inscription from its reveal output back to the connected ordinals address and
67
- * broadcasts it. Input 0 is `<revealTxId>:0`, read from the reveal transaction rather than from
71
+ * broadcasts it. It applies to a withdraw whose reveal was broadcast, such as a stuck relayed send.
72
+ * Input 0 is `<revealTxId>:0`, read from the reveal transaction rather than from
68
73
  * where an indexer places the inscription, so the send conflicts with (and, at a higher fee,
69
74
  * replaces) a stuck relay send of the same output. Output 0 returns the inscription at the ordinals
70
75
  * address's dust value; cardinal UTXOs of the payment address pay the fee, and every input signals
@@ -1,3 +1,4 @@
1
+ import { CommitOpts } from '../types/common';
1
2
  /** BRC2.0 grants each inscription `content bytes × GAS_PER_BYTE` gas. */
2
3
  export declare const GAS_PER_BYTE = 12000;
3
4
  /**
@@ -80,10 +81,11 @@ export declare function deploySmartContractAbi(bytecode: string, abi: any, param
80
81
  * @param paymentAddr - An optional parameter representing the Bitcoin address to which payment should be sent for the minting transaction. If null, no payment will be made.
81
82
  * @param payment - An optional parameter representing the amount of payment to be sent for the minting transaction, specified in sats. If null or less than or equal to 0, no payment will be made.
82
83
  * @param dryRun - A boolean flag indicating whether to perform a dry run. If true, the function will return the transaction hexes without broadcasting them to the network. If false, the transactions will be broadcasted after creation.
84
+ * @param commitOpts - Outputs of the payment address the commit spends, and the least fee it pays (see `CommitOpts`). Omit for plain coin selection at the fee rate.
83
85
  *
84
86
  * @returns An object containing details of the function call process, including transaction IDs, signed transaction hexes, inscription ID, postage, and secret used in the minting process. If dryRun is true, the transactions will not be broadcasted and the hexes will be returned for inspection.
85
87
  */
86
- export declare function callSmartContract(smartContractContractAddr: string, inputHex: string, estimatedGas: number, feeRate: number, postage: number | null, paymentAddr: string | null, payment: number | null, dryRun: boolean): Promise<{
88
+ export declare function callSmartContract(smartContractContractAddr: string, inputHex: string, estimatedGas: number, feeRate: number, postage: number | null, paymentAddr: string | null, payment: number | null, dryRun: boolean, commitOpts?: CommitOpts): Promise<{
87
89
  commitTxId: string;
88
90
  signedCommitTxHex: string;
89
91
  revealTxId: string;
@@ -107,9 +109,11 @@ export declare function callSmartContract(smartContractContractAddr: string, inp
107
109
  * @param dryRun - A boolean flag indicating whether to perform a dry run. If true, the function will return the transaction hexes without broadcasting them to the network. If false, the transactions will be broadcasted after creation.
108
110
  *
109
111
  * @returns An object containing details of the function call process, including transaction IDs, signed transaction hexes, inscription ID, postage, and secret used in the minting process. If dryRun is true, the transactions will not be broadcasted and the hexes will be returned for inspection.
112
+ * @param commitOpts - Outputs of the payment address the commit spends, and the least fee it pays (see `CommitOpts`). Omit for plain coin selection at the fee rate.
113
+ *
110
114
  * @throws Will throw an error if the wallet is not connected, if the input parameters are of incorrect types, or if there is a failure in creating or sending the inscription.
111
115
  */
112
- export declare function callSmartContractFromPaymentWallet(smartContractContractAddr: string, inputHex: string, estimatedGas: number, feeRate: number, postage: number | null, paymentAddr: string | null, payment: number | null, dryRun: boolean): Promise<{
116
+ export declare function callSmartContractFromPaymentWallet(smartContractContractAddr: string, inputHex: string, estimatedGas: number, feeRate: number, postage: number | null, paymentAddr: string | null, payment: number | null, dryRun: boolean, commitOpts?: CommitOpts): Promise<{
113
117
  commitTxId: string;
114
118
  signedCommitTxHex: string;
115
119
  revealTxId: string;
@@ -22,6 +22,12 @@ export interface Utxo {
22
22
  satpoints?: string[] | null;
23
23
  /** What each entry of `inscription_ids` was used for, as the Best in Slot API reports it. */
24
24
  brc20_inscriptions?: UsedBrc20Inscription[] | null;
25
+ /**
26
+ * The height of the block that confirmed the output, or `null` while it is unconfirmed. A
27
+ * provider that leaves it out reports nothing about confirmation, and the kit treats its
28
+ * outputs as confirmed.
29
+ */
30
+ block_height?: number | null;
25
31
  }
26
32
  /** A used BRC-20 inscription on a cardinal output, as the Best in Slot API describes it. */
27
33
  export interface UsedBrc20Inscription {
@@ -42,8 +48,6 @@ export interface OrdinalUtxo extends Utxo {
42
48
  inscription_ids: string[];
43
49
  /** The satpoint (`txid:vout:offset`) of each entry of `inscription_ids`, in the same order. */
44
50
  satpoints: string[];
45
- /** The height of the block that confirmed the output, or `null` while it is unconfirmed. */
46
- block_height?: number | null;
47
51
  }
48
52
  /**
49
53
  * The mempool acceptance verdict for one transaction, in the shape of Bitcoin Core's
@@ -1,5 +1,5 @@
1
1
  import { SignFunction, SignManyFunction, SignResponse } from '../provider/api';
2
- import { PaymentOpts } from '../types/common';
2
+ import { CommitOpts, PaymentOpts } from '../types/common';
3
3
  import { InscribeFees, InscribeMultipleResult, InscribeResult, SendInscriptionResult, InscriptionDetails } from '../types/inscription';
4
4
  import { Utxo } from './chain-providers';
5
5
  import { OrdinalUtxoInfo } from './helpers';
@@ -61,7 +61,7 @@ interface BuildTransactionResult {
61
61
  */
62
62
  output_index: number[];
63
63
  }
64
- export declare function buildTransaction(utxoInfos: UtxoInfo[], forceInUtxos: UtxoInfoWithWallet[], payerWallet: WalletInfo, opReturnWallets: WalletInfo[], outputWallet: WalletInfo | null, changeWallet: WalletInfo, feeRate: number, amount: number, paymentWallet: WalletInfo | null, payment: number | null, minChange?: number): BuildTransactionResult;
64
+ export declare function buildTransaction(utxoInfos: UtxoInfo[], forceInUtxos: UtxoInfoWithWallet[], payerWallet: WalletInfo, opReturnWallets: WalletInfo[], outputWallet: WalletInfo | null, changeWallet: WalletInfo, feeRate: number, amount: number, paymentWallet: WalletInfo | null, payment: number | null, minChange?: number, minFee?: number): BuildTransactionResult;
65
65
  interface TransactionInOuts {
66
66
  ins: {
67
67
  hash: Buffer;
@@ -302,10 +302,11 @@ export declare function getInscriptionDetails(inscriptionId: string, inscription
302
302
  * @param payment - amount to pay (if payment is not null)
303
303
  * @param dryRun - if true, the transactions will not be broadcasted and the signed transaction hex will be returned for inspection
304
304
  * @param signFunc - function to sign the transactions
305
+ * @param commitOpts - outputs of the payer the commit spends, and the least fee it pays (see `CommitOpts`)
305
306
  *
306
307
  * @returns an object containing the commit transaction ID, signed commit transaction hex, reveal transaction ID, signed reveal transaction hex, inscription ID, postage used, and the secret token used for minting
307
308
  */
308
- export declare function mintAll(inscriptionDetails: InscriptionDetails, feeRate: number, postage: number | null, paymentAddr: string | null, payment: number | null, dryRun: boolean, signFunc: SignFunction): Promise<{
309
+ export declare function mintAll(inscriptionDetails: InscriptionDetails, feeRate: number, postage: number | null, paymentAddr: string | null, payment: number | null, dryRun: boolean, signFunc: SignFunction, commitOpts?: CommitOpts): Promise<{
309
310
  commit_txid: string;
310
311
  signed_commit_tx_hex: string;
311
312
  reveal_txid: string;
@@ -326,10 +327,11 @@ export declare function mintAll(inscriptionDetails: InscriptionDetails, feeRate:
326
327
  * @param payment - amount to pay (if payment is not null)
327
328
  * @param dryRun - if true, the transactions will not be broadcasted and the signed transaction hex will be returned for inspection
328
329
  * @param signFunc - function to sign the transactions
330
+ * @param commitOpts - outputs of the payer the commit spends, and the least fee it pays (see `CommitOpts`)
329
331
  *
330
332
  * @returns an object containing the commit transaction ID, signed commit transaction hex, reveal transaction ID, signed reveal transaction hex, inscription ID, postage used, and the secret token used for minting
331
333
  */
332
- export declare function mintAllPaymentWallet(inscriptionDetails: InscriptionDetails, feeRate: number, postage: number | null, paymentAddr: string | null, payment: number | null, dryRun: boolean, signFunc: SignFunction): Promise<InscribeResult>;
334
+ export declare function mintAllPaymentWallet(inscriptionDetails: InscriptionDetails, feeRate: number, postage: number | null, paymentAddr: string | null, payment: number | null, dryRun: boolean, signFunc: SignFunction, commitOpts?: CommitOpts): Promise<InscribeResult>;
333
335
  interface InscribeCheckFeesResult {
334
336
  commit_fee: number;
335
337
  reveal_fee: number;
@@ -361,10 +363,11 @@ export declare function mintAllCheckFees(inscriptionDetails: InscriptionDetails,
361
363
  * @param feeRate - fee rate in sat/vbyte to use for the transaction
362
364
  * @param dryRun - if true, the transaction will not be broadcasted
363
365
  * @param signFunc - function to sign the transaction
366
+ * @param replacing - true when the saved extra transactions start with a commit that replaces an earlier package: the send then funds only from confirmed provider outputs and the saved extra transactions, and skips the mempool test, which would include that commit
364
367
  *
365
368
  * @returns an object containing the transaction ID and signed transaction hex of the sent transaction
366
369
  */
367
- export declare function sendInscriptionToOpReturnAll(inscriptionId: string, targetWallet: WalletInfo, targetPostage: number | null, feeRate: number, dryRun: boolean, signFunc: SignFunction): Promise<SendInscriptionResult>;
370
+ export declare function sendInscriptionToOpReturnAll(inscriptionId: string, targetWallet: WalletInfo, targetPostage: number | null, feeRate: number, dryRun: boolean, signFunc: SignFunction, replacing?: boolean): Promise<SendInscriptionResult>;
368
371
  /**
369
372
  * Sends an inscription to a target address using an OP_RETURN output, with the payment wallet as the source of funds for the transaction. This function is similar to sendInscriptionToOpReturnAll, but it specifically uses the payment wallet for funding the transaction, which can be useful in cases where the inscription wallet does not have enough funds to cover the transaction fees. It builds a transaction that spends the inscription UTXO and creates an OP_RETURN output with the inscription data, along with a target output with the specified postage. It then signs and broadcasts the transaction. If dryRun is true, it returns the signed transaction hex without broadcasting.
370
373
  *
@@ -374,10 +377,11 @@ export declare function sendInscriptionToOpReturnAll(inscriptionId: string, targ
374
377
  * @param feeRate - fee rate in sat/vbyte to use for the transaction
375
378
  * @param dryRun - if true, the transaction will not be broadcasted
376
379
  * @param signFunc - function to sign the transaction
380
+ * @param replacing - true when the saved extra transactions start with a commit that replaces an earlier package: the send then funds only from confirmed provider outputs and the saved extra transactions, and skips the mempool test, which would include that commit
377
381
  *
378
382
  * @returns an object containing the transaction ID and signed transaction hex of the sent transaction
379
383
  */
380
- export declare function sendInscriptionInPaymentWalletToOpReturnAll(inscriptionId: string, targetWallet: WalletInfo, targetPostage: number | null, feeRate: number, dryRun: boolean, signFunc: SignFunction): Promise<SendInscriptionResult>;
384
+ export declare function sendInscriptionInPaymentWalletToOpReturnAll(inscriptionId: string, targetWallet: WalletInfo, targetPostage: number | null, feeRate: number, dryRun: boolean, signFunc: SignFunction, replacing?: boolean): Promise<SendInscriptionResult>;
381
385
  /**
382
386
  * Mints an inscription with a parent inscription by building and signing the commit and reveal transactions that reference the parent inscription. This function is used when the user wants to create a new inscription that is linked to an existing parent inscription, allowing for hierarchical relationships between inscriptions. It retrieves the connected wallets, builds and signs the transactions, validates them, and broadcasts them to the network. If dryRun is true, it returns the signed transaction hex without broadcasting.
383
387
  *
@@ -8,6 +8,6 @@ export { getEndpoints, getNetwork, setEndpoints, setNetwork, subscribeToNetwork,
8
8
  export type { Endpoints, EndpointsConfig } from './core/store-network';
9
9
  export { getProviders, setProviders } from './core/chain-providers';
10
10
  export type { NetworkProviders, ProvidersConfig } from './core/chain-providers';
11
- export type { PaymentOpts } from './types/common';
11
+ export type { CommitInput, CommitOpts, PaymentOpts } from './types/common';
12
12
  export * as bitcoinjs from 'bitcoinjs-lib';
13
13
  export * as Buff from '@cmdcode/buff-utils';
@@ -4,6 +4,6 @@ export * as brc20 from './api/brc20';
4
4
  export * as mint from './api/mint';
5
5
  export * as balances from './api/balances';
6
6
  export * from './api/helpers';
7
- export type { PaymentOpts } from './types/common';
7
+ export type { CommitInput, CommitOpts, PaymentOpts } from './types/common';
8
8
  export * as bitcoinjs from 'bitcoinjs-lib';
9
9
  export * as Buff from '@cmdcode/buff-utils';
@@ -40,3 +40,43 @@ export interface PaymentOpts {
40
40
  paymentAddress: string;
41
41
  paymentAmount: number;
42
42
  }
43
+ /**
44
+ * An output the commit transaction must spend.
45
+ *
46
+ * @property outpoint - The output as `txid:vout`.
47
+ * @property value - The output's value in sats.
48
+ */
49
+ export interface CommitInput {
50
+ outpoint: string;
51
+ value: number;
52
+ }
53
+ /**
54
+ * Options for the commit transaction of a smart contract call. With neither set, coin selection
55
+ * funds the commit from the payer's cardinal UTXOs.
56
+ *
57
+ * Spending the inputs of an earlier call package that is unconfirmed, or that mempools dropped,
58
+ * replaces that package with the new one: pass the earlier commit's own inputs as `inputs`, and
59
+ * while the earlier package is still in mempools, a `minCommitFee` of at least the total fee of
60
+ * every transaction the new commit evicts (BIP125 rule 3) plus the relay fee for its own size
61
+ * (rule 4).
62
+ *
63
+ * With `inputs`, the call runs in replacement mode: coin selection for the commit and the send
64
+ * skips provider outputs reported unconfirmed (`block_height: null`), since they may belong to the
65
+ * earlier package, and the commit is tested for mempool acceptance alone, since a
66
+ * multi-transaction test refuses any conflict with the mempool. The reveal and send go untested.
67
+ *
68
+ * @property inputs - Outputs the commit spends, ahead of any extra funding coin selection adds.
69
+ * Each must be an output of the payer (payment) address with the given value, which the kit
70
+ * checks against the output's transaction. Each must also carry no inscription: the kit rejects
71
+ * one its chain provider lists with inscriptions, and the caller guarantees it for any other.
72
+ * While the earlier package is unconfirmed, its inputs are spent in the mempool, so the provider
73
+ * no longer lists them and the kit cannot see their inscriptions: pass only the earlier commit's
74
+ * own inputs, never an output of the earlier package.
75
+ * @property minCommitFee - The least absolute fee the commit pays, in sats. When the fee rate
76
+ * gives a lower fee, the commit's change (or, without change, its commit output) gives up the
77
+ * difference. A value at or below the fee-rate fee changes nothing.
78
+ */
79
+ export interface CommitOpts {
80
+ inputs?: CommitInput[];
81
+ minCommitFee?: number;
82
+ }
package/dist/vue.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ref as s, onScopeDispose as u, watch as i } from "vue";
2
- import { f as r, _ as c, m as f } from "./helpers-Dho-nzKc.js";
2
+ import { f as r, _ as c, m as f } from "./helpers-DAaj_HTc.js";
3
3
  function w() {
4
4
  const e = s(r()), t = c((o) => {
5
5
  e.value !== o && (e.value = o);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bestinslot/wallet-kit",
3
3
  "type": "module",
4
- "version": "0.16.0-rc.0",
4
+ "version": "0.16.1",
5
5
  "private": false,
6
6
  "description": "A lightweight JavaScript library for connecting Bitcoin wallets with a unified API.",
7
7
  "license": "MIT",