@babylonlabs-io/ts-sdk 0.19.0 → 0.20.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/README.md +56 -12
- package/dist/bitcoin-CNnPFU6Y.cjs +2 -0
- package/dist/bitcoin-CNnPFU6Y.cjs.map +1 -0
- package/dist/{constants-Q7v2O7Ps.js → bitcoin-nOOgeRyl.js} +64 -76
- package/dist/bitcoin-nOOgeRyl.js.map +1 -0
- package/dist/buildAndBroadcastRefund-DWEQvj9T.cjs +2 -0
- package/dist/buildAndBroadcastRefund-DWEQvj9T.cjs.map +1 -0
- package/dist/buildAndBroadcastRefund-DnTQkCgG.js +1331 -0
- package/dist/buildAndBroadcastRefund-DnTQkCgG.js.map +1 -0
- package/dist/challengeAssert-D1lpvuMv.js +283 -0
- package/dist/challengeAssert-D1lpvuMv.js.map +1 -0
- package/dist/challengeAssert-nYlgeAI8.cjs +2 -0
- package/dist/challengeAssert-nYlgeAI8.cjs.map +1 -0
- package/dist/errors-D9EtjJoD.cjs +2 -0
- package/dist/errors-D9EtjJoD.cjs.map +1 -0
- package/dist/{errors-aMocmFr-.js → errors-D_PI__IT.js} +98 -97
- package/dist/errors-D_PI__IT.js.map +1 -0
- package/dist/fundPeginTransaction-BLYXxLBv.js +70 -0
- package/dist/fundPeginTransaction-BLYXxLBv.js.map +1 -0
- package/dist/fundPeginTransaction-DxNOeyNI.cjs +2 -0
- package/dist/fundPeginTransaction-DxNOeyNI.cjs.map +1 -0
- package/dist/index-BpXpESWu.cjs +2 -0
- package/dist/index-BpXpESWu.cjs.map +1 -0
- package/dist/{index-BvFLf3vm.js → index-CFwoGJNQ.js} +146 -518
- package/dist/index-CFwoGJNQ.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +133 -109
- package/dist/payout-DzGsAnhf.js +261 -0
- package/dist/payout-DzGsAnhf.js.map +1 -0
- package/dist/payout-RFIh7GLN.cjs +2 -0
- package/dist/payout-RFIh7GLN.cjs.map +1 -0
- package/dist/psbtInputFields-05ZrwRzf.cjs +2 -0
- package/dist/psbtInputFields-05ZrwRzf.cjs.map +1 -0
- package/dist/psbtInputFields-r1ss6WLU.js +237 -0
- package/dist/psbtInputFields-r1ss6WLU.js.map +1 -0
- package/dist/signing-DeWVBl7m.js +64 -0
- package/dist/signing-DeWVBl7m.js.map +1 -0
- package/dist/signing-cl-lowxV.cjs +2 -0
- package/dist/signing-cl-lowxV.cjs.map +1 -0
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +2 -2
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.d.ts +3 -1
- package/dist/tbv/core/index.d.ts.map +1 -1
- package/dist/tbv/core/index.js +130 -106
- package/dist/tbv/core/managers/PeginManager.d.ts +1 -1
- package/dist/tbv/core/primitives/index.cjs +1 -1
- package/dist/tbv/core/primitives/index.d.ts +3 -2
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +24 -23
- package/dist/tbv/core/primitives/psbt/__tests__/helpers.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/index.d.ts +1 -1
- package/dist/tbv/core/primitives/psbt/payout.d.ts.map +1 -1
- package/dist/tbv/core/primitives/psbt/pegin.d.ts +2 -3
- package/dist/tbv/core/primitives/psbt/pegin.d.ts.map +1 -1
- package/dist/tbv/core/primitives/utils/bitcoin.d.ts +4 -0
- package/dist/tbv/core/primitives/utils/bitcoin.d.ts.map +1 -1
- package/dist/tbv/core/primitives/utils/index.d.ts +1 -1
- package/dist/tbv/core/primitives/utils/index.d.ts.map +1 -1
- package/dist/tbv/core/services/activation/__tests__/activateVault.test.d.ts +2 -0
- package/dist/tbv/core/services/activation/__tests__/activateVault.test.d.ts.map +1 -0
- package/dist/tbv/core/services/activation/activateVault.d.ts +77 -0
- package/dist/tbv/core/services/activation/activateVault.d.ts.map +1 -0
- package/dist/tbv/core/services/activation/index.d.ts +7 -0
- package/dist/tbv/core/services/activation/index.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/__tests__/peginState.test.d.ts +2 -0
- package/dist/tbv/core/services/deposit/__tests__/peginState.test.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/__tests__/validation.test.d.ts +5 -0
- package/dist/tbv/core/services/deposit/__tests__/validation.test.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/index.d.ts +4 -0
- package/dist/tbv/core/services/deposit/index.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/peginState.d.ts +93 -0
- package/dist/tbv/core/services/deposit/peginState.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/validation.d.ts +114 -0
- package/dist/tbv/core/services/deposit/validation.d.ts.map +1 -0
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.d.ts +3 -0
- package/dist/tbv/core/services/index.d.ts.map +1 -1
- package/dist/tbv/core/services/index.js +25 -7
- package/dist/tbv/core/services/index.js.map +1 -1
- package/dist/tbv/core/services/pegout/__tests__/state.test.d.ts +2 -0
- package/dist/tbv/core/services/pegout/__tests__/state.test.d.ts.map +1 -0
- package/dist/tbv/core/services/pegout/index.d.ts +2 -0
- package/dist/tbv/core/services/pegout/index.d.ts.map +1 -0
- package/dist/tbv/core/services/pegout/state.d.ts +30 -0
- package/dist/tbv/core/services/pegout/state.d.ts.map +1 -0
- package/dist/tbv/core/services/refund/__tests__/buildAndBroadcastRefund.test.d.ts +2 -0
- package/dist/tbv/core/services/refund/__tests__/buildAndBroadcastRefund.test.d.ts.map +1 -0
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts +103 -0
- package/dist/tbv/core/services/refund/buildAndBroadcastRefund.d.ts.map +1 -0
- package/dist/tbv/core/services/refund/errors.d.ts +13 -0
- package/dist/tbv/core/services/refund/errors.d.ts.map +1 -0
- package/dist/tbv/core/services/refund/index.d.ts +8 -0
- package/dist/tbv/core/services/refund/index.d.ts.map +1 -0
- package/dist/tbv/core/utils/index.cjs +1 -1
- package/dist/tbv/core/utils/index.js +30 -24
- package/dist/tbv/core/utils/transaction/fundPeginTransaction.d.ts +1 -1
- package/dist/tbv/core/utils/utxo/__tests__/availability.test.d.ts +3 -0
- package/dist/tbv/core/utils/utxo/__tests__/availability.test.d.ts.map +1 -0
- package/dist/tbv/core/utils/utxo/__tests__/reservation.test.d.ts +3 -0
- package/dist/tbv/core/utils/utxo/__tests__/reservation.test.d.ts.map +1 -0
- package/dist/tbv/core/utils/utxo/availability.d.ts +62 -0
- package/dist/tbv/core/utils/utxo/availability.d.ts.map +1 -0
- package/dist/tbv/core/utils/utxo/index.d.ts +2 -0
- package/dist/tbv/core/utils/utxo/index.d.ts.map +1 -1
- package/dist/tbv/core/utils/utxo/reservation.d.ts +91 -0
- package/dist/tbv/core/utils/utxo/reservation.d.ts.map +1 -0
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +130 -106
- package/dist/tbv/integrations/aave/index.cjs +1 -1
- package/dist/tbv/integrations/aave/index.cjs.map +1 -1
- package/dist/tbv/integrations/aave/index.d.ts +3 -3
- package/dist/tbv/integrations/aave/index.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/index.js +145 -169
- package/dist/tbv/integrations/aave/index.js.map +1 -1
- package/dist/tbv/integrations/aave/utils/healthFactor.d.ts +0 -30
- package/dist/tbv/integrations/aave/utils/healthFactor.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/utils/index.d.ts +2 -2
- package/dist/tbv/integrations/aave/utils/index.d.ts.map +1 -1
- package/dist/types-B-p4dhEH.cjs +2 -0
- package/dist/types-B-p4dhEH.cjs.map +1 -0
- package/dist/types-DWjaqVfP.js +608 -0
- package/dist/types-DWjaqVfP.js.map +1 -0
- package/package.json +5 -1
- package/dist/challengeAssert-D_k_ADgP.cjs +0 -2
- package/dist/challengeAssert-D_k_ADgP.cjs.map +0 -1
- package/dist/challengeAssert-k5_LWUtO.js +0 -362
- package/dist/challengeAssert-k5_LWUtO.js.map +0 -1
- package/dist/constants-EiyZkXce.cjs +0 -2
- package/dist/constants-EiyZkXce.cjs.map +0 -1
- package/dist/constants-Q7v2O7Ps.js.map +0 -1
- package/dist/errors-DVNYib5y.cjs +0 -2
- package/dist/errors-DVNYib5y.cjs.map +0 -1
- package/dist/errors-aMocmFr-.js.map +0 -1
- package/dist/fundPeginTransaction-DpwnDslW.js +0 -50
- package/dist/fundPeginTransaction-DpwnDslW.js.map +0 -1
- package/dist/fundPeginTransaction-EbrZzlrh.cjs +0 -2
- package/dist/fundPeginTransaction-EbrZzlrh.cjs.map +0 -1
- package/dist/index-BX-V3C9t.js +0 -995
- package/dist/index-BX-V3C9t.js.map +0 -1
- package/dist/index-BgnxXV5G.cjs +0 -2
- package/dist/index-BgnxXV5G.cjs.map +0 -1
- package/dist/index-BvFLf3vm.js.map +0 -1
- package/dist/index-DpKhuCta.cjs +0 -2
- package/dist/index-DpKhuCta.cjs.map +0 -1
- package/dist/payout-Ce9vSs9e.js +0 -164
- package/dist/payout-Ce9vSs9e.js.map +0 -1
- package/dist/payout-CfsDnjKI.cjs +0 -2
- package/dist/payout-CfsDnjKI.cjs.map +0 -1
- package/dist/psbtInputFields-C0nKn_GD.cjs +0 -2
- package/dist/psbtInputFields-C0nKn_GD.cjs.map +0 -1
- package/dist/psbtInputFields-DO0ELwiv.js +0 -116
- package/dist/psbtInputFields-DO0ELwiv.js.map +0 -1
- package/dist/signing-Deg5lCoC.cjs +0 -2
- package/dist/signing-Deg5lCoC.cjs.map +0 -1
- package/dist/signing-Drwr3bXB.js +0 -16
- package/dist/signing-Drwr3bXB.js.map +0 -1
- package/dist/types-D1rYwwCu.js +0 -235
- package/dist/types-D1rYwwCu.js.map +0 -1
- package/dist/types-DEWiqXYp.cjs +0 -2
- package/dist/types-DEWiqXYp.cjs.map +0 -1
package/dist/tbv/core/index.js
CHANGED
|
@@ -1,112 +1,136 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { computeMinClaimValue as
|
|
3
|
-
import { b as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { P as
|
|
10
|
-
import { A as
|
|
11
|
-
import { D as
|
|
1
|
+
import { i as e, g as t, h as o, d as r, a as i, b as l, c as n, e as u, f as P } from "../../challengeAssert-D1lpvuMv.js";
|
|
2
|
+
import { computeMinClaimValue as c, deriveVaultId as p } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
+
import { a as g, b as S, c as A, e as E } from "../../payout-DzGsAnhf.js";
|
|
4
|
+
import { d as m, a as _, e as b, f as x, g as f, h as I, i as v, b as U, p as C, s as y, t as h, u as O, v as V } from "../../bitcoin-nOOgeRyl.js";
|
|
5
|
+
import { C as B, P as D, a as N, c as M, g as H } from "../../signing-DeWVBl7m.js";
|
|
6
|
+
import { B as k, C as W, P as K, a as w, m as X, h as G, i as Y, l as J, k as j, p as Z, b as z, s as q, v as Q, g as $, d as aa, c as sa, j as ea, e as ta, f as oa, w as ra } from "../../buildAndBroadcastRefund-DnTQkCgG.js";
|
|
7
|
+
import { B as la, D as na, F as ua, L as Pa, M as da, P as ca, a as pa, S as Ta, T as ga, W as Sa, f as Aa, b as Ea, p as Ra, r as ma } from "../../fundPeginTransaction-BLYXxLBv.js";
|
|
8
|
+
import { B as ba, U as xa, a as fa, f as Ia, c as va, e as Ua, g as Ca, i as ya, h as ha, s as Oa, b as Va, d as Fa, v as Ba } from "../../psbtInputFields-r1ss6WLU.js";
|
|
9
|
+
import { C as Na, P as Ma, b as Ha, c as La, a as ka, d as Wa, f as Ka, e as wa, g as Xa, h as Ga, i as Ya, j as Ja, k as ja, m as Za } from "../../errors-D_PI__IT.js";
|
|
10
|
+
import { A as qa, M as Qa, P as $a, V as as, i as ss, j as es, k as ts, l as os, h as rs, g as is, a as ls, b as ns, c as us, d as Ps, e as ds, f as cs, p as ps, r as Ts } from "../../index-CFwoGJNQ.js";
|
|
11
|
+
import { B as Ss, D as As, b as Es, J as Rs, a as ms, d as _s, P as bs, R as xs, c as fs, V as Is } from "../../types-DWjaqVfP.js";
|
|
12
12
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
13
|
+
qa as ApplicationRegistryABI,
|
|
14
|
+
k as BIP68NotMatureError,
|
|
15
|
+
Ss as BTCVaultRegistryABI,
|
|
16
|
+
la as BTC_DUST_SAT,
|
|
17
|
+
ba as BitcoinScriptType,
|
|
18
|
+
Na as CONTRACT_ERRORS,
|
|
19
|
+
W as ClaimerPegoutStatusValue,
|
|
20
|
+
B as ContractStatus,
|
|
21
|
+
na as DUST_THRESHOLD,
|
|
22
|
+
As as DaemonStatus,
|
|
23
|
+
ua as FEE_SAFETY_MARGIN,
|
|
24
|
+
Es as JSON_RPC_ERROR_CODES,
|
|
25
|
+
Rs as JsonRpcClient,
|
|
26
|
+
ms as JsonRpcError,
|
|
27
|
+
Pa as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
28
|
+
da as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
29
|
+
Qa as MEMPOOL_API_URLS,
|
|
30
|
+
ca as P2TR_INPUT_SIZE,
|
|
31
|
+
pa as PEGIN_FIXED_OUTPUTS,
|
|
32
|
+
_s as POST_WOTS_STATUSES,
|
|
33
|
+
bs as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
34
|
+
K as PayoutManager,
|
|
35
|
+
D as PeginAction,
|
|
36
|
+
Ma as PeginManager,
|
|
37
|
+
$a as ProtocolParamsABI,
|
|
38
|
+
xs as RpcErrorCode,
|
|
39
|
+
Ta as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
40
|
+
ga as TX_BUFFER_SIZE_OVERHEAD,
|
|
41
|
+
xa as UtxoNotAvailableError,
|
|
42
|
+
fs as VP_TERMINAL_STATUSES,
|
|
43
|
+
Is as VP_TRANSIENT_STATUSES,
|
|
44
|
+
as as VaultProviderRpcClient,
|
|
45
|
+
ss as ViemProtocolParamsReader,
|
|
46
|
+
es as ViemUniversalChallengerReader,
|
|
47
|
+
ts as ViemVaultKeeperReader,
|
|
48
|
+
os as ViemVaultRegistryReader,
|
|
49
|
+
rs as VpResponseValidationError,
|
|
50
|
+
Sa as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
51
|
+
w as activateVault,
|
|
52
|
+
fa as assertUtxosAvailable,
|
|
53
|
+
X as buildAndBroadcastRefund,
|
|
46
54
|
e as buildChallengeAssertPsbt,
|
|
47
55
|
t as buildDepositorPayoutPsbt,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
56
|
+
o as buildNoPayoutPsbt,
|
|
57
|
+
g as buildPayoutPsbt,
|
|
58
|
+
r as buildPeginInputPsbt,
|
|
51
59
|
i as buildPeginTxFromFundedPrePegin,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
60
|
+
l as buildPrePeginPsbt,
|
|
61
|
+
S as buildRefundPsbt,
|
|
62
|
+
Ia as calculateBtcTxHash,
|
|
63
|
+
N as canPerformAction,
|
|
64
|
+
va as collectReservedUtxoRefs,
|
|
65
|
+
G as computeHashlock,
|
|
66
|
+
c as computeMinClaimValue,
|
|
67
|
+
n as computeNumLocalChallengers,
|
|
68
|
+
Ha as computeWotsBlockPublicKeysHash,
|
|
69
|
+
La as computeWotsPkHash,
|
|
70
|
+
A as createPayoutScript,
|
|
71
|
+
M as createTaprootScriptPathSignOptions,
|
|
72
|
+
m as deriveNativeSegwitAddress,
|
|
73
|
+
_ as deriveTaprootAddress,
|
|
74
|
+
p as deriveVaultId,
|
|
75
|
+
ka as deriveWotsBlockPublicKeys,
|
|
76
|
+
Wa as deriveWotsKeypair,
|
|
77
|
+
Ka as deriveWotsPkHash,
|
|
78
|
+
b as ensureHexPrefix,
|
|
79
|
+
wa as extractErrorData,
|
|
80
|
+
Ua as extractInputsFromTransaction,
|
|
81
|
+
E as extractPayoutSignature,
|
|
82
|
+
u as extractPeginInputSignature,
|
|
83
|
+
P as finalizePeginInputPsbt,
|
|
84
|
+
x as formatSatoshisToBtc,
|
|
85
|
+
Aa as fundPeginTransaction,
|
|
86
|
+
is as getAddressTxs,
|
|
87
|
+
ls as getAddressUtxos,
|
|
88
|
+
Xa as getContractErrorMessage,
|
|
89
|
+
Ca as getDustThreshold,
|
|
90
|
+
ns as getMempoolApiUrl,
|
|
91
|
+
f as getNetwork,
|
|
92
|
+
us as getNetworkFees,
|
|
93
|
+
H as getPeginProtocolState,
|
|
94
|
+
ya as getPsbtInputFields,
|
|
95
|
+
ha as getScriptType,
|
|
96
|
+
Ps as getTxHex,
|
|
97
|
+
ds as getTxInfo,
|
|
98
|
+
cs as getUtxoInfo,
|
|
99
|
+
Ga as handleContractError,
|
|
100
|
+
I as hexToUint8Array,
|
|
101
|
+
v as isAddressFromPublicKey,
|
|
102
|
+
Y as isDepositAmountValid,
|
|
103
|
+
Ya as isKnownContractError,
|
|
104
|
+
J as isPegoutTerminalStatus,
|
|
105
|
+
j as isRecognizedPegoutStatus,
|
|
106
|
+
U as isValidHex,
|
|
107
|
+
Ja as isWotsMismatchError,
|
|
108
|
+
ja as keypairToPublicKey,
|
|
109
|
+
Za as mnemonicToWotsSeed,
|
|
110
|
+
Ea as parseUnfundedWasmTransaction,
|
|
111
|
+
Ra as peginOutputCount,
|
|
112
|
+
Z as pollAndSignPayouts,
|
|
113
|
+
C as processPublicKeyToXOnly,
|
|
114
|
+
ps as pushTx,
|
|
115
|
+
ma as rateBasedTxBufferFee,
|
|
116
|
+
Ts as resolveProtocolAddresses,
|
|
117
|
+
Oa as selectUtxosForDeposit,
|
|
118
|
+
Va as selectUtxosForPegin,
|
|
119
|
+
Fa as shouldAddChangeOutput,
|
|
120
|
+
z as signDepositorGraph,
|
|
121
|
+
y as stripHexPrefix,
|
|
122
|
+
q as submitWotsPublicKey,
|
|
123
|
+
h as toXOnly,
|
|
124
|
+
O as uint8ArrayToHex,
|
|
125
|
+
Q as validateDepositAmount,
|
|
126
|
+
$ as validateMultiVaultDepositInputs,
|
|
127
|
+
aa as validateProviderSelection,
|
|
128
|
+
sa as validateRemainingCapacity,
|
|
129
|
+
ea as validateSecretAgainstHashlock,
|
|
130
|
+
Ba as validateUtxosAvailable,
|
|
131
|
+
ta as validateVaultAmounts,
|
|
132
|
+
oa as validateVaultProviderPubkey,
|
|
133
|
+
V as validateWalletPubkey,
|
|
134
|
+
ra as waitForPeginStatus
|
|
111
135
|
};
|
|
112
136
|
//# sourceMappingURL=index.js.map
|
|
@@ -311,7 +311,7 @@ export declare class PeginManager {
|
|
|
311
311
|
* 2. Build unfunded Pre-PegIn transaction (HTLC output) using primitives
|
|
312
312
|
* 3. Select UTXOs to cover the HTLC value
|
|
313
313
|
* 4. Fund the Pre-PegIn transaction
|
|
314
|
-
* 5. Derive the PegIn transaction from the funded Pre-PegIn
|
|
314
|
+
* 5. Derive the PegIn transaction from the funded Pre-PegIn tx
|
|
315
315
|
* 6. Build PSBT for signing the PegIn input (HTLC leaf 0)
|
|
316
316
|
* 7. Sign via BTC wallet and extract depositor signature
|
|
317
317
|
*
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../challengeAssert-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../challengeAssert-nYlgeAI8.cjs"),r=require("@babylonlabs-io/babylon-tbv-rust-wasm"),i=require("../../../payout-RFIh7GLN.cjs"),e=require("../../../bitcoin-CNnPFU6Y.cjs");exports.buildChallengeAssertPsbt=t.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=t.buildDepositorPayoutPsbt;exports.buildNoPayoutPsbt=t.buildNoPayoutPsbt;exports.buildPeginInputPsbt=t.buildPeginInputPsbt;exports.buildPeginTxFromFundedPrePegin=t.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=t.buildPrePeginPsbt;exports.computeNumLocalChallengers=t.computeNumLocalChallengers;exports.extractPeginInputSignature=t.extractPeginInputSignature;exports.finalizePeginInputPsbt=t.finalizePeginInputPsbt;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>r.computeMinClaimValue});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>r.deriveVaultId});exports.buildPayoutPsbt=i.buildPayoutPsbt;exports.buildRefundPsbt=i.buildRefundPsbt;exports.createPayoutScript=i.createPayoutScript;exports.extractPayoutSignature=i.extractPayoutSignature;exports.deriveNativeSegwitAddress=e.deriveNativeSegwitAddress;exports.deriveTaprootAddress=e.deriveTaprootAddress;exports.ensureHexPrefix=e.ensureHexPrefix;exports.formatSatoshisToBtc=e.formatSatoshisToBtc;exports.hexToUint8Array=e.hexToUint8Array;exports.isAddressFromPublicKey=e.isAddressFromPublicKey;exports.isValidHex=e.isValidHex;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -39,7 +39,8 @@
|
|
|
39
39
|
* ## Key Exports
|
|
40
40
|
*
|
|
41
41
|
* ### PSBT Builders
|
|
42
|
-
* - {@link
|
|
42
|
+
* - {@link buildPrePeginPsbt} - Create unfunded Pre-PegIn transaction (HTLC outputs)
|
|
43
|
+
* - {@link buildPeginTxFromFundedPrePegin} - Derive PegIn tx from funded Pre-PegIn
|
|
43
44
|
* - {@link buildPayoutPsbt} - Create payout PSBT for signing
|
|
44
45
|
* - {@link extractPayoutSignature} - Extract Schnorr signature from signed PSBT
|
|
45
46
|
* - {@link buildDepositorPayoutPsbt} - Create depositor's own Payout PSBT (depositor-as-claimer path)
|
|
@@ -99,5 +100,5 @@ export { buildChallengeAssertPsbt } from './psbt/challengeAssert';
|
|
|
99
100
|
export type { ChallengeAssertParams } from './psbt/challengeAssert';
|
|
100
101
|
export { createPayoutScript } from './scripts/payout';
|
|
101
102
|
export type { PayoutScriptParams, PayoutScriptResult } from './scripts/payout';
|
|
102
|
-
export { deriveNativeSegwitAddress, deriveTaprootAddress, hexToUint8Array, isAddressFromPublicKey, isValidHex, ensureHexPrefix, processPublicKeyToXOnly, stripHexPrefix, toXOnly, uint8ArrayToHex, validateWalletPubkey, type WalletPubkeyValidationResult, } from './utils/bitcoin';
|
|
103
|
+
export { deriveNativeSegwitAddress, deriveTaprootAddress, hexToUint8Array, isAddressFromPublicKey, isValidHex, ensureHexPrefix, formatSatoshisToBtc, processPublicKeyToXOnly, stripHexPrefix, toXOnly, uint8ArrayToHex, validateWalletPubkey, type WalletPubkeyValidationResult, } from './utils/bitcoin';
|
|
103
104
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/primitives/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3D,YAAY,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AAE5F;;;;;;GAMG;AACH,MAAM,MAAM,OAAO,GAAG,KAAK,MAAM,EAAE,CAAC;AACpC,YAAY,EACV,mCAAmC,EACnC,8BAA8B,EAC9B,qBAAqB,GACtB,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AACjF,YAAY,EACV,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,aAAa,GACd,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAE,mBAAmB,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC5G,YAAY,EACV,yBAAyB,EACzB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,YAAY,EACV,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACxE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEtD,OAAO,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAClE,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAGpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAG/E,OAAO,EACL,yBAAyB,EACzB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,KAAK,4BAA4B,GAClC,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,33 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { computeMinClaimValue as
|
|
3
|
-
import { b as g, c as y, e as
|
|
4
|
-
import { d as
|
|
1
|
+
import { i as s, g as t, h as i, d as r, a as o, b as u, c as P, e as d, f as l } from "../../../challengeAssert-D1lpvuMv.js";
|
|
2
|
+
import { computeMinClaimValue as n, deriveVaultId as p } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
+
import { a as c, b as g, c as y, e as f } from "../../../payout-DzGsAnhf.js";
|
|
4
|
+
import { d as h, a as v, e as A, f as T, h as S, i as H, b as I, p as C, s as F, t as N, u as V, v as K } from "../../../bitcoin-nOOgeRyl.js";
|
|
5
5
|
export {
|
|
6
6
|
s as buildChallengeAssertPsbt,
|
|
7
7
|
t as buildDepositorPayoutPsbt,
|
|
8
8
|
i as buildNoPayoutPsbt,
|
|
9
|
-
|
|
9
|
+
c as buildPayoutPsbt,
|
|
10
10
|
r as buildPeginInputPsbt,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
o as buildPeginTxFromFundedPrePegin,
|
|
12
|
+
u as buildPrePeginPsbt,
|
|
13
|
+
g as buildRefundPsbt,
|
|
14
|
+
n as computeMinClaimValue,
|
|
15
|
+
P as computeNumLocalChallengers,
|
|
16
16
|
y as createPayoutScript,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
T as
|
|
17
|
+
h as deriveNativeSegwitAddress,
|
|
18
|
+
v as deriveTaprootAddress,
|
|
19
|
+
p as deriveVaultId,
|
|
20
|
+
A as ensureHexPrefix,
|
|
21
|
+
f as extractPayoutSignature,
|
|
22
|
+
d as extractPeginInputSignature,
|
|
23
|
+
l as finalizePeginInputPsbt,
|
|
24
|
+
T as formatSatoshisToBtc,
|
|
25
|
+
S as hexToUint8Array,
|
|
25
26
|
H as isAddressFromPublicKey,
|
|
26
27
|
I as isValidHex,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
C as processPublicKeyToXOnly,
|
|
29
|
+
F as stripHexPrefix,
|
|
30
|
+
N as toXOnly,
|
|
31
|
+
V as uint8ArrayToHex,
|
|
32
|
+
K as validateWalletPubkey
|
|
32
33
|
};
|
|
33
34
|
//# sourceMappingURL=index.js.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Exports:
|
|
8
8
|
* - {@link buildPrePeginPsbt} - Create unfunded Pre-PegIn transaction (HTLC output)
|
|
9
|
-
* - {@link buildPeginTxFromFundedPrePegin} - Derive PegIn tx from funded Pre-PegIn
|
|
9
|
+
* - {@link buildPeginTxFromFundedPrePegin} - Derive PegIn tx from funded Pre-PegIn tx
|
|
10
10
|
* - {@link buildPeginInputPsbt} - Create PSBT for depositor to sign PegIn HTLC leaf 0 input
|
|
11
11
|
* - {@link extractPeginInputSignature} - Extract depositor signature from signed PegIn input PSBT
|
|
12
12
|
* - {@link buildPayoutPsbt} - Create payout PSBT for signing
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payout.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/payout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,KAAK,OAAO,EAEb,MAAM,uCAAuC,CAAC;
|
|
1
|
+
{"version":3,"file":"payout.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/payout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,KAAK,OAAO,EAEb,MAAM,uCAAuC,CAAC;AAsB/C;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,kBAAkB,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,sBAAsB,EAAE,MAAM,CAAC;IAE/B;;OAEG;IACH,qBAAqB,EAAE,MAAM,EAAE,CAAC;IAEhC;;OAEG;IACH,6BAA6B,EAAE,MAAM,EAAE,CAAC;IAExC;;OAEG;IACH,aAAa,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,gBAAgB,CAAC,CAqI3B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CACpC,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,EACvB,UAAU,SAAI,GACb,MAAM,CA+CR"}
|
|
@@ -38,8 +38,7 @@ export interface PrePeginPsbtResult {
|
|
|
38
38
|
* The caller is responsible for:
|
|
39
39
|
* - Selecting UTXOs covering totalOutputValue + network fees
|
|
40
40
|
* - Funding the transaction (add inputs and change output)
|
|
41
|
-
* -
|
|
42
|
-
* - Calling buildPeginTxFromFundedPrePegin() with the funded txid
|
|
41
|
+
* - Calling buildPeginTxFromFundedPrePegin() with the funded tx hex
|
|
43
42
|
*/
|
|
44
43
|
psbtHex: string;
|
|
45
44
|
/** Sum of all unfunded outputs (HTLC + CPFP anchor) — use this for UTXO selection */
|
|
@@ -56,7 +55,7 @@ export interface PrePeginPsbtResult {
|
|
|
56
55
|
depositorClaimValue: bigint;
|
|
57
56
|
}
|
|
58
57
|
/**
|
|
59
|
-
* Parameters for building the PegIn transaction from a funded Pre-PegIn
|
|
58
|
+
* Parameters for building the PegIn transaction from a funded Pre-PegIn tx
|
|
60
59
|
*/
|
|
61
60
|
export interface BuildPeginTxParams {
|
|
62
61
|
/** Same PrePeginParams used to create the Pre-PegIn transaction */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pegin.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/psbt/pegin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAGL,KAAK,OAAO,EACb,MAAM,uCAAuC,CAAC;AAI/C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,yEAAyE;IACzE,eAAe,EAAE,MAAM,CAAC;IACxB,4DAA4D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aAAa,CAAC,CA2BxB"}
|
|
@@ -106,6 +106,10 @@ export interface WalletPubkeyValidationResult {
|
|
|
106
106
|
* @throws If wallet pubkey doesn't match expected depositor pubkey
|
|
107
107
|
*/
|
|
108
108
|
export declare function validateWalletPubkey(walletPubkeyRaw: string, expectedDepositorPubkey?: string): WalletPubkeyValidationResult;
|
|
109
|
+
/**
|
|
110
|
+
* Format satoshis as a human-readable BTC string with trailing zeros removed.
|
|
111
|
+
*/
|
|
112
|
+
export declare function formatSatoshisToBtc(satoshis: bigint): string;
|
|
109
113
|
/**
|
|
110
114
|
* Map SDK network type to bitcoinjs-lib Network object.
|
|
111
115
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bitcoin.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/utils/bitcoin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,QAAQ,EAAY,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,MAAO,CAAC;AAE3C;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"bitcoin.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/utils/bitcoin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,QAAQ,EAAY,MAAM,eAAe,CAAC;AAEnD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC;AACrE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;;;G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,wBAAgB,yBAAyB,CACvC,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,OAAO,GACf,MAAM,CAiBR;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,OAAO,EAAE,OAAO,GACf,OAAO,CAgCT"}
|
|
@@ -5,5 +5,5 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @module primitives/utils
|
|
7
7
|
*/
|
|
8
|
-
export { ensureHexPrefix, hexToUint8Array, isValidHex, processPublicKeyToXOnly, stripHexPrefix, toXOnly, uint8ArrayToHex, validateWalletPubkey, type WalletPubkeyValidationResult, } from './bitcoin';
|
|
8
|
+
export { ensureHexPrefix, formatSatoshisToBtc, hexToUint8Array, isValidHex, processPublicKeyToXOnly, stripHexPrefix, toXOnly, uint8ArrayToHex, validateWalletPubkey, type WalletPubkeyValidationResult, } from './bitcoin';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,eAAe,EACf,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,cAAc,EACd,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,KAAK,4BAA4B,GAClC,MAAM,WAAW,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/primitives/utils/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,UAAU,EACV,uBAAuB,EACvB,cAAc,EACd,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,KAAK,4BAA4B,GAClC,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activateVault.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/activation/__tests__/activateVault.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Abi, Address, Hash, Hex } from 'viem';
|
|
2
|
+
/**
|
|
3
|
+
* A single ETH contract-write call. The SDK assembles these; the caller
|
|
4
|
+
* executes them via viem, wagmi, a wallet provider, or any other transport.
|
|
5
|
+
*/
|
|
6
|
+
export interface EthContractWriteCall {
|
|
7
|
+
address: Address;
|
|
8
|
+
abi: Abi;
|
|
9
|
+
functionName: string;
|
|
10
|
+
args: readonly unknown[];
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Minimum shape the SDK requires from any contract-write result. Callers may
|
|
14
|
+
* return richer objects (e.g. including the receipt) — the SDK propagates
|
|
15
|
+
* them unchanged via the generic parameter on {@link EthContractWriter}.
|
|
16
|
+
*/
|
|
17
|
+
export interface EthContractWriteResult {
|
|
18
|
+
transactionHash: Hash;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Caller-provided contract writer. The generic `R` lets callers return any
|
|
22
|
+
* transport-specific result shape (e.g. `{ transactionHash, receipt }`);
|
|
23
|
+
* the SDK forwards that shape back through `activateVault`.
|
|
24
|
+
*/
|
|
25
|
+
export type EthContractWriter<R extends EthContractWriteResult = EthContractWriteResult> = (call: EthContractWriteCall) => Promise<R>;
|
|
26
|
+
export interface ActivateVaultInput<R extends EthContractWriteResult = EthContractWriteResult> {
|
|
27
|
+
/** BTCVaultRegistry contract address (env-specific). */
|
|
28
|
+
btcVaultRegistryAddress: Address;
|
|
29
|
+
/** Vault ID (bytes32, 0x-prefixed). */
|
|
30
|
+
vaultId: Hex;
|
|
31
|
+
/**
|
|
32
|
+
* HTLC secret preimage (bytes32). A missing `0x` prefix or an uppercase
|
|
33
|
+
* `0X` prefix is normalised before validation.
|
|
34
|
+
*/
|
|
35
|
+
secret: string;
|
|
36
|
+
/**
|
|
37
|
+
* Optional hashlock for client-side pre-validation. When provided, the SDK
|
|
38
|
+
* rejects before calling `writeContract` if `sha256(secret) != hashlock`.
|
|
39
|
+
*/
|
|
40
|
+
hashlock?: Hex;
|
|
41
|
+
/**
|
|
42
|
+
* Activation metadata passed through to the contract. Required to keep
|
|
43
|
+
* the "empty metadata" convention explicit at the call site — pass `"0x"`
|
|
44
|
+
* (empty bytes) when no metadata is needed. Must be a 0x-prefixed hex
|
|
45
|
+
* string with an even number of hex chars.
|
|
46
|
+
*/
|
|
47
|
+
activationMetadata: Hex;
|
|
48
|
+
/** Caller-provided write callback — see {@link EthContractWriter}. */
|
|
49
|
+
writeContract: EthContractWriter<R>;
|
|
50
|
+
/**
|
|
51
|
+
* Optional abort signal. Checked before validation runs; since validation
|
|
52
|
+
* is fully synchronous, cancellation between validation and the write is
|
|
53
|
+
* not observable and callers should rely on the transport's own
|
|
54
|
+
* cancellation support for that window.
|
|
55
|
+
*/
|
|
56
|
+
signal?: AbortSignal;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Reveal the HTLC secret on Ethereum and activate the vault.
|
|
60
|
+
*
|
|
61
|
+
* Validates inputs, optionally pre-checks the secret against the expected
|
|
62
|
+
* hashlock, and delegates the contract write to `writeContract`. Returns
|
|
63
|
+
* whatever the writer returns so callers can keep richer transport-specific
|
|
64
|
+
* metadata (e.g. viem receipts) end-to-end.
|
|
65
|
+
*
|
|
66
|
+
* @throws `Error` if `btcVaultRegistryAddress` is not a valid 20-byte address
|
|
67
|
+
* @throws `Error` if `vaultId` or `secret` is not a valid 32-byte hex
|
|
68
|
+
* @throws `Error` if `hashlock` is provided and is not a valid 32-byte hex,
|
|
69
|
+
* or if `sha256(secret) != hashlock`
|
|
70
|
+
* @throws `Error` if `activationMetadata` is not a 0x-prefixed hex byte
|
|
71
|
+
* string (must have an even number of hex chars). Pass `"0x"` for
|
|
72
|
+
* empty metadata.
|
|
73
|
+
* @throws whatever the injected `writeContract` throws
|
|
74
|
+
* @throws `AbortError` / caller-provided abort reason if `signal` aborts
|
|
75
|
+
*/
|
|
76
|
+
export declare function activateVault<R extends EthContractWriteResult = EthContractWriteResult>(input: ActivateVaultInput<R>): Promise<R>;
|
|
77
|
+
//# sourceMappingURL=activateVault.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activateVault.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/activation/activateVault.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AA2CpD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,GAAG,CAAC;IACT,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;CAC1B;AAED;;;;GAIG;AACH,MAAM,WAAW,sBAAsB;IACrC,eAAe,EAAE,IAAI,CAAC;CACvB;AAED;;;;GAIG;AACH,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,sBAAsB,GAAG,sBAAsB,IAAI,CACzF,IAAI,EAAE,oBAAoB,KACvB,OAAO,CAAC,CAAC,CAAC,CAAC;AAEhB,MAAM,WAAW,kBAAkB,CACjC,CAAC,SAAS,sBAAsB,GAAG,sBAAsB;IAEzD,wDAAwD;IACxD,uBAAuB,EAAE,OAAO,CAAC;IACjC,uCAAuC;IACvC,OAAO,EAAE,GAAG,CAAC;IACb;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf;;;;;OAKG;IACH,kBAAkB,EAAE,GAAG,CAAC;IACxB,sEAAsE;IACtE,aAAa,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;IACpC;;;;;OAKG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,aAAa,CACjC,CAAC,SAAS,sBAAsB,GAAG,sBAAsB,EACzD,KAAK,EAAE,kBAAkB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAmC1C"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Vault activation service — reveal HTLC secret on Ethereum.
|
|
3
|
+
*
|
|
4
|
+
* @module services/activation
|
|
5
|
+
*/
|
|
6
|
+
export { activateVault, type ActivateVaultInput, type EthContractWriteCall, type EthContractWriteResult, type EthContractWriter, } from './activateVault';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/activation/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,GACvB,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"peginState.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/deposit/__tests__/peginState.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validation.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/deposit/__tests__/validation.test.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
|
@@ -7,4 +7,8 @@ export { signDepositorGraph } from './signDepositorGraph';
|
|
|
7
7
|
export type { SignDepositorGraphParams } from './signDepositorGraph';
|
|
8
8
|
export { pollAndSignPayouts } from './signAndSubmitPayouts';
|
|
9
9
|
export type { PayoutSigningContext, PollAndSignPayoutsParams, } from './signAndSubmitPayouts';
|
|
10
|
+
export { ContractStatus, PeginAction, canPerformAction, getPeginProtocolState, } from './peginState';
|
|
11
|
+
export type { ExpirationReason, GetPeginProtocolStateOptions, PeginProtocolState, } from './peginState';
|
|
12
|
+
export { isDepositAmountValid, validateDepositAmount, validateRemainingCapacity, validateProviderSelection, validateVaultAmounts, validateVaultProviderPubkey, validateMultiVaultDepositInputs, } from './validation';
|
|
13
|
+
export type { ValidationResult, DepositFormValidityParams, RemainingCapacityParams, MultiVaultDepositFlowInputs, } from './validation';
|
|
10
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EACV,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/services/deposit/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,iBAAiB,EACjB,gBAAgB,EAChB,aAAa,EACb,sBAAsB,GACvB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,YAAY,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EACV,oBAAoB,EACpB,wBAAwB,GACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,gBAAgB,EAChB,4BAA4B,EAC5B,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,yBAAyB,EACzB,oBAAoB,EACpB,2BAA2B,EAC3B,+BAA+B,GAChC,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,gBAAgB,EAChB,yBAAyB,EACzB,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,cAAc,CAAC"}
|