@babylonlabs-io/ts-sdk 0.16.2 → 0.17.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/challengeAssert-D_k_ADgP.cjs +2 -0
- package/dist/challengeAssert-D_k_ADgP.cjs.map +1 -0
- package/dist/challengeAssert-k5_LWUtO.js +362 -0
- package/dist/challengeAssert-k5_LWUtO.js.map +1 -0
- package/dist/constants-EiyZkXce.cjs +2 -0
- package/dist/constants-EiyZkXce.cjs.map +1 -0
- package/dist/constants-Q7v2O7Ps.js +155 -0
- package/dist/constants-Q7v2O7Ps.js.map +1 -0
- package/dist/errors-DKLboMnq.cjs +2 -0
- package/dist/errors-DKLboMnq.cjs.map +1 -0
- package/dist/errors-KY63mgWT.js +1510 -0
- package/dist/errors-KY63mgWT.js.map +1 -0
- package/dist/fundPeginTransaction-DpwnDslW.js +50 -0
- package/dist/fundPeginTransaction-DpwnDslW.js.map +1 -0
- package/dist/fundPeginTransaction-EbrZzlrh.cjs +2 -0
- package/dist/fundPeginTransaction-EbrZzlrh.cjs.map +1 -0
- package/dist/index-D3z3SZAj.cjs +2 -0
- package/dist/index-D3z3SZAj.cjs.map +1 -0
- package/dist/index-Dw7FAwne.js +913 -0
- package/dist/index-Dw7FAwne.js.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +98 -74
- package/dist/index.js.map +1 -1
- package/dist/payout-Ce9vSs9e.js +164 -0
- package/dist/payout-Ce9vSs9e.js.map +1 -0
- package/dist/payout-CfsDnjKI.cjs +2 -0
- package/dist/payout-CfsDnjKI.cjs.map +1 -0
- package/dist/psbtInputFields-C0nKn_GD.cjs +2 -0
- package/dist/psbtInputFields-C0nKn_GD.cjs.map +1 -0
- package/dist/psbtInputFields-DO0ELwiv.js +116 -0
- package/dist/psbtInputFields-DO0ELwiv.js.map +1 -0
- package/dist/signAndSubmitPayouts-CAOEAQp9.js +490 -0
- package/dist/signAndSubmitPayouts-CAOEAQp9.js.map +1 -0
- package/dist/signAndSubmitPayouts-CSJmcPQN.cjs +2 -0
- package/dist/signAndSubmitPayouts-CSJmcPQN.cjs.map +1 -0
- package/dist/signing-Deg5lCoC.cjs +2 -0
- package/dist/signing-Deg5lCoC.cjs.map +1 -0
- package/dist/signing-Drwr3bXB.js +16 -0
- package/dist/signing-Drwr3bXB.js.map +1 -0
- package/dist/tbv/core/clients/eth/__tests__/vault-registry-reader.test.d.ts +2 -0
- package/dist/tbv/core/clients/eth/__tests__/vault-registry-reader.test.d.ts.map +1 -0
- package/dist/tbv/core/clients/eth/index.d.ts +3 -0
- package/dist/tbv/core/clients/eth/index.d.ts.map +1 -0
- package/dist/tbv/core/clients/eth/types.d.ts +37 -0
- package/dist/tbv/core/clients/eth/types.d.ts.map +1 -0
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts +20 -0
- package/dist/tbv/core/clients/eth/vault-registry-reader.d.ts.map +1 -0
- package/dist/tbv/core/clients/index.cjs +2 -0
- package/dist/tbv/core/clients/index.cjs.map +1 -0
- package/dist/tbv/core/clients/index.d.ts +2 -0
- package/dist/tbv/core/clients/index.d.ts.map +1 -1
- package/dist/tbv/core/clients/index.js +26 -0
- package/dist/tbv/core/clients/index.js.map +1 -0
- package/dist/tbv/core/clients/vault-provider/__tests__/json-rpc-client.test.d.ts +2 -0
- package/dist/tbv/core/clients/vault-provider/__tests__/json-rpc-client.test.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/__tests__/validators.test.d.ts +2 -0
- package/dist/tbv/core/clients/vault-provider/__tests__/validators.test.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/api.d.ts +53 -0
- package/dist/tbv/core/clients/vault-provider/api.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/index.d.ts +7 -0
- package/dist/tbv/core/clients/vault-provider/index.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts +90 -0
- package/dist/tbv/core/clients/vault-provider/json-rpc-client.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/types.d.ts +256 -0
- package/dist/tbv/core/clients/vault-provider/types.d.ts.map +1 -0
- package/dist/tbv/core/clients/vault-provider/validators.d.ts +30 -0
- package/dist/tbv/core/clients/vault-provider/validators.d.ts.map +1 -0
- package/dist/tbv/core/index.cjs +1 -1
- package/dist/tbv/core/index.d.ts +1 -0
- package/dist/tbv/core/index.d.ts.map +1 -1
- package/dist/tbv/core/index.js +97 -73
- package/dist/tbv/core/index.js.map +1 -1
- package/dist/tbv/core/primitives/index.cjs +1 -1
- package/dist/tbv/core/primitives/index.d.ts +8 -0
- package/dist/tbv/core/primitives/index.d.ts.map +1 -1
- package/dist/tbv/core/primitives/index.js +26 -24
- package/dist/tbv/core/primitives/index.js.map +1 -1
- package/dist/tbv/core/services/deposit/__tests__/submitWotsPublicKey.test.d.ts +2 -0
- package/dist/tbv/core/services/deposit/__tests__/submitWotsPublicKey.test.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/__tests__/waitForPeginStatus.test.d.ts +2 -0
- package/dist/tbv/core/services/deposit/__tests__/waitForPeginStatus.test.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/index.d.ts +10 -0
- package/dist/tbv/core/services/deposit/index.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/interfaces.d.ts +21 -0
- package/dist/tbv/core/services/deposit/interfaces.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/signAndSubmitPayouts.d.ts +55 -0
- package/dist/tbv/core/services/deposit/signAndSubmitPayouts.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts +21 -0
- package/dist/tbv/core/services/deposit/signDepositorGraph.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/submitWotsPublicKey.d.ts +25 -0
- package/dist/tbv/core/services/deposit/submitWotsPublicKey.d.ts.map +1 -0
- package/dist/tbv/core/services/deposit/waitForPeginStatus.d.ts +24 -0
- package/dist/tbv/core/services/deposit/waitForPeginStatus.d.ts.map +1 -0
- package/dist/tbv/core/services/index.cjs +2 -0
- package/dist/tbv/core/services/index.cjs.map +1 -0
- package/dist/tbv/core/services/index.d.ts +10 -0
- package/dist/tbv/core/services/index.d.ts.map +1 -0
- package/dist/tbv/core/services/index.js +8 -0
- package/dist/tbv/core/services/index.js.map +1 -0
- package/dist/tbv/core/utils/index.cjs +2 -0
- package/dist/tbv/core/utils/index.cjs.map +1 -0
- package/dist/tbv/core/utils/index.js +30 -0
- package/dist/tbv/core/utils/index.js.map +1 -0
- package/dist/tbv/index.cjs +1 -1
- package/dist/tbv/index.js +97 -73
- package/dist/tbv/index.js.map +1 -1
- package/dist/tbv/integrations/aave/clients/abis/AaveSpoke.abi.json.d.ts +28 -18
- package/dist/tbv/integrations/aave/clients/spoke.d.ts +2 -2
- package/dist/tbv/integrations/aave/clients/spoke.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/constants.d.ts +7 -0
- 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 +2 -2
- package/dist/tbv/integrations/aave/index.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/index.js +124 -120
- package/dist/tbv/integrations/aave/index.js.map +1 -1
- package/dist/tbv/integrations/aave/types.d.ts +4 -6
- package/dist/tbv/integrations/aave/types.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/utils/aaveConversions.d.ts +10 -1
- package/dist/tbv/integrations/aave/utils/aaveConversions.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/utils/debtUtils.d.ts +0 -1
- package/dist/tbv/integrations/aave/utils/debtUtils.d.ts.map +1 -1
- package/dist/tbv/integrations/aave/utils/index.d.ts +1 -1
- package/dist/tbv/integrations/aave/utils/index.d.ts.map +1 -1
- package/dist/types-D1rYwwCu.js +235 -0
- package/dist/types-D1rYwwCu.js.map +1 -0
- package/dist/types-DEWiqXYp.cjs +2 -0
- package/dist/types-DEWiqXYp.cjs.map +1 -0
- package/package.json +11 -1
- package/dist/challengeAssert-CTajvPAY.cjs +0 -2
- package/dist/challengeAssert-CTajvPAY.cjs.map +0 -1
- package/dist/challengeAssert-DtrQLG0c.js +0 -711
- package/dist/challengeAssert-DtrQLG0c.js.map +0 -1
- package/dist/errors-BeFfs5_J.js +0 -2250
- package/dist/errors-BeFfs5_J.js.map +0 -1
- package/dist/errors-CAFiRPYI.cjs +0 -2
- package/dist/errors-CAFiRPYI.cjs.map +0 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for Vault Provider JSON-RPC API.
|
|
3
|
+
*
|
|
4
|
+
* These types match the `vaultProvider_*` RPC namespace defined by the
|
|
5
|
+
* btc-vault daemon. They are the SDK's canonical copy of the VP protocol
|
|
6
|
+
* contract, independent of any frontend framework.
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/babylonlabs-io/btc-vault/blob/main/docs/pegin.md
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Backend daemon status (vault provider database).
|
|
12
|
+
* Source: btc-vault crates/vaultd/src/workers/claimer/mod.rs PegInStatus enum
|
|
13
|
+
*
|
|
14
|
+
* State flow (happy path):
|
|
15
|
+
* PendingIngestion -> PendingDepositorWotsPK -> PendingBabeSetup -> PendingChallengerPresigning
|
|
16
|
+
* -> PendingPeginSigsAvailability -> PendingPrePegInConfirmations
|
|
17
|
+
* -> PendingDepositorSignatures -> PendingACKs -> PendingActivation -> Activated
|
|
18
|
+
*
|
|
19
|
+
* Terminal / branching states:
|
|
20
|
+
* - Expired: vault timed out before activation
|
|
21
|
+
* - ClaimPosted: claim transaction posted on-chain
|
|
22
|
+
* - PeggedOut: BTC has been returned to the depositor
|
|
23
|
+
*/
|
|
24
|
+
export declare enum DaemonStatus {
|
|
25
|
+
PENDING_INGESTION = "PendingIngestion",
|
|
26
|
+
PENDING_DEPOSITOR_WOTS_PK = "PendingDepositorWotsPK",
|
|
27
|
+
PENDING_BABE_SETUP = "PendingBabeSetup",
|
|
28
|
+
PENDING_CHALLENGER_PRESIGNING = "PendingChallengerPresigning",
|
|
29
|
+
PENDING_PEGIN_SIGS_AVAILABILITY = "PendingPeginSigsAvailability",
|
|
30
|
+
PENDING_PRE_PEGIN_CONFIRMATIONS = "PendingPrePegInConfirmations",
|
|
31
|
+
PENDING_DEPOSITOR_SIGNATURES = "PendingDepositorSignatures",
|
|
32
|
+
PENDING_ACKS = "PendingACKs",
|
|
33
|
+
PENDING_ACTIVATION = "PendingActivation",
|
|
34
|
+
ACTIVATED = "Activated",
|
|
35
|
+
EXPIRED = "Expired",
|
|
36
|
+
CLAIM_POSTED = "ClaimPosted",
|
|
37
|
+
PEGGED_OUT = "PeggedOut"
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* States where the VP is still processing (no depositor action needed).
|
|
41
|
+
* Excludes PENDING_DEPOSITOR_WOTS_PK (requires depositor action).
|
|
42
|
+
*/
|
|
43
|
+
export declare const PRE_DEPOSITOR_SIGNATURES_STATES: readonly DaemonStatus[];
|
|
44
|
+
/**
|
|
45
|
+
* Statuses where no depositor action is needed (VP processing or already past
|
|
46
|
+
* depositor interaction). Excludes PENDING_INGESTION and PENDING_DEPOSITOR_WOTS_PK.
|
|
47
|
+
*/
|
|
48
|
+
export declare const VP_TRANSIENT_STATUSES: ReadonlySet<DaemonStatus>;
|
|
49
|
+
/**
|
|
50
|
+
* Terminal VP statuses where no further progress is possible.
|
|
51
|
+
* If the VP reaches one of these states while polling, polling should
|
|
52
|
+
* stop immediately with an error rather than waiting for timeout.
|
|
53
|
+
*/
|
|
54
|
+
export declare const VP_TERMINAL_STATUSES: ReadonlySet<DaemonStatus>;
|
|
55
|
+
/**
|
|
56
|
+
* Statuses that come after WOTS key submission.
|
|
57
|
+
* If the VP is already in one of these states, the WOTS key was already
|
|
58
|
+
* submitted and we can skip.
|
|
59
|
+
*/
|
|
60
|
+
export declare const POST_WOTS_STATUSES: ReadonlySet<DaemonStatus>;
|
|
61
|
+
/**
|
|
62
|
+
* WOTS configuration for a single block.
|
|
63
|
+
* Matches Rust `babe::wots::Config` serde format.
|
|
64
|
+
*/
|
|
65
|
+
export interface WotsConfig {
|
|
66
|
+
/** Digit bit-width (e.g. 4 → base-16 digits). */
|
|
67
|
+
d: number;
|
|
68
|
+
/** Number of message digits in this block. */
|
|
69
|
+
n: number;
|
|
70
|
+
/** Radix used for the checksum computation. */
|
|
71
|
+
checksum_radix: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A single block of WOTS public keys.
|
|
75
|
+
* Chain values are arrays of byte values (matching Rust `[u8; 20]`).
|
|
76
|
+
*/
|
|
77
|
+
export interface WotsBlockPublicKey {
|
|
78
|
+
config: WotsConfig;
|
|
79
|
+
message_terminals: number[][];
|
|
80
|
+
checksum_major_terminal: number[];
|
|
81
|
+
checksum_minor_terminal: number[];
|
|
82
|
+
}
|
|
83
|
+
/** Params for requesting the payout/claim/assert transactions to pre-sign. */
|
|
84
|
+
export interface RequestDepositorPresignTransactionsParams {
|
|
85
|
+
pegin_txid: string;
|
|
86
|
+
depositor_pk: string;
|
|
87
|
+
}
|
|
88
|
+
/** Params for submitting the depositor's WOTS public key to the VP. */
|
|
89
|
+
export interface SubmitDepositorWotsKeyParams {
|
|
90
|
+
pegin_txid: string;
|
|
91
|
+
depositor_pk: string;
|
|
92
|
+
wots_public_keys: WotsBlockPublicKey[];
|
|
93
|
+
}
|
|
94
|
+
/** Per-challenger signatures for the depositor-as-claimer flow. */
|
|
95
|
+
export interface DepositorPreSigsPerChallenger {
|
|
96
|
+
nopayout_signature: string;
|
|
97
|
+
}
|
|
98
|
+
/** Depositor-as-claimer pre-signatures (payout + per-challenger). */
|
|
99
|
+
export interface DepositorAsClaimerPresignatures {
|
|
100
|
+
payout_signatures: ClaimerSignatures;
|
|
101
|
+
per_challenger: Record<string, DepositorPreSigsPerChallenger>;
|
|
102
|
+
}
|
|
103
|
+
/** Params for submitting depositor pre-signatures including claimer presignatures. */
|
|
104
|
+
export interface SubmitDepositorPresignaturesParams {
|
|
105
|
+
pegin_txid: string;
|
|
106
|
+
depositor_pk: string;
|
|
107
|
+
signatures: Record<string, ClaimerSignatures>;
|
|
108
|
+
depositor_claimer_presignatures: DepositorAsClaimerPresignatures;
|
|
109
|
+
}
|
|
110
|
+
/** Payout signatures per claimer. */
|
|
111
|
+
export interface ClaimerSignatures {
|
|
112
|
+
payout_signature: string;
|
|
113
|
+
}
|
|
114
|
+
/** Params for requesting BaBe DecryptorArtifacts from the VP. */
|
|
115
|
+
export interface RequestDepositorClaimerArtifactsParams {
|
|
116
|
+
pegin_txid: string;
|
|
117
|
+
depositor_pk: string;
|
|
118
|
+
}
|
|
119
|
+
/** Params for querying pegin status. Either pegin_txid or vault_id must be provided. */
|
|
120
|
+
export type GetPeginStatusParams = {
|
|
121
|
+
pegin_txid: string;
|
|
122
|
+
vault_id?: never;
|
|
123
|
+
} | {
|
|
124
|
+
vault_id: string;
|
|
125
|
+
pegin_txid?: never;
|
|
126
|
+
};
|
|
127
|
+
/** A raw Bitcoin transaction with its hex encoding. */
|
|
128
|
+
export interface TransactionData {
|
|
129
|
+
tx_hex: string;
|
|
130
|
+
}
|
|
131
|
+
/** Set of transactions the depositor must pre-sign for a single claimer. */
|
|
132
|
+
export interface ClaimerTransactions {
|
|
133
|
+
claimer_pubkey: string;
|
|
134
|
+
claim_tx: TransactionData;
|
|
135
|
+
assert_tx: TransactionData;
|
|
136
|
+
payout_tx: TransactionData;
|
|
137
|
+
payout_psbt: string;
|
|
138
|
+
}
|
|
139
|
+
/** Per-segment connector data for ChallengeAssert inputs. */
|
|
140
|
+
export interface ChallengeAssertConnectorData {
|
|
141
|
+
wots_pks_json: string;
|
|
142
|
+
gc_wots_keys_json: string;
|
|
143
|
+
}
|
|
144
|
+
/** Challenger-specific transactions and signing data for the depositor graph. */
|
|
145
|
+
export interface PresignDataPerChallenger {
|
|
146
|
+
challenger_pubkey: string;
|
|
147
|
+
challenge_assert_x_tx: TransactionData;
|
|
148
|
+
challenge_assert_y_tx: TransactionData;
|
|
149
|
+
nopayout_tx: TransactionData;
|
|
150
|
+
nopayout_psbt: string;
|
|
151
|
+
challenge_assert_connectors: ChallengeAssertConnectorData[];
|
|
152
|
+
output_label_hashes: string[];
|
|
153
|
+
}
|
|
154
|
+
/** Depositor-as-claimer TxGraph transactions. */
|
|
155
|
+
export interface DepositorGraphTransactions {
|
|
156
|
+
claim_tx: TransactionData;
|
|
157
|
+
assert_tx: TransactionData;
|
|
158
|
+
payout_tx: TransactionData;
|
|
159
|
+
payout_psbt: string;
|
|
160
|
+
challenger_presign_data: PresignDataPerChallenger[];
|
|
161
|
+
offchain_params_version: number;
|
|
162
|
+
}
|
|
163
|
+
/** Response from `requestDepositorPresignTransactions`. */
|
|
164
|
+
export interface RequestDepositorPresignTransactionsResponse {
|
|
165
|
+
txs: ClaimerTransactions[];
|
|
166
|
+
depositor_graph: DepositorGraphTransactions;
|
|
167
|
+
}
|
|
168
|
+
/** BaBe garbled-circuit session data for a single challenger. */
|
|
169
|
+
export interface BaBeSessionData {
|
|
170
|
+
decryptor_artifacts_hex: string;
|
|
171
|
+
}
|
|
172
|
+
/** Response from `requestDepositorClaimerArtifacts`. */
|
|
173
|
+
export interface RequestDepositorClaimerArtifactsResponse {
|
|
174
|
+
tx_graph_json: string;
|
|
175
|
+
verifying_key_hex: string;
|
|
176
|
+
babe_sessions: Record<string, BaBeSessionData>;
|
|
177
|
+
}
|
|
178
|
+
/** Progress tracker for a multi-challenger operation. */
|
|
179
|
+
export interface ChallengerProgress {
|
|
180
|
+
total_challengers: number;
|
|
181
|
+
completed_challengers: number;
|
|
182
|
+
completed_challenger_pubkeys: string[];
|
|
183
|
+
pending_challenger_pubkeys: string[];
|
|
184
|
+
}
|
|
185
|
+
export type GcDataProgress = ChallengerProgress;
|
|
186
|
+
export type AckCollectionProgress = ChallengerProgress;
|
|
187
|
+
/** Extended presigning progress with all 3 concurrent phases. */
|
|
188
|
+
export interface PresigningProgress extends ChallengerProgress {
|
|
189
|
+
depositor_graph_created?: boolean;
|
|
190
|
+
vk_challenger_presigning_completed?: number;
|
|
191
|
+
vk_challenger_presigning_total?: number;
|
|
192
|
+
}
|
|
193
|
+
/** Detailed progress breakdown for an in-progress pegin. */
|
|
194
|
+
export interface PeginProgressDetails {
|
|
195
|
+
gc_data?: GcDataProgress;
|
|
196
|
+
presigning?: PresigningProgress;
|
|
197
|
+
ack_collection?: AckCollectionProgress;
|
|
198
|
+
claimer_graphs?: ClaimerGraphStatus[];
|
|
199
|
+
}
|
|
200
|
+
/** Per-claimer graph status (challenger perspective). */
|
|
201
|
+
export interface ClaimerGraphStatus {
|
|
202
|
+
claimer_pubkey: string;
|
|
203
|
+
presigned: boolean;
|
|
204
|
+
}
|
|
205
|
+
/** Response from `getPeginStatus`. */
|
|
206
|
+
export interface GetPeginStatusResponse {
|
|
207
|
+
pegin_txid: string;
|
|
208
|
+
status: string;
|
|
209
|
+
progress: PeginProgressDetails;
|
|
210
|
+
health_info: string;
|
|
211
|
+
last_error?: string;
|
|
212
|
+
}
|
|
213
|
+
/** Params for querying pegout status from the VP daemon. */
|
|
214
|
+
export interface GetPegoutStatusParams {
|
|
215
|
+
pegin_txid: string;
|
|
216
|
+
}
|
|
217
|
+
/** Claimer-side pegout progress. */
|
|
218
|
+
export interface ClaimerPegoutStatus {
|
|
219
|
+
status: string;
|
|
220
|
+
failed: boolean;
|
|
221
|
+
claim_txid?: string;
|
|
222
|
+
claimer_pubkey?: string;
|
|
223
|
+
challenger_pubkey?: string;
|
|
224
|
+
created_at?: string;
|
|
225
|
+
updated_at?: string;
|
|
226
|
+
}
|
|
227
|
+
/** Challenger-side pegout progress. */
|
|
228
|
+
export interface ChallengerPegoutStatus {
|
|
229
|
+
status: string;
|
|
230
|
+
claim_txid?: string;
|
|
231
|
+
claimer_pubkey?: string;
|
|
232
|
+
assert_txid?: string;
|
|
233
|
+
challenge_assert_txid?: string;
|
|
234
|
+
nopayout_txid?: string;
|
|
235
|
+
created_at?: string;
|
|
236
|
+
updated_at?: string;
|
|
237
|
+
}
|
|
238
|
+
/** Response from `getPegoutStatus`. */
|
|
239
|
+
export interface GetPegoutStatusResponse {
|
|
240
|
+
pegin_txid: string;
|
|
241
|
+
found: boolean;
|
|
242
|
+
claimer?: ClaimerPegoutStatus;
|
|
243
|
+
challenger?: ChallengerPegoutStatus;
|
|
244
|
+
}
|
|
245
|
+
/** JSON-RPC error codes returned by the vault provider. */
|
|
246
|
+
export declare enum RpcErrorCode {
|
|
247
|
+
DATABASE_ERROR = -32005,
|
|
248
|
+
PRESIGN_ERROR = -32006,
|
|
249
|
+
JSON_SERIALIZATION_ERROR = -32007,
|
|
250
|
+
TX_GRAPH_ERROR = -32008,
|
|
251
|
+
INVALID_GRAPH = -32009,
|
|
252
|
+
VALIDATION_ERROR = -32010,
|
|
253
|
+
NOT_FOUND = -32011,
|
|
254
|
+
INTERNAL_ERROR = -32603
|
|
255
|
+
}
|
|
256
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/vault-provider/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;;;;;;;;;;;GAaG;AACH,oBAAY,YAAY;IACtB,iBAAiB,qBAAqB;IACtC,yBAAyB,2BAA2B;IACpD,kBAAkB,qBAAqB;IACvC,6BAA6B,gCAAgC;IAC7D,+BAA+B,iCAAiC;IAChE,+BAA+B,iCAAiC;IAChE,4BAA4B,+BAA+B;IAC3D,YAAY,gBAAgB;IAC5B,kBAAkB,sBAAsB;IACxC,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,YAAY,gBAAgB;IAC5B,UAAU,cAAc;CACzB;AAMD;;;GAGG;AACH,eAAO,MAAM,+BAA+B,EAAE,SAAS,YAAY,EAMlE,CAAC;AASF;;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Ac,SAAS;IACvB,aAAa,SAAS;IACtB,gBAAgB,SAAS;IACzB,SAAS,SAAS;IAClB,cAAc,SAAS;CACxB"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { GetPeginStatusResponse, GetPegoutStatusResponse, RequestDepositorClaimerArtifactsResponse, RequestDepositorPresignTransactionsResponse } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Thrown when a VP RPC response fails runtime validation.
|
|
4
|
+
*
|
|
5
|
+
* `.message` is a user-facing string safe to display in the UI.
|
|
6
|
+
* `.detail` contains the technical reason, suitable for logging.
|
|
7
|
+
*/
|
|
8
|
+
export declare class VpResponseValidationError extends Error {
|
|
9
|
+
readonly detail: string;
|
|
10
|
+
constructor(detail: string);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Validate a getPeginStatus response.
|
|
14
|
+
*
|
|
15
|
+
* Throws if the status field is not a recognized DaemonStatus value.
|
|
16
|
+
*/
|
|
17
|
+
export declare function validateGetPeginStatusResponse(response: unknown): asserts response is GetPeginStatusResponse;
|
|
18
|
+
/**
|
|
19
|
+
* Validate a requestDepositorPresignTransactions response.
|
|
20
|
+
*/
|
|
21
|
+
export declare function validateRequestDepositorPresignTransactionsResponse(response: unknown): asserts response is RequestDepositorPresignTransactionsResponse;
|
|
22
|
+
/**
|
|
23
|
+
* Validate a requestDepositorClaimerArtifacts response.
|
|
24
|
+
*/
|
|
25
|
+
export declare function validateRequestDepositorClaimerArtifactsResponse(response: unknown): asserts response is RequestDepositorClaimerArtifactsResponse;
|
|
26
|
+
/**
|
|
27
|
+
* Validate a getPegoutStatus response.
|
|
28
|
+
*/
|
|
29
|
+
export declare function validateGetPegoutStatusResponse(response: unknown): asserts response is GetPegoutStatusResponse;
|
|
30
|
+
//# sourceMappingURL=validators.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../../../../src/tbv/core/clients/vault-provider/validators.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAGH,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,wCAAwC,EACxC,2CAA2C,EAC5C,MAAM,SAAS,CAAC;AAejB;;;;;GAKG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,EAAE,MAAM;CAK3B;AAiGD;;;;GAIG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,QAAQ,IAAI,sBAAsB,CAkD5C;AAED;;GAEG;AACH,wBAAgB,mDAAmD,CACjE,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,QAAQ,IAAI,2CAA2C,CA4BjE;AA2FD;;GAEG;AACH,wBAAgB,gDAAgD,CAC9D,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,QAAQ,IAAI,wCAAwC,CA0C9D;AAED;;GAEG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,OAAO,GAChB,OAAO,CAAC,QAAQ,IAAI,uBAAuB,CAqD7C"}
|
package/dist/tbv/core/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../../challengeAssert-D_k_ADgP.cjs"),u=require("@babylonlabs-io/babylon-tbv-rust-wasm"),a=require("../../payout-CfsDnjKI.cjs"),e=require("../../constants-EiyZkXce.cjs"),s=require("../../psbtInputFields-C0nKn_GD.cjs"),T=require("../../fundPeginTransaction-EbrZzlrh.cjs"),P=require("../../signing-Deg5lCoC.cjs"),r=require("../../errors-DKLboMnq.cjs"),n=require("../../signAndSubmitPayouts-CSJmcPQN.cjs"),t=require("../../index-D3z3SZAj.cjs"),o=require("../../types-DEWiqXYp.cjs");exports.buildChallengeAssertPsbt=i.buildChallengeAssertPsbt;exports.buildDepositorPayoutPsbt=i.buildDepositorPayoutPsbt;exports.buildNoPayoutPsbt=i.buildNoPayoutPsbt;exports.buildPeginInputPsbt=i.buildPeginInputPsbt;exports.buildPeginTxFromFundedPrePegin=i.buildPeginTxFromFundedPrePegin;exports.buildPrePeginPsbt=i.buildPrePeginPsbt;exports.buildRefundPsbt=i.buildRefundPsbt;exports.computeNumLocalChallengers=i.computeNumLocalChallengers;exports.extractPeginInputSignature=i.extractPeginInputSignature;exports.finalizePeginInputPsbt=i.finalizePeginInputPsbt;Object.defineProperty(exports,"computeMinClaimValue",{enumerable:!0,get:()=>u.computeMinClaimValue});Object.defineProperty(exports,"deriveVaultId",{enumerable:!0,get:()=>u.deriveVaultId});exports.buildPayoutPsbt=a.buildPayoutPsbt;exports.createPayoutScript=a.createPayoutScript;exports.extractPayoutSignature=a.extractPayoutSignature;exports.BTC_DUST_SAT=e.BTC_DUST_SAT;exports.DUST_THRESHOLD=e.DUST_THRESHOLD;exports.FEE_SAFETY_MARGIN=e.FEE_SAFETY_MARGIN;exports.LOW_RATE_ESTIMATION_ACCURACY_BUFFER=e.LOW_RATE_ESTIMATION_ACCURACY_BUFFER;exports.MAX_NON_LEGACY_OUTPUT_SIZE=e.MAX_NON_LEGACY_OUTPUT_SIZE;exports.P2TR_INPUT_SIZE=e.P2TR_INPUT_SIZE;exports.PEGIN_FIXED_OUTPUTS=e.PEGIN_FIXED_OUTPUTS;exports.SPLIT_TX_FEE_SAFETY_MULTIPLIER=e.SPLIT_TX_FEE_SAFETY_MULTIPLIER;exports.TX_BUFFER_SIZE_OVERHEAD=e.TX_BUFFER_SIZE_OVERHEAD;exports.WALLET_RELAY_FEE_RATE_THRESHOLD=e.WALLET_RELAY_FEE_RATE_THRESHOLD;exports.deriveNativeSegwitAddress=e.deriveNativeSegwitAddress;exports.deriveTaprootAddress=e.deriveTaprootAddress;exports.ensureHexPrefix=e.ensureHexPrefix;exports.getNetwork=e.getNetwork;exports.hexToUint8Array=e.hexToUint8Array;exports.isAddressFromPublicKey=e.isAddressFromPublicKey;exports.isValidHex=e.isValidHex;exports.peginOutputCount=e.peginOutputCount;exports.processPublicKeyToXOnly=e.processPublicKeyToXOnly;exports.rateBasedTxBufferFee=e.rateBasedTxBufferFee;exports.stripHexPrefix=e.stripHexPrefix;exports.toXOnly=e.toXOnly;exports.uint8ArrayToHex=e.uint8ArrayToHex;exports.validateWalletPubkey=e.validateWalletPubkey;exports.BitcoinScriptType=s.BitcoinScriptType;exports.calculateBtcTxHash=s.calculateBtcTxHash;exports.getDustThreshold=s.getDustThreshold;exports.getPsbtInputFields=s.getPsbtInputFields;exports.getScriptType=s.getScriptType;exports.selectUtxosForPegin=s.selectUtxosForPegin;exports.shouldAddChangeOutput=s.shouldAddChangeOutput;exports.fundPeginTransaction=T.fundPeginTransaction;exports.parseUnfundedWasmTransaction=T.parseUnfundedWasmTransaction;exports.createTaprootScriptPathSignOptions=P.createTaprootScriptPathSignOptions;exports.CONTRACT_ERRORS=r.CONTRACT_ERRORS;exports.PeginManager=r.PeginManager;exports.computeWotsPkHash=r.computeWotsPkHash;exports.deriveWotsKeypair=r.deriveWotsKeypair;exports.deriveWotsPkHash=r.deriveWotsPkHash;exports.extractErrorData=r.extractErrorData;exports.getContractErrorMessage=r.getContractErrorMessage;exports.handleContractError=r.handleContractError;exports.isKnownContractError=r.isKnownContractError;exports.isWotsMismatchError=r.isWotsMismatchError;exports.keypairToPublicKey=r.keypairToPublicKey;exports.mnemonicToWotsSeed=r.mnemonicToWotsSeed;exports.PayoutManager=n.PayoutManager;exports.pollAndSignPayouts=n.pollAndSignPayouts;exports.signDepositorGraph=n.signDepositorGraph;exports.submitWotsPublicKey=n.submitWotsPublicKey;exports.waitForPeginStatus=n.waitForPeginStatus;exports.BTCVaultRegistryABI=t.BTCVaultRegistryABI;exports.MEMPOOL_API_URLS=t.MEMPOOL_API_URLS;exports.VaultProviderRpcClient=t.VaultProviderRpcClient;exports.ViemVaultRegistryReader=t.ViemVaultRegistryReader;exports.VpResponseValidationError=t.VpResponseValidationError;exports.getAddressTxs=t.getAddressTxs;exports.getAddressUtxos=t.getAddressUtxos;exports.getMempoolApiUrl=t.getMempoolApiUrl;exports.getNetworkFees=t.getNetworkFees;exports.getTxHex=t.getTxHex;exports.getTxInfo=t.getTxInfo;exports.getUtxoInfo=t.getUtxoInfo;exports.pushTx=t.pushTx;exports.DaemonStatus=o.DaemonStatus;exports.JSON_RPC_ERROR_CODES=o.JSON_RPC_ERROR_CODES;exports.JsonRpcClient=o.JsonRpcClient;exports.JsonRpcError=o.JsonRpcError;exports.POST_WOTS_STATUSES=o.POST_WOTS_STATUSES;exports.PRE_DEPOSITOR_SIGNATURES_STATES=o.PRE_DEPOSITOR_SIGNATURES_STATES;exports.RpcErrorCode=o.RpcErrorCode;exports.VP_TERMINAL_STATUSES=o.VP_TERMINAL_STATUSES;exports.VP_TRANSIENT_STATUSES=o.VP_TRANSIENT_STATUSES;
|
|
2
2
|
//# sourceMappingURL=index.cjs.map
|
package/dist/tbv/core/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tbv/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/tbv/core/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC"}
|
package/dist/tbv/core/index.js
CHANGED
|
@@ -1,78 +1,102 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { computeMinClaimValue as
|
|
3
|
-
import {
|
|
1
|
+
import { j as e, h as t, i as r, d as o, a as i, b as n, g as T, c as P, e as u, f as p } from "../../challengeAssert-k5_LWUtO.js";
|
|
2
|
+
import { computeMinClaimValue as E, deriveVaultId as S } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
+
import { b as _, c, e as g } from "../../payout-Ce9vSs9e.js";
|
|
4
|
+
import { B as A, D as x, F as b, L as m, M as f, P as I, c as O, S as y, T as C, W as U, d as h, a as F, e as N, g as D, h as L, i as M, b as V, f as H, p as B, r as W, s as v, t as k, u as w, v as K } from "../../constants-Q7v2O7Ps.js";
|
|
5
|
+
import { B as G, c as Y, g as J, d as Z, b as j, s as z, a as q } from "../../psbtInputFields-DO0ELwiv.js";
|
|
6
|
+
import { f as $, p as aa } from "../../fundPeginTransaction-DpwnDslW.js";
|
|
7
|
+
import { c as ea } from "../../signing-Drwr3bXB.js";
|
|
8
|
+
import { C as ra, P as oa, c as ia, d as na, a as Ta, e as Pa, g as ua, h as pa, i as da, b as Ea, k as Sa, m as la } from "../../errors-KY63mgWT.js";
|
|
9
|
+
import { P as ca, p as ga, a as Ra, s as Aa, w as xa } from "../../signAndSubmitPayouts-CAOEAQp9.js";
|
|
10
|
+
import { B as ma, M as fa, V as Ia, i as Oa, h as ya, g as Ca, a as Ua, b as ha, c as Fa, d as Na, e as Da, f as La, p as Ma } from "../../index-Dw7FAwne.js";
|
|
11
|
+
import { D as Ha, b as Ba, J as Wa, a as va, d as ka, P as wa, R as Ka, c as Xa, V as Ga } from "../../types-D1rYwwCu.js";
|
|
4
12
|
export {
|
|
5
|
-
|
|
6
|
-
|
|
13
|
+
ma as BTCVaultRegistryABI,
|
|
14
|
+
A as BTC_DUST_SAT,
|
|
7
15
|
G as BitcoinScriptType,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
na as
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
Pa as
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
16
|
+
ra as CONTRACT_ERRORS,
|
|
17
|
+
x as DUST_THRESHOLD,
|
|
18
|
+
Ha as DaemonStatus,
|
|
19
|
+
b as FEE_SAFETY_MARGIN,
|
|
20
|
+
Ba as JSON_RPC_ERROR_CODES,
|
|
21
|
+
Wa as JsonRpcClient,
|
|
22
|
+
va as JsonRpcError,
|
|
23
|
+
m as LOW_RATE_ESTIMATION_ACCURACY_BUFFER,
|
|
24
|
+
f as MAX_NON_LEGACY_OUTPUT_SIZE,
|
|
25
|
+
fa as MEMPOOL_API_URLS,
|
|
26
|
+
I as P2TR_INPUT_SIZE,
|
|
27
|
+
O as PEGIN_FIXED_OUTPUTS,
|
|
28
|
+
ka as POST_WOTS_STATUSES,
|
|
29
|
+
wa as PRE_DEPOSITOR_SIGNATURES_STATES,
|
|
30
|
+
ca as PayoutManager,
|
|
31
|
+
oa as PeginManager,
|
|
32
|
+
Ka as RpcErrorCode,
|
|
33
|
+
y as SPLIT_TX_FEE_SAFETY_MULTIPLIER,
|
|
34
|
+
C as TX_BUFFER_SIZE_OVERHEAD,
|
|
35
|
+
Xa as VP_TERMINAL_STATUSES,
|
|
36
|
+
Ga as VP_TRANSIENT_STATUSES,
|
|
37
|
+
Ia as VaultProviderRpcClient,
|
|
38
|
+
Oa as ViemVaultRegistryReader,
|
|
39
|
+
ya as VpResponseValidationError,
|
|
40
|
+
U as WALLET_RELAY_FEE_RATE_THRESHOLD,
|
|
41
|
+
e as buildChallengeAssertPsbt,
|
|
42
|
+
t as buildDepositorPayoutPsbt,
|
|
43
|
+
r as buildNoPayoutPsbt,
|
|
44
|
+
_ as buildPayoutPsbt,
|
|
45
|
+
o as buildPeginInputPsbt,
|
|
46
|
+
i as buildPeginTxFromFundedPrePegin,
|
|
47
|
+
n as buildPrePeginPsbt,
|
|
48
|
+
T as buildRefundPsbt,
|
|
49
|
+
Y as calculateBtcTxHash,
|
|
50
|
+
E as computeMinClaimValue,
|
|
51
|
+
P as computeNumLocalChallengers,
|
|
52
|
+
ia as computeWotsPkHash,
|
|
53
|
+
c as createPayoutScript,
|
|
54
|
+
ea as createTaprootScriptPathSignOptions,
|
|
55
|
+
h as deriveNativeSegwitAddress,
|
|
56
|
+
F as deriveTaprootAddress,
|
|
57
|
+
S as deriveVaultId,
|
|
58
|
+
na as deriveWotsKeypair,
|
|
59
|
+
Ta as deriveWotsPkHash,
|
|
60
|
+
N as ensureHexPrefix,
|
|
61
|
+
Pa as extractErrorData,
|
|
62
|
+
g as extractPayoutSignature,
|
|
63
|
+
u as extractPeginInputSignature,
|
|
64
|
+
p as finalizePeginInputPsbt,
|
|
65
|
+
$ as fundPeginTransaction,
|
|
66
|
+
Ca as getAddressTxs,
|
|
67
|
+
Ua as getAddressUtxos,
|
|
68
|
+
ua as getContractErrorMessage,
|
|
69
|
+
J as getDustThreshold,
|
|
70
|
+
ha as getMempoolApiUrl,
|
|
71
|
+
D as getNetwork,
|
|
72
|
+
Fa as getNetworkFees,
|
|
73
|
+
Z as getPsbtInputFields,
|
|
74
|
+
j as getScriptType,
|
|
75
|
+
Na as getTxHex,
|
|
76
|
+
Da as getTxInfo,
|
|
77
|
+
La as getUtxoInfo,
|
|
78
|
+
pa as handleContractError,
|
|
79
|
+
L as hexToUint8Array,
|
|
80
|
+
M as isAddressFromPublicKey,
|
|
81
|
+
da as isKnownContractError,
|
|
82
|
+
V as isValidHex,
|
|
83
|
+
Ea as isWotsMismatchError,
|
|
84
|
+
Sa as keypairToPublicKey,
|
|
85
|
+
la as mnemonicToWotsSeed,
|
|
86
|
+
aa as parseUnfundedWasmTransaction,
|
|
67
87
|
H as peginOutputCount,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
v as
|
|
76
|
-
|
|
88
|
+
ga as pollAndSignPayouts,
|
|
89
|
+
B as processPublicKeyToXOnly,
|
|
90
|
+
Ma as pushTx,
|
|
91
|
+
W as rateBasedTxBufferFee,
|
|
92
|
+
z as selectUtxosForPegin,
|
|
93
|
+
q as shouldAddChangeOutput,
|
|
94
|
+
Ra as signDepositorGraph,
|
|
95
|
+
v as stripHexPrefix,
|
|
96
|
+
Aa as submitWotsPublicKey,
|
|
97
|
+
k as toXOnly,
|
|
98
|
+
w as uint8ArrayToHex,
|
|
99
|
+
K as validateWalletPubkey,
|
|
100
|
+
xa as waitForPeginStatus
|
|
77
101
|
};
|
|
78
102
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../../challengeAssert-D_k_ADgP.cjs"),r=require("@babylonlabs-io/babylon-tbv-rust-wasm"),i=require("../../../payout-CfsDnjKI.cjs"),e=require("../../../constants-EiyZkXce.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.buildRefundPsbt=t.buildRefundPsbt;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.createPayoutScript=i.createPayoutScript;exports.extractPayoutSignature=i.extractPayoutSignature;exports.deriveNativeSegwitAddress=e.deriveNativeSegwitAddress;exports.deriveTaprootAddress=e.deriveTaprootAddress;exports.ensureHexPrefix=e.ensureHexPrefix;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
|
|
@@ -74,6 +74,14 @@
|
|
|
74
74
|
export { computeNumLocalChallengers } from './challengers';
|
|
75
75
|
export type { Network } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
76
76
|
export { computeMinClaimValue, deriveVaultId } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
77
|
+
/**
|
|
78
|
+
* 0x-prefixed bytes32, keccak256(abi.encode(peginTxHash, depositor)).
|
|
79
|
+
* On-chain vault identifier used by BTCVaultRegistry contract.
|
|
80
|
+
*
|
|
81
|
+
* Type alias for documentation — not branded.
|
|
82
|
+
* Derive with `deriveVaultId(peginTxHash, depositorAddress)`.
|
|
83
|
+
*/
|
|
84
|
+
export type VaultId = `0x${string}`;
|
|
77
85
|
export type { AssertPayoutNoPayoutConnectorParams, ChallengeAssertConnectorParams, PayoutConnectorParams, } from '@babylonlabs-io/babylon-tbv-rust-wasm';
|
|
78
86
|
export { buildPrePeginPsbt, buildPeginTxFromFundedPrePegin } from './psbt/pegin';
|
|
79
87
|
export type { PrePeginParams, PrePeginPsbtResult, BuildPeginTxParams, PeginTxResult, } from './psbt/pegin';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;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;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tbv/core/primitives/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwEG;AAGH,OAAO,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAG3D,YAAY,EAAE,OAAO,EAAE,MAAM,uCAAuC,CAAC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zB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,UAAU,EACV,eAAe,EACf,uBAAuB,EACvB,cAAc,EACd,OAAO,EACP,eAAe,EACf,oBAAoB,EACpB,KAAK,4BAA4B,GAClC,MAAM,iBAAiB,CAAC"}
|
|
@@ -1,31 +1,33 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { computeMinClaimValue as
|
|
1
|
+
import { j as s, h as t, i, d as r, a as u, b as o, g as P, c as d, e as l, f as b } from "../../../challengeAssert-k5_LWUtO.js";
|
|
2
|
+
import { computeMinClaimValue as p, deriveVaultId as x } from "@babylonlabs-io/babylon-tbv-rust-wasm";
|
|
3
|
+
import { b as g, c as y, e as m } from "../../../payout-Ce9vSs9e.js";
|
|
4
|
+
import { d as v, a as A, e as h, h as T, i as H, b as I, p as S, s as C, t as F, u as N, v as V } from "../../../constants-Q7v2O7Ps.js";
|
|
3
5
|
export {
|
|
4
6
|
s as buildChallengeAssertPsbt,
|
|
5
7
|
t as buildDepositorPayoutPsbt,
|
|
6
8
|
i as buildNoPayoutPsbt,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
g as buildPayoutPsbt,
|
|
10
|
+
r as buildPeginInputPsbt,
|
|
11
|
+
u as buildPeginTxFromFundedPrePegin,
|
|
12
|
+
o as buildPrePeginPsbt,
|
|
13
|
+
P as buildRefundPsbt,
|
|
14
|
+
p as computeMinClaimValue,
|
|
13
15
|
d as computeNumLocalChallengers,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
y as createPayoutScript,
|
|
17
|
+
v as deriveNativeSegwitAddress,
|
|
18
|
+
A as deriveTaprootAddress,
|
|
19
|
+
x as deriveVaultId,
|
|
20
|
+
h as ensureHexPrefix,
|
|
21
|
+
m as extractPayoutSignature,
|
|
22
|
+
l as extractPeginInputSignature,
|
|
23
|
+
b as finalizePeginInputPsbt,
|
|
24
|
+
T as hexToUint8Array,
|
|
25
|
+
H as isAddressFromPublicKey,
|
|
26
|
+
I as isValidHex,
|
|
27
|
+
S as processPublicKeyToXOnly,
|
|
28
|
+
C as stripHexPrefix,
|
|
29
|
+
F as toXOnly,
|
|
30
|
+
N as uint8ArrayToHex,
|
|
31
|
+
V as validateWalletPubkey
|
|
30
32
|
};
|
|
31
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"submitWotsPublicKey.test.d.ts","sourceRoot":"","sources":["../../../../../../src/tbv/core/services/deposit/__tests__/submitWotsPublicKey.test.ts"],"names":[],"mappings":""}
|