@hyperbridge/sdk 1.7.1 → 1.8.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 CHANGED
@@ -1,21 +1,51 @@
1
- MIT License
2
-
3
- Copyright (c) [year] [fullname]
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
10
+
11
+ "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
12
+
13
+ "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
14
+
15
+ "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
16
+
17
+ "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
18
+
19
+ "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
20
+
21
+ "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
22
+
23
+ "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
24
+
25
+ "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
26
+
27
+ "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
28
+
29
+ 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
30
+
31
+ 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
32
+
33
+ 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
34
+
35
+ You must give any other recipients of the Work or Derivative Works a copy of this License; and
36
+ You must cause any modified files to carry prominent notices stating that You changed the files; and
37
+ You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
38
+ If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
39
+
40
+ You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
41
+ 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
42
+
43
+ 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
44
+
45
+ 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
46
+
47
+ 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
48
+
49
+ 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
50
+
51
+ END OF TERMS AND CONDITIONS
@@ -857,6 +857,14 @@ declare class SubstrateChain implements IChain {
857
857
  api?: ApiPromise;
858
858
  private rpcClient;
859
859
  constructor(params: ISubstrateConfig);
860
+ /**
861
+ * Creates a `SubstrateChain` instance and immediately connects to the
862
+ * WebSocket endpoint, returning a fully initialised chain client.
863
+ *
864
+ * @param params - Substrate chain configuration (wsUrl, stateMachineId, etc.).
865
+ * @returns A connected `SubstrateChain` instance.
866
+ */
867
+ static connect(params: ISubstrateConfig): Promise<SubstrateChain>;
860
868
  get config(): ISubstrateConfig;
861
869
  /**
862
870
  * Connects to the Substrate chain using the provided WebSocket URL.
@@ -1132,6 +1140,10 @@ interface EvmChainParams {
1132
1140
  * Consensus state identifier of this chain on hyperbridge
1133
1141
  */
1134
1142
  consensusStateId?: string;
1143
+ /**
1144
+ * Optional ERC-4337 bundler URL for account abstraction support
1145
+ */
1146
+ bundlerUrl?: string;
1135
1147
  }
1136
1148
  /**
1137
1149
  * Encapsulates an EVM chain.
@@ -1141,8 +1153,25 @@ declare class EvmChain implements IChain {
1141
1153
  private publicClient;
1142
1154
  private chainConfigService;
1143
1155
  constructor(params: EvmChainParams);
1156
+ /**
1157
+ * Creates an `EvmChain` instance by auto-detecting the chain ID from the RPC endpoint
1158
+ * and resolving the correct `IsmpHost` contract address for that chain.
1159
+ *
1160
+ * @param rpcUrl - HTTP(S) RPC URL of the EVM node
1161
+ * @param bundlerUrl - Optional ERC-4337 bundler URL for account abstraction support
1162
+ * @returns A fully initialised `EvmChain` ready for use
1163
+ * @throws If the chain ID returned by the RPC is not a known Hyperbridge deployment
1164
+ *
1165
+ * @example
1166
+ * ```typescript
1167
+ * const chain = await EvmChain.create("https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY")
1168
+ * const chain = await EvmChain.create("https://mainnet.base.org", "https://bundler.example.com")
1169
+ * ```
1170
+ */
1171
+ static create(rpcUrl: string, bundlerUrl?: string): Promise<EvmChain>;
1144
1172
  get client(): PublicClient;
1145
1173
  get host(): HexString;
1174
+ get bundlerUrl(): string | undefined;
1146
1175
  get config(): IEvmConfig;
1147
1176
  get configService(): ChainConfigService;
1148
1177
  /**
@@ -1249,6 +1278,7 @@ declare class EvmChain implements IChain {
1249
1278
  */
1250
1279
  getHostNonce(): Promise<bigint>;
1251
1280
  broadcastTransaction(signedTransaction: HexString): Promise<TransactionReceipt>;
1281
+ getTransactionReceipt(hash: HexString): Promise<TransactionReceipt>;
1252
1282
  }
1253
1283
  /**
1254
1284
  * Factory function for creating EVM chain instances with common defaults
@@ -1487,6 +1517,7 @@ declare class TronChain implements IChain {
1487
1517
  * This mirrors the behavior used in IntentGatewayV2 for Tron chains.
1488
1518
  */
1489
1519
  broadcastTransaction(signedTransaction: any): Promise<TransactionReceipt>;
1520
+ getTransactionReceipt(hash: HexString): Promise<TransactionReceipt>;
1490
1521
  /** Gets the fee token address and decimals for the chain. */
1491
1522
  getFeeTokenWithDecimals(): Promise<{
1492
1523
  address: HexString;
@@ -1651,6 +1682,7 @@ interface IChain {
1651
1682
  interface IEvmChain extends IChain {
1652
1683
  readonly configService: ChainConfigService;
1653
1684
  readonly client: PublicClient;
1685
+ readonly bundlerUrl?: string;
1654
1686
  getHostNonce(): Promise<bigint>;
1655
1687
  quoteNative(request: IPostRequest | IGetRequest, fee: bigint): Promise<bigint>;
1656
1688
  getFeeTokenWithDecimals(): Promise<{
@@ -1659,6 +1691,7 @@ interface IEvmChain extends IChain {
1659
1691
  }>;
1660
1692
  getPlaceOrderCalldata(txHash: string, intentGatewayAddress: string): Promise<HexString>;
1661
1693
  broadcastTransaction(signedTransaction: HexString): Promise<TransactionReceipt>;
1694
+ getTransactionReceipt(hash: HexString): Promise<TransactionReceipt>;
1662
1695
  }
1663
1696
  /**
1664
1697
  * Returns the chain interface for a given state machine identifier.
@@ -3025,13 +3058,12 @@ declare function createIndexerClient(config: {
3025
3058
  * host: "0x87ea42345..",
3026
3059
  * consensusStateId: "ARB0"
3027
3060
  * })
3028
- * const hyperbridgeChain = new SubstrateChain({
3061
+ * const hyperbridgeChain = await SubstrateChain.connect({
3029
3062
  * stateMachineId: "POLKADOT-3367",
3030
3063
  * wsUrl: "ws://localhost:9944",
3031
3064
  * hasher: "Keccak",
3032
3065
  * consensusStateId: "DOT0"
3033
3066
  * })
3034
- * await hyperbridgeChain.connect()
3035
3067
  *
3036
3068
  * const client = new IndexerClient({
3037
3069
  * queryClient: queryClient,
@@ -3598,183 +3630,6 @@ declare class Swap {
3598
3630
  private getTickSpacing;
3599
3631
  }
3600
3632
 
3601
- /**
3602
- * IntentGateway handles cross-chain intent operations between EVM chains.
3603
- * It provides functionality for estimating fill orders, finding optimal swap protocols,
3604
- * and checking order statuses across different chains.
3605
- */
3606
- declare class IntentGateway {
3607
- readonly source: EvmChain;
3608
- readonly dest: EvmChain;
3609
- readonly swap: Swap;
3610
- private readonly storage;
3611
- /**
3612
- * Optional custom IntentGateway address for the destination chain.
3613
- * If set, this address will be used when fetching destination proofs in `cancelOrder`.
3614
- * If not set, uses the default address from the chain configuration.
3615
- * This allows using different IntentGateway contract versions (e.g., old vs new contracts).
3616
- */
3617
- destIntentGatewayAddress?: HexString;
3618
- /**
3619
- * Creates a new IntentGateway instance for cross-chain operations.
3620
- * @param source - The source EVM chain
3621
- * @param dest - The destination EVM chain
3622
- * @param destIntentGatewayAddress - Optional custom IntentGateway address for the destination chain.
3623
- * If provided, this address will be used when fetching destination proofs in `cancelOrder`.
3624
- * If not provided, uses the default address from the chain configuration.
3625
- */
3626
- constructor(source: EvmChain, dest: EvmChain, destIntentGatewayAddress?: HexString);
3627
- /**
3628
- * Estimates the total cost required to fill an order, including gas fees, relayer fees,
3629
- * protocol fees, and swap operations.
3630
- *
3631
- * @param order - The order to estimate fill costs for
3632
- * @returns An object containing the estimated cost in both fee token and native token, plus the post request calldata
3633
- */
3634
- estimateFillOrder(order: Order): Promise<{
3635
- order: Order;
3636
- feeTokenAmount: bigint;
3637
- nativeTokenAmount: bigint;
3638
- postRequestCalldata: HexString;
3639
- }>;
3640
- /**
3641
- * Converts fee token amounts back to the equivalent amount in native token.
3642
- * Uses USD pricing to convert between fee token amounts and native token costs.
3643
- *
3644
- * @param feeTokenAmount - The amount in fee token (DAI)
3645
- * @param getQuoteIn - Whether to use "source" or "dest" chain for the conversion
3646
- * @param evmChainID - The EVM chain ID in format "EVM-{id}"
3647
- * @returns The fee token amount converted to native token amount
3648
- * @private
3649
- */
3650
- private convertFeeTokenToNative;
3651
- /**
3652
- * Converts gas costs to the equivalent amount in the fee token (DAI).
3653
- * Uses USD pricing to convert between native token gas costs and fee token amounts.
3654
- *
3655
- * @param gasEstimate - The estimated gas units
3656
- * @param gasEstimateIn - Whether to use "source" or "dest" chain for the conversion
3657
- * @param evmChainID - The EVM chain ID in format "EVM-{id}"
3658
- * @returns The gas cost converted to fee token amount
3659
- * @private
3660
- */
3661
- private convertGasToFeeToken;
3662
- /**
3663
- * Gets a quote for the native token cost of dispatching a post request.
3664
- *
3665
- * @param postRequest - The post request to quote
3666
- * @param fee - The fee amount in fee token
3667
- * @returns The native token amount required
3668
- */
3669
- quoteNative(postRequest: IPostRequest, fee: bigint): Promise<bigint>;
3670
- /**
3671
- * Checks if an order has been filled by verifying the commitment status on-chain.
3672
- * Reads the storage slot corresponding to the order's commitment hash.
3673
- *
3674
- * @param order - The order to check
3675
- * @returns True if the order has been filled, false otherwise
3676
- */
3677
- isOrderFilled(order: Order): Promise<boolean>;
3678
- /**
3679
- * Checks if an order has been refunded by verifying the escrowed token amounts on-chain.
3680
- * Reads the storage slots for the `_orders` mapping on the source chain (where the escrow is held).
3681
- * An order is considered refunded when all input token amounts in the `_orders` mapping are 0.
3682
- *
3683
- * @param order - The order to check
3684
- * @returns True if the order has been refunded (all token amounts are 0), false otherwise
3685
- */
3686
- isOrderRefunded(order: Order): Promise<boolean>;
3687
- private submitAndConfirmReceipt;
3688
- /**
3689
- * Returns the native token amount required to dispatch a cancellation GET request for the given order.
3690
- * Internally constructs the IGetRequest and calls quoteNative.
3691
- */
3692
- quoteCancelNative(order: Order): Promise<bigint>;
3693
- /**
3694
- * Cancels an order through the cross-chain protocol by generating and submitting proofs.
3695
- * This is an async generator function that yields status updates throughout the cancellation process.
3696
- *
3697
- * The cancellation process involves:
3698
- * 1. Fetching proof from the destination chain that the order exists
3699
- * 2. Creating a GET request to retrieve the order state
3700
- * 3. Waiting for the source chain to finalize the request
3701
- * 4. Fetching proof from the source chain
3702
- * 5. Waiting for the challenge period to complete
3703
- * 6. Submitting the request message to Hyperbridge
3704
- * 7. Monitoring until Hyperbridge finalizes the cancellation
3705
- *
3706
- * @param order - The order to cancel, containing source/dest chains, deadline, and other order details
3707
- * @param indexerClient - Client for querying the indexer and interacting with Hyperbridge
3708
- *
3709
- * @yields {CancelEvent} Status updates during the cancellation process:
3710
- * - DESTINATION_FINALIZED: Destination proof has been obtained
3711
- * - AWAITING_GET_REQUEST: Waiting for GET request to be provided
3712
- * - SOURCE_FINALIZED: Source chain has finalized the request
3713
- * - HYPERBRIDGE_DELIVERED: Hyperbridge has delivered the request
3714
- * - HYPERBRIDGE_FINALIZED: Cancellation is complete
3715
- *
3716
- * @throws {Error} If GET request is not provided when needed
3717
- *
3718
- * @example
3719
- * ```typescript
3720
- * // Using default IntentGateway address
3721
- * const intentGateway = new IntentGateway(sourceChain, destChain);
3722
- * const cancelStream = intentGateway.cancelOrder(order, indexerClient);
3723
- *
3724
- * // Using custom IntentGateway address (e.g., for old contract version)
3725
- * const intentGateway = new IntentGateway(
3726
- * sourceChain,
3727
- * destChain,
3728
- * "0xd54165e45926720b062C192a5bacEC64d5bB08DA"
3729
- * );
3730
- * const cancelStream = intentGateway.cancelOrder(order, indexerClient);
3731
- *
3732
- * // Or set it after instantiation
3733
- * const intentGateway = new IntentGateway(sourceChain, destChain);
3734
- * intentGateway.destIntentGatewayAddress = "0xd54165e45926720b062C192a5bacEC64d5bB08DA";
3735
- * const cancelStream = intentGateway.cancelOrder(order, indexerClient);
3736
- *
3737
- * for await (const event of cancelStream) {
3738
- * switch (event.status) {
3739
- * case 'SOURCE_FINALIZED':
3740
- * console.log('Source finalized at block:', event.data.metadata.blockNumber);
3741
- * break;
3742
- * case 'HYPERBRIDGE_FINALIZED':
3743
- * console.log('Cancellation complete');
3744
- * break;
3745
- * }
3746
- * }
3747
- * ```
3748
- */
3749
- cancelOrder(order: Order, indexerClient: IndexerClient): AsyncGenerator<CancelEvent$1>;
3750
- /**
3751
- * Fetches proof for the destination chain.
3752
- * @param order - The order to fetch proof for
3753
- * @param indexerClient - Client for querying the indexer
3754
- */
3755
- private fetchDestinationProof;
3756
- }
3757
- interface CancelEventMap {
3758
- DESTINATION_FINALIZED: {
3759
- proof: IProof;
3760
- };
3761
- AWAITING_GET_REQUEST: undefined;
3762
- SOURCE_FINALIZED: {
3763
- metadata: {
3764
- blockNumber: number;
3765
- };
3766
- };
3767
- HYPERBRIDGE_DELIVERED: RequestStatusWithMetadata;
3768
- HYPERBRIDGE_FINALIZED: RequestStatusWithMetadata;
3769
- SOURCE_PROOF_RECEIVED: IProof;
3770
- }
3771
- type CancelEvent$1 = {
3772
- [K in keyof CancelEventMap]: {
3773
- status: K;
3774
- data: CancelEventMap[K];
3775
- };
3776
- }[keyof CancelEventMap];
3777
-
3778
3633
  type StorageDriverKey = "node" | "localstorage" | "indexeddb" | "memory";
3779
3634
  interface CancellationStorageOptions {
3780
3635
  env?: StorageDriverKey;
@@ -4001,6 +3856,9 @@ type CancelEvent = {
4001
3856
  data: HexString;
4002
3857
  to: HexString;
4003
3858
  value: bigint;
3859
+ } | {
3860
+ status: "CANCEL_STARTED";
3861
+ receipt: TransactionReceipt;
4004
3862
  } | {
4005
3863
  status: "SOURCE_FINALIZED";
4006
3864
  metadata: Extract<RequestStatusWithMetadata, {
@@ -4032,7 +3890,7 @@ type CancelEvent = {
4032
3890
  * reference to this object so they can share fee-token caches, storage
4033
3891
  * adapters, and chain clients without duplicating initialisation logic.
4034
3892
  */
4035
- interface IntentsV2Context {
3893
+ interface IntentGatewayContext {
4036
3894
  /** EVM chain on which orders are placed and escrowed. */
4037
3895
  source: IEvmChain;
4038
3896
  /** EVM chain on which solvers fill orders and receive outputs. */
@@ -4068,7 +3926,7 @@ interface IntentsV2Context {
4068
3926
  /**
4069
3927
  * High-level facade for the IntentGatewayV2 protocol.
4070
3928
  *
4071
- * `IntentsV2` orchestrates the complete lifecycle of an intent-based
3929
+ * `IntentGateway` orchestrates the complete lifecycle of an intent-based
4072
3930
  * cross-chain swap:
4073
3931
  * - **Order placement** — encodes and yields `placeOrder` calldata; caller
4074
3932
  * signs and submits the transaction.
@@ -4084,9 +3942,9 @@ interface IntentsV2Context {
4084
3942
  * {@link OrderExecutor}, {@link OrderCanceller}, {@link BidManager},
4085
3943
  * {@link GasEstimator}, {@link OrderStatusChecker}, and {@link CryptoUtils}.
4086
3944
  *
4087
- * Use `IntentsV2.create()` to obtain an initialised instance.
3945
+ * Use `IntentGateway.create()` to obtain an initialised instance.
4088
3946
  */
4089
- declare class IntentsV2 {
3947
+ declare class IntentGateway {
4090
3948
  /** EVM chain on which orders are placed and escrowed. */
4091
3949
  readonly source: IEvmChain;
4092
3950
  /** EVM chain on which solvers fill orders and deliver outputs. */
@@ -4112,7 +3970,7 @@ declare class IntentsV2 {
4112
3970
  /** Estimates gas costs for filling an order and converts them to fee-token amounts. */
4113
3971
  private readonly gasEstimator;
4114
3972
  /**
4115
- * Private constructor — use {@link IntentsV2.create} instead.
3973
+ * Private constructor — use {@link IntentGateway.create} instead.
4116
3974
  *
4117
3975
  * Initialises all sub-modules and the shared context, including storage
4118
3976
  * adapters, fee-token and solver-code caches, and the DEX-quote utility.
@@ -4120,28 +3978,29 @@ declare class IntentsV2 {
4120
3978
  * @param source - Source chain client.
4121
3979
  * @param dest - Destination chain client.
4122
3980
  * @param intentsCoprocessor - Optional coprocessor for bid fetching.
4123
- * @param bundlerUrl - Optional ERC-4337 bundler endpoint URL.
4124
3981
  */
4125
3982
  private constructor();
4126
3983
  /**
4127
- * Creates an initialized IntentsV2 instance.
3984
+ * Creates an initialized IntentGateway instance.
4128
3985
  *
4129
3986
  * Fetches the fee tokens for both chains and optionally caches the solver
4130
3987
  * account bytecode before returning, so the instance is ready for use
4131
3988
  * without additional warm-up calls.
4132
3989
  *
3990
+ * The ERC-4337 bundler URL is read from `dest.bundlerUrl`, set when constructing
3991
+ * the destination chain via {@link EvmChain.create} or {@link EvmChainParams.bundlerUrl}.
3992
+ *
4133
3993
  * @param source - Source chain for order placement
4134
3994
  * @param dest - Destination chain for order fulfillment
4135
3995
  * @param intentsCoprocessor - Optional coprocessor for bid fetching and order execution
4136
- * @param bundlerUrl - Optional ERC-4337 bundler URL for gas estimation and UserOp submission
4137
- * @returns Initialized IntentsV2 instance
3996
+ * @returns Initialized IntentGateway instance
4138
3997
  */
4139
- static create(source: IEvmChain, dest: IEvmChain, intentsCoprocessor?: IntentsCoprocessor, bundlerUrl?: string): Promise<IntentsV2>;
3998
+ static create(source: IEvmChain, dest: IEvmChain, intentsCoprocessor?: IntentsCoprocessor): Promise<IntentGateway>;
4140
3999
  /**
4141
4000
  * Pre-warms the fee-token cache for both chains and attempts to load the
4142
4001
  * solver account bytecode into the solver-code cache.
4143
4002
  *
4144
- * Called automatically by {@link IntentsV2.create}; not intended for direct use.
4003
+ * Called automatically by {@link IntentGateway.create}; not intended for direct use.
4145
4004
  */
4146
4005
  private init;
4147
4006
  /**
@@ -4185,11 +4044,11 @@ declare class IntentsV2 {
4185
4044
  * Delegates to {@link OrderCanceller.quoteCancelNative}.
4186
4045
  *
4187
4046
  * @param order - The order to quote cancellation for.
4188
- * @param from - Chain side that initiates the cancel (`"source"` or `"dest"`).
4189
- * Defaults to `"source"`.
4047
+ * @param fromDest - If `true`, quotes the destination-initiated cancellation fee.
4048
+ * Defaults to `false` (source-side cancellation).
4190
4049
  * @returns The native token amount required to submit the cancel transaction.
4191
4050
  */
4192
- quoteCancelNative(order: OrderV2, from?: "source" | "dest"): Promise<bigint>;
4051
+ quoteCancelNative(order: OrderV2, fromDest?: boolean): Promise<bigint>;
4193
4052
  /**
4194
4053
  * Async generator that cancels an order and streams status events until
4195
4054
  * cancellation is complete.
@@ -4198,10 +4057,11 @@ declare class IntentsV2 {
4198
4057
  *
4199
4058
  * @param order - The order to cancel.
4200
4059
  * @param indexerClient - Indexer client used for ISMP request status streaming.
4201
- * @param from - Chain side that initiates the cancel. Defaults to `"source"`.
4060
+ * @param fromDest - If `true`, initiates cancellation from the destination chain.
4061
+ * Defaults to `false` (source-side cancellation).
4202
4062
  * @yields {@link CancelEvent} objects describing each cancellation stage.
4203
4063
  */
4204
- cancelOrder(order: OrderV2, indexerClient: IndexerClient, from?: "source" | "dest"): AsyncGenerator<CancelEvent>;
4064
+ cancelOrder(order: OrderV2, indexerClient: IndexerClient, fromDest?: boolean): AsyncGenerator<CancelEvent>;
4205
4065
  /**
4206
4066
  * Constructs a signed `PackedUserOperation` for a solver to submit as a bid.
4207
4067
  *
@@ -4291,7 +4151,7 @@ declare class OrderStatusChecker {
4291
4151
  * @param ctx - Shared IntentsV2 context providing the source and destination
4292
4152
  * chain clients and config service.
4293
4153
  */
4294
- constructor(ctx: IntentsV2Context);
4154
+ constructor(ctx: IntentGatewayContext);
4295
4155
  /**
4296
4156
  * Checks if a V2 order has been filled by reading the commitment storage slot on the destination chain.
4297
4157
  *
@@ -8106,13 +7966,68 @@ declare enum Chains {
8106
7966
  MAINNET = "EVM-1",
8107
7967
  BSC_MAINNET = "EVM-56",
8108
7968
  ARBITRUM_MAINNET = "EVM-42161",
7969
+ ARBITRUM_SEPOLIA = "EVM-421614",
8109
7970
  BASE_MAINNET = "EVM-8453",
7971
+ BASE_SEPOLIA = "EVM-84532",
7972
+ OPTIMISM_MAINNET = "EVM-10",
7973
+ OPTIMISM_SEPOLIA = "EVM-11155420",
7974
+ GNOSIS_MAINNET = "EVM-100",
7975
+ SONEIUM_MAINNET = "EVM-1868",
8110
7976
  POLYGON_MAINNET = "EVM-137",
8111
7977
  UNICHAIN_MAINNET = "EVM-130",
8112
7978
  POLYGON_AMOY = "EVM-80002",
7979
+ POLKADOT_ASSET_HUB_PASEO = "EVM-420420417",
8113
7980
  TRON_MAINNET = "EVM-728126428",
8114
7981
  TRON_NILE = "EVM-3448148188"
8115
7982
  }
7983
+ /** Polkadot Asset Hub Paseo testnet (chain ID 420420417) — not in viem/chains */
7984
+ declare const polkadotAssetHubPaseo: {
7985
+ blockExplorers: {
7986
+ readonly default: {
7987
+ readonly name: "Routescan";
7988
+ readonly url: "https://polkadot.testnet.routescan.io";
7989
+ };
7990
+ };
7991
+ blockTime?: number | undefined | undefined;
7992
+ contracts?: {
7993
+ [x: string]: viem.ChainContract | {
7994
+ [sourceId: number]: viem.ChainContract | undefined;
7995
+ } | undefined;
7996
+ ensRegistry?: viem.ChainContract | undefined;
7997
+ ensUniversalResolver?: viem.ChainContract | undefined;
7998
+ multicall3?: viem.ChainContract | undefined;
7999
+ erc6492Verifier?: viem.ChainContract | undefined;
8000
+ } | undefined;
8001
+ ensTlds?: readonly string[] | undefined;
8002
+ id: 420420417;
8003
+ name: "Polkadot Asset Hub (Paseo)";
8004
+ nativeCurrency: {
8005
+ readonly name: "PAS";
8006
+ readonly symbol: "PAS";
8007
+ readonly decimals: 10;
8008
+ };
8009
+ experimental_preconfirmationTime?: number | undefined | undefined;
8010
+ rpcUrls: {
8011
+ readonly default: {
8012
+ readonly http: readonly ["https://testnet-asset-hub-eth-rpc.polkadot.io"];
8013
+ };
8014
+ };
8015
+ sourceId?: number | undefined | undefined;
8016
+ testnet?: boolean | undefined | undefined;
8017
+ custom?: Record<string, unknown> | undefined;
8018
+ extendSchema?: Record<string, unknown> | undefined;
8019
+ fees?: viem.ChainFees<undefined> | undefined;
8020
+ formatters?: undefined;
8021
+ prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
8022
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
8023
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
8024
+ phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
8025
+ }) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
8026
+ runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
8027
+ }] | undefined;
8028
+ serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
8029
+ verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
8030
+ };
8116
8031
  /** Tron Nile Testnet (chain ID 3448148188) — not in viem/chains */
8117
8032
  declare const tronNile: {
8118
8033
  blockExplorers: {
@@ -8233,4 +8148,4 @@ declare const getChainId: (stateMachineId: string) => number | undefined;
8233
8148
  declare const getViemChain: (chainId: number) => Chain | undefined;
8234
8149
  declare const hyperbridgeAddress = "";
8235
8150
 
8236
- export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BundlerGasEstimate, BundlerMethod, type CancelEvent, type CancelOptions, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedOrderV2PlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type DispatchGet, type DispatchInfoV2, type DispatchPost, ERC20Method, type ERC7821Call, ERC7821_BATCH_MODE, type EstimateFillOrderV2Params, type EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, type ExecuteIntentOrderOptions, type ExecutionResult, type FillOptions, type FillOptionsV2, type FillOrderEstimateV2, type FillerBid, type FillerConfig, type GetRequestResponse, type GetRequestWithStatus, type GetResponseByRequestIdResponse, type GetResponseStorageValues, type HexString, type HostParams, HyperClientStatus, type HyperbridgeTxEvents, type IChain, type IConfig, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, IndexerClient, type IndexerQueryClient, IntentGateway, type IntentGatewayParams, ABI$1 as IntentGatewayV2ABI, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, IntentsCoprocessor, IntentsV2, type IntentsV2Context, type IsmpRequest, MOCK_ADDRESS, type NewDeployment, ORDER_V2_PARAM_TYPE, type Order, type OrderResponse, OrderStatus, OrderStatusChecker, type OrderStatusMetadata, type OrderV2, type OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, type PackedUserOperation, type Params, type PaymentInfo, type PaymentInfoV2, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, type QuoteNativeResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, type RequestBody, type RequestCommitment, RequestKind, type RequestResponse, RequestStatus, type RequestStatusKey, type RequestStatusWithMetadata, type ResponseCommitmentWithValues, type RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, type SelectBidResult, type SelectOptions, type StateMachineHeight, type StateMachineIdParams, type StateMachineResponse, type StateMachineUpdate, type StorageFacade, type SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TimeoutStatus, type TimeoutStatusKey, TokenGateway, type TokenGatewayAssetTeleportedResponse, type TokenGatewayAssetTeleportedWithStatus, type TokenInfo, type TokenInfoV2, type TokenPrice, type TokenPricesResponse, type Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createChain, createEvmChain, createIndexerClient, createQueryClient, decodeUserOpScale, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChain, getChainId, getConfigByStateMachineId, getContractCallInput, getEvmChain, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getSubstrateChain, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, orderCommitment, orderV2Commitment, parseStateMachineId, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, requestCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
8151
+ export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BundlerGasEstimate, BundlerMethod, type CancelEvent, type CancelOptions, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedOrderV2PlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type DispatchGet, type DispatchInfoV2, type DispatchPost, ERC20Method, type ERC7821Call, ERC7821_BATCH_MODE, type EstimateFillOrderV2Params, type EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, type ExecuteIntentOrderOptions, type ExecutionResult, type FillOptions, type FillOptionsV2, type FillOrderEstimateV2, type FillerBid, type FillerConfig, type GetRequestResponse, type GetRequestWithStatus, type GetResponseByRequestIdResponse, type GetResponseStorageValues, type HexString, type HostParams, HyperClientStatus, type HyperbridgeTxEvents, type IChain, type IConfig, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, IndexerClient, type IndexerQueryClient, IntentGateway, type IntentGatewayContext, type IntentGatewayParams, ABI$1 as IntentGatewayV2ABI, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, IntentsCoprocessor, type IsmpRequest, MOCK_ADDRESS, type NewDeployment, ORDER_V2_PARAM_TYPE, type Order, type OrderResponse, OrderStatus, OrderStatusChecker, type OrderStatusMetadata, type OrderV2, type OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, type PackedUserOperation, type Params, type PaymentInfo, type PaymentInfoV2, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, type QuoteNativeResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, type RequestBody, type RequestCommitment, RequestKind, type RequestResponse, RequestStatus, type RequestStatusKey, type RequestStatusWithMetadata, type ResponseCommitmentWithValues, type RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, type SelectBidResult, type SelectOptions, type StateMachineHeight, type StateMachineIdParams, type StateMachineResponse, type StateMachineUpdate, type StorageFacade, type SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TimeoutStatus, type TimeoutStatusKey, TokenGateway, type TokenGatewayAssetTeleportedResponse, type TokenGatewayAssetTeleportedWithStatus, type TokenInfo, type TokenInfoV2, type TokenPrice, type TokenPricesResponse, type Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createChain, createEvmChain, createIndexerClient, createQueryClient, decodeUserOpScale, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChain, getChainId, getConfigByStateMachineId, getContractCallInput, getEvmChain, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getSubstrateChain, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, orderCommitment, orderV2Commitment, parseStateMachineId, polkadotAssetHubPaseo, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, requestCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };