@babylonlabs-io/ts-sdk 0.34.0 → 0.35.0
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/{PayoutManager-DDnNB0mj.cjs → PayoutManager-BhJoQZsG.cjs} +2 -2
- package/dist/PayoutManager-BhJoQZsG.cjs.map +1 -0
- package/dist/{PayoutManager-C9XHKZ5j.js → PayoutManager-s_uH8Uuj.js} +2 -2
- package/dist/PayoutManager-s_uH8Uuj.js.map +1 -0
- package/dist/PeginManager-DF1oinIQ.js +1172 -0
- package/dist/PeginManager-DF1oinIQ.js.map +1 -0
- package/dist/PeginManager-cPQuJTB9.cjs +2 -0
- package/dist/PeginManager-cPQuJTB9.cjs.map +1 -0
- package/dist/{buildAndBroadcastRefund-C7hnNWbj.cjs → buildAndBroadcastRefund-BQ0CaL6Q.cjs} +2 -2
- package/dist/{buildAndBroadcastRefund-C7hnNWbj.cjs.map → buildAndBroadcastRefund-BQ0CaL6Q.cjs.map} +1 -1
- package/dist/{buildAndBroadcastRefund-B6fGRmvo.js → buildAndBroadcastRefund-DzX11N9S.js} +2 -2
- package/dist/{buildAndBroadcastRefund-B6fGRmvo.js.map → buildAndBroadcastRefund-DzX11N9S.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +124 -123
- package/dist/sha2-BYVxyZzX.js +274 -0
- package/dist/{sha2-6wN58S6R.js.map → sha2-BYVxyZzX.js.map} +1 -1
- package/dist/sha2-DsrLC4NM.cjs +2 -0
- package/dist/{sha2-CsTynrfJ.cjs.map → sha2-DsrLC4NM.cjs.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/index.cjs +1 -1
- package/dist/tbv/core/index.js +134 -133
- package/dist/tbv/core/managers/PeginManager.d.ts.map +1 -1
- package/dist/tbv/core/managers/index.cjs +1 -1
- package/dist/tbv/core/managers/index.js +2 -2
- package/dist/tbv/core/services/index.cjs +1 -1
- package/dist/tbv/core/services/index.js +2 -2
- package/dist/tbv/core/utils/eth/__tests__/waitForTransactionReceiptSmartAware.test.d.ts +2 -0
- package/dist/tbv/core/utils/eth/__tests__/waitForTransactionReceiptSmartAware.test.d.ts.map +1 -0
- package/dist/tbv/core/utils/eth/index.d.ts +2 -0
- package/dist/tbv/core/utils/eth/index.d.ts.map +1 -0
- package/dist/tbv/core/utils/eth/waitForTransactionReceiptSmartAware.d.ts +18 -0
- package/dist/tbv/core/utils/eth/waitForTransactionReceiptSmartAware.d.ts.map +1 -0
- package/dist/tbv/core/utils/index.cjs +1 -1
- package/dist/tbv/core/utils/index.d.ts +1 -0
- package/dist/tbv/core/utils/index.d.ts.map +1 -1
- package/dist/tbv/core/utils/index.js +14 -13
- package/dist/tbv/core/vault-secrets/__tests__/deriveVaultRoot.test.d.ts +1 -1
- package/dist/tbv/core/vault-secrets/__tests__/expand.test.d.ts +4 -6
- package/dist/tbv/core/vault-secrets/__tests__/expand.test.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts +1 -1
- package/dist/tbv/core/vault-secrets/deriveVaultRoot.d.ts.map +1 -1
- package/dist/tbv/core/vault-secrets/index.d.ts +1 -1
- package/dist/tbv/core/vault-secrets/index.d.ts.map +1 -1
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +134 -133
- package/dist/testing/index.cjs +1 -1
- package/dist/testing/index.js +1 -1
- package/dist/{vault-registry-reader-CqhD3Iyd.js → vault-registry-reader-BBk0p-u-.js} +2 -2
- package/dist/{vault-registry-reader-CqhD3Iyd.js.map → vault-registry-reader-BBk0p-u-.js.map} +1 -1
- package/dist/{vault-registry-reader-Brkh1j7p.cjs → vault-registry-reader-DQgnZilV.cjs} +2 -2
- package/dist/{vault-registry-reader-Brkh1j7p.cjs.map → vault-registry-reader-DQgnZilV.cjs.map} +1 -1
- package/dist/waitForTransactionReceiptSmartAware-Cj_DKm0G.js +217 -0
- package/dist/waitForTransactionReceiptSmartAware-Cj_DKm0G.js.map +1 -0
- package/dist/waitForTransactionReceiptSmartAware-D9ykVriz.cjs +2 -0
- package/dist/waitForTransactionReceiptSmartAware-D9ykVriz.cjs.map +1 -0
- package/package.json +1 -2
- package/dist/PayoutManager-C9XHKZ5j.js.map +0 -1
- package/dist/PayoutManager-DDnNB0mj.cjs.map +0 -1
- package/dist/PeginManager-C8-I4gFH.js +0 -1280
- package/dist/PeginManager-C8-I4gFH.js.map +0 -1
- package/dist/PeginManager-D0TW9RET.cjs +0 -2
- package/dist/PeginManager-D0TW9RET.cjs.map +0 -1
- package/dist/psbtInputFields-2224j2ZY.js +0 -128
- package/dist/psbtInputFields-2224j2ZY.js.map +0 -1
- package/dist/psbtInputFields-B1lrwYzH.cjs +0 -2
- package/dist/psbtInputFields-B1lrwYzH.cjs.map +0 -1
- package/dist/sha2-6wN58S6R.js +0 -280
- package/dist/sha2-CsTynrfJ.cjs +0 -2
- package/dist/tbv/core/vault-secrets/__tests__/info.test.d.ts +0 -8
- package/dist/tbv/core/vault-secrets/__tests__/info.test.d.ts.map +0 -1
- package/dist/tbv/core/vault-secrets/expand.d.ts +0 -58
- package/dist/tbv/core/vault-secrets/expand.d.ts.map +0 -1
- package/dist/tbv/core/vault-secrets/info.d.ts +0 -55
- package/dist/tbv/core/vault-secrets/info.d.ts.map +0 -1
package/dist/tbv/index.js
CHANGED
|
@@ -1,171 +1,172 @@
|
|
|
1
|
-
import { a as
|
|
2
|
-
import { computeMinClaimValue as i, deriveVaultId as n } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
-
import { c as
|
|
4
|
-
import { a as
|
|
5
|
-
import { a as
|
|
6
|
-
import { d as
|
|
7
|
-
import { c as
|
|
8
|
-
import { B as
|
|
9
|
-
import { P as
|
|
10
|
-
import { P as
|
|
1
|
+
import { a as s, b as t, c as r } from "../challengeAssert-BzxQmdZy.js";
|
|
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 A } from "../peginInput-C2QPvuhR.js";
|
|
4
|
+
import { a as R, b as g } from "../noPayout-DBX6G96_.js";
|
|
5
|
+
import { a as _, b as x, c as f, e as b } from "../payout-BNFMBXS6.js";
|
|
6
|
+
import { d as v, a as C, e as U, f as V, g as O, h as F, i as y, b as h, p as N, s as B, t as D, u as M, v as H } from "../bitcoin-B0S8SHCX.js";
|
|
7
|
+
import { c as k } from "../signing-DaLvGwQe.js";
|
|
8
|
+
import { B as X, H as w, K, M as G, T as Y } from "../validation-CxqROCno.js";
|
|
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";
|
|
10
|
+
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
|
-
import { C as
|
|
14
|
-
import { B as
|
|
15
|
-
import { U as
|
|
16
|
-
import { B as ka, c as Wa, g as Xa, d as
|
|
17
|
-
import { M as
|
|
18
|
-
import { S as
|
|
19
|
-
import { D as
|
|
20
|
-
import { i as
|
|
21
|
-
import { B as
|
|
22
|
-
import { C as
|
|
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 Ea, D as Ra, F as ga, L as ma, M as _a, P as xa, b as fa, a as ba, S as Ia, T as va, W as Ca, f as Ua, c as Va, p as Oa, r as Fa } from "../fundPeginTransaction-oV-dNJOU.js";
|
|
15
|
+
import { U as ha, a as Na, c as Ba, e as Da, s as Ma, v as Ha } from "../reservation-CHUGW0F_.js";
|
|
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
|
+
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 Ae, g as Ee, h as Re, v as ge, i as me, c as _e, e as xe } from "../vault-registry-reader-BBk0p-u-.js";
|
|
19
|
+
import { D as be, b as Ie, J as ve, a as Ce, d as Ue, P as Ve, R as Oe, e as Fe, c as ye, V as he } from "../types-TiIjyo2b.js";
|
|
20
|
+
import { i as Be, p as De } from "../errors-9AkghWyk.js";
|
|
21
|
+
import { B as He, C as Le, R as ke, a as We, k as Xe, l as we, i as Ke, j as Ge, h as Ye, r as Ze, b as Je, s as je, v as ze, g as qe, d as Qe, c as $e, e as as, f as es, w as ss } from "../buildAndBroadcastRefund-DzX11N9S.js";
|
|
22
|
+
import { C as rs, P as os, c as is, g as ns } from "../peginState-CBAlxgXk.js";
|
|
23
23
|
export {
|
|
24
24
|
ia as ApplicationRegistryABI,
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
He as BIP68NotMatureError,
|
|
26
|
+
X as BITCOIN_ADDRESS_RE,
|
|
27
27
|
ua as BTCVaultRegistryABI,
|
|
28
|
-
|
|
28
|
+
Ea as BTC_DUST_SAT,
|
|
29
29
|
ka as BitcoinScriptType,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
30
|
+
pa as CONTRACT_ERRORS,
|
|
31
|
+
Le as ClaimerPegoutStatusValue,
|
|
32
|
+
rs as ContractStatus,
|
|
33
|
+
Ra as DUST_THRESHOLD,
|
|
34
|
+
be as DaemonStatus,
|
|
35
|
+
ga as FEE_SAFETY_MARGIN,
|
|
36
|
+
w as HEX_RE,
|
|
37
|
+
Ie as JSON_RPC_ERROR_CODES,
|
|
38
|
+
ve as JsonRpcClient,
|
|
39
|
+
Ce as JsonRpcError,
|
|
40
|
+
K as KNOWN_SCRIPT_PREFIXES,
|
|
41
41
|
ma as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
42
42
|
_a as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
G as MAX_REASONABLE_FEE_SATS,
|
|
44
|
+
ja as MEMPOOL_API_URLS,
|
|
45
45
|
xa as P2TR_INPUT_SIZE,
|
|
46
46
|
fa as PEGIN_AUTH_ANCHOR_OUTPUTS,
|
|
47
47
|
ba as PEGIN_FIXED_OUTPUTS,
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
Ue as POST_WOTS_STATUSES,
|
|
49
|
+
Ve as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
50
|
+
sa as PayoutManager,
|
|
51
|
+
os as PeginAction,
|
|
52
|
+
J as PeginManager,
|
|
53
53
|
na as ProtocolParamsABI,
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
ke as REFUND_VSIZE,
|
|
55
|
+
Oe as RpcErrorCode,
|
|
56
56
|
Ia as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
oe as ServerIdentityError,
|
|
58
|
+
Y as TXID_RE,
|
|
59
59
|
va as TX_BUFFER_SIZE_OVERHEAD,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
60
|
+
ha as UtxoNotAvailableError,
|
|
61
|
+
j as VAULT_APP_NAME,
|
|
62
|
+
Fe as VP_BATCH_MAX_SIZE,
|
|
63
|
+
ye as VP_TERMINAL_STATUSES,
|
|
64
|
+
he as VP_TRANSIENT_STATUSES,
|
|
65
|
+
ie as VaultProviderRpcClient,
|
|
66
|
+
ne as ViemProtocolParamsReader,
|
|
67
|
+
le as ViemUniversalChallengerReader,
|
|
68
|
+
ue as ViemVaultKeeperReader,
|
|
69
|
+
de as ViemVaultRegistryReader,
|
|
70
|
+
pe as VpResponseValidationError,
|
|
71
|
+
Pe as VpTokenRegistry,
|
|
72
72
|
Ca as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
We as activateVault,
|
|
74
|
+
_ as assertPayoutOutputMatchesRegistered,
|
|
75
75
|
Na as assertUtxosAvailable,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
76
|
+
ce as batchPollByProvider,
|
|
77
|
+
Xe as buildAndBroadcastRefund,
|
|
78
|
+
s as buildChallengeAssertPsbt,
|
|
79
79
|
t as buildDepositorPayoutPsbt,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
80
|
+
z as buildFundingOutpointsCommitment,
|
|
81
|
+
R as buildNoPayoutPsbt,
|
|
82
|
+
x as buildPayoutPsbt,
|
|
83
|
+
P as buildPeginInputPsbt,
|
|
84
|
+
c as buildPeginTxFromFundedPrePegin,
|
|
85
|
+
T as buildPrePeginPsbt,
|
|
86
|
+
g as buildRefundPsbt,
|
|
87
|
+
q as buildVaultContext,
|
|
88
88
|
Wa as calculateBtcTxHash,
|
|
89
|
-
|
|
89
|
+
is as canPerformAction,
|
|
90
90
|
Ba as collectReservedUtxoRefs,
|
|
91
91
|
ta as computeHashlock,
|
|
92
92
|
i as computeMinClaimValue,
|
|
93
93
|
r as computeNumLocalChallengers,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
94
|
+
Q as computeWotsBlockPublicKeysHash,
|
|
95
|
+
Te as createAuthenticatedVpClient,
|
|
96
|
+
f as createPayoutScript,
|
|
97
|
+
k as createTaprootScriptPathSignOptions,
|
|
98
|
+
v as deriveNativeSegwitAddress,
|
|
99
|
+
C as deriveTaprootAddress,
|
|
100
100
|
n as deriveVaultId,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
$ as deriveVaultRoot,
|
|
102
|
+
aa as deriveWotsBlocksFromSeed,
|
|
103
|
+
U as ensureHexPrefix,
|
|
104
|
+
we as estimateRefundFeeSats,
|
|
105
|
+
l as expandAuthAnchor,
|
|
106
|
+
u as expandHashlockSecret,
|
|
107
|
+
d as expandWotsSeed,
|
|
108
|
+
Pa as extractErrorData,
|
|
109
109
|
Da as extractInputsFromTransaction,
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
b as extractPayoutSignature,
|
|
111
|
+
S as extractPeginInputSignature,
|
|
112
|
+
A as finalizePeginInputPsbt,
|
|
113
|
+
V as formatSatoshisToBtc,
|
|
114
114
|
Ua as fundPeginTransaction,
|
|
115
|
-
|
|
116
|
-
|
|
115
|
+
za as getAddressTxs,
|
|
116
|
+
qa as getAddressUtxos,
|
|
117
117
|
ca as getContractErrorMessage,
|
|
118
118
|
Xa as getDustThreshold,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
119
|
+
Qa as getMempoolApiUrl,
|
|
120
|
+
O as getNetwork,
|
|
121
|
+
$a as getNetworkFees,
|
|
122
|
+
ns as getPeginProtocolState,
|
|
123
|
+
wa as getPsbtInputFields,
|
|
124
|
+
Ka as getScriptType,
|
|
125
|
+
ae as getTxHex,
|
|
126
|
+
ee as getTxInfo,
|
|
127
|
+
se as getUtxoInfo,
|
|
128
128
|
Ta as handleContractError,
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
129
|
+
F as hexToUint8Array,
|
|
130
|
+
y as isAddressFromPublicKey,
|
|
131
|
+
Ke as isDepositAmountValid,
|
|
132
132
|
Sa as isKnownContractError,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
Ge as isPegoutTerminalStatus,
|
|
134
|
+
Ye as isRecognizedPegoutStatus,
|
|
135
|
+
h as isValidHex,
|
|
136
|
+
Be as isWotsMismatchError,
|
|
137
|
+
De as parseFundingOutpointsFromTx,
|
|
138
138
|
Va as parseUnfundedWasmTransaction,
|
|
139
139
|
Oa as peginOutputCount,
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
140
|
+
Se as primeVpTokenRegistry,
|
|
141
|
+
N as processPublicKeyToXOnly,
|
|
142
|
+
te as pushTx,
|
|
143
|
+
Fa as rateBasedTxBufferFee,
|
|
144
|
+
Ae as resolveProtocolAddresses,
|
|
145
|
+
Ze as runDepositorPresignFlow,
|
|
146
146
|
Ma as selectUtxosForDeposit,
|
|
147
147
|
Ga as selectUtxosForPegin,
|
|
148
148
|
Ya as shouldAddChangeOutput,
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
149
|
+
Je as signDepositorGraph,
|
|
150
|
+
B as stripHexPrefix,
|
|
151
|
+
je as submitWotsPublicKey,
|
|
152
|
+
D as toXOnly,
|
|
153
|
+
M as uint8ArrayToHex,
|
|
154
|
+
ze as validateDepositAmount,
|
|
155
|
+
qe as validateMultiVaultDepositInputs,
|
|
156
|
+
Ee as validateOffchainParams,
|
|
157
|
+
Re as validatePegInConfiguration,
|
|
158
|
+
Qe as validateProviderSelection,
|
|
159
|
+
$e as validateRemainingCapacity,
|
|
160
|
+
ge as validateRequestDepositorClaimerArtifactsResponse,
|
|
161
161
|
ra as validateSecretAgainstHashlock,
|
|
162
|
-
|
|
162
|
+
me as validateTBVProtocolParams,
|
|
163
163
|
Ha as validateUtxosAvailable,
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
164
|
+
as as validateVaultAmounts,
|
|
165
|
+
es as validateVaultProviderPubkey,
|
|
166
|
+
H as validateWalletPubkey,
|
|
167
|
+
_e as verifyServerIdentity,
|
|
168
|
+
xe as vpTokenRegistry,
|
|
169
|
+
ss as waitForPeginStatus,
|
|
170
|
+
Za as waitForTransactionReceiptSmartAware
|
|
170
171
|
};
|
|
171
172
|
//# sourceMappingURL=index.js.map
|
package/dist/testing/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var d=Object.defineProperty;var l=(i,t,e)=>t in i?d(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var r=(i,t,e)=>l(i,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../sha2-
|
|
1
|
+
"use strict";var d=Object.defineProperty;var l=(i,t,e)=>t in i?d(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var r=(i,t,e)=>l(i,typeof t!="symbol"?t+"":t,e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("../sha2-DsrLC4NM.cjs"),o=require("buffer"),g=require("../bitcoin-B3aqjuMP.cjs"),q=require("../shared/index.cjs"),f=async(i,t)=>{const e=new TextEncoder,n=e.encode(i),s=e.encode(t),a=new Uint8Array(4+n.length+4+s.length),c=new DataView(a.buffer);return c.setUint32(0,n.length),a.set(n,4),c.setUint32(4+n.length,s.length),a.set(s,4+n.length+4),g.uint8ArrayToHex(u.sha256(a))},h={publicKeyHex:"a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6e7f8a9b0c1d2e3f4a5b6c7d8e9f0a1b2",address:"tb1pqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkx6jks",network:q.BitcoinNetworks.SIGNET,shouldFailSigning:!1,deriveContextHash:f};class b{constructor(t={}){r(this,"config");this.config={...h,...t.publicKeyHex?{publicKeyHex:t.publicKeyHex}:{},...t.address?{address:t.address}:{},...t.network!==void 0?{network:t.network}:{},...t.shouldFailSigning!==void 0?{shouldFailSigning:t.shouldFailSigning}:{},...t.deriveContextHash?{deriveContextHash:t.deriveContextHash}:{}}}async getPublicKeyHex(){return this.config.publicKeyHex}async getAddress(){return this.config.address}async signPsbt(t){if(this.config.shouldFailSigning)throw new Error("Mock signing failed");if(!t||t.length===0)throw new Error("Invalid PSBT: empty hex string");return t+"deadbeef"}async signPsbts(t,e){const n=[];for(const s of t){const a=await this.signPsbt(s);n.push(a)}return n}async signMessage(t,e){if(this.config.shouldFailSigning)throw new Error("Mock signing failed");if(!t||t.length===0)throw new Error("Invalid message: empty string");return o.Buffer.from(`mock-signature-${e}-${t}-${this.config.publicKeyHex}`).toString("base64")}async getNetwork(){return this.config.network}async deriveContextHash(t,e){return this.config.deriveContextHash(t,e)}updateConfig(t){this.config={...this.config,...t}}reset(){this.config={...h}}}class y{constructor(t={}){r(this,"account");r(this,"chain");r(this,"shouldFailOperations");r(this,"transactionDelay");r(this,"nonce",0);this.account={address:t.address||"0x742d35cc6634c0532925a3b844bc9e7595f0beb0"},this.chain={id:t.chainId??11155111},this.shouldFailOperations=t.shouldFailOperations??!1,this.transactionDelay=t.transactionDelay??0,this.signMessage=this.signMessage.bind(this),this.sendTransaction=this.sendTransaction.bind(this)}async signMessage(t){const e=t.message,n=t.account||this.account.address;if(this.shouldFailOperations)throw new Error("Mock signing failed");if(!e||e.length===0)throw new Error("Invalid message: empty string");const s=`personal_sign:${e}-${n}-${this.chain.id}`;return`0x${o.Buffer.from(s).toString("hex").slice(0,130).padEnd(130,"0")}`}async sendTransaction(t){var s;if(this.shouldFailOperations)throw new Error("Mock transaction failed");if(!t.to)throw new Error("Invalid transaction: missing 'to' address");this.transactionDelay>0&&await new Promise(a=>setTimeout(a,this.transactionDelay)),this.nonce++;const e=JSON.stringify({from:this.account.address,to:t.to,value:((s=t.value)==null?void 0:s.toString())||"0",nonce:this.nonce,chainId:this.chain.id});return`0x${o.Buffer.from(e).toString("hex").slice(0,64).padEnd(64,"0")}`}updateConfig(t){t.address!==void 0&&(this.account.address=t.address),t.chainId!==void 0&&(this.chain.id=t.chainId),t.shouldFailOperations!==void 0&&(this.shouldFailOperations=t.shouldFailOperations),t.transactionDelay!==void 0&&(this.transactionDelay=t.transactionDelay)}reset(){this.account.address="0x742d35cc6634c0532925a3b844bc9e7595f0beb0",this.chain.id=11155111,this.shouldFailOperations=!1,this.transactionDelay=0,this.nonce=0}getCurrentNonce(){return this.nonce}}exports.MockBitcoinWallet=b;exports.MockEthereumWallet=y;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/testing/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var d = Object.defineProperty;
|
|
2
2
|
var l = (e, t, s) => t in e ? d(e, t, { enumerable: !0, configurable: !0, writable: !0, value: s }) : e[t] = s;
|
|
3
3
|
var o = (e, t, s) => l(e, typeof t != "symbol" ? t + "" : t, s);
|
|
4
|
-
import { s as g } from "../sha2-
|
|
4
|
+
import { s as g } from "../sha2-BYVxyZzX.js";
|
|
5
5
|
import { Buffer as r } from "buffer";
|
|
6
6
|
import { u } from "../bitcoin-B0S8SHCX.js";
|
|
7
7
|
import { BitcoinNetworks as q } from "../shared/index.js";
|
|
@@ -7,7 +7,7 @@ import { H as T } from "./validation-CxqROCno.js";
|
|
|
7
7
|
import * as j from "@bitcoin-js/tiny-secp256k1-asmjs";
|
|
8
8
|
import { payments as we, Transaction as K } from "bitcoinjs-lib";
|
|
9
9
|
import { Buffer as A } from "buffer";
|
|
10
|
-
import { s as q } from "./sha2-
|
|
10
|
+
import { s as q } from "./sha2-BYVxyZzX.js";
|
|
11
11
|
import { B as V } from "./BTCVaultRegistry.abi-DbJ5lsFJ.js";
|
|
12
12
|
import { P as _, A as F } from "./ProtocolParams.abi-DXu8L0Fn.js";
|
|
13
13
|
const W = new Set(Object.values(be)), ve = 200;
|
|
@@ -1289,4 +1289,4 @@ export {
|
|
|
1289
1289
|
dt as r,
|
|
1290
1290
|
Se as v
|
|
1291
1291
|
};
|
|
1292
|
-
//# sourceMappingURL=vault-registry-reader-
|
|
1292
|
+
//# sourceMappingURL=vault-registry-reader-BBk0p-u-.js.map
|