@provablehq/aleo-bridge-sdk 0.8.0-rc.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/LICENSE +21 -0
- package/README.md +325 -0
- package/dist/agent/index.d.ts +22 -0
- package/dist/agent/index.js +7 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/chunk-KG3LFIU5.js +61 -0
- package/dist/chunk-KG3LFIU5.js.map +1 -0
- package/dist/createBridgeClient-CjHY-JvW.d.ts +779 -0
- package/dist/index.d.ts +421 -0
- package/dist/index.js +1627 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/index.d.ts +26 -0
- package/dist/mcp/index.js +13 -0
- package/dist/mcp/index.js.map +1 -0
- package/package.json +60 -0
|
@@ -0,0 +1,779 @@
|
|
|
1
|
+
import { TransactionInput, Client } from '@provablehq/veil-core';
|
|
2
|
+
import { Address, Hex, Hash } from 'viem';
|
|
3
|
+
|
|
4
|
+
/** Identifies the protocol that carries a bridge transfer. */
|
|
5
|
+
type BridgeProtocol = 'xreserve' | 'hyperlane';
|
|
6
|
+
/** Identifies the deployment environment selected by a bridge client. */
|
|
7
|
+
type BridgeEnvironment = 'mainnet' | 'testnet';
|
|
8
|
+
/** Identifies the transaction model used by a chain. */
|
|
9
|
+
type BridgeChainFamily = 'aleo' | 'evm' | 'solana';
|
|
10
|
+
/**
|
|
11
|
+
* Describes a chain known to the protocol bridge registry.
|
|
12
|
+
*
|
|
13
|
+
* @property id Stable SDK identifier used by assets and routes.
|
|
14
|
+
* @property displayName Human-readable chain name.
|
|
15
|
+
* @property family Transaction model used to prepare transfer steps.
|
|
16
|
+
* @property environment Deployment environment containing the chain.
|
|
17
|
+
* @property nativeCurrencySymbol Symbol used to pay transaction fees.
|
|
18
|
+
* @property protocolDomains Protocol-specific domain identifiers when known.
|
|
19
|
+
*/
|
|
20
|
+
type ProtocolBridgeChain = {
|
|
21
|
+
id: string;
|
|
22
|
+
displayName: string;
|
|
23
|
+
family: BridgeChainFamily;
|
|
24
|
+
environment: BridgeEnvironment;
|
|
25
|
+
nativeCurrencySymbol: string;
|
|
26
|
+
protocolDomains?: Partial<Record<BridgeProtocol, string | number>> | undefined;
|
|
27
|
+
};
|
|
28
|
+
/** Identifies how an asset exists on its chain. */
|
|
29
|
+
type BridgeAssetKind = 'native' | 'token';
|
|
30
|
+
/**
|
|
31
|
+
* Locates a token on its chain.
|
|
32
|
+
*
|
|
33
|
+
* @property kind Namespace containing the identifier.
|
|
34
|
+
* @property value Contract, program, mint, or native-denom identifier.
|
|
35
|
+
* @property tokenId Optional token identifier within a shared token program.
|
|
36
|
+
*/
|
|
37
|
+
type BridgeAssetLocator = {
|
|
38
|
+
kind: 'aleo-program' | 'evm-contract' | 'solana-mint' | 'native';
|
|
39
|
+
value: string;
|
|
40
|
+
tokenId?: string | undefined;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Describes one chain-specific representation of a bridgeable asset.
|
|
44
|
+
*
|
|
45
|
+
* @property id Stable registry identifier, scoped to one chain.
|
|
46
|
+
* @property chainId Chain carrying this representation.
|
|
47
|
+
* @property symbol Display symbol.
|
|
48
|
+
* @property name Human-readable asset name.
|
|
49
|
+
* @property decimals Number of decimal places accepted in display amounts.
|
|
50
|
+
* @property kind Whether the representation is native currency or a token.
|
|
51
|
+
* @property locator Onchain identifier when the deployment is known.
|
|
52
|
+
* @property addressValidationRegex Optional recipient validation expression.
|
|
53
|
+
*/
|
|
54
|
+
type ProtocolBridgeAsset = {
|
|
55
|
+
id: string;
|
|
56
|
+
chainId: string;
|
|
57
|
+
symbol: string;
|
|
58
|
+
name: string;
|
|
59
|
+
decimals: number;
|
|
60
|
+
kind: BridgeAssetKind;
|
|
61
|
+
locator?: BridgeAssetLocator | undefined;
|
|
62
|
+
addressValidationRegex?: string | undefined;
|
|
63
|
+
};
|
|
64
|
+
/** Reports whether a route has enough reviewed metadata for execution. */
|
|
65
|
+
type BridgeRouteAvailability = 'active' | 'metadata-required' | 'disabled';
|
|
66
|
+
/**
|
|
67
|
+
* Describes one directional protocol route.
|
|
68
|
+
*
|
|
69
|
+
* @property id Stable route identifier.
|
|
70
|
+
* @property protocol Protocol responsible for delivery.
|
|
71
|
+
* @property environment Deployment environment containing both endpoints.
|
|
72
|
+
* @property sourceAssetId Registry id of the debited asset.
|
|
73
|
+
* @property destinationAssetId Registry id of the delivered asset.
|
|
74
|
+
* @property availability Readiness for transaction execution.
|
|
75
|
+
* @property deploymentId Upstream protocol deployment identifier when known.
|
|
76
|
+
* @property source Reference used to audit the route metadata.
|
|
77
|
+
* @property metadata Protocol-specific non-secret configuration.
|
|
78
|
+
*/
|
|
79
|
+
type ProtocolBridgeRoute = {
|
|
80
|
+
id: string;
|
|
81
|
+
protocol: BridgeProtocol;
|
|
82
|
+
environment: BridgeEnvironment;
|
|
83
|
+
sourceAssetId: string;
|
|
84
|
+
destinationAssetId: string;
|
|
85
|
+
availability: BridgeRouteAvailability;
|
|
86
|
+
deploymentId?: string | undefined;
|
|
87
|
+
source?: string | undefined;
|
|
88
|
+
metadata?: Readonly<Record<string, string | number | boolean>> | undefined;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Stores reviewed bridge chains, assets, and directional routes.
|
|
92
|
+
*
|
|
93
|
+
* @property version Caller-visible version used to pin and audit configuration.
|
|
94
|
+
* @property chains Chain metadata referenced by assets.
|
|
95
|
+
* @property assets Chain-specific assets referenced by routes.
|
|
96
|
+
* @property routes Directional protocol routes.
|
|
97
|
+
* @property sources Upstream registries and documentation used to build the snapshot.
|
|
98
|
+
*/
|
|
99
|
+
type BridgeRegistry = {
|
|
100
|
+
version: string;
|
|
101
|
+
chains: readonly ProtocolBridgeChain[];
|
|
102
|
+
assets: readonly ProtocolBridgeAsset[];
|
|
103
|
+
routes: readonly ProtocolBridgeRoute[];
|
|
104
|
+
sources?: readonly string[] | undefined;
|
|
105
|
+
};
|
|
106
|
+
/** Identifies the signer or service responsible for a transfer step. */
|
|
107
|
+
type BridgeStepExecutor = 'aleo-wallet' | 'evm-wallet' | 'solana-wallet' | 'protocol';
|
|
108
|
+
/** Identifies a resumable operation in a protocol transfer. */
|
|
109
|
+
type BridgeExecutionStepKind = 'approve' | 'deposit' | 'burn' | 'dispatch' | 'wait-attestation' | 'mint' | 'withdraw' | 'wait-delivery' | 'confirm-delivery';
|
|
110
|
+
/**
|
|
111
|
+
* Describes one ordered operation in a prepared transfer.
|
|
112
|
+
*
|
|
113
|
+
* @property key Stable step key within the plan.
|
|
114
|
+
* @property kind Operation the executor performs.
|
|
115
|
+
* @property chainId Chain on which the operation occurs, when applicable.
|
|
116
|
+
* @property executor Wallet or protocol service responsible for the operation.
|
|
117
|
+
* @property description Human-readable consequence of the step.
|
|
118
|
+
* @property irreversible Whether submitting the step commits funds to the protocol flow.
|
|
119
|
+
*/
|
|
120
|
+
type BridgeExecutionStep = {
|
|
121
|
+
key: string;
|
|
122
|
+
kind: BridgeExecutionStepKind;
|
|
123
|
+
chainId?: string | undefined;
|
|
124
|
+
executor: BridgeStepExecutor;
|
|
125
|
+
description: string;
|
|
126
|
+
irreversible: boolean;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* Describes a fee associated with a transfer plan.
|
|
130
|
+
*
|
|
131
|
+
* @property kind Fee category.
|
|
132
|
+
* @property chainId Chain charging the fee.
|
|
133
|
+
* @property assetId Asset used to pay the fee when known.
|
|
134
|
+
* @property amount Decimal fee amount when available.
|
|
135
|
+
* @property estimated Whether the amount can change before submission.
|
|
136
|
+
*/
|
|
137
|
+
type BridgeFee = {
|
|
138
|
+
kind: 'network' | 'protocol' | 'relayer';
|
|
139
|
+
chainId: string;
|
|
140
|
+
assetId?: string | undefined;
|
|
141
|
+
amount?: string | undefined;
|
|
142
|
+
estimated: boolean;
|
|
143
|
+
};
|
|
144
|
+
/** Identifies how much live protocol information a transfer quote contains. */
|
|
145
|
+
type BridgeQuoteStatus = 'not-queried' | 'estimated' | 'confirmed';
|
|
146
|
+
/** Selects the Aleo destination transition used for an xReserve mint. */
|
|
147
|
+
type AleoMintMode = 'public' | 'record' | 'private';
|
|
148
|
+
/**
|
|
149
|
+
* Captures protocol fees and expected delivery for a directional route.
|
|
150
|
+
*
|
|
151
|
+
* @property routeId Directional route the quote prices.
|
|
152
|
+
* @property protocol Protocol responsible for delivery.
|
|
153
|
+
* @property amountIn Decimal source amount.
|
|
154
|
+
* @property amountOut Expected decimal destination amount after known fees.
|
|
155
|
+
* @property fees Network, protocol, and relayer fee components.
|
|
156
|
+
* @property status Whether protocol endpoints have supplied live values.
|
|
157
|
+
* @property expiresAt Expiration time for protocol-bound fee data when present.
|
|
158
|
+
*/
|
|
159
|
+
type BridgeTransferQuote = {
|
|
160
|
+
routeId: string;
|
|
161
|
+
protocol: BridgeProtocol;
|
|
162
|
+
amountIn: string;
|
|
163
|
+
amountOut?: string | undefined;
|
|
164
|
+
fees: BridgeFee[];
|
|
165
|
+
status: BridgeQuoteStatus;
|
|
166
|
+
expiresAt?: string | undefined;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Parameters for preparing a protocol bridge transfer.
|
|
170
|
+
*
|
|
171
|
+
* @property routeId Directional route selected from `getRoutes`.
|
|
172
|
+
* @property amount Decimal source amount in display units.
|
|
173
|
+
* @property recipient Destination-chain recipient.
|
|
174
|
+
* @property sender Optional source-chain sender used by future fee and approval planning.
|
|
175
|
+
* @property mintMode Aleo mint transition selected for xReserve delivery. Defaults to `public`.
|
|
176
|
+
* @property privateMintSecretNonce Aleo scalar literal committed into a private-mint hook. Defaults to `0scalar`; applies only to `private` mode and must remain available for the destination transaction.
|
|
177
|
+
* @property privateRecipient Deprecated alias for `mintMode: 'private'`. Defaults to false.
|
|
178
|
+
*/
|
|
179
|
+
type PrepareTransferParameters = {
|
|
180
|
+
routeId: string;
|
|
181
|
+
amount: string;
|
|
182
|
+
recipient: string;
|
|
183
|
+
sender?: string | undefined;
|
|
184
|
+
mintMode?: AleoMintMode | undefined;
|
|
185
|
+
privateMintSecretNonce?: string | undefined;
|
|
186
|
+
/** @deprecated Use `mintMode: 'private'`; retained for compatibility through the next major release. */
|
|
187
|
+
privateRecipient?: boolean | undefined;
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* Captures a locally prepared, non-fund-moving bridge transfer.
|
|
191
|
+
*
|
|
192
|
+
* @property registryVersion Registry snapshot used to build the plan.
|
|
193
|
+
* @property protocol Protocol responsible for delivery.
|
|
194
|
+
* @property route Directional route selected by the caller.
|
|
195
|
+
* @property sourceAsset Asset debited by the source transaction.
|
|
196
|
+
* @property destinationAsset Asset delivered on the destination chain.
|
|
197
|
+
* @property amountIn Decimal source amount.
|
|
198
|
+
* @property amountOut Expected decimal destination amount when determinable without a live fee query.
|
|
199
|
+
* @property recipient Destination-chain recipient.
|
|
200
|
+
* @property sender Optional source-chain sender.
|
|
201
|
+
* @property mintMode Aleo destination transition selected by the caller.
|
|
202
|
+
* @property privateMintSecretNonce Aleo scalar literal committed into a private-mint hook. Present only for private xReserve mints and sensitive until submission.
|
|
203
|
+
* @property privateRecipient Whether the destination requests private Aleo delivery.
|
|
204
|
+
* @property fees Known fee categories; amounts remain absent until protocol quoting is implemented.
|
|
205
|
+
* @property steps Ordered operations required to complete the transfer.
|
|
206
|
+
*/
|
|
207
|
+
type BridgeTransferPlan = {
|
|
208
|
+
registryVersion: string;
|
|
209
|
+
protocol: BridgeProtocol;
|
|
210
|
+
route: ProtocolBridgeRoute;
|
|
211
|
+
sourceAsset: ProtocolBridgeAsset;
|
|
212
|
+
destinationAsset: ProtocolBridgeAsset;
|
|
213
|
+
amountIn: string;
|
|
214
|
+
amountOut?: string | undefined;
|
|
215
|
+
recipient: string;
|
|
216
|
+
sender?: string | undefined;
|
|
217
|
+
mintMode: AleoMintMode;
|
|
218
|
+
privateMintSecretNonce?: string | undefined;
|
|
219
|
+
privateRecipient: boolean;
|
|
220
|
+
quote: BridgeTransferQuote;
|
|
221
|
+
fees: BridgeFee[];
|
|
222
|
+
steps: BridgeExecutionStep[];
|
|
223
|
+
};
|
|
224
|
+
/** Identifies the normalized lifecycle state of a protocol transfer. */
|
|
225
|
+
type BridgeTransferStatus = 'PREPARED' | 'SOURCE_APPROVAL_PENDING' | 'SOURCE_SUBMISSION_PENDING' | 'SOURCE_CONFIRMING' | 'ATTESTATION_PENDING' | 'DELIVERY_PENDING' | 'DESTINATION_CONFIRMING' | 'COMPLETED' | 'FAILED' | 'EXPIRED';
|
|
226
|
+
/**
|
|
227
|
+
* Captures protocol-neutral transfer progress and protocol-native state.
|
|
228
|
+
*
|
|
229
|
+
* @property id Stable transfer or message identifier.
|
|
230
|
+
* @property protocol Protocol responsible for delivery.
|
|
231
|
+
* @property status Normalized lifecycle state.
|
|
232
|
+
* @property sourceTxId Source-chain transaction identifier when submitted.
|
|
233
|
+
* @property destinationTxId Destination-chain transaction identifier when submitted.
|
|
234
|
+
* @property messageId Hyperlane message identifier when applicable.
|
|
235
|
+
* @property protocolState Protocol-native progress fields retained for diagnostics and resumption.
|
|
236
|
+
*/
|
|
237
|
+
type BridgeTransferReceipt = {
|
|
238
|
+
id: string;
|
|
239
|
+
protocol: BridgeProtocol;
|
|
240
|
+
status: BridgeTransferStatus;
|
|
241
|
+
sourceTxId?: string | undefined;
|
|
242
|
+
destinationTxId?: string | undefined;
|
|
243
|
+
messageId?: string | undefined;
|
|
244
|
+
protocolState: Readonly<Record<string, unknown>>;
|
|
245
|
+
};
|
|
246
|
+
|
|
247
|
+
/** Filters the protocol asset catalog. */
|
|
248
|
+
type GetProtocolAssetsParameters = {
|
|
249
|
+
environment?: BridgeEnvironment | undefined;
|
|
250
|
+
chainId?: string | undefined;
|
|
251
|
+
symbol?: string | undefined;
|
|
252
|
+
};
|
|
253
|
+
/** Filters directional protocol routes. */
|
|
254
|
+
type GetProtocolRoutesParameters = {
|
|
255
|
+
environment?: BridgeEnvironment | undefined;
|
|
256
|
+
protocol?: BridgeProtocol | undefined;
|
|
257
|
+
sourceChainId?: string | undefined;
|
|
258
|
+
destinationChainId?: string | undefined;
|
|
259
|
+
symbol?: string | undefined;
|
|
260
|
+
includeUnavailable?: boolean | undefined;
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* Lists chain-specific assets from a protocol bridge registry.
|
|
264
|
+
*
|
|
265
|
+
* Pure and local. Filters match identifiers and symbols case-insensitively.
|
|
266
|
+
*
|
|
267
|
+
* @param registry Reviewed registry snapshot.
|
|
268
|
+
* @param params Optional environment, chain, and symbol filters.
|
|
269
|
+
* @returns Matching assets in registry order.
|
|
270
|
+
*
|
|
271
|
+
* @example
|
|
272
|
+
* const usdcx = getProtocolAssets(registry, { symbol: 'USDCx' })
|
|
273
|
+
*/
|
|
274
|
+
declare function getProtocolAssets(registry: BridgeRegistry, params?: GetProtocolAssetsParameters): ProtocolBridgeAsset[];
|
|
275
|
+
/**
|
|
276
|
+
* Lists directional routes from a protocol bridge registry.
|
|
277
|
+
*
|
|
278
|
+
* Pure and local. Routes marked `disabled` are omitted unless
|
|
279
|
+
* `includeUnavailable` is true; `metadata-required` routes remain visible so
|
|
280
|
+
* applications can distinguish known protocol support from execution readiness.
|
|
281
|
+
*
|
|
282
|
+
* @param registry Reviewed registry snapshot.
|
|
283
|
+
* @param params Optional protocol, environment, endpoint, and symbol filters.
|
|
284
|
+
* @returns Matching directional routes in registry order.
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* const outbound = getProtocolRoutes(registry, { sourceChainId: 'aleo' })
|
|
288
|
+
*/
|
|
289
|
+
declare function getProtocolRoutes(registry: BridgeRegistry, params?: GetProtocolRoutesParameters): ProtocolBridgeRoute[];
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Supplies a fetch-compatible HTTP response for Circle attestation requests.
|
|
293
|
+
*
|
|
294
|
+
* @property ok Whether the response status is successful.
|
|
295
|
+
* @property status Numeric HTTP status used to distinguish pending attestations.
|
|
296
|
+
* @property json Parses the response body as JSON.
|
|
297
|
+
*/
|
|
298
|
+
type XReserveHttpResponse = {
|
|
299
|
+
ok: boolean;
|
|
300
|
+
status: number;
|
|
301
|
+
json: () => Promise<unknown>;
|
|
302
|
+
};
|
|
303
|
+
/** Sends an HTTP request without coupling the bridge client to a runtime global. */
|
|
304
|
+
type XReserveHttpTransport = (url: string, init?: {
|
|
305
|
+
signal?: AbortSignal;
|
|
306
|
+
}) => Promise<XReserveHttpResponse>;
|
|
307
|
+
/**
|
|
308
|
+
* Captures reviewed Ethereum-to-Aleo xReserve deployment values.
|
|
309
|
+
*
|
|
310
|
+
* @property xReserveContract Ethereum contract receiving deposits.
|
|
311
|
+
* @property sourceChainId Expected EIP-155 wallet chain id.
|
|
312
|
+
* @property sourceDomain Circle domain included in the deposit nonce.
|
|
313
|
+
* @property remoteDomain Aleo Circle domain passed to `depositToRemote`.
|
|
314
|
+
* @property remoteTokenBytes32 Aleo USDCx token identifier in Circle wire form.
|
|
315
|
+
* @property minimumAmountAtomic Smallest supported deposit in USDC base units.
|
|
316
|
+
* @property maxFeeAtomic Maximum Circle fee in USDC base units.
|
|
317
|
+
* @property bridgeProgram Aleo program handling public and record mints.
|
|
318
|
+
* @property wrapperProgram Aleo program handling private wrapper mints.
|
|
319
|
+
* @property attestationBaseUrl Circle endpoint prefix for individual message hashes.
|
|
320
|
+
*/
|
|
321
|
+
type EvmXReserveRouteMetadata = {
|
|
322
|
+
xReserveContract: Address;
|
|
323
|
+
sourceChainId: number;
|
|
324
|
+
sourceDomain: number;
|
|
325
|
+
remoteDomain: number;
|
|
326
|
+
remoteTokenBytes32: Hex;
|
|
327
|
+
minimumAmountAtomic: bigint;
|
|
328
|
+
maxFeeAtomic: bigint;
|
|
329
|
+
bridgeProgram: string;
|
|
330
|
+
wrapperProgram: string;
|
|
331
|
+
attestationBaseUrl: string;
|
|
332
|
+
};
|
|
333
|
+
/**
|
|
334
|
+
* Selects a prepared xReserve transfer for live balance and allowance checks.
|
|
335
|
+
*
|
|
336
|
+
* @property plan Pure plan returned by `prepareTransfer`.
|
|
337
|
+
*/
|
|
338
|
+
type QuoteEvmXReserveTransferParameters = {
|
|
339
|
+
plan: BridgeTransferPlan;
|
|
340
|
+
};
|
|
341
|
+
/**
|
|
342
|
+
* Captures atomic values and allowance state required by an xReserve deposit.
|
|
343
|
+
*
|
|
344
|
+
* @property routeId Reviewed route used for the quote.
|
|
345
|
+
* @property xReserveContract Contract receiving the deposit.
|
|
346
|
+
* @property tokenAddress USDC contract approved and deposited.
|
|
347
|
+
* @property sourceChainId Expected EIP-155 wallet chain id.
|
|
348
|
+
* @property remoteDomain Aleo Circle domain supplied to the contract.
|
|
349
|
+
* @property remoteRecipientBytes32 User or wrapper address in wire form.
|
|
350
|
+
* @property amountAtomic Deposit amount in USDC base units.
|
|
351
|
+
* @property maxFeeAtomic Maximum Circle fee in USDC base units.
|
|
352
|
+
* @property hookData Fixed 65-byte Aleo mint instruction.
|
|
353
|
+
* @property balanceAtomic Connected account balance in USDC base units.
|
|
354
|
+
* @property allowanceAtomic Current xReserve allowance in USDC base units.
|
|
355
|
+
* @property approvalRequired Whether execution must submit an approval first.
|
|
356
|
+
*/
|
|
357
|
+
type EvmXReserveTransferQuote = {
|
|
358
|
+
routeId: string;
|
|
359
|
+
xReserveContract: Address;
|
|
360
|
+
tokenAddress: Address;
|
|
361
|
+
sourceChainId: number;
|
|
362
|
+
remoteDomain: number;
|
|
363
|
+
remoteRecipientBytes32: Hex;
|
|
364
|
+
amountAtomic: bigint;
|
|
365
|
+
maxFeeAtomic: bigint;
|
|
366
|
+
hookData: Hex;
|
|
367
|
+
balanceAtomic: bigint;
|
|
368
|
+
allowanceAtomic: bigint;
|
|
369
|
+
approvalRequired: boolean;
|
|
370
|
+
};
|
|
371
|
+
/**
|
|
372
|
+
* Configures an Ethereum-to-Aleo xReserve deposit submission.
|
|
373
|
+
*
|
|
374
|
+
* @property plan Pure plan returned by `prepareTransfer`.
|
|
375
|
+
* @property pollingIntervalMs Delay between receipt checks. Defaults to 1,000 milliseconds.
|
|
376
|
+
* @property confirmationTimeoutMs Maximum receipt wait per transaction. Defaults to 120,000 milliseconds.
|
|
377
|
+
*/
|
|
378
|
+
type ExecuteEvmXReserveTransferParameters = {
|
|
379
|
+
plan: BridgeTransferPlan;
|
|
380
|
+
pollingIntervalMs?: number | undefined;
|
|
381
|
+
confirmationTimeoutMs?: number | undefined;
|
|
382
|
+
};
|
|
383
|
+
/**
|
|
384
|
+
* Captures wallet transactions and resumable xReserve progress after execution.
|
|
385
|
+
*
|
|
386
|
+
* @property receipt Protocol-neutral status plus Circle payload identifiers.
|
|
387
|
+
* @property approvalTxIds ERC-20 approvals submitted before the deposit.
|
|
388
|
+
*/
|
|
389
|
+
type EvmXReserveTransferExecution = {
|
|
390
|
+
receipt: BridgeTransferReceipt;
|
|
391
|
+
approvalTxIds: Hash[];
|
|
392
|
+
};
|
|
393
|
+
/**
|
|
394
|
+
* Selects a Circle attestation by its 32-byte message hash.
|
|
395
|
+
*
|
|
396
|
+
* @property routeId Route supplying the environment-specific Circle endpoint.
|
|
397
|
+
* @property messageHash Keccak-256 hash returned by deposit execution.
|
|
398
|
+
* @property signal Optional cancellation signal. Defaults to no cancellation.
|
|
399
|
+
*/
|
|
400
|
+
type GetXReserveAttestationParameters = {
|
|
401
|
+
routeId: string;
|
|
402
|
+
messageHash: Hash;
|
|
403
|
+
signal?: AbortSignal | undefined;
|
|
404
|
+
};
|
|
405
|
+
/** Reports whether Circle has produced the signature for an xReserve message. */
|
|
406
|
+
type XReserveAttestationResult = {
|
|
407
|
+
status: 'pending';
|
|
408
|
+
messageHash: Hash;
|
|
409
|
+
} | {
|
|
410
|
+
status: 'complete';
|
|
411
|
+
messageHash: Hash;
|
|
412
|
+
payload: Hex;
|
|
413
|
+
attestation: Hex;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
/**
|
|
417
|
+
* Submits one Aleo program execution through an application-provided wallet client.
|
|
418
|
+
*
|
|
419
|
+
* The shape is compatible with Veil wallet clients and connected Aleo wallet adapters.
|
|
420
|
+
*
|
|
421
|
+
* @property executeTransaction Prompts the wallet to prove, sign, and broadcast a program call.
|
|
422
|
+
*/
|
|
423
|
+
type AleoBridgeExecutor = {
|
|
424
|
+
executeTransaction: (params: {
|
|
425
|
+
program: string;
|
|
426
|
+
function: string;
|
|
427
|
+
inputs: TransactionInput[];
|
|
428
|
+
privateFee?: boolean | undefined;
|
|
429
|
+
imports?: string[] | undefined;
|
|
430
|
+
}) => Promise<string | {
|
|
431
|
+
transactionId: string;
|
|
432
|
+
}>;
|
|
433
|
+
};
|
|
434
|
+
/**
|
|
435
|
+
* Configures submission of the user-authorized USDCx wrapper mint.
|
|
436
|
+
*
|
|
437
|
+
* @property plan Original private-mint transfer plan.
|
|
438
|
+
* @property deposit Confirmed EVM deposit receipt carrying the canonical payload.
|
|
439
|
+
* @property attestation Completed Circle payload and signature response.
|
|
440
|
+
* @property privateFee Whether the Aleo wallet should pay its fee privately. Defaults to false.
|
|
441
|
+
*/
|
|
442
|
+
type ExecuteXReservePrivateMintParameters = {
|
|
443
|
+
plan: BridgeTransferPlan;
|
|
444
|
+
deposit: BridgeTransferReceipt;
|
|
445
|
+
attestation: XReserveAttestationResult;
|
|
446
|
+
privateFee?: boolean | undefined;
|
|
447
|
+
};
|
|
448
|
+
/**
|
|
449
|
+
* Captures the submitted wrapper transaction and resumable destination state.
|
|
450
|
+
*
|
|
451
|
+
* @property transactionId Aleo transaction id returned by the connected wallet.
|
|
452
|
+
* @property receipt Transfer state retaining source, Circle, and destination identifiers.
|
|
453
|
+
*/
|
|
454
|
+
type XReservePrivateMintExecution = {
|
|
455
|
+
transactionId: string;
|
|
456
|
+
receipt: BridgeTransferReceipt;
|
|
457
|
+
};
|
|
458
|
+
/** Selects which deployed USDCx burn transition the Aleo wallet calls. */
|
|
459
|
+
type XReserveBurnMode = 'private' | 'public' | 'public-as-signer';
|
|
460
|
+
/**
|
|
461
|
+
* Describes one validated Aleo USDCx burn call without submitting it.
|
|
462
|
+
*
|
|
463
|
+
* @property routeId Aleo-to-Ethereum xReserve route used for the burn.
|
|
464
|
+
* @property mode Transition variant selected by the caller.
|
|
465
|
+
* @property program Deployed bridge or wrapper program receiving the transaction.
|
|
466
|
+
* @property function Exact burn transition invoked by the wallet.
|
|
467
|
+
* @property inputs Ordered Aleo literals and wallet record requests.
|
|
468
|
+
* @property amountAtomic Burn amount in USDCx base units.
|
|
469
|
+
* @property nativeDomain Circle Ethereum destination domain, fixed to 0.
|
|
470
|
+
* @property nativeRecipientBytes32 Ethereum recipient left-padded to 32 bytes.
|
|
471
|
+
*/
|
|
472
|
+
type XReserveBurnCall = {
|
|
473
|
+
routeId: string;
|
|
474
|
+
mode: XReserveBurnMode;
|
|
475
|
+
program: string;
|
|
476
|
+
function: 'burn_public_as_signer' | 'burn_public' | 'private_burn';
|
|
477
|
+
inputs: TransactionInput[];
|
|
478
|
+
amountAtomic: bigint;
|
|
479
|
+
nativeDomain: number;
|
|
480
|
+
nativeRecipientBytes32: `0x${string}`;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* Configures an Aleo USDCx burn destined for Ethereum USDC.
|
|
484
|
+
*
|
|
485
|
+
* @property plan Aleo-to-Ethereum plan returned by `prepareTransfer`.
|
|
486
|
+
* @property mode Burn transition to submit. Defaults to `private`.
|
|
487
|
+
* @property userRecord Wallet record request or encoded USDCx token record. Required only for `private`.
|
|
488
|
+
* @property merkleProof Encoded `[MerkleProof; 2]` Aleo literal. Required only for `private`.
|
|
489
|
+
* @property privateFee Whether the Aleo wallet should pay its fee privately. Defaults to false.
|
|
490
|
+
*/
|
|
491
|
+
type ExecuteXReserveBurnParameters = {
|
|
492
|
+
plan: BridgeTransferPlan;
|
|
493
|
+
mode?: XReserveBurnMode | undefined;
|
|
494
|
+
userRecord?: TransactionInput | undefined;
|
|
495
|
+
merkleProof?: string | undefined;
|
|
496
|
+
privateFee?: boolean | undefined;
|
|
497
|
+
};
|
|
498
|
+
/**
|
|
499
|
+
* Captures the submitted Aleo burn and the service-managed delivery state.
|
|
500
|
+
*
|
|
501
|
+
* @property transactionId Aleo transaction id returned by the connected wallet.
|
|
502
|
+
* @property receipt Transfer state retained while the Aleo attestation service forwards the burn to Circle.
|
|
503
|
+
*/
|
|
504
|
+
type XReserveBurnExecution = {
|
|
505
|
+
transactionId: string;
|
|
506
|
+
receipt: BridgeTransferReceipt;
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* Describes one locally constructed Aleo Hyperlane transfer call.
|
|
510
|
+
*
|
|
511
|
+
* @property routeId Directional Hyperlane route used to construct the call.
|
|
512
|
+
* @property program Aleo Warp Route program receiving the transaction.
|
|
513
|
+
* @property function Exact Warp Route transition invoked by the wallet.
|
|
514
|
+
* @property inputs Seven ordered Aleo literals expected by the selected transfer transition.
|
|
515
|
+
* @property amountAtomic Source amount expressed in the Aleo token's base units.
|
|
516
|
+
* @property usesPlaceholderConfiguration Whether unresolved deployment values make the call unsafe to submit.
|
|
517
|
+
* @property placeholderFields Registry fields that must be replaced before submission is enabled.
|
|
518
|
+
*/
|
|
519
|
+
type AleoHyperlaneTransferRemoteCall = {
|
|
520
|
+
routeId: string;
|
|
521
|
+
program: string;
|
|
522
|
+
function: 'transfer_remote' | 'transfer_remote_as_signer';
|
|
523
|
+
inputs: TransactionInput[];
|
|
524
|
+
amountAtomic: bigint;
|
|
525
|
+
usesPlaceholderConfiguration: boolean;
|
|
526
|
+
placeholderFields: readonly string[];
|
|
527
|
+
};
|
|
528
|
+
/**
|
|
529
|
+
* Configures construction or submission of an Aleo Hyperlane withdrawal.
|
|
530
|
+
*
|
|
531
|
+
* @property plan Aleo-origin Hyperlane plan returned by `prepareTransfer`.
|
|
532
|
+
* @property mode Whether the program burns from `self.caller` or the EOA-bound `self.signer`. Defaults to `caller`.
|
|
533
|
+
* @property privateFee Whether the Aleo wallet should pay its fee privately. Defaults to false.
|
|
534
|
+
*/
|
|
535
|
+
type ExecuteAleoHyperlaneTransferRemoteParameters = {
|
|
536
|
+
plan: BridgeTransferPlan;
|
|
537
|
+
mode?: 'caller' | 'signer' | undefined;
|
|
538
|
+
privateFee?: boolean | undefined;
|
|
539
|
+
};
|
|
540
|
+
/**
|
|
541
|
+
* Captures a submitted Aleo Hyperlane dispatch.
|
|
542
|
+
*
|
|
543
|
+
* @property transactionId Aleo transaction id returned by the connected wallet.
|
|
544
|
+
* @property receipt Resumable receipt awaiting Hyperlane delivery.
|
|
545
|
+
*/
|
|
546
|
+
type AleoHyperlaneTransferRemoteExecution = {
|
|
547
|
+
transactionId: string;
|
|
548
|
+
receipt: BridgeTransferReceipt;
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Sends JSON-RPC requests through an injected or application-provided EVM wallet.
|
|
553
|
+
*
|
|
554
|
+
* The shape is compatible with EIP-1193 providers exposed by wallets such as
|
|
555
|
+
* MetaMask and Phantom. The bridge package never reads a runtime global.
|
|
556
|
+
*
|
|
557
|
+
* @property request Executes one EIP-1193 request, which may prompt the wallet for transaction approval.
|
|
558
|
+
* @property account Optional connected account. When omitted, the executor resolves the first `eth_accounts` entry.
|
|
559
|
+
*/
|
|
560
|
+
type EvmBridgeExecutor = {
|
|
561
|
+
request: (args: {
|
|
562
|
+
method: string;
|
|
563
|
+
params?: readonly unknown[] | Record<string, unknown> | undefined;
|
|
564
|
+
}) => Promise<unknown>;
|
|
565
|
+
account?: Address | undefined;
|
|
566
|
+
};
|
|
567
|
+
/**
|
|
568
|
+
* Groups optional chain executors supplied to a bridge client.
|
|
569
|
+
*
|
|
570
|
+
* @property evm EIP-1193 executor used by Ethereum bridge actions when present.
|
|
571
|
+
* @property aleo Wallet client used only for user-authorized Aleo transactions such as private USDCx minting.
|
|
572
|
+
*/
|
|
573
|
+
type BridgeExecutors = {
|
|
574
|
+
evm?: EvmBridgeExecutor | undefined;
|
|
575
|
+
aleo?: AleoBridgeExecutor | undefined;
|
|
576
|
+
};
|
|
577
|
+
/** Identifies the Ethereum Hyperlane router's collateral model. */
|
|
578
|
+
type EvmHyperlaneRouterType = 'native' | 'collateral';
|
|
579
|
+
/**
|
|
580
|
+
* Captures the reviewed metadata required to dispatch an Ethereum Warp Route transfer.
|
|
581
|
+
*
|
|
582
|
+
* @property routerAddress Contract receiving `transferRemote`.
|
|
583
|
+
* @property sourceChainId EIP-155 chain id expected from the connected wallet.
|
|
584
|
+
* @property destinationDomain Hyperlane domain passed to `transferRemote` as a uint32.
|
|
585
|
+
* @property routerType Whether the router locks native ETH or ERC-20 collateral.
|
|
586
|
+
* @property tokenAddress ERC-20 collateral contract. Required for collateral routers.
|
|
587
|
+
* @property destinationRouter Protocol-native identifier of the enrolled Aleo router.
|
|
588
|
+
* @property mailboxAddress Ethereum Hyperlane Mailbox used by the reviewed deployment.
|
|
589
|
+
* @property interchainGasPaymaster Ethereum gas-paymaster identifier used by the reviewed deployment.
|
|
590
|
+
* @property interchainSecurityModule Route-specific ISM, or the zero address when the Mailbox default applies.
|
|
591
|
+
* @property registryCommit Hyperlane Registry commit containing the deployment snapshot.
|
|
592
|
+
* @property requiresApprovalReset Whether a non-zero ERC-20 allowance must be reset before changing it.
|
|
593
|
+
*/
|
|
594
|
+
type EvmHyperlaneRouteMetadata = {
|
|
595
|
+
routerAddress: Address;
|
|
596
|
+
sourceChainId: number;
|
|
597
|
+
destinationDomain: number;
|
|
598
|
+
routerType: EvmHyperlaneRouterType;
|
|
599
|
+
tokenAddress?: Address | undefined;
|
|
600
|
+
destinationRouter: string;
|
|
601
|
+
mailboxAddress: Address;
|
|
602
|
+
interchainGasPaymaster: Address;
|
|
603
|
+
interchainSecurityModule: Address;
|
|
604
|
+
registryCommit: string;
|
|
605
|
+
requiresApprovalReset?: boolean | undefined;
|
|
606
|
+
};
|
|
607
|
+
/**
|
|
608
|
+
* Selects a prepared Ethereum Hyperlane transfer for live fee quoting.
|
|
609
|
+
*
|
|
610
|
+
* @property plan Pure transfer plan returned by `prepareTransfer`.
|
|
611
|
+
* @property recipientBytes32 Aleo recipient in the exact 32-byte encoding expected by the enrolled Warp Route.
|
|
612
|
+
*/
|
|
613
|
+
type QuoteEvmHyperlaneTransferParameters = {
|
|
614
|
+
plan: BridgeTransferPlan;
|
|
615
|
+
recipientBytes32: Hex;
|
|
616
|
+
};
|
|
617
|
+
/**
|
|
618
|
+
* Captures the atomic values required by an Ethereum Warp Route transaction.
|
|
619
|
+
*
|
|
620
|
+
* @property routeId Route whose deployment and amount were quoted.
|
|
621
|
+
* @property routerAddress Contract that supplied the quote.
|
|
622
|
+
* @property sourceChainId EIP-155 chain id on which submission must occur.
|
|
623
|
+
* @property destinationDomain Hyperlane destination domain supplied to the router.
|
|
624
|
+
* @property recipientBytes32 Wire-format destination recipient.
|
|
625
|
+
* @property amountAtomic Asset amount passed to `transferRemote`.
|
|
626
|
+
* @property nativeValueAtomic Total `msg.value` required by the router.
|
|
627
|
+
* @property nativeFeeAtomic Native fee above the bridged amount for native routes, or the full native fee for collateral routes.
|
|
628
|
+
* @property tokenAmountAtomic ERC-20 amount requiring allowance for collateral routes.
|
|
629
|
+
* @property tokenAddress ERC-20 collateral contract for collateral routes.
|
|
630
|
+
*/
|
|
631
|
+
type EvmHyperlaneTransferQuote = {
|
|
632
|
+
routeId: string;
|
|
633
|
+
routerAddress: Address;
|
|
634
|
+
sourceChainId: number;
|
|
635
|
+
destinationDomain: number;
|
|
636
|
+
recipientBytes32: Hex;
|
|
637
|
+
amountAtomic: bigint;
|
|
638
|
+
nativeValueAtomic: bigint;
|
|
639
|
+
nativeFeeAtomic: bigint;
|
|
640
|
+
tokenAmountAtomic?: bigint | undefined;
|
|
641
|
+
tokenAddress?: Address | undefined;
|
|
642
|
+
};
|
|
643
|
+
/**
|
|
644
|
+
* Configures an Ethereum Hyperlane submission.
|
|
645
|
+
*
|
|
646
|
+
* The action requotes immediately before submission. ERC-20 allowance is
|
|
647
|
+
* checked first and only insufficient allowances generate approval calls.
|
|
648
|
+
*
|
|
649
|
+
* @property plan Pure transfer plan returned by `prepareTransfer`.
|
|
650
|
+
* @property recipientBytes32 Aleo recipient in the exact 32-byte encoding expected by the enrolled Warp Route.
|
|
651
|
+
* @property pollingIntervalMs Delay between transaction-receipt checks. Defaults to 1,000 milliseconds.
|
|
652
|
+
* @property confirmationTimeoutMs Maximum time to wait for each approval or dispatch receipt. Defaults to 120,000 milliseconds; a timeout returns resumable pending state.
|
|
653
|
+
*/
|
|
654
|
+
type ExecuteEvmHyperlaneTransferParameters = {
|
|
655
|
+
plan: BridgeTransferPlan;
|
|
656
|
+
recipientBytes32: Hex;
|
|
657
|
+
pollingIntervalMs?: number | undefined;
|
|
658
|
+
confirmationTimeoutMs?: number | undefined;
|
|
659
|
+
};
|
|
660
|
+
/**
|
|
661
|
+
* Captures wallet transactions and resumable Hyperlane progress after execution.
|
|
662
|
+
*
|
|
663
|
+
* @property receipt Protocol-neutral transfer state, including the source transaction and message id when confirmed.
|
|
664
|
+
* @property approvalTxIds ERC-20 approval transactions submitted before dispatch.
|
|
665
|
+
*/
|
|
666
|
+
type EvmHyperlaneTransferExecution = {
|
|
667
|
+
receipt: BridgeTransferReceipt;
|
|
668
|
+
approvalTxIds: Hash[];
|
|
669
|
+
};
|
|
670
|
+
|
|
671
|
+
/**
|
|
672
|
+
* Carries registry defaults from client construction into bound actions.
|
|
673
|
+
*
|
|
674
|
+
* @property environment Environment applied when an action omits its filter.
|
|
675
|
+
* @property registry Reviewed snapshot supplying chains, assets, and routes.
|
|
676
|
+
* @property executors Optional wallet capabilities injected at construction.
|
|
677
|
+
* @property xReserveHttpTransport Optional HTTP capability for Circle attestation lookups.
|
|
678
|
+
*/
|
|
679
|
+
type BridgeActionsConfig = {
|
|
680
|
+
environment: BridgeEnvironment;
|
|
681
|
+
registry: BridgeRegistry;
|
|
682
|
+
executors?: BridgeExecutors | undefined;
|
|
683
|
+
xReserveHttpTransport?: XReserveHttpTransport | undefined;
|
|
684
|
+
};
|
|
685
|
+
/**
|
|
686
|
+
* Lists the protocol-oriented actions bound to a bridge client.
|
|
687
|
+
*
|
|
688
|
+
* @property getAssets Lists chain-specific registry assets without network access.
|
|
689
|
+
* @property getRoutes Lists directional registry routes without network access.
|
|
690
|
+
* @property prepareTransfer Validates inputs and returns a non-fund-moving execution plan.
|
|
691
|
+
* @property quoteEvmHyperlaneTransfer Reads live Ethereum Warp Route fees without signing.
|
|
692
|
+
* @property executeEvmHyperlaneTransfer Approves collateral when needed, then signs and dispatches through the Ethereum wallet.
|
|
693
|
+
* @property quoteEvmXReserveTransfer Reads USDC balance and allowance and derives Circle deposit inputs.
|
|
694
|
+
* @property executeEvmXReserveTransfer Approves USDC when needed and submits the Circle deposit.
|
|
695
|
+
* @property getXReserveAttestation Fetches one Circle attestation by message hash.
|
|
696
|
+
* @property executeXReservePrivateMint Prompts the Aleo wallet for the wrapper private mint.
|
|
697
|
+
* @property executeXReserveBurn Prompts the Aleo wallet for one of the reviewed USDCx burn transitions.
|
|
698
|
+
* @property buildAleoHyperlaneTransferRemoteCall Constructs the seven-input Aleo Warp Route call without wallet access.
|
|
699
|
+
* @property executeAleoHyperlaneTransferRemote Submits only fully reviewed, non-placeholder Aleo Warp Route calls.
|
|
700
|
+
*/
|
|
701
|
+
type BridgeActions = {
|
|
702
|
+
getAssets: (params?: GetProtocolAssetsParameters) => ProtocolBridgeAsset[];
|
|
703
|
+
getRoutes: (params?: GetProtocolRoutesParameters) => ProtocolBridgeRoute[];
|
|
704
|
+
prepareTransfer: (params: PrepareTransferParameters) => BridgeTransferPlan;
|
|
705
|
+
quoteEvmHyperlaneTransfer: (params: QuoteEvmHyperlaneTransferParameters) => Promise<EvmHyperlaneTransferQuote>;
|
|
706
|
+
executeEvmHyperlaneTransfer: (params: ExecuteEvmHyperlaneTransferParameters) => Promise<EvmHyperlaneTransferExecution>;
|
|
707
|
+
quoteEvmXReserveTransfer: (params: QuoteEvmXReserveTransferParameters) => Promise<EvmXReserveTransferQuote>;
|
|
708
|
+
executeEvmXReserveTransfer: (params: ExecuteEvmXReserveTransferParameters) => Promise<EvmXReserveTransferExecution>;
|
|
709
|
+
getXReserveAttestation: (params: GetXReserveAttestationParameters) => Promise<XReserveAttestationResult>;
|
|
710
|
+
executeXReservePrivateMint: (params: ExecuteXReservePrivateMintParameters) => Promise<XReservePrivateMintExecution>;
|
|
711
|
+
executeXReserveBurn: (params: ExecuteXReserveBurnParameters) => Promise<XReserveBurnExecution>;
|
|
712
|
+
buildAleoHyperlaneTransferRemoteCall: (params: ExecuteAleoHyperlaneTransferRemoteParameters) => AleoHyperlaneTransferRemoteCall;
|
|
713
|
+
executeAleoHyperlaneTransferRemote: (params: ExecuteAleoHyperlaneTransferRemoteParameters) => Promise<AleoHyperlaneTransferRemoteExecution>;
|
|
714
|
+
};
|
|
715
|
+
/**
|
|
716
|
+
* Binds registry discovery and transfer planning to a client.
|
|
717
|
+
*
|
|
718
|
+
* Discovery and planning are pure and local. EVM actions use the optional
|
|
719
|
+
* executor injected through the configuration and fail before network access
|
|
720
|
+
* when it is absent.
|
|
721
|
+
*
|
|
722
|
+
* @param client Client receiving the action layer.
|
|
723
|
+
* @param config Registry and default environment selected at construction.
|
|
724
|
+
* @returns Bound protocol bridge actions.
|
|
725
|
+
*
|
|
726
|
+
* @example
|
|
727
|
+
* const actions = bridgeActions(client, { environment: 'mainnet', registry })
|
|
728
|
+
*/
|
|
729
|
+
declare function bridgeActions(_client: Client, config: BridgeActionsConfig): BridgeActions;
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Configures a protocol bridge client.
|
|
733
|
+
*
|
|
734
|
+
* @property environment Routes and assets exposed by default. Defaults to `mainnet`.
|
|
735
|
+
* @property registry Reviewed protocol deployment snapshot. Defaults to {@link DEFAULT_BRIDGE_REGISTRY}.
|
|
736
|
+
* @property executors Optional wallet capabilities used by fund-moving protocol actions.
|
|
737
|
+
* @property xReserveHttpTransport Optional fetch-compatible transport used for Circle attestation requests.
|
|
738
|
+
* @property key Client identifier. Defaults to `bridge`.
|
|
739
|
+
* @property name Human-readable client name. Defaults to `Bridge Client`.
|
|
740
|
+
*/
|
|
741
|
+
type BridgeClientConfig = {
|
|
742
|
+
environment?: BridgeEnvironment | undefined;
|
|
743
|
+
registry?: BridgeRegistry | undefined;
|
|
744
|
+
executors?: BridgeExecutors | undefined;
|
|
745
|
+
xReserveHttpTransport?: XReserveHttpTransport | undefined;
|
|
746
|
+
key?: string | undefined;
|
|
747
|
+
name?: string | undefined;
|
|
748
|
+
};
|
|
749
|
+
type BridgeClientState = {
|
|
750
|
+
environment: BridgeEnvironment;
|
|
751
|
+
registry: BridgeRegistry;
|
|
752
|
+
};
|
|
753
|
+
/**
|
|
754
|
+
* Exposes protocol bridge discovery, planning, and configured execution actions.
|
|
755
|
+
*
|
|
756
|
+
* The client retains Veil's `extend()` composition model. Its base transport
|
|
757
|
+
* is reserved for protocol executors. Discovery and planning remain pure and
|
|
758
|
+
* local; execution actions require the corresponding injected capability.
|
|
759
|
+
*/
|
|
760
|
+
type BridgeClient = Client<BridgeActions & BridgeClientState>;
|
|
761
|
+
/**
|
|
762
|
+
* Creates a protocol-oriented bridge client for xReserve and Hyperlane.
|
|
763
|
+
*
|
|
764
|
+
* Discovery and transfer planning read the configured registry without network
|
|
765
|
+
* access. An injected EVM executor enables Ethereum Hyperlane quote and execution
|
|
766
|
+
* actions without exposing private keys to the client. An injected Aleo wallet
|
|
767
|
+
* client enables user-authorized private USDCx mints and USDCx burns.
|
|
768
|
+
*
|
|
769
|
+
* @param config Optional environment, registry, executors, and client identity.
|
|
770
|
+
* @returns A bridge client exposing discovery, planning, and configured protocol actions.
|
|
771
|
+
* @throws BridgeError When the supplied registry has invalid references.
|
|
772
|
+
*
|
|
773
|
+
* @example
|
|
774
|
+
* const bridge = createBridgeClient({ environment: 'testnet' })
|
|
775
|
+
* const routes = bridge.getRoutes({ protocol: 'xreserve' })
|
|
776
|
+
*/
|
|
777
|
+
declare function createBridgeClient(config?: BridgeClientConfig): BridgeClient;
|
|
778
|
+
|
|
779
|
+
export { type XReserveHttpResponse as $, type AleoBridgeExecutor as A, type BridgeRegistry as B, type BridgeExecutionStep as C, type BridgeExecutionStepKind as D, type EvmBridgeExecutor as E, type BridgeExecutors as F, type GetXReserveAttestationParameters as G, type BridgeFee as H, type BridgeProtocol as I, type BridgeQuoteStatus as J, type BridgeRouteAvailability as K, type BridgeStepExecutor as L, type BridgeTransferQuote as M, type BridgeTransferReceipt as N, type BridgeTransferStatus as O, type PrepareTransferParameters as P, type QuoteEvmHyperlaneTransferParameters as Q, type EvmHyperlaneRouteMetadata as R, type EvmHyperlaneRouterType as S, type EvmXReserveRouteMetadata as T, type GetProtocolAssetsParameters as U, type GetProtocolRoutesParameters as V, type ProtocolBridgeAsset as W, type XReserveHttpTransport as X, type ProtocolBridgeChain as Y, type ProtocolBridgeRoute as Z, type XReserveBurnMode as _, type BridgeTransferPlan as a, bridgeActions as a0, createBridgeClient as a1, getProtocolAssets as a2, getProtocolRoutes as a3, type ExecuteEvmHyperlaneTransferParameters as b, type EvmHyperlaneTransferExecution as c, type EvmHyperlaneTransferQuote as d, type ExecuteEvmXReserveTransferParameters as e, type EvmXReserveTransferExecution as f, type XReserveAttestationResult as g, type QuoteEvmXReserveTransferParameters as h, type EvmXReserveTransferQuote as i, type ExecuteXReservePrivateMintParameters as j, type XReservePrivateMintExecution as k, type ExecuteXReserveBurnParameters as l, type XReserveBurnCall as m, type XReserveBurnExecution as n, type ExecuteAleoHyperlaneTransferRemoteParameters as o, type AleoHyperlaneTransferRemoteCall as p, type AleoHyperlaneTransferRemoteExecution as q, type BridgeEnvironment as r, type AleoMintMode as s, type BridgeActions as t, type BridgeActionsConfig as u, type BridgeAssetKind as v, type BridgeAssetLocator as w, type BridgeChainFamily as x, type BridgeClient as y, type BridgeClientConfig as z };
|