@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 +51 -21
- package/dist/browser/index.d.ts +112 -197
- package/dist/browser/index.js +5489 -5853
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.d.ts +112 -197
- package/dist/node/index.js +4840 -5204
- package/dist/node/index.js.map +1 -1
- package/package.json +2 -2
package/dist/node/index.d.ts
CHANGED
|
@@ -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 =
|
|
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
|
|
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
|
-
* `
|
|
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 `
|
|
3945
|
+
* Use `IntentGateway.create()` to obtain an initialised instance.
|
|
4088
3946
|
*/
|
|
4089
|
-
declare class
|
|
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
|
|
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
|
|
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
|
-
* @
|
|
4137
|
-
* @returns Initialized IntentsV2 instance
|
|
3996
|
+
* @returns Initialized IntentGateway instance
|
|
4138
3997
|
*/
|
|
4139
|
-
static create(source: IEvmChain, dest: IEvmChain, intentsCoprocessor?: IntentsCoprocessor
|
|
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
|
|
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
|
|
4189
|
-
* Defaults to `
|
|
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,
|
|
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
|
|
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,
|
|
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:
|
|
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,
|
|
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 };
|