@provablehq/aleo-bridge-sdk 0.1.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.
@@ -0,0 +1,739 @@
1
+ import { B as BridgeChainClients, E as ExecuteParameters, a as BridgeExecution, Q as QuoteParameters, b as BridgeQuote, C as CompleteParameters, X as XReserveHttpTransport, G as GetStatusParameters, R as RecoverParameters, c as ResumeParameters, W as WaitParameters, S as ShieldParameters, A as AleoPrivacyExecution, U as UnshieldParameters, d as QuoteAleoHyperlaneGasPaymentParameters, e as AleoHyperlaneGasQuote, f as AleoWalletClient, g as ExecuteAleoHyperlaneTransferRemoteParameters, h as AleoHyperlaneTransferRemoteExecution, i as EvmClient, j as QuoteEvmHyperlaneTransferParameters, k as EvmHyperlaneTransferQuote, l as EvmWalletClient, m as ExecuteEvmHyperlaneTransferParameters, n as EvmHyperlaneTransferExecution, o as QuoteEvmXReserveTransferParameters, p as EvmXReserveTransferQuote, q as ExecuteEvmXReserveTransferParameters, r as EvmXReserveTransferExecution, s as GetXReserveAttestationParameters, t as XReserveAttestationResult, u as ExecuteXReservePrivateMintParameters, v as XReservePrivateMintExecution, w as ExecuteXReserveBurnParameters, x as XReserveBurnExecution, y as XReserveBurnCall, z as AleoHyperlaneTransferRemoteCall, D as AleoClient } from './createBridgeClient-DzmEyXfG.js';
2
+ export { F as AleoClientConfig, H as BridgeActions, I as BridgeActionsConfig, J as BridgeChainClient, K as BridgeClient, L as BridgeClientConfig, M as BridgeExecutionKind, N as BridgeQuoteKind, O as EvmAccount, P as EvmCallParameters, T as EvmClientConfig, V as EvmGetLogsParameters, Y as EvmHttpOptions, Z as EvmHyperlaneRouteMetadata, _ as EvmHyperlaneRouterType, $ as EvmLog, a0 as EvmPublicClient, a1 as EvmReceipt, a2 as EvmRequest, a3 as EvmTransaction, a4 as EvmTransactionParameters, a5 as EvmTransport, a6 as EvmXReserveRouteMetadata, a7 as XReserveBurnMode, a8 as XReserveHttpResponse, a9 as aleoWallet, aa as bridgeActions, ab as createAleoClient, ac as createBridgeClient, ad as createEvmClient, ae as evmCustom, af as evmHttp, ag as evmLocalAccount, ah as evmPrivateKey, ai as evmProvider } from './createBridgeClient-DzmEyXfG.js';
3
+ import { B as BridgeRegistry, a as BridgeReceipt, b as BridgeProgress, c as BridgePlan, d as BridgeCheckpoint, S as SolanaClient, Q as QuoteSolanaHyperlaneTransferParameters, e as SolanaHyperlaneTransferQuote, f as SolanaWalletClient, E as ExecuteSolanaHyperlaneTransferParameters, g as SolanaHyperlaneTransferExecution, h as BridgeEnvironment, A as AleoMintMode } from './solana-D5Qr6SLa.js';
4
+ export { i as AleoPrivacyCapability, j as AleoPrivacyKind, k as BridgeAssetKind, l as BridgeAssetLocator, m as BridgeChainFamily, n as BridgeEndpoint, o as BridgeExecutionStep, p as BridgeExecutionStepKind, q as BridgeFee, r as BridgeIntent, s as BridgeNextAction, t as BridgeProgressNext, u as BridgeProtocol, v as BridgeRouteAvailability, w as BridgeStatus, x as BridgeStepExecutor, D as DEFAULT_SOLANA_RPC_URL, G as GetAssetsParameters, y as GetRoutesParameters, P as PrepareParameters, z as ProtocolBridgeAsset, C as ProtocolBridgeChain, F as ProtocolBridgeRoute, H as SolanaAccount, I as SolanaClientConfig, J as SolanaHttpOptions, K as SolanaHyperlaneRouteMetadata, L as SolanaPublicClient, M as SolanaRequest, N as SolanaTransport, O as createSolanaClient, R as solanaCustom, T as solanaHttp, U as solanaKeyPair, V as solanaWallet } from './solana-D5Qr6SLa.js';
5
+ import { Client } from '@provablehq/veil-core';
6
+ import { Hex, Address, Hash } from 'viem';
7
+
8
+ /**
9
+ * Begins a cross-chain transfer by committing funds on the source chain.
10
+ *
11
+ * Token transfers may first require the source wallet to approve the bridge
12
+ * contract. The action then submits the deposit, burn, or dispatch that commits
13
+ * the asset to the selected bridge provider.
14
+ *
15
+ * The returned receipt identifies the in-progress transfer. Once the source
16
+ * transaction is accepted, the transfer may no longer be reversible. Each
17
+ * submitted transaction may incur a network fee even if a later stage fails.
18
+ *
19
+ * @param registry Supported chains, assets, and bridge provider deployments.
20
+ * @param clients Network and wallet access for the source and destination chains.
21
+ * @param params Transfer details, source wallet preferences, and an optional callback for saving recovery information.
22
+ * @returns The submitted transaction identifier and the initial state of the in-progress transfer.
23
+ * @throws BridgeError When the transfer is unsupported, the connected wallet cannot authorize it, current funds or fees are insufficient, or submission fails.
24
+ * @example const execution = await execute(registry, clients, { plan, onCheckpoint: saveCheckpoint })
25
+ */
26
+ declare function execute(registry: BridgeRegistry, clients: BridgeChainClients, params: ExecuteParameters): Promise<BridgeExecution>;
27
+
28
+ /**
29
+ * Calculates the funds and fees required to begin a cross-chain transfer.
30
+ *
31
+ * The caller supplies the intended source, destination, amount, recipient, and
32
+ * optional provider. The result includes both the validated transfer plan and
33
+ * the bridge and network costs the selected provider can determine. Depending
34
+ * on the route, it also reports the expected destination amount, wallet
35
+ * balance, and token approval requirements.
36
+ *
37
+ * Routes with live pricing read current network and provider state; other routes
38
+ * return their configured costs. The action does not request a wallet signature
39
+ * or move funds.
40
+ *
41
+ * @param registry Supported chains, assets, and bridge provider deployments.
42
+ * @param clients Network access for the chains involved in the transfer.
43
+ * @param params Transfer details whose current cost and requirements are calculated.
44
+ * @returns The amount expected at the destination and the known bridge, network, and approval costs.
45
+ * @throws BridgeError When the selected provider cannot quote the transfer or required network access is unavailable.
46
+ * @example const result = await quote(registry, clients, { source, destination, amount: '1', recipient })
47
+ */
48
+ declare function quote(registry: BridgeRegistry, clients: BridgeChainClients, params: QuoteParameters): Promise<BridgeQuote>;
49
+
50
+ /**
51
+ * Submits the destination-chain transaction required to receive bridged funds.
52
+ *
53
+ * This currently applies to a private USDC-to-USDCx xReserve transfer after
54
+ * Circle has attested the source deposit. The Aleo wallet proves, signs, and
55
+ * submits the private mint that delivers a private record to the recipient.
56
+ *
57
+ * The source transaction is never repeated. The destination transaction incurs
58
+ * an Aleo network fee even if it fails.
59
+ *
60
+ * @param registry Supported chains, assets, and bridge provider deployments.
61
+ * @param clients Network and wallet access for the Aleo destination chain.
62
+ * @param params Transfer state ready for private delivery, fee preference, secret nonce, and optional callback for saving recovery information.
63
+ * @returns The Aleo transaction identifier and the destination confirmation state.
64
+ * @throws BridgeError When no destination transaction is required, the Circle attestation is invalid, required wallet access is unavailable, or submission fails.
65
+ * @example const execution = await complete(registry, clients, { plan, receipt: ready, onCheckpoint: save })
66
+ */
67
+ declare function complete(registry: BridgeRegistry, clients: BridgeChainClients, params: CompleteParameters): Promise<BridgeExecution>;
68
+
69
+ /**
70
+ * Checks one stage of an in-progress cross-chain transfer.
71
+ *
72
+ * The action checks the relevant source chain, bridge provider, or destination
73
+ * chain once. The result advances when that stage has completed and otherwise
74
+ * remains unchanged, which suits refresh buttons and scheduled background jobs.
75
+ *
76
+ * The action does not request a signature, submit a transaction, or move funds.
77
+ *
78
+ * @param registry Supported chains, assets, and bridge provider deployments.
79
+ * @param clients Network access for the chains involved in the transfer.
80
+ * @param client HTTP access for bridge provider status checks.
81
+ * @param params Transfer details, latest receipt, and optional cancellation signal.
82
+ * @returns The latest known state after one network or provider check.
83
+ * @throws BridgeError When the receipt does not belong to the transfer, required network access is unavailable, or a provider returns invalid data.
84
+ * @example const receipt = await getStatus(registry, clients, fetch, { plan, receipt: checkpoint })
85
+ */
86
+ declare function getStatus(registry: BridgeRegistry, clients: BridgeChainClients, client: XReserveHttpTransport, params: GetStatusParameters): Promise<BridgeReceipt>;
87
+
88
+ /**
89
+ * Reconstructs an interrupted cross-chain transfer from a saved checkpoint.
90
+ *
91
+ * The action determines which transactions were submitted, which stages have
92
+ * completed, and whether the transfer is still moving, finished, failed, or
93
+ * waiting for another wallet authorization.
94
+ *
95
+ * Recovery reads existing network and provider state. It never repeats a
96
+ * transaction or moves funds.
97
+ *
98
+ * @param registry Supported chains, assets, and bridge provider deployments.
99
+ * @param clients Network access for the chains involved in the transfer.
100
+ * @param client HTTP access for bridge provider status checks.
101
+ * @param params Saved route, amount, recipient, and submitted transaction identifiers.
102
+ * @returns The current transfer state and whether to wait, resume source submission, authorize destination completion, or stop.
103
+ * @throws BridgeError When the saved information is invalid, no longer matches the configured route, or describes an unsupported recovery path.
104
+ * @example const progress = await recover(registry, clients, fetch, { checkpoint })
105
+ */
106
+ declare function recover(registry: BridgeRegistry, clients: BridgeChainClients, client: XReserveHttpTransport, params: RecoverParameters): Promise<BridgeProgress>;
107
+
108
+ /**
109
+ * Submits the source-chain transaction left unfinished after an interruption.
110
+ *
111
+ * This applies when a token approval succeeded without the following deposit,
112
+ * or an Aleo transaction was fully proved before the application stopped. Only
113
+ * the pending submission continues. A proved Aleo transaction may be
114
+ * rebroadcast byte-for-byte with the same transaction identifier, so recovery
115
+ * cannot create a second transfer.
116
+ *
117
+ * The action may request authorization from the source wallet. A submitted
118
+ * transaction can commit funds and incur a network fee.
119
+ *
120
+ * @param registry Supported chains, assets, and bridge provider deployments.
121
+ * @param clients Network and wallet access for the source chain.
122
+ * @param params Recovered transfer state, confirmation controls, and an optional callback for saving the new submission.
123
+ * @returns The submitted transaction identifier and the updated state of the in-progress transfer.
124
+ * @throws BridgeError When no source transaction remains to be submitted, required wallet access is unavailable, or submission fails.
125
+ * @example const execution = await resume(registry, clients, { progress })
126
+ */
127
+ declare function resume(registry: BridgeRegistry, clients: BridgeChainClients, params: ResumeParameters): Promise<BridgeExecution>;
128
+
129
+ /**
130
+ * Follows a cross-chain transfer until it finishes or requires another wallet authorization.
131
+ *
132
+ * The action monitors source confirmation, provider processing, and destination
133
+ * delivery where those stages can be verified. The result states whether the
134
+ * funds arrived, the transfer failed, or another source- or destination-chain
135
+ * transaction is required.
136
+ *
137
+ * Monitoring does not request a signature, submit a transaction, or move funds.
138
+ *
139
+ * @param registry Supported chains, assets, and bridge provider deployments.
140
+ * @param clients Network access for the chains involved in the transfer.
141
+ * @param client HTTP access for bridge provider status checks.
142
+ * @param params Current transfer state, optional stopping statuses, polling controls, and optional progress callback.
143
+ * @returns The completed or failed transfer, or the next transaction the caller must authorize.
144
+ * @throws BridgeError When the saved state does not belong to the transfer, the wait times out or is cancelled, or a network or provider check fails.
145
+ * @example const next = await wait(registry, clients, fetch, { progress })
146
+ */
147
+ declare function wait(registry: BridgeRegistry, clients: BridgeChainClients, client: XReserveHttpTransport, params: WaitParameters): Promise<BridgeProgress>;
148
+
149
+ /**
150
+ * Converts an Aleo token balance visible on the public ledger into a private record owned by the recipient.
151
+ *
152
+ * A private record stores spendable value without exposing the owner or amount
153
+ * in a public account balance. The Aleo wallet proves and submits the
154
+ * conversion, which spends the public balance and incurs an Aleo transaction
155
+ * fee.
156
+ *
157
+ * @param registry Supported Aleo assets and their public-to-private conversion programs.
158
+ * @param clients Network and wallet access for Aleo.
159
+ * @param params Asset, amount, optional private recipient, fee preference, and proving progress callbacks.
160
+ * @returns The submitted Aleo transaction identifier and exact converted amount.
161
+ * @throws BridgeError When the asset cannot be converted privately, the amount is invalid, required wallet access is unavailable, or submission fails.
162
+ * @example
163
+ * await shield(registry, clients, { asset: { chain: 'aleo', asset: 'sol' }, amount: '0.1' })
164
+ */
165
+ declare function shield(registry: BridgeRegistry, clients: BridgeChainClients, params: ShieldParameters): Promise<AleoPrivacyExecution>;
166
+
167
+ /**
168
+ * Converts an Aleo private record into a token balance visible on the public ledger.
169
+ *
170
+ * A private record stores spendable value without exposing the owner or amount
171
+ * in a public account balance. The wallet selects a sufficient record unless
172
+ * the caller supplies one, then proves and submits the conversion. The public
173
+ * recipient and amount become visible, and the transaction incurs an Aleo fee.
174
+ *
175
+ * @param registry Supported Aleo assets and their private-to-public conversion programs.
176
+ * @param clients Network and wallet access for Aleo.
177
+ * @param params Asset, amount, optional private record and public recipient, fee preference, freeze-list proof, and proving progress callbacks.
178
+ * @returns The submitted Aleo transaction identifier and exact converted amount.
179
+ * @throws BridgeError When the asset cannot be converted publicly, the amount or private record is invalid, required wallet access is unavailable, or submission fails.
180
+ * @example
181
+ * await unshield(registry, clients, { asset: { chain: 'aleo', asset: 'sol' }, amount: '0.1' })
182
+ */
183
+ declare function unshield(registry: BridgeRegistry, clients: BridgeChainClients, params: UnshieldParameters): Promise<AleoPrivacyExecution>;
184
+
185
+ /**
186
+ * Captures the information an application needs to return to a cross-chain transfer after an interruption.
187
+ *
188
+ * The result includes the route, assets, amount, recipient, and submitted
189
+ * transaction identifiers. It excludes private keys, Aleo record contents, and
190
+ * the secret used for a private xReserve mint.
191
+ *
192
+ * Creating a checkpoint does not contact a network or store data on the
193
+ * caller's behalf. The application decides whether and where to save it.
194
+ *
195
+ * @param plan Transfer details that identify the route, assets, amount, and recipient.
196
+ * @param receipt Latest state returned after a wallet submission.
197
+ * @returns Public recovery information suitable for optional durable storage.
198
+ * @throws BridgeError When the receipt belongs to a different transfer route.
199
+ * @example const checkpoint = createBridgeCheckpoint(plan, execution.receipt)
200
+ */
201
+ declare function createBridgeCheckpoint(plan: BridgePlan, receipt: BridgeReceipt): BridgeCheckpoint;
202
+
203
+ /**
204
+ * Selects a custom registry for a direct protocol helper.
205
+ *
206
+ * @property registry Reviewed registry snapshot. Defaults to the package registry.
207
+ */
208
+ type ProtocolHelperRegistry = {
209
+ registry?: BridgeRegistry | undefined;
210
+ };
211
+ /**
212
+ * Exposes chain-specific Hyperlane helpers for direct protocol integrations.
213
+ *
214
+ * Helpers use the default reviewed registry unless `params.registry` supplies
215
+ * a custom snapshot. Most applications should use the protocol-neutral bridge
216
+ * client actions instead.
217
+ *
218
+ * @example const result = await hyperlane.evm.quote(client, { plan, recipientBytes32 })
219
+ */
220
+ declare const hyperlane: {
221
+ readonly aleo: {
222
+ /**
223
+ * Calculates the Hyperlane relayer payment for a transfer leaving Aleo.
224
+ *
225
+ * Reads the current gas oracle on Aleo without requesting a signature or
226
+ * moving funds. The payment can change before the transfer is submitted.
227
+ *
228
+ * @param client Aleo network access used to read the current gas price and exchange rate.
229
+ * @param params Route selected for the transfer and optional replacement bridge deployments.
230
+ * @returns Destination gas requirements and the exact payment in Aleo microcredits.
231
+ * @throws BridgeError When the route is unavailable or its gas configuration is invalid.
232
+ * @example const result = await hyperlane.aleo.quote(client, { routeId })
233
+ */
234
+ readonly quote: (client: Client, params: QuoteAleoHyperlaneGasPaymentParameters & ProtocolHelperRegistry) => Promise<AleoHyperlaneGasQuote>;
235
+ /**
236
+ * Begins an Aleo-to-Ethereum or Aleo-to-Solana transfer through Hyperlane.
237
+ *
238
+ * The Aleo wallet proves, signs, and submits the source transaction, which
239
+ * commits the asset and incurs an Aleo network fee.
240
+ *
241
+ * @param client Aleo wallet that authorizes and submits the source transaction.
242
+ * @param params Route, assets, amount, recipient, gas payment, and optional replacement bridge deployments.
243
+ * @returns The Aleo transaction identifier and state needed to follow delivery.
244
+ * @throws BridgeError When the transfer is unavailable, its payment is invalid, or wallet submission fails.
245
+ * @example const result = await hyperlane.aleo.execute(client, { plan, gasPaymentMicrocredits })
246
+ */
247
+ readonly execute: (client: AleoWalletClient, params: ExecuteAleoHyperlaneTransferRemoteParameters & ProtocolHelperRegistry) => Promise<AleoHyperlaneTransferRemoteExecution>;
248
+ };
249
+ readonly evm: {
250
+ /**
251
+ * Calculates the funds required for a Hyperlane transfer leaving an EVM chain.
252
+ *
253
+ * Reads the deployed router without requesting a wallet signature or moving
254
+ * funds. The quoted network payment can change before submission.
255
+ *
256
+ * @param client EVM network access used to read the selected Hyperlane router.
257
+ * @param params Route, assets, amount, encoded Aleo recipient, and optional replacement bridge deployments.
258
+ * @returns Source token amount and native network payment required by the router.
259
+ * @throws BridgeError When the route is unavailable or the router returns invalid values.
260
+ * @example const result = await hyperlane.evm.quote(client, { plan, recipientBytes32 })
261
+ */
262
+ readonly quote: (client: EvmClient, params: QuoteEvmHyperlaneTransferParameters & ProtocolHelperRegistry) => Promise<EvmHyperlaneTransferQuote>;
263
+ /**
264
+ * Begins an EVM-to-Aleo transfer through Hyperlane.
265
+ *
266
+ * An ERC-20 transfer may first request token approval. The wallet then
267
+ * submits the source dispatch, which commits funds and incurs network fees.
268
+ *
269
+ * @param client EVM network and wallet access used to authorize and submit the transfer.
270
+ * @param params Route, assets, amount, encoded Aleo recipient, confirmation controls, and optional replacement bridge deployments.
271
+ * @returns Submitted approval identifiers and state needed to follow delivery.
272
+ * @throws BridgeError When the transfer is unavailable, wallet authorization fails, funds are insufficient, or submission fails.
273
+ * @example const result = await hyperlane.evm.execute(client, { plan, recipientBytes32 })
274
+ */
275
+ readonly execute: (client: EvmClient & {
276
+ walletClient: EvmWalletClient;
277
+ }, params: ExecuteEvmHyperlaneTransferParameters & ProtocolHelperRegistry) => Promise<EvmHyperlaneTransferExecution>;
278
+ };
279
+ readonly solana: {
280
+ /**
281
+ * Calculates the SOL required for a Solana-to-Aleo Hyperlane transfer.
282
+ *
283
+ * Reads current gas, transaction fee, and rent requirements without
284
+ * requesting a wallet signature or moving funds.
285
+ *
286
+ * @param client Solana network access used to read account, fee, and rent values.
287
+ * @param params Route, amount, recipient, and optional replacement bridge deployments.
288
+ * @returns Transfer amount, relayer payment, network fee, rent, and total required lamports.
289
+ * @throws BridgeError When the route is unavailable or Solana returns invalid account or fee data.
290
+ * @example const result = await hyperlane.solana.quote(client, { plan })
291
+ */
292
+ readonly quote: (client: SolanaClient, params: QuoteSolanaHyperlaneTransferParameters & ProtocolHelperRegistry) => Promise<SolanaHyperlaneTransferQuote>;
293
+ /**
294
+ * Begins a Solana-to-Aleo transfer through Hyperlane.
295
+ *
296
+ * The Solana wallet signs and submits the source transaction, which commits
297
+ * SOL and incurs the relayer payment, network fee, and account rent.
298
+ *
299
+ * @param client Solana network and wallet access used to authorize and submit the transfer.
300
+ * @param params Route, amount, recipient, confirmation controls, and optional replacement bridge deployments.
301
+ * @returns The Solana signature and state needed to follow delivery.
302
+ * @throws BridgeError When the route is unavailable, funds are insufficient, wallet authorization fails, or submission fails.
303
+ * @example const result = await hyperlane.solana.execute(client, { plan })
304
+ */
305
+ readonly execute: (client: SolanaClient & {
306
+ walletClient: SolanaWalletClient;
307
+ }, params: ExecuteSolanaHyperlaneTransferParameters & ProtocolHelperRegistry) => Promise<SolanaHyperlaneTransferExecution>;
308
+ };
309
+ };
310
+ /**
311
+ * Exposes directional Circle xReserve helpers for direct protocol integrations.
312
+ *
313
+ * Helpers use the default reviewed registry unless `params.registry` supplies
314
+ * a custom snapshot. Most applications should use the protocol-neutral bridge
315
+ * client actions instead.
316
+ *
317
+ * @example const result = await xreserve.evmToAleo.quote(client, { plan })
318
+ */
319
+ declare const xreserve: {
320
+ readonly evmToAleo: {
321
+ /**
322
+ * Calculates the USDC and token approval required for an xReserve transfer to Aleo.
323
+ *
324
+ * Reads the prepared sender's USDC balance and existing xReserve allowance
325
+ * without requesting a signature or moving funds. When the plan omits a
326
+ * sender, the client resolves it from its optional wallet capability.
327
+ *
328
+ * @param client Ethereum network access, plus a wallet when the plan does not identify the source account.
329
+ * @param params Route, amount, Aleo recipient, privacy preference, and optional replacement bridge deployments.
330
+ * @returns Deposit amount, maximum provider fee, balance, allowance, and whether approval is required.
331
+ * @throws BridgeError When the route is unavailable, the account lacks funds, or Ethereum returns invalid state.
332
+ * @example const result = await xreserve.evmToAleo.quote(client, { plan })
333
+ */
334
+ readonly quote: (client: EvmClient, params: QuoteEvmXReserveTransferParameters & ProtocolHelperRegistry) => Promise<EvmXReserveTransferQuote>;
335
+ /**
336
+ * Begins a USDC-to-USDCx transfer from Ethereum to Aleo through xReserve.
337
+ *
338
+ * The wallet may first approve USDC spending, then submits the reserve
339
+ * deposit that commits funds and incurs Ethereum network fees.
340
+ *
341
+ * @param client Ethereum network and wallet access used to authorize and submit the deposit.
342
+ * @param params Route, amount, Aleo recipient, privacy preference, confirmation controls, and optional replacement bridge deployments.
343
+ * @returns Submitted approval identifiers and state needed to obtain Circle's attestation and follow delivery.
344
+ * @throws BridgeError When the route is unavailable, funds are insufficient, wallet authorization fails, or submission fails.
345
+ * @example const result = await xreserve.evmToAleo.execute(client, { plan })
346
+ */
347
+ readonly execute: (client: EvmClient & {
348
+ walletClient: EvmWalletClient;
349
+ }, params: ExecuteEvmXReserveTransferParameters & ProtocolHelperRegistry) => Promise<EvmXReserveTransferExecution>;
350
+ /**
351
+ * Checks whether Circle has attested one confirmed xReserve deposit.
352
+ *
353
+ * Contacts Circle once and does not request a wallet signature, submit a
354
+ * transaction, or move funds.
355
+ *
356
+ * @param client HTTP access used to contact Circle's attestation service.
357
+ * @param params Deposit message hash, route, cancellation signal, and optional replacement bridge deployments.
358
+ * @returns Whether the attestation is pending or the signed attestation is ready.
359
+ * @throws BridgeError When Circle returns an invalid response.
360
+ * @example const result = await xreserve.evmToAleo.getAttestation(fetch, { routeId, messageHash })
361
+ */
362
+ readonly getAttestation: (client: XReserveHttpTransport, params: GetXReserveAttestationParameters & ProtocolHelperRegistry) => Promise<XReserveAttestationResult>;
363
+ /**
364
+ * Delivers a private USDCx record after Circle attests an Ethereum deposit.
365
+ *
366
+ * The Aleo wallet proves, signs, and submits the private mint, which incurs
367
+ * an Aleo network fee. The source deposit is not repeated.
368
+ *
369
+ * @param client Aleo wallet that authorizes and submits the private mint.
370
+ * @param params Transfer details, attested deposit, private mint secret, recovery callback, and optional replacement bridge deployments.
371
+ * @returns The Aleo transaction identifier and state needed to confirm private delivery.
372
+ * @throws BridgeError When the attestation or private mint secret is invalid, wallet authorization fails, or submission fails.
373
+ * @example const result = await xreserve.evmToAleo.complete(client, { plan, deposit, attestation })
374
+ */
375
+ readonly complete: (client: AleoWalletClient, params: ExecuteXReservePrivateMintParameters & ProtocolHelperRegistry) => Promise<XReservePrivateMintExecution>;
376
+ };
377
+ readonly aleoToEvm: {
378
+ /**
379
+ * Begins a USDCx-to-USDC transfer from Aleo to Ethereum through xReserve.
380
+ *
381
+ * The Aleo wallet proves, signs, and submits a burn that commits USDCx and
382
+ * incurs an Aleo network fee. The provider completes Ethereum delivery
383
+ * without another wallet authorization.
384
+ *
385
+ * @param client Aleo wallet that authorizes and submits the USDCx burn.
386
+ * @param params Route, amount, Ethereum recipient, public or private funding preference, and optional replacement bridge deployments.
387
+ * @returns The Aleo transaction identifier and state needed to follow provider-managed delivery.
388
+ * @throws BridgeError When the route or private funding inputs are invalid, wallet authorization fails, or submission fails.
389
+ * @example const result = await xreserve.aleoToEvm.execute(client, { plan, mode: 'public' })
390
+ */
391
+ readonly execute: (client: AleoWalletClient, params: ExecuteXReserveBurnParameters & ProtocolHelperRegistry) => Promise<XReserveBurnExecution>;
392
+ };
393
+ };
394
+
395
+ /**
396
+ * Builds an Aleo xReserve burn call without prompting a wallet.
397
+ *
398
+ * Selects the reviewed entrypoint and validates mode-specific inputs without
399
+ * contacting Aleo or prompting a wallet.
400
+ *
401
+ * @param registry Supported assets and reviewed xReserve deployments.
402
+ * @param params Route, amount, Ethereum recipient, funding mode, and private inputs when applicable.
403
+ * @returns Aleo program, transition, ordered inputs, atomic amount, destination domain, and encoded recipient.
404
+ * @throws BridgeError When the route is unavailable, the amount cannot cover the withdrawal fee, the recipient is invalid, or private funding inputs are missing.
405
+ * @example const call = buildXReserveBurnCall(registry, { plan, mode: 'public' })
406
+ */
407
+ declare function buildXReserveBurnCall(registry: BridgeRegistry, params: ExecuteXReserveBurnParameters): XReserveBurnCall;
408
+
409
+ /**
410
+ * Builds an Aleo Hyperlane `transfer_remote` call without prompting a wallet.
411
+ *
412
+ * Validates the transfer details against reviewed route metadata without
413
+ * contacting Aleo or prompting a wallet.
414
+ *
415
+ * @param registry Supported assets and reviewed Hyperlane deployments.
416
+ * @param params Route, amount, recipient, authorization mode, and optional current relayer payment.
417
+ * @returns Aleo program, transition, ordered inputs, atomic amount, and any configuration that is not ready for submission.
418
+ * @throws BridgeError When the transfer conflicts with the deployment or the relayer payment is invalid.
419
+ * @example const call = buildAleoHyperlaneTransferRemoteCall(registry, { plan, gasPaymentMicrocredits })
420
+ */
421
+ declare function buildAleoHyperlaneTransferRemoteCall(registry: BridgeRegistry, params: ExecuteAleoHyperlaneTransferRemoteParameters): AleoHyperlaneTransferRemoteCall;
422
+
423
+ /**
424
+ * Supplies the initial reviewed protocol-route snapshot.
425
+ *
426
+ * xReserve contract identifiers are populated from Circle's published
427
+ * mainnet and testnet tables. Hyperlane routes intentionally remain
428
+ * `metadata-required` until their router, domain, ISM, and token identifiers
429
+ * are pinned from one reviewed registry commit. Reading this snapshot does not
430
+ * contact any chain or bridge provider.
431
+ *
432
+ * @example
433
+ * const bridge = createBridgeClient({ registry: DEFAULT_BRIDGE_REGISTRY })
434
+ */
435
+ declare const DEFAULT_BRIDGE_REGISTRY: BridgeRegistry;
436
+
437
+ /**
438
+ * Validates the referential integrity of a protocol bridge registry.
439
+ *
440
+ * Duplicate identifiers and dangling asset or chain references throw before a
441
+ * client can describe a misleading transfer. An active Hyperlane route sourced
442
+ * from a Solana-family chain additionally must carry a complete
443
+ * `SolanaHyperlaneRouteMetadata` object, so a route cannot be made active ahead
444
+ * of its metadata being reviewed and filled in. Validation does not contact a
445
+ * chain or bridge provider.
446
+ *
447
+ * @param registry Registry supplied to `createBridgeClient`.
448
+ * @returns The validated registry unchanged.
449
+ * @throws BridgeError When identifiers are duplicated, references are
450
+ * missing, or an active Solana-source Hyperlane route is missing required
451
+ * Sealevel deployment metadata.
452
+ *
453
+ * @example
454
+ * const registry = validateBridgeRegistry(DEFAULT_BRIDGE_REGISTRY)
455
+ */
456
+ declare function validateBridgeRegistry(registry: BridgeRegistry): BridgeRegistry;
457
+
458
+ /**
459
+ * Decodes a checksummed Aleo bech32m address into xReserve bytes32 form.
460
+ *
461
+ * Validates the supplied prefix, length, checksum, padding, and payload width
462
+ * without contacting Aleo or Circle.
463
+ *
464
+ * @param address Aleo account address to encode.
465
+ * @returns Exactly 32 decoded bytes as prefixed hexadecimal.
466
+ * @throws BridgeError When the address has invalid bech32m structure.
467
+ *
468
+ * @example
469
+ * const recipient = aleoAddressToBytes32('aleo1…')
470
+ */
471
+ declare function aleoAddressToBytes32(address: string): Hex;
472
+ /**
473
+ * Restores the Aleo account address carried in a bridge protocol's bytes32 recipient field.
474
+ *
475
+ * Call this when reconstructing a transfer from Solana instructions or EVM
476
+ * events, where the destination address is stored without its human-readable
477
+ * prefix and checksum.
478
+ *
479
+ * @param recipient Exactly 32 Aleo address bytes encoded as prefixed hexadecimal.
480
+ * @returns The canonical checksummed `aleo1…` account address.
481
+ * @throws BridgeError When the recipient is not exactly 32 bytes.
482
+ */
483
+ declare function bytes32ToAleoAddress(recipient: Hex): string;
484
+ /**
485
+ * Derives the Aleo account address owned by a deployed program id.
486
+ *
487
+ * Lazily loads the optional Aleo WASM SDK but performs no network access.
488
+ *
489
+ * @param programId Deployed Aleo program id whose account receives funds.
490
+ * @param environment Consensus environment used for address derivation.
491
+ * @returns The program-owned `aleo1…` account address.
492
+ * @throws BridgeError When the optional SDK is unavailable or derivation fails.
493
+ *
494
+ * @example
495
+ * const wrapper = await aleoProgramAddress('shielded_usdcx_wrapper.aleo', 'mainnet')
496
+ */
497
+ declare function aleoProgramAddress(programId: string, environment: BridgeEnvironment): Promise<string>;
498
+ /**
499
+ * Builds the fixed 65-byte xReserve hook for public, record, or wrapper-private minting.
500
+ *
501
+ * Public and record hooks use only the supplied values. Private hooks lazily
502
+ * load Aleo WASM to commit the intended recipient with BHP256 and the selected
503
+ * secret nonce. No chain or bridge provider is contacted.
504
+ *
505
+ * @param mode Destination mint transition selected by the caller.
506
+ * @param recipient Intended Aleo recipient committed by private mode.
507
+ * @param environment Consensus environment used by private commitment derivation.
508
+ * @param secretNonce Aleo scalar literal used by the private commitment. Defaults to `0scalar`.
509
+ * @returns A 65-byte hook whose first byte is 0, 1, or 2.
510
+ * @throws BridgeError When private derivation lacks the optional SDK or the secret nonce is not a valid Aleo scalar.
511
+ *
512
+ * @example
513
+ * const hook = await buildXReserveHookData('record', recipient, 'testnet')
514
+ */
515
+ declare function buildXReserveHookData(mode: AleoMintMode, recipient: string, environment: BridgeEnvironment, secretNonce?: string): Promise<Hex>;
516
+ /**
517
+ * Derives the Circle deposit nonce from source domain, transaction hash, and log index.
518
+ *
519
+ * Follows Circle's ABI-padded nonce preimage exactly without contacting Circle
520
+ * or either chain.
521
+ *
522
+ * @param sourceDomain Circle domain of the source xReserve contract.
523
+ * @param transactionHash Confirmed deposit transaction hash.
524
+ * @param logIndex Zero-based `DepositedToRemote` receipt log index.
525
+ * @returns The Keccak-256 deposit nonce.
526
+ *
527
+ * @example
528
+ * const nonce = calculateXReserveDepositNonce(0, txHash, 3)
529
+ */
530
+ declare function calculateXReserveDepositNonce(sourceDomain: number, transactionHash: Hash, logIndex: number): Hash;
531
+ /**
532
+ * Builds the canonical 305-byte Circle xReserve v2 deposit payload.
533
+ *
534
+ * Rejects fields with invalid wire widths before constructing the payload. It
535
+ * does not contact Circle or either chain.
536
+ *
537
+ * @param params Event-derived deposit values and reviewed route identifiers.
538
+ * @returns The exact payload submitted to Circle's attester.
539
+ * @throws BridgeError When a value is invalid or exceeds its wire width.
540
+ *
541
+ * @example
542
+ * const payload = buildXReserveDepositPayload(fields)
543
+ */
544
+ declare function buildXReserveDepositPayload(params: {
545
+ amount: bigint;
546
+ remoteDomain: number;
547
+ remoteToken: Hex;
548
+ remoteRecipient: Hex;
549
+ localToken: Address;
550
+ depositor: Address;
551
+ maxFee: bigint;
552
+ nonce: Hash;
553
+ hookData: Hex;
554
+ }): Hex;
555
+ /**
556
+ * Hashes a canonical xReserve deposit payload for Circle attestation lookup.
557
+ *
558
+ * Computes Keccak-256 from the supplied payload without contacting Circle.
559
+ *
560
+ * @param payload Canonical xReserve deposit bytes.
561
+ * @returns The 32-byte Circle message hash.
562
+ *
563
+ * @example
564
+ * const messageHash = calculateXReserveMessageHash(payload)
565
+ */
566
+ declare function calculateXReserveMessageHash(payload: Hex): Hash;
567
+ /**
568
+ * Reads the deposit nonce from Circle's fixed-width xReserve payload.
569
+ *
570
+ * Applications can use the nonce to verify Aleo delivery even when older saved
571
+ * progress retained the signed payload but omitted the nonce as a separate field.
572
+ * The payload is decoded in memory and no network or wallet is contacted.
573
+ *
574
+ * @param payload Canonical 305-byte xReserve deposit payload returned by Circle.
575
+ * @returns The 32-byte deposit nonce used by the Aleo bridge nullifier mapping.
576
+ * @throws BridgeError When the payload has the wrong header, width, or hook length.
577
+ * @example const nonce = xReserveDepositNonceFromPayload(attestation.payload)
578
+ */
579
+ declare function xReserveDepositNonceFromPayload(payload: Hex): Hash;
580
+ /**
581
+ * Formats fixed-width hexadecimal bytes as an Aleo `[u8; N]` literal.
582
+ *
583
+ * Validates the exact byte width before formatting inputs for a wallet. It does
584
+ * not contact Aleo or prompt the wallet.
585
+ *
586
+ * @param value Prefixed hexadecimal bytes to format.
587
+ * @param expectedBytes Required array width from the target Aleo function.
588
+ * @returns An Aleo array literal containing decimal `u8` values.
589
+ * @throws BridgeError When the input is malformed or has the wrong width.
590
+ *
591
+ * @example
592
+ * const hashInput = xReserveHexToAleoBytes(messageHash, 32)
593
+ */
594
+ declare function xReserveHexToAleoBytes(value: Hex, expectedBytes: number): string;
595
+ /**
596
+ * Encodes an Ethereum address as the 32-byte recipient required by xReserve burns.
597
+ *
598
+ * Preserves the 20 address bytes and adds twelve leading zero bytes without
599
+ * contacting Ethereum or Circle.
600
+ *
601
+ * @param address Checksummed or lowercase Ethereum address selected by the caller.
602
+ * @returns The address left-padded to exactly 32 bytes.
603
+ * @throws BridgeError When the address is malformed.
604
+ *
605
+ * @example
606
+ * const recipient = evmAddressToXReserveBytes32('0x0000000000000000000000000000000000000001')
607
+ */
608
+ declare function evmAddressToXReserveBytes32(address: string): Hex;
609
+
610
+ /**
611
+ * Encodes an Ethereum account as the two little-endian limbs used by Aleo Warp Routes.
612
+ *
613
+ * Validates a 20-byte EVM address, left-pads it to Hyperlane bytes32 form, and
614
+ * interprets each 16-byte half as an Aleo `u128` without contacting either
615
+ * chain.
616
+ *
617
+ * @param address Destination Ethereum account supplied by the transfer plan.
618
+ * @returns Two unsigned 128-bit limbs in Hyperlane message order.
619
+ * @throws BridgeError When the destination is not a valid 20-byte EVM address.
620
+ *
621
+ * @example
622
+ * const recipient = evmAddressToAleoHyperlaneRecipient('0x1e196d0a7d8189054c4db744ab3340c3f1c68b19')
623
+ */
624
+ declare function evmAddressToAleoHyperlaneRecipient(address: string): readonly [bigint, bigint];
625
+ /**
626
+ * Encodes a Solana account as the two little-endian limbs used by Aleo Warp Routes.
627
+ *
628
+ * Decodes a base58 account to its 32-byte public key and interprets each
629
+ * 16-byte half as an Aleo `u128` without contacting either chain.
630
+ *
631
+ * @param address Destination Solana account supplied by the transfer plan.
632
+ * @returns Two unsigned 128-bit limbs in Hyperlane message order.
633
+ * @throws BridgeError When the destination is not a base58-encoded 32-byte account.
634
+ *
635
+ * @example
636
+ * const recipient = solanaAddressToAleoHyperlaneRecipient('11111111111111111111111111111111')
637
+ */
638
+ declare function solanaAddressToAleoHyperlaneRecipient(address: string): readonly [bigint, bigint];
639
+
640
+ /**
641
+ * Selects the destination mailbox and dispatched Hyperlane message to verify.
642
+ *
643
+ * @property mailbox Destination Mailbox contract address or Aleo program id.
644
+ * @property messageId Canonical 32-byte Hyperlane message identifier.
645
+ */
646
+ type ReadHyperlaneDeliveryParameters = {
647
+ mailbox: string;
648
+ messageId: string;
649
+ };
650
+ /**
651
+ * Checks whether the destination Hyperlane Mailbox accepted a transfer message.
652
+ *
653
+ * The Mailbox contract or program is the authoritative delivery record, unlike
654
+ * a third-party explorer that may lag or omit a route. The helper reads the
655
+ * destination chain once and never requests a signature or moves funds.
656
+ *
657
+ * @param client Destination EVM or Aleo network access used to read the Mailbox.
658
+ * @param params Hyperlane message identifier and the destination Mailbox contract or program.
659
+ * @returns Whether the destination chain has recorded the message as delivered.
660
+ * @throws BridgeError When the message identifier is invalid or the Mailbox does not belong to the destination chain family.
661
+ * @example const delivered = await readHyperlaneDelivery(client, { messageId, mailbox: 'hyp_mailbox.aleo' })
662
+ */
663
+ declare function readHyperlaneDelivery(client: AleoClient | EvmClient, params: ReadHyperlaneDeliveryParameters): Promise<boolean>;
664
+
665
+ /**
666
+ * Selects the destination xReserve program and deposit to verify.
667
+ *
668
+ * @property bridgeProgram Destination Aleo bridge program that mints the asset.
669
+ * @property nonce Canonical 32-byte Circle deposit nonce emitted on the source chain.
670
+ */
671
+ type ReadXReserveDeliveryParameters = {
672
+ bridgeProgram: string;
673
+ nonce: string;
674
+ };
675
+ /**
676
+ * Checks whether an inbound xReserve deposit has already minted on Aleo.
677
+ *
678
+ * The Aleo bridge program records every completed public, record, and private
679
+ * mint under the deposit nonce. Call this before offering or retrying a mint so
680
+ * a refreshed application does not ask the recipient to complete settled funds.
681
+ *
682
+ * @param client Destination Aleo network access used to read the bridge program.
683
+ * @param params Aleo bridge program and Circle deposit nonce emitted on Ethereum.
684
+ * @returns Whether Aleo has finalized a mint for this deposit.
685
+ * @throws BridgeError When the bridge program or nonce is malformed.
686
+ * @example const delivered = await readXReserveDelivery(client, { bridgeProgram: 'usdcx_bridge_v2.aleo', nonce })
687
+ */
688
+ declare function readXReserveDelivery(client: AleoClient, params: ReadXReserveDeliveryParameters): Promise<boolean>;
689
+
690
+ /**
691
+ * Represents protocol bridge configuration and planning failures.
692
+ *
693
+ * @example
694
+ * try {
695
+ * await bridge.quote(params)
696
+ * } catch (error) {
697
+ * if (error instanceof BridgeError) console.error(error.message)
698
+ * }
699
+ */
700
+ declare class BridgeError extends Error {
701
+ constructor(message: string, options?: ErrorOptions);
702
+ }
703
+
704
+ /**
705
+ * Converts a decimal amount string into the asset's atomic units.
706
+ *
707
+ * Protocol inputs use display decimals (`"0.5"` ALEO), while onchain calls
708
+ * use atomic integers (`500000n` microcredits). String arithmetic keeps the
709
+ * conversion exact without floating-point rounding or contacting a chain.
710
+ *
711
+ * @param amount Decimal amount as a string (e.g. `"0.5"`, `"100"`).
712
+ * @param decimals The asset's display decimals (e.g. 6 for ALEO/USDC, 18 for ETH).
713
+ * @returns The atomic amount as a bigint.
714
+ * @throws BridgeError When the string is not a plain decimal number, or has
715
+ * more fractional digits than the asset supports (that precision cannot be
716
+ * represented on chain).
717
+ *
718
+ * @example
719
+ * parseDecimalAmount('0.5', 6) // 500000n
720
+ * parseDecimalAmount('100', 6) // 100000000n
721
+ */
722
+ declare function parseDecimalAmount(amount: string, decimals: number): bigint;
723
+ /**
724
+ * Formats a non-negative atomic amount as an exact decimal display value.
725
+ *
726
+ * String arithmetic removes trailing fractional zeroes without floating-point
727
+ * rounding and does not read a balance or contact a chain.
728
+ *
729
+ * @param amount Atomic amount to format; MUST be non-negative.
730
+ * @param decimals Number of fractional decimal places used by the asset.
731
+ * @returns Canonical decimal text with no redundant trailing zeroes.
732
+ * @throws BridgeError When the amount or decimal width is negative.
733
+ *
734
+ * @example
735
+ * formatDecimalAmount(2_000_001n, 6) // '2.000001'
736
+ */
737
+ declare function formatDecimalAmount(amount: bigint, decimals: number): string;
738
+
739
+ export { AleoClient, AleoHyperlaneGasQuote, AleoHyperlaneTransferRemoteCall, AleoHyperlaneTransferRemoteExecution, AleoMintMode, AleoPrivacyExecution, AleoWalletClient, BridgeChainClients, BridgeCheckpoint, BridgeEnvironment, BridgeError, BridgeExecution, BridgePlan, BridgeProgress, BridgeQuote, BridgeReceipt, BridgeRegistry, CompleteParameters, DEFAULT_BRIDGE_REGISTRY, EvmClient, EvmHyperlaneTransferExecution, EvmHyperlaneTransferQuote, EvmWalletClient, EvmXReserveTransferExecution, EvmXReserveTransferQuote, ExecuteAleoHyperlaneTransferRemoteParameters, ExecuteParameters, ExecuteXReserveBurnParameters, ExecuteXReservePrivateMintParameters, GetStatusParameters, GetXReserveAttestationParameters, type ProtocolHelperRegistry, QuoteParameters, type ReadHyperlaneDeliveryParameters, type ReadXReserveDeliveryParameters, RecoverParameters, ResumeParameters, ShieldParameters, SolanaClient, SolanaHyperlaneTransferExecution, SolanaHyperlaneTransferQuote, SolanaWalletClient, UnshieldParameters, WaitParameters, XReserveAttestationResult, XReserveBurnCall, XReserveBurnExecution, XReserveHttpTransport, XReservePrivateMintExecution, aleoAddressToBytes32, aleoProgramAddress, buildAleoHyperlaneTransferRemoteCall, buildXReserveBurnCall, buildXReserveDepositPayload, buildXReserveHookData, bytes32ToAleoAddress, calculateXReserveDepositNonce, calculateXReserveMessageHash, complete, createBridgeCheckpoint, evmAddressToAleoHyperlaneRecipient, evmAddressToXReserveBytes32, execute, formatDecimalAmount, getStatus, hyperlane, parseDecimalAmount, quote, readHyperlaneDelivery, readXReserveDelivery, recover, resume, shield, solanaAddressToAleoHyperlaneRecipient, unshield, validateBridgeRegistry, wait, xReserveDepositNonceFromPayload, xReserveHexToAleoBytes, xreserve };