@babylonlabs-io/ts-sdk 0.35.0 → 0.36.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/buildAndBroadcastRefund-D4YqqClN.js +872 -0
- package/dist/buildAndBroadcastRefund-D4YqqClN.js.map +1 -0
- package/dist/buildAndBroadcastRefund-DSELaUiR.cjs +2 -0
- package/dist/buildAndBroadcastRefund-DSELaUiR.cjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +73 -69
- package/dist/tbv/core/clients/eth/types.d.ts +1 -0
- package/dist/tbv/core/clients/eth/types.d.ts.map +1 -1
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts +1 -0
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -1
- package/dist/tbv/core/clients/index.cjs +1 -1
- package/dist/tbv/core/clients/index.js +1 -1
- package/dist/tbv/core/clients/vault-provider/auth/gatedMethods.d.ts.map +1 -1
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.js +66 -62
- package/dist/tbv/core/services/deposit/__tests__/validateOnChainParticipantKeys.test.d.ts +2 -0
- package/dist/tbv/core/services/deposit/__tests__/validateOnChainParticipantKeys.test.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/__tests__/verifyRegisteredVaultVersions.test.d.ts +2 -0
- package/dist/tbv/core/services/deposit/__tests__/verifyRegisteredVaultVersions.test.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/index.d.ts +8 -12
- package/dist/tbv/core/services/deposit/index.d.ts.map +1 -1
- package/dist/tbv/core/services/deposit/validateOnChainParticipantKeys.d.ts +21 -0
- package/dist/tbv/core/services/deposit/validateOnChainParticipantKeys.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/verifyRegisteredVaultVersions.d.ts +15 -0
- package/dist/tbv/core/services/deposit/verifyRegisteredVaultVersions.d.ts.map +1 -0
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +23 -19
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +66 -62
- package/dist/tbv/integrations/aave/constants.d.ts +15 -2
- package/dist/tbv/integrations/aave/constants.d.ts.map +1 -1
- 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 +1 -1
- package/dist/tbv/integrations/aave/index.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/index.js +94 -93
- package/dist/tbv/integrations/aave/index.js.map +1 -1
- package/dist/vault-registry-reader-CLnhAUN4.cjs +2 -0
- package/dist/vault-registry-reader-CLnhAUN4.cjs.map +1 -0
- package/dist/{vault-registry-reader-BBk0p-u-.js → vault-registry-reader-CrLodprY.js} +228 -197
- package/dist/vault-registry-reader-CrLodprY.js.map +1 -0
- package/package.json +1 -1
- package/dist/buildAndBroadcastRefund-BQ0CaL6Q.cjs +0 -2
- package/dist/buildAndBroadcastRefund-BQ0CaL6Q.cjs.map +0 -1
- package/dist/buildAndBroadcastRefund-DzX11N9S.js +0 -785
- package/dist/buildAndBroadcastRefund-DzX11N9S.js.map +0 -1
- package/dist/vault-registry-reader-BBk0p-u-.js.map +0 -1
- package/dist/vault-registry-reader-DQgnZilV.cjs +0 -2
- package/dist/vault-registry-reader-DQgnZilV.cjs.map +0 -1
package/dist/tbv/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { a as s, b as t, c as r } from "../challengeAssert-BzxQmdZy.js";
|
|
2
2
|
import { computeMinClaimValue as i, deriveVaultId as n, expandAuthAnchor as l, expandHashlockSecret as u, expandWotsSeed as d } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
-
import { c as P, a as c, b as T, e as S, f as
|
|
4
|
-
import { a as
|
|
3
|
+
import { c as P, a as c, b as T, e as S, f as E } from "../peginInput-C2QPvuhR.js";
|
|
4
|
+
import { a as g, b as A } from "../noPayout-DBX6G96_.js";
|
|
5
5
|
import { a as _, b as x, c as f, e as b } from "../payout-BNFMBXS6.js";
|
|
6
|
-
import { d as
|
|
6
|
+
import { d as I, a as V, e as C, f as O, g as U, h, i as y, b as F, p as N, s as B, t as D, u as M, v as H } from "../bitcoin-B0S8SHCX.js";
|
|
7
7
|
import { c as k } from "../signing-DaLvGwQe.js";
|
|
8
8
|
import { B as X, H as w, K, M as G, T as Y } from "../validation-CxqROCno.js";
|
|
9
9
|
import { P as J, V as j, b as z, a as q, c as Q, e as $, d as aa } from "../PeginManager-DF1oinIQ.js";
|
|
@@ -11,32 +11,32 @@ import { P as sa, c as ta, v as ra } from "../PayoutManager-s_uH8Uuj.js";
|
|
|
11
11
|
import { A as ia, P as na } from "../ProtocolParams.abi-DXu8L0Fn.js";
|
|
12
12
|
import { B as ua } from "../BTCVaultRegistry.abi-DbJ5lsFJ.js";
|
|
13
13
|
import { C as pa, e as Pa, g as ca, h as Ta, i as Sa } from "../errors-CznAK5NB.js";
|
|
14
|
-
import { B as
|
|
15
|
-
import { U as
|
|
14
|
+
import { B as Ra, D as ga, F as Aa, L as ma, M as _a, P as xa, b as fa, a as ba, S as va, T as Ia, W as Va, f as Ca, c as Oa, p as Ua, r as ha } from "../fundPeginTransaction-oV-dNJOU.js";
|
|
15
|
+
import { U as Fa, a as Na, c as Ba, e as Da, s as Ma, v as Ha } from "../reservation-CHUGW0F_.js";
|
|
16
16
|
import { B as ka, c as Wa, g as Xa, d as wa, b as Ka, s as Ga, a as Ya, w as Za } from "../waitForTransactionReceiptSmartAware-Cj_DKm0G.js";
|
|
17
17
|
import { M as ja, g as za, a as qa, b as Qa, c as $a, d as ae, e as ee, f as se, p as te } from "../mempoolApi-CAIge7Nj.js";
|
|
18
|
-
import { S as oe, V as ie, j as ne, k as le, l as ue, m as de, a as pe, d as Pe, b as ce, f as Te, p as Se, r as
|
|
19
|
-
import { D as be, b as
|
|
18
|
+
import { S as oe, V as ie, j as ne, k as le, l as ue, m as de, a as pe, d as Pe, b as ce, f as Te, p as Se, r as Ee, g as Re, h as ge, v as Ae, i as me, c as _e, e as xe } from "../vault-registry-reader-CrLodprY.js";
|
|
19
|
+
import { D as be, b as ve, J as Ie, a as Ve, d as Ce, P as Oe, R as Ue, e as he, c as ye, V as Fe } from "../types-TiIjyo2b.js";
|
|
20
20
|
import { i as Be, p as De } from "../errors-9AkghWyk.js";
|
|
21
|
-
import { B as He, C as Le,
|
|
22
|
-
import { C as
|
|
21
|
+
import { B as He, C as Le, p as ke, R as We, a as Xe, n as we, o as Ke, i as Ge, m as Ye, l as Ze, j as Je, r as je, b as ze, s as qe, v as Qe, g as $e, h as as, d as es, c as ss, e as ts, f as rs, k as os, w as is } from "../buildAndBroadcastRefund-D4YqqClN.js";
|
|
22
|
+
import { C as ls, P as us, c as ds, g as ps } from "../peginState-CBAlxgXk.js";
|
|
23
23
|
export {
|
|
24
24
|
ia as ApplicationRegistryABI,
|
|
25
25
|
He as BIP68NotMatureError,
|
|
26
26
|
X as BITCOIN_ADDRESS_RE,
|
|
27
27
|
ua as BTCVaultRegistryABI,
|
|
28
|
-
|
|
28
|
+
Ra as BTC_DUST_SAT,
|
|
29
29
|
ka as BitcoinScriptType,
|
|
30
30
|
pa as CONTRACT_ERRORS,
|
|
31
31
|
Le as ClaimerPegoutStatusValue,
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
ls as ContractStatus,
|
|
33
|
+
ga as DUST_THRESHOLD,
|
|
34
34
|
be as DaemonStatus,
|
|
35
|
-
|
|
35
|
+
Aa as FEE_SAFETY_MARGIN,
|
|
36
36
|
w as HEX_RE,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
ve as JSON_RPC_ERROR_CODES,
|
|
38
|
+
Ie as JsonRpcClient,
|
|
39
|
+
Ve as JsonRpcError,
|
|
40
40
|
K as KNOWN_SCRIPT_PREFIXES,
|
|
41
41
|
ma as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
42
42
|
_a as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
@@ -45,23 +45,24 @@ export {
|
|
|
45
45
|
xa as P2TR_INPUT_SIZE,
|
|
46
46
|
fa as PEGIN_AUTH_ANCHOR_OUTPUTS,
|
|
47
47
|
ba as PEGIN_FIXED_OUTPUTS,
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
Ce as POST_WOTS_STATUSES,
|
|
49
|
+
Oe as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
50
50
|
sa as PayoutManager,
|
|
51
|
-
|
|
51
|
+
us as PeginAction,
|
|
52
52
|
J as PeginManager,
|
|
53
53
|
na as ProtocolParamsABI,
|
|
54
54
|
ke as REFUND_VSIZE,
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
We as RegisteredVaultVersionMismatchError,
|
|
56
|
+
Ue as RpcErrorCode,
|
|
57
|
+
va as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
57
58
|
oe as ServerIdentityError,
|
|
58
59
|
Y as TXID_RE,
|
|
59
|
-
|
|
60
|
-
|
|
60
|
+
Ia as TX_BUFFER_SIZE_OVERHEAD,
|
|
61
|
+
Fa as UtxoNotAvailableError,
|
|
61
62
|
j as VAULT_APP_NAME,
|
|
62
|
-
|
|
63
|
+
he as VP_BATCH_MAX_SIZE,
|
|
63
64
|
ye as VP_TERMINAL_STATUSES,
|
|
64
|
-
|
|
65
|
+
Fe as VP_TRANSIENT_STATUSES,
|
|
65
66
|
ie as VaultProviderRpcClient,
|
|
66
67
|
ne as ViemProtocolParamsReader,
|
|
67
68
|
le as ViemUniversalChallengerReader,
|
|
@@ -69,24 +70,24 @@ export {
|
|
|
69
70
|
de as ViemVaultRegistryReader,
|
|
70
71
|
pe as VpResponseValidationError,
|
|
71
72
|
Pe as VpTokenRegistry,
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
Va as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
74
|
+
Xe as activateVault,
|
|
74
75
|
_ as assertPayoutOutputMatchesRegistered,
|
|
75
76
|
Na as assertUtxosAvailable,
|
|
76
77
|
ce as batchPollByProvider,
|
|
77
|
-
|
|
78
|
+
we as buildAndBroadcastRefund,
|
|
78
79
|
s as buildChallengeAssertPsbt,
|
|
79
80
|
t as buildDepositorPayoutPsbt,
|
|
80
81
|
z as buildFundingOutpointsCommitment,
|
|
81
|
-
|
|
82
|
+
g as buildNoPayoutPsbt,
|
|
82
83
|
x as buildPayoutPsbt,
|
|
83
84
|
P as buildPeginInputPsbt,
|
|
84
85
|
c as buildPeginTxFromFundedPrePegin,
|
|
85
86
|
T as buildPrePeginPsbt,
|
|
86
|
-
|
|
87
|
+
A as buildRefundPsbt,
|
|
87
88
|
q as buildVaultContext,
|
|
88
89
|
Wa as calculateBtcTxHash,
|
|
89
|
-
|
|
90
|
+
ds as canPerformAction,
|
|
90
91
|
Ba as collectReservedUtxoRefs,
|
|
91
92
|
ta as computeHashlock,
|
|
92
93
|
i as computeMinClaimValue,
|
|
@@ -95,13 +96,13 @@ export {
|
|
|
95
96
|
Te as createAuthenticatedVpClient,
|
|
96
97
|
f as createPayoutScript,
|
|
97
98
|
k as createTaprootScriptPathSignOptions,
|
|
98
|
-
|
|
99
|
-
|
|
99
|
+
I as deriveNativeSegwitAddress,
|
|
100
|
+
V as deriveTaprootAddress,
|
|
100
101
|
n as deriveVaultId,
|
|
101
102
|
$ as deriveVaultRoot,
|
|
102
103
|
aa as deriveWotsBlocksFromSeed,
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
C as ensureHexPrefix,
|
|
105
|
+
Ke as estimateRefundFeeSats,
|
|
105
106
|
l as expandAuthAnchor,
|
|
106
107
|
u as expandHashlockSecret,
|
|
107
108
|
d as expandWotsSeed,
|
|
@@ -109,64 +110,67 @@ export {
|
|
|
109
110
|
Da as extractInputsFromTransaction,
|
|
110
111
|
b as extractPayoutSignature,
|
|
111
112
|
S as extractPeginInputSignature,
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
113
|
+
E as finalizePeginInputPsbt,
|
|
114
|
+
O as formatSatoshisToBtc,
|
|
115
|
+
Ca as fundPeginTransaction,
|
|
115
116
|
za as getAddressTxs,
|
|
116
117
|
qa as getAddressUtxos,
|
|
117
118
|
ca as getContractErrorMessage,
|
|
118
119
|
Xa as getDustThreshold,
|
|
119
120
|
Qa as getMempoolApiUrl,
|
|
120
|
-
|
|
121
|
+
U as getNetwork,
|
|
121
122
|
$a as getNetworkFees,
|
|
122
|
-
|
|
123
|
+
ps as getPeginProtocolState,
|
|
123
124
|
wa as getPsbtInputFields,
|
|
124
125
|
Ka as getScriptType,
|
|
125
126
|
ae as getTxHex,
|
|
126
127
|
ee as getTxInfo,
|
|
127
128
|
se as getUtxoInfo,
|
|
128
129
|
Ta as handleContractError,
|
|
129
|
-
|
|
130
|
+
h as hexToUint8Array,
|
|
130
131
|
y as isAddressFromPublicKey,
|
|
131
|
-
|
|
132
|
+
Ge as isDepositAmountValid,
|
|
132
133
|
Sa as isKnownContractError,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
Ye as isPegoutTerminalStatus,
|
|
135
|
+
Ze as isRecognizedPegoutStatus,
|
|
136
|
+
Je as isRegisteredVaultVersionMismatchError,
|
|
137
|
+
F as isValidHex,
|
|
136
138
|
Be as isWotsMismatchError,
|
|
137
139
|
De as parseFundingOutpointsFromTx,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
Oa as parseUnfundedWasmTransaction,
|
|
141
|
+
Ua as peginOutputCount,
|
|
140
142
|
Se as primeVpTokenRegistry,
|
|
141
143
|
N as processPublicKeyToXOnly,
|
|
142
144
|
te as pushTx,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
145
|
+
ha as rateBasedTxBufferFee,
|
|
146
|
+
Ee as resolveProtocolAddresses,
|
|
147
|
+
je as runDepositorPresignFlow,
|
|
146
148
|
Ma as selectUtxosForDeposit,
|
|
147
149
|
Ga as selectUtxosForPegin,
|
|
148
150
|
Ya as shouldAddChangeOutput,
|
|
149
|
-
|
|
151
|
+
ze as signDepositorGraph,
|
|
150
152
|
B as stripHexPrefix,
|
|
151
|
-
|
|
153
|
+
qe as submitWotsPublicKey,
|
|
152
154
|
D as toXOnly,
|
|
153
155
|
M as uint8ArrayToHex,
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
156
|
+
Qe as validateDepositAmount,
|
|
157
|
+
$e as validateMultiVaultDepositInputs,
|
|
158
|
+
Re as validateOffchainParams,
|
|
159
|
+
as as validateOnChainParticipantKeys,
|
|
160
|
+
ge as validatePegInConfiguration,
|
|
161
|
+
es as validateProviderSelection,
|
|
162
|
+
ss as validateRemainingCapacity,
|
|
163
|
+
Ae as validateRequestDepositorClaimerArtifactsResponse,
|
|
161
164
|
ra as validateSecretAgainstHashlock,
|
|
162
165
|
me as validateTBVProtocolParams,
|
|
163
166
|
Ha as validateUtxosAvailable,
|
|
164
|
-
|
|
165
|
-
|
|
167
|
+
ts as validateVaultAmounts,
|
|
168
|
+
rs as validateVaultProviderPubkey,
|
|
166
169
|
H as validateWalletPubkey,
|
|
170
|
+
os as verifyRegisteredVaultVersions,
|
|
167
171
|
_e as verifyServerIdentity,
|
|
168
172
|
xe as vpTokenRegistry,
|
|
169
|
-
|
|
173
|
+
is as waitForPeginStatus,
|
|
170
174
|
Za as waitForTransactionReceiptSmartAware
|
|
171
175
|
};
|
|
172
176
|
//# sourceMappingURL=index.js.map
|
|
@@ -82,7 +82,20 @@ export declare const MIN_HEALTH_FACTOR_FOR_BORROW = 1.2;
|
|
|
82
82
|
/**
|
|
83
83
|
* Buffer for full repayment to account for interest accrual
|
|
84
84
|
* between fetching debt and transaction execution.
|
|
85
|
-
*
|
|
85
|
+
*
|
|
86
|
+
* 0.5% buffer (50 basis points). Sized to absorb hours of execution delay
|
|
87
|
+
* (e.g. Safe-multisig quorum collection) without leaving residual dust.
|
|
88
|
+
* The adapter only pulls what's actually owed; excess approval/balance
|
|
89
|
+
* stays with the user.
|
|
90
|
+
*
|
|
91
|
+
* Users whose wallet balance covers the debt but not the full buffer are
|
|
92
|
+
* routed through the "max-capped" repay path instead of `repayFull`, so
|
|
93
|
+
* a larger buffer never blocks a legitimate max-repay.
|
|
94
|
+
*/
|
|
95
|
+
export declare const FULL_REPAY_BUFFER_DIVISOR = 200n;
|
|
96
|
+
/**
|
|
97
|
+
* Same buffer as `FULL_REPAY_BUFFER_DIVISOR`, expressed as a float fraction
|
|
98
|
+
* for UI-side comparisons that operate in `number` rather than `bigint`.
|
|
86
99
|
*/
|
|
87
|
-
export declare const
|
|
100
|
+
export declare const FULL_REPAY_BUFFER_FRACTION: number;
|
|
88
101
|
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tbv/integrations/aave/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;IAC9B,kEAAkE;;IAElE,sCAAsC;;IAEtC,wCAAwC;;IAExC,6DAA6D;;CAErD,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,QAAQ,CAAC;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B;;;GAGG;AACH,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/tbv/integrations/aave/constants.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,eAAO,MAAM,mBAAmB;IAC9B,kEAAkE;;IAElE,sCAAsC;;IAEtC,wCAAwC;;IAExC,6DAA6D;;CAErD,CAAC;AAEX;;;GAGG;AACH,eAAO,MAAM,YAAY,IAAI,CAAC;AAE9B;;;GAGG;AACH,eAAO,MAAM,aAAa,IAAI,CAAC;AAE/B;;;;;;;;;;GAUG;AACH,eAAO,MAAM,sBAAsB,MAAM,CAAC;AAE1C;;;;;GAKG;AACH,eAAO,MAAM,SAAS,QAAQ,CAAC;AAE/B;;;;;GAKG;AACH,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C;;;;;;GAMG;AACH,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAElD;;;;;GAKG;AACH,eAAO,MAAM,YAAY,KAAK,CAAC;AAE/B;;;GAGG;AACH,eAAO,MAAM,+BAA+B,MAAM,CAAC;AAEnD;;;GAGG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,yBAAyB,OAAO,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,0BAA0B,QACA,CAAC"}
|