@hyperbridge/sdk 1.9.5 → 2.0.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/README.md +6 -4
- package/dist/browser/index.d.ts +873 -391
- package/dist/browser/index.js +2979 -2695
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.d.ts +873 -391
- package/dist/node/index.js +2979 -2695
- package/dist/node/index.js.map +1 -1
- package/package.json +1 -1
package/dist/browser/index.d.ts
CHANGED
|
@@ -13,48 +13,28 @@ export { Account as ViemAccount } from 'viem/accounts';
|
|
|
13
13
|
|
|
14
14
|
declare const _default: {
|
|
15
15
|
ABI: readonly [{
|
|
16
|
-
readonly inputs: readonly [
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
readonly name: "
|
|
22
|
-
readonly
|
|
23
|
-
|
|
24
|
-
readonly
|
|
25
|
-
readonly name: "DuplicateMessage";
|
|
26
|
-
readonly type: "error";
|
|
27
|
-
}, {
|
|
28
|
-
readonly inputs: readonly [];
|
|
29
|
-
readonly name: "HostFrozen";
|
|
30
|
-
readonly type: "error";
|
|
31
|
-
}, {
|
|
32
|
-
readonly inputs: readonly [];
|
|
33
|
-
readonly name: "InvalidMessageDestination";
|
|
34
|
-
readonly type: "error";
|
|
35
|
-
}, {
|
|
36
|
-
readonly inputs: readonly [];
|
|
37
|
-
readonly name: "InvalidProof";
|
|
38
|
-
readonly type: "error";
|
|
39
|
-
}, {
|
|
40
|
-
readonly inputs: readonly [];
|
|
41
|
-
readonly name: "MessageNotTimedOut";
|
|
42
|
-
readonly type: "error";
|
|
43
|
-
}, {
|
|
44
|
-
readonly inputs: readonly [];
|
|
45
|
-
readonly name: "MessageTimedOut";
|
|
46
|
-
readonly type: "error";
|
|
47
|
-
}, {
|
|
48
|
-
readonly inputs: readonly [];
|
|
49
|
-
readonly name: "StateCommitmentNotFound";
|
|
50
|
-
readonly type: "error";
|
|
16
|
+
readonly inputs: readonly [{
|
|
17
|
+
readonly internalType: "bytes[]";
|
|
18
|
+
readonly name: "calls";
|
|
19
|
+
readonly type: "bytes[]";
|
|
20
|
+
}];
|
|
21
|
+
readonly name: "batchCall";
|
|
22
|
+
readonly outputs: readonly [];
|
|
23
|
+
readonly stateMutability: "nonpayable";
|
|
24
|
+
readonly type: "function";
|
|
51
25
|
}, {
|
|
52
26
|
readonly inputs: readonly [];
|
|
53
|
-
readonly name: "
|
|
54
|
-
readonly
|
|
27
|
+
readonly name: "currentEpoch";
|
|
28
|
+
readonly outputs: readonly [{
|
|
29
|
+
readonly internalType: "uint256";
|
|
30
|
+
readonly name: "";
|
|
31
|
+
readonly type: "uint256";
|
|
32
|
+
}];
|
|
33
|
+
readonly stateMutability: "view";
|
|
34
|
+
readonly type: "function";
|
|
55
35
|
}, {
|
|
56
36
|
readonly inputs: readonly [{
|
|
57
|
-
readonly internalType: "contract
|
|
37
|
+
readonly internalType: "contract IHost";
|
|
58
38
|
readonly name: "host";
|
|
59
39
|
readonly type: "address";
|
|
60
40
|
}, {
|
|
@@ -68,7 +48,7 @@ declare const _default: {
|
|
|
68
48
|
readonly type: "function";
|
|
69
49
|
}, {
|
|
70
50
|
readonly inputs: readonly [{
|
|
71
|
-
readonly internalType: "contract
|
|
51
|
+
readonly internalType: "contract IHost";
|
|
72
52
|
readonly name: "host";
|
|
73
53
|
readonly type: "address";
|
|
74
54
|
}, {
|
|
@@ -137,7 +117,7 @@ declare const _default: {
|
|
|
137
117
|
readonly type: "function";
|
|
138
118
|
}, {
|
|
139
119
|
readonly inputs: readonly [{
|
|
140
|
-
readonly internalType: "contract
|
|
120
|
+
readonly internalType: "contract IHost";
|
|
141
121
|
readonly name: "host";
|
|
142
122
|
readonly type: "address";
|
|
143
123
|
}, {
|
|
@@ -216,7 +196,7 @@ declare const _default: {
|
|
|
216
196
|
readonly name: "value";
|
|
217
197
|
readonly type: "bytes";
|
|
218
198
|
}];
|
|
219
|
-
readonly internalType: "struct StorageValue[]";
|
|
199
|
+
readonly internalType: "struct MerklePatricia.StorageValue[]";
|
|
220
200
|
readonly name: "values";
|
|
221
201
|
readonly type: "tuple[]";
|
|
222
202
|
}];
|
|
@@ -227,10 +207,6 @@ declare const _default: {
|
|
|
227
207
|
readonly internalType: "uint256";
|
|
228
208
|
readonly name: "index";
|
|
229
209
|
readonly type: "uint256";
|
|
230
|
-
}, {
|
|
231
|
-
readonly internalType: "uint256";
|
|
232
|
-
readonly name: "kIndex";
|
|
233
|
-
readonly type: "uint256";
|
|
234
210
|
}];
|
|
235
211
|
readonly internalType: "struct GetResponseLeaf[]";
|
|
236
212
|
readonly name: "responses";
|
|
@@ -246,7 +222,7 @@ declare const _default: {
|
|
|
246
222
|
readonly type: "function";
|
|
247
223
|
}, {
|
|
248
224
|
readonly inputs: readonly [{
|
|
249
|
-
readonly internalType: "contract
|
|
225
|
+
readonly internalType: "contract IHost";
|
|
250
226
|
readonly name: "host";
|
|
251
227
|
readonly type: "address";
|
|
252
228
|
}, {
|
|
@@ -311,7 +287,7 @@ declare const _default: {
|
|
|
311
287
|
readonly type: "function";
|
|
312
288
|
}, {
|
|
313
289
|
readonly inputs: readonly [{
|
|
314
|
-
readonly internalType: "contract
|
|
290
|
+
readonly internalType: "contract IHost";
|
|
315
291
|
readonly name: "host";
|
|
316
292
|
readonly type: "address";
|
|
317
293
|
}, {
|
|
@@ -379,10 +355,6 @@ declare const _default: {
|
|
|
379
355
|
readonly internalType: "uint256";
|
|
380
356
|
readonly name: "index";
|
|
381
357
|
readonly type: "uint256";
|
|
382
|
-
}, {
|
|
383
|
-
readonly internalType: "uint256";
|
|
384
|
-
readonly name: "kIndex";
|
|
385
|
-
readonly type: "uint256";
|
|
386
358
|
}];
|
|
387
359
|
readonly internalType: "struct PostRequestLeaf[]";
|
|
388
360
|
readonly name: "requests";
|
|
@@ -398,7 +370,7 @@ declare const _default: {
|
|
|
398
370
|
readonly type: "function";
|
|
399
371
|
}, {
|
|
400
372
|
readonly inputs: readonly [{
|
|
401
|
-
readonly internalType: "contract
|
|
373
|
+
readonly internalType: "contract IHost";
|
|
402
374
|
readonly name: "host";
|
|
403
375
|
readonly type: "address";
|
|
404
376
|
}, {
|
|
@@ -476,7 +448,7 @@ declare const _default: {
|
|
|
476
448
|
readonly type: "function";
|
|
477
449
|
}, {
|
|
478
450
|
readonly inputs: readonly [{
|
|
479
|
-
readonly internalType: "contract
|
|
451
|
+
readonly internalType: "contract IHost";
|
|
480
452
|
readonly name: "host";
|
|
481
453
|
readonly type: "address";
|
|
482
454
|
}, {
|
|
@@ -557,10 +529,6 @@ declare const _default: {
|
|
|
557
529
|
readonly internalType: "uint256";
|
|
558
530
|
readonly name: "index";
|
|
559
531
|
readonly type: "uint256";
|
|
560
|
-
}, {
|
|
561
|
-
readonly internalType: "uint256";
|
|
562
|
-
readonly name: "kIndex";
|
|
563
|
-
readonly type: "uint256";
|
|
564
532
|
}];
|
|
565
533
|
readonly internalType: "struct PostResponseLeaf[]";
|
|
566
534
|
readonly name: "responses";
|
|
@@ -574,6 +542,20 @@ declare const _default: {
|
|
|
574
542
|
readonly outputs: readonly [];
|
|
575
543
|
readonly stateMutability: "nonpayable";
|
|
576
544
|
readonly type: "function";
|
|
545
|
+
}, {
|
|
546
|
+
readonly inputs: readonly [{
|
|
547
|
+
readonly internalType: "uint256";
|
|
548
|
+
readonly name: "authoritySetId";
|
|
549
|
+
readonly type: "uint256";
|
|
550
|
+
}];
|
|
551
|
+
readonly name: "relayerOf";
|
|
552
|
+
readonly outputs: readonly [{
|
|
553
|
+
readonly internalType: "address";
|
|
554
|
+
readonly name: "";
|
|
555
|
+
readonly type: "address";
|
|
556
|
+
}];
|
|
557
|
+
readonly stateMutability: "view";
|
|
558
|
+
readonly type: "function";
|
|
577
559
|
}, {
|
|
578
560
|
readonly inputs: readonly [{
|
|
579
561
|
readonly internalType: "bytes4";
|
|
@@ -588,6 +570,85 @@ declare const _default: {
|
|
|
588
570
|
}];
|
|
589
571
|
readonly stateMutability: "view";
|
|
590
572
|
readonly type: "function";
|
|
573
|
+
}, {
|
|
574
|
+
readonly anonymous: false;
|
|
575
|
+
readonly inputs: readonly [{
|
|
576
|
+
readonly indexed: true;
|
|
577
|
+
readonly internalType: "uint256";
|
|
578
|
+
readonly name: "authoritySetId";
|
|
579
|
+
readonly type: "uint256";
|
|
580
|
+
}, {
|
|
581
|
+
readonly indexed: true;
|
|
582
|
+
readonly internalType: "address";
|
|
583
|
+
readonly name: "relayer";
|
|
584
|
+
readonly type: "address";
|
|
585
|
+
}];
|
|
586
|
+
readonly name: "NewEpoch";
|
|
587
|
+
readonly type: "event";
|
|
588
|
+
}, {
|
|
589
|
+
readonly inputs: readonly [{
|
|
590
|
+
readonly internalType: "uint256";
|
|
591
|
+
readonly name: "index";
|
|
592
|
+
readonly type: "uint256";
|
|
593
|
+
}, {
|
|
594
|
+
readonly internalType: "bytes";
|
|
595
|
+
readonly name: "reason";
|
|
596
|
+
readonly type: "bytes";
|
|
597
|
+
}];
|
|
598
|
+
readonly name: "BatchCallFailed";
|
|
599
|
+
readonly type: "error";
|
|
600
|
+
}, {
|
|
601
|
+
readonly inputs: readonly [];
|
|
602
|
+
readonly name: "ChallengePeriodNotElapsed";
|
|
603
|
+
readonly type: "error";
|
|
604
|
+
}, {
|
|
605
|
+
readonly inputs: readonly [];
|
|
606
|
+
readonly name: "ConsensusClientExpired";
|
|
607
|
+
readonly type: "error";
|
|
608
|
+
}, {
|
|
609
|
+
readonly inputs: readonly [];
|
|
610
|
+
readonly name: "DuplicateMessage";
|
|
611
|
+
readonly type: "error";
|
|
612
|
+
}, {
|
|
613
|
+
readonly inputs: readonly [];
|
|
614
|
+
readonly name: "EmptyTree";
|
|
615
|
+
readonly type: "error";
|
|
616
|
+
}, {
|
|
617
|
+
readonly inputs: readonly [];
|
|
618
|
+
readonly name: "HostFrozen";
|
|
619
|
+
readonly type: "error";
|
|
620
|
+
}, {
|
|
621
|
+
readonly inputs: readonly [];
|
|
622
|
+
readonly name: "InvalidMessageDestination";
|
|
623
|
+
readonly type: "error";
|
|
624
|
+
}, {
|
|
625
|
+
readonly inputs: readonly [];
|
|
626
|
+
readonly name: "InvalidProof";
|
|
627
|
+
readonly type: "error";
|
|
628
|
+
}, {
|
|
629
|
+
readonly inputs: readonly [];
|
|
630
|
+
readonly name: "MessageNotTimedOut";
|
|
631
|
+
readonly type: "error";
|
|
632
|
+
}, {
|
|
633
|
+
readonly inputs: readonly [];
|
|
634
|
+
readonly name: "MessageTimedOut";
|
|
635
|
+
readonly type: "error";
|
|
636
|
+
}, {
|
|
637
|
+
readonly inputs: readonly [];
|
|
638
|
+
readonly name: "OutOfBoundsLeaves";
|
|
639
|
+
readonly type: "error";
|
|
640
|
+
}, {
|
|
641
|
+
readonly inputs: readonly [];
|
|
642
|
+
readonly name: "ProofExhausted";
|
|
643
|
+
readonly type: "error";
|
|
644
|
+
}, {
|
|
645
|
+
readonly inputs: readonly [];
|
|
646
|
+
readonly name: "StateCommitmentNotFound";
|
|
647
|
+
readonly type: "error";
|
|
648
|
+
}, {
|
|
649
|
+
readonly inputs: readonly [];
|
|
650
|
+
readonly name: "UnknownMessage";
|
|
651
|
+
readonly type: "error";
|
|
591
652
|
}];
|
|
592
653
|
};
|
|
593
654
|
|
|
@@ -638,7 +699,7 @@ declare class ChainConfigService {
|
|
|
638
699
|
getPopularTokens(chain: string): string[];
|
|
639
700
|
getIntentGatewayV2Address(chain: string): HexString;
|
|
640
701
|
getEntryPointV08Address(chain: string): HexString;
|
|
641
|
-
|
|
702
|
+
getCirclePaymasterAddress(chain: string): HexString | undefined;
|
|
642
703
|
getHyperbridgeAddress(): string;
|
|
643
704
|
/**
|
|
644
705
|
* Get the LayerZero Endpoint ID for the chain
|
|
@@ -658,6 +719,9 @@ declare class ChainConfigService {
|
|
|
658
719
|
* This represents the zero address in EVM chains.
|
|
659
720
|
*/
|
|
660
721
|
declare const DEFAULT_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
722
|
+
/**
|
|
723
|
+
* ERC-165 interface ID for IHandlerV2 (bytes4(keccak256("batchCall(bytes[])"))).
|
|
724
|
+
*/
|
|
661
725
|
/**
|
|
662
726
|
* Parameters for an EVM chain.
|
|
663
727
|
*/
|
|
@@ -724,6 +788,10 @@ declare class EvmChain implements IChain {
|
|
|
724
788
|
get bundlerUrl(): string | undefined;
|
|
725
789
|
get config(): IEvmConfig;
|
|
726
790
|
get configService(): ChainConfigService;
|
|
791
|
+
/**
|
|
792
|
+
* Returns the current authority set epoch from the HandlerV2 contract.
|
|
793
|
+
*/
|
|
794
|
+
currentEpoch(): Promise<bigint>;
|
|
727
795
|
/**
|
|
728
796
|
* Derives the key for the request receipt.
|
|
729
797
|
* @param {HexString} commitment - The commitment to derive the key from.
|
|
@@ -912,7 +980,6 @@ declare function getStateCommitmentSlot(stateMachineId: bigint, height: bigint):
|
|
|
912
980
|
* - root: The MMR root hash as a hex string
|
|
913
981
|
* - proof: An array of hex strings representing the MMR proof for the unmodified request
|
|
914
982
|
* - index: The index of the unmodified request in the MMR
|
|
915
|
-
* - kIndex: The k-index of the unmodified request in the MMR
|
|
916
983
|
* - treeSize: The number of leaves in the MMR
|
|
917
984
|
* - mmrSize: The size of the MMR in nodes
|
|
918
985
|
*/
|
|
@@ -920,7 +987,6 @@ declare function generateRootWithProof(postRequest: IPostRequest, treeSize: bigi
|
|
|
920
987
|
root: HexString;
|
|
921
988
|
proof: HexString[];
|
|
922
989
|
index: bigint;
|
|
923
|
-
kIndex: bigint;
|
|
924
990
|
treeSize: bigint;
|
|
925
991
|
mmrSize: bigint;
|
|
926
992
|
}>;
|
|
@@ -1264,10 +1330,21 @@ declare class SubstrateChain implements IChain {
|
|
|
1264
1330
|
*/
|
|
1265
1331
|
encode(message: IIsmpMessage): HexString;
|
|
1266
1332
|
/**
|
|
1267
|
-
*
|
|
1268
|
-
|
|
1269
|
-
|
|
1333
|
+
* Queries the latest proven height for this chain from pallet-ismp.
|
|
1334
|
+
*/
|
|
1335
|
+
queryLastProvenHeight(): Promise<bigint>;
|
|
1336
|
+
/**
|
|
1337
|
+
* Queries all consensus proofs needed to catch up from a given on-chain epoch
|
|
1338
|
+
* to the latest proven state. Returns rotation proofs (in order) to advance
|
|
1339
|
+
* the authority set, plus the final messaging proof that covers `neededHeight`.
|
|
1340
|
+
*
|
|
1341
|
+
* @param neededHeight - The Hyperbridge block height that must be covered
|
|
1342
|
+
* @param currentEpoch - The current authority set id on the destination EVM chain
|
|
1270
1343
|
*/
|
|
1344
|
+
queryConsensusProofs(neededHeight: bigint, currentEpoch: bigint): Promise<{
|
|
1345
|
+
proofs: HexString[];
|
|
1346
|
+
provenHeight: bigint;
|
|
1347
|
+
} | undefined>;
|
|
1271
1348
|
private getPalletIndex;
|
|
1272
1349
|
}
|
|
1273
1350
|
/**
|
|
@@ -1613,10 +1690,102 @@ declare class PolkadotHubChain implements IChain {
|
|
|
1613
1690
|
getTransactionReceipt(hash: HexString): Promise<TransactionReceipt>;
|
|
1614
1691
|
}
|
|
1615
1692
|
|
|
1693
|
+
/**
|
|
1694
|
+
* Chain parameters for a Pharos EVM chain. Pharos reuses the EVM JSON-RPC
|
|
1695
|
+
* surface for reads, writes and host queries — proof fetching is the only
|
|
1696
|
+
* place where the Pharos client deviates from a standard EVM chain.
|
|
1697
|
+
*/
|
|
1698
|
+
type PharosChainParams = EvmChainParams;
|
|
1699
|
+
/**
|
|
1700
|
+
* Pharos EVM chain client.
|
|
1701
|
+
*
|
|
1702
|
+
* Delegates every standard EVM interaction to {@link EvmChain} and overrides
|
|
1703
|
+
* {@link PharosChain.queryProof} / {@link PharosChain.queryStateProof} to speak
|
|
1704
|
+
* Pharos's custom `eth_getProof` response format — mirroring the Rust
|
|
1705
|
+
* `tesseract-messaging-pharos-evm` client.
|
|
1706
|
+
*/
|
|
1707
|
+
declare class PharosChain implements IChain {
|
|
1708
|
+
private readonly params;
|
|
1709
|
+
private readonly evm;
|
|
1710
|
+
private readonly rpc;
|
|
1711
|
+
static fromParams(params: PharosChainParams): PharosChain;
|
|
1712
|
+
/**
|
|
1713
|
+
* Creates a `PharosChain` by auto-detecting the EVM chain ID and `IsmpHost`
|
|
1714
|
+
* address via {@link EvmChain.create}.
|
|
1715
|
+
*
|
|
1716
|
+
* @param rpcUrl - HTTP(S) JSON-RPC URL of the Pharos node
|
|
1717
|
+
* @param bundlerUrl - Optional ERC-4337 bundler URL forwarded to `EvmChain.create`
|
|
1718
|
+
*/
|
|
1719
|
+
static create(rpcUrl: string, bundlerUrl?: string): Promise<PharosChain>;
|
|
1720
|
+
private constructor();
|
|
1721
|
+
get client(): PublicClient;
|
|
1722
|
+
get host(): HexString;
|
|
1723
|
+
get bundlerUrl(): string | undefined;
|
|
1724
|
+
get configService(): ChainConfigService;
|
|
1725
|
+
get config(): IPharosConfig;
|
|
1726
|
+
private hostAddress;
|
|
1727
|
+
/**
|
|
1728
|
+
* Fetch a storage proof for `slotKeys` under `address` at the given block and
|
|
1729
|
+
* merge the response into the supplied accumulator. Mirrors the membership
|
|
1730
|
+
* proof path of `PharosEvmClient::fetch_pharos_proof` on the Rust side.
|
|
1731
|
+
*/
|
|
1732
|
+
private fetchStorageProofInto;
|
|
1733
|
+
/**
|
|
1734
|
+
* Fetch an account proof (no storage keys) at the given block and record it on
|
|
1735
|
+
* the accumulator. Mirrors `PharosEvmClient::fetch_account_proof`.
|
|
1736
|
+
*/
|
|
1737
|
+
private fetchAccountProofInto;
|
|
1738
|
+
timestamp(): Promise<bigint>;
|
|
1739
|
+
requestReceiptKey(commitment: HexString): HexString;
|
|
1740
|
+
queryRequestReceipt(commitment: HexString): Promise<HexString | undefined>;
|
|
1741
|
+
/**
|
|
1742
|
+
* Query a Pharos state proof for the request/response commitments in `message`.
|
|
1743
|
+
*
|
|
1744
|
+
* Mirrors `PharosEvmClient::query_requests_proof` / `query_responses_proof`:
|
|
1745
|
+
* for every commitment we derive the second storage slot (`slot1` from
|
|
1746
|
+
* {@link requestCommitmentKey} / {@link responseCommitmentKey}) and request it
|
|
1747
|
+
* from the ISMP host via `eth_getProof`.
|
|
1748
|
+
*/
|
|
1749
|
+
queryProof(message: IMessage, _counterparty: string, at?: bigint): Promise<HexString>;
|
|
1750
|
+
/**
|
|
1751
|
+
* Query a Pharos state proof for arbitrary keys.
|
|
1752
|
+
*
|
|
1753
|
+
* Supports the same key shapes as `PharosEvmClient::query_state_proof`:
|
|
1754
|
+
* - 32-byte keys: ISMP host storage slots
|
|
1755
|
+
* - 52-byte keys: `address (20) || slot (32)` grouped by contract
|
|
1756
|
+
* - 20-byte keys: account queries (proves the account leaf itself)
|
|
1757
|
+
*
|
|
1758
|
+
* If `address` is provided, all keys are treated as 32-byte slots under that
|
|
1759
|
+
* contract (matching the `EvmChain.queryStateProof` contract-override shape).
|
|
1760
|
+
*/
|
|
1761
|
+
queryStateProof(at: bigint, keys: HexString[], address?: HexString): Promise<HexString>;
|
|
1762
|
+
encode(message: IIsmpMessage): HexString;
|
|
1763
|
+
latestStateMachineHeight(stateMachineId: StateMachineIdParams): Promise<bigint>;
|
|
1764
|
+
challengePeriod(stateMachineId: StateMachineIdParams): Promise<bigint>;
|
|
1765
|
+
stateMachineUpdateTime(stateMachineHeight: StateMachineHeight): Promise<bigint>;
|
|
1766
|
+
getHostNonce(): Promise<bigint>;
|
|
1767
|
+
quoteNative(request: IPostRequest | IGetRequest, fee: bigint): Promise<bigint>;
|
|
1768
|
+
getFeeTokenWithDecimals(): Promise<{
|
|
1769
|
+
address: HexString;
|
|
1770
|
+
decimals: number;
|
|
1771
|
+
}>;
|
|
1772
|
+
getPlaceOrderCalldata(txHash: string, intentGatewayAddress: string): Promise<HexString>;
|
|
1773
|
+
estimateGas(request: IPostRequest): Promise<{
|
|
1774
|
+
gas: bigint;
|
|
1775
|
+
postRequestCalldata: HexString;
|
|
1776
|
+
}>;
|
|
1777
|
+
broadcastTransaction(signedTransaction: HexString): Promise<TransactionReceipt>;
|
|
1778
|
+
getTransactionReceipt(hash: HexString): Promise<TransactionReceipt>;
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1616
1781
|
/**
|
|
1617
1782
|
* Type representing an ISMP message.
|
|
1618
1783
|
*/
|
|
1619
|
-
type IIsmpMessage = IRequestMessage | ITimeoutPostRequestMessage | IGetResponseMessage | IGetRequestMessage;
|
|
1784
|
+
type IIsmpMessage = IRequestMessage | ITimeoutPostRequestMessage | IGetResponseMessage | IGetRequestMessage | IConsensusMessage | IBatchConsensusAndPostRequestMessage | IBatchConsensusAndGetResponseMessage;
|
|
1785
|
+
interface IConsensusMessage {
|
|
1786
|
+
kind: "Consensus";
|
|
1787
|
+
consensusProof: HexString;
|
|
1788
|
+
}
|
|
1620
1789
|
interface IRequestMessage {
|
|
1621
1790
|
/**
|
|
1622
1791
|
* The kind of message.
|
|
@@ -1699,6 +1868,20 @@ interface ITimeoutPostRequestMessage {
|
|
|
1699
1868
|
*/
|
|
1700
1869
|
proof: IProof;
|
|
1701
1870
|
}
|
|
1871
|
+
interface IBatchConsensusAndPostRequestMessage {
|
|
1872
|
+
kind: "BatchConsensusAndPostRequest";
|
|
1873
|
+
consensusProofs: HexString[];
|
|
1874
|
+
requests: IPostRequest[];
|
|
1875
|
+
proof: IProof;
|
|
1876
|
+
signer: HexString;
|
|
1877
|
+
}
|
|
1878
|
+
interface IBatchConsensusAndGetResponseMessage {
|
|
1879
|
+
kind: "BatchConsensusAndGetResponse";
|
|
1880
|
+
consensusProofs: HexString[];
|
|
1881
|
+
responses: IGetResponse[];
|
|
1882
|
+
proof: IProof;
|
|
1883
|
+
signer: HexString;
|
|
1884
|
+
}
|
|
1702
1885
|
interface IProof {
|
|
1703
1886
|
/**
|
|
1704
1887
|
* The height of the proof.
|
|
@@ -1724,7 +1907,7 @@ interface IChain {
|
|
|
1724
1907
|
/**
|
|
1725
1908
|
* Returns the configuration for this chain
|
|
1726
1909
|
*/
|
|
1727
|
-
get config(): IEvmConfig | ISubstrateConfig | IPolkadotHubConfig;
|
|
1910
|
+
get config(): IEvmConfig | ISubstrateConfig | IPolkadotHubConfig | IPharosConfig;
|
|
1728
1911
|
timestamp(): Promise<bigint>;
|
|
1729
1912
|
/**
|
|
1730
1913
|
* Returns the state trie key for the request-receipt storage item for the given request commitment.
|
|
@@ -1776,8 +1959,8 @@ interface IEvmChain extends IChain {
|
|
|
1776
1959
|
type EstimateGasCallData = ContractFunctionArgs<typeof _default.ABI, "nonpayable" | "payable", "handlePostRequests">;
|
|
1777
1960
|
type HexString = `0x${string}`;
|
|
1778
1961
|
interface IConfig {
|
|
1779
|
-
source: IEvmConfig | ISubstrateConfig | IPolkadotHubConfig;
|
|
1780
|
-
dest: IEvmConfig | ISubstrateConfig | IPolkadotHubConfig;
|
|
1962
|
+
source: IEvmConfig | ISubstrateConfig | IPolkadotHubConfig | IPharosConfig;
|
|
1963
|
+
dest: IEvmConfig | ISubstrateConfig | IPolkadotHubConfig | IPharosConfig;
|
|
1781
1964
|
hyperbridge: IHyperbridgeConfig;
|
|
1782
1965
|
tracing?: boolean;
|
|
1783
1966
|
}
|
|
@@ -1794,6 +1977,14 @@ interface IEvmConfig {
|
|
|
1794
1977
|
interface IPolkadotHubConfig extends IEvmConfig {
|
|
1795
1978
|
substrateRpcUrl: string;
|
|
1796
1979
|
}
|
|
1980
|
+
/**
|
|
1981
|
+
* Pharos EVM chain — same as {@link IEvmConfig}. Pharos uses a non-standard
|
|
1982
|
+
* `eth_getProof` response format (hexary hash tree proof nodes with offsets plus
|
|
1983
|
+
* SHA-256 hashing), so proof fetching is handled by the Pharos-specific chain
|
|
1984
|
+
* client rather than viem's standard `getProof`.
|
|
1985
|
+
*/
|
|
1986
|
+
interface IPharosConfig extends IEvmConfig {
|
|
1987
|
+
}
|
|
1797
1988
|
interface ISubstrateConfig {
|
|
1798
1989
|
wsUrl: string;
|
|
1799
1990
|
consensusStateId: string;
|
|
@@ -2790,7 +2981,7 @@ interface SigningAccount {
|
|
|
2790
2981
|
yParity: number;
|
|
2791
2982
|
}>;
|
|
2792
2983
|
/**
|
|
2793
|
-
* Signs an EIP-712 typed-data payload (e.g. an EIP-2612 USDC permit for the Circle
|
|
2984
|
+
* Signs an EIP-712 typed-data payload (e.g. an EIP-2612 USDC permit for the Circle Paymaster).
|
|
2794
2985
|
* The shape of `typedData` matches viem's `TypedDataDefinition` (domain + types + message).
|
|
2795
2986
|
*/
|
|
2796
2987
|
signTypedData: (typedData: unknown, chainId?: number) => Promise<HexString>;
|
|
@@ -2843,9 +3034,9 @@ interface FillOrderEstimate {
|
|
|
2843
3034
|
callGasLimit: bigint;
|
|
2844
3035
|
verificationGasLimit: bigint;
|
|
2845
3036
|
preVerificationGas: bigint;
|
|
2846
|
-
/** Paymaster verification gas limit from bundler estimate
|
|
3037
|
+
/** Paymaster verification gas limit from bundler estimate. 0n when no paymaster. */
|
|
2847
3038
|
paymasterVerificationGasLimit: bigint;
|
|
2848
|
-
/** Paymaster postOp gas limit from bundler estimate
|
|
3039
|
+
/** Paymaster postOp gas limit from bundler estimate. 0n when no paymaster. */
|
|
2849
3040
|
paymasterPostOpGasLimit: bigint;
|
|
2850
3041
|
maxFeePerGas: bigint;
|
|
2851
3042
|
maxPriorityFeePerGas: bigint;
|
|
@@ -3035,101 +3226,16 @@ type ERC7821Call = {
|
|
|
3035
3226
|
};
|
|
3036
3227
|
|
|
3037
3228
|
/**
|
|
3038
|
-
*
|
|
3039
|
-
*
|
|
3040
|
-
*
|
|
3041
|
-
* through the Hyperbridge protocol. It supports:
|
|
3042
|
-
*
|
|
3043
|
-
* - Querying state machine updates by block height or timestamp
|
|
3044
|
-
* - Retrieving request status information by transaction hash
|
|
3045
|
-
* - Monitoring request status changes through streaming interfaces
|
|
3046
|
-
* - Handling request timeout flows and related proof generation
|
|
3047
|
-
* - Tracking request finalization across source and destination chains
|
|
3048
|
-
*
|
|
3049
|
-
* The client implements automatic retries with exponential backoff for network
|
|
3050
|
-
* resilience and provides both simple query methods and advanced streaming
|
|
3051
|
-
* interfaces for real-time status tracking.
|
|
3052
|
-
*
|
|
3053
|
-
* The URLs provided in the configuration must point to archive nodes to allow the client to query for storage proofs
|
|
3054
|
-
* of potentially much older blocks. Regular nodes only store the state for recent blocks and will not be able
|
|
3055
|
-
* to provide the necessary proofs for cross-chain verification, especially in timeout scenarios.
|
|
3056
|
-
*
|
|
3057
|
-
* @example
|
|
3058
|
-
* ```typescript
|
|
3059
|
-
* const sourceChain = EvmChain.fromParams({
|
|
3060
|
-
* chainId: 1,
|
|
3061
|
-
* rpcUrl: "https://eth-rpc.com",
|
|
3062
|
-
* host: "0x87ea45..",
|
|
3063
|
-
* consensusStateId: "ETH0"
|
|
3064
|
-
* })
|
|
3065
|
-
* const destChain = EvmChain.fromParams({
|
|
3066
|
-
* chainId: 42161,
|
|
3067
|
-
* rpcUrl: "https://arb-rpc.com",
|
|
3068
|
-
* host: "0x87ea42345..",
|
|
3069
|
-
* consensusStateId: "ARB0"
|
|
3070
|
-
* })
|
|
3071
|
-
* const hyperbridgeChain = await SubstrateChain.connect({
|
|
3072
|
-
* stateMachineId: "POLKADOT-3367",
|
|
3073
|
-
* wsUrl: "ws://localhost:9944",
|
|
3074
|
-
* hasher: "Keccak",
|
|
3075
|
-
* consensusStateId: "DOT0"
|
|
3076
|
-
* })
|
|
3077
|
-
*
|
|
3078
|
-
* const client = new IndexerClient({
|
|
3079
|
-
* queryClient: queryClient,
|
|
3080
|
-
* pollInterval: 2000,
|
|
3081
|
-
* source: sourceChain,
|
|
3082
|
-
* dest: destChain,
|
|
3083
|
-
* hyperbridge: hyperbridgeChain
|
|
3084
|
-
* });
|
|
3085
|
-
*
|
|
3086
|
-
* // Query a request status
|
|
3087
|
-
* const status = await client.queryRequestWithStatus("0x1234...");
|
|
3088
|
-
*
|
|
3089
|
-
* // Stream status updates
|
|
3090
|
-
* for await (const update of client.postRequestStatusStream("0x1234...")) {
|
|
3091
|
-
* console.log(`Request status: ${update.status}`);
|
|
3092
|
-
* }
|
|
3093
|
-
* ```
|
|
3229
|
+
* Read-only indexer queries — state machine updates, post/get requests, and
|
|
3230
|
+
* response lookups. Groups the thin GraphQL wrappers that other client
|
|
3231
|
+
* sub-modules consume when building finality events and status streams.
|
|
3094
3232
|
*/
|
|
3095
|
-
declare class
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
private client;
|
|
3100
|
-
/**
|
|
3101
|
-
* Configuration for the IndexerClient including URLs, poll intervals, and chain-specific settings
|
|
3102
|
-
*/
|
|
3103
|
-
private config;
|
|
3104
|
-
private logger;
|
|
3105
|
-
/**
|
|
3106
|
-
* Default configuration for retry behavior when network requests fail
|
|
3107
|
-
* - maxRetries: Maximum number of retry attempts before failing
|
|
3108
|
-
* - backoffMs: Initial backoff time in milliseconds (doubles with each retry)
|
|
3109
|
-
*/
|
|
3110
|
-
private defaultRetryConfig;
|
|
3111
|
-
/**
|
|
3112
|
-
* Creates a new IndexerClient instance
|
|
3113
|
-
*/
|
|
3114
|
-
constructor(config: PartialClientConfig);
|
|
3115
|
-
/**
|
|
3116
|
-
* Get the source chain instance
|
|
3117
|
-
*/
|
|
3118
|
-
get source(): IChain;
|
|
3119
|
-
/**
|
|
3120
|
-
* Get the destination chain instance
|
|
3121
|
-
*/
|
|
3122
|
-
get dest(): IChain;
|
|
3123
|
-
/**
|
|
3124
|
-
* Get the hyperbridge chain instance
|
|
3125
|
-
*/
|
|
3126
|
-
get hyperbridge(): IChain;
|
|
3233
|
+
declare class Queries {
|
|
3234
|
+
private readonly ctx;
|
|
3235
|
+
private readonly logger;
|
|
3236
|
+
constructor(ctx: ClientContext);
|
|
3127
3237
|
/**
|
|
3128
3238
|
* Query for a single state machine update event greater than or equal to the given height.
|
|
3129
|
-
* @params statemachineId - ID of the state machine
|
|
3130
|
-
* @params height - Starting block height
|
|
3131
|
-
* @params chain - The identifier for the chain where the state machine update should be queried (corresponds to a stateMachineId)
|
|
3132
|
-
* @returns Closest state machine update
|
|
3133
3239
|
*/
|
|
3134
3240
|
queryStateMachineUpdateByHeight({ statemachineId, height, chain, }: {
|
|
3135
3241
|
statemachineId: string;
|
|
@@ -3138,10 +3244,6 @@ declare class IndexerClient {
|
|
|
3138
3244
|
}): Promise<StateMachineUpdate | undefined>;
|
|
3139
3245
|
/**
|
|
3140
3246
|
* Query for a single state machine update event greater than or equal to the given timestamp.
|
|
3141
|
-
* @params statemachineId - ID of the state machine
|
|
3142
|
-
* @params timestamp - Starting block timestamp
|
|
3143
|
-
* @params chain - The identifier for the chain where the state machine update should be queried (corresponds to a stateMachineId)
|
|
3144
|
-
* @returns Closest state machine update
|
|
3145
3247
|
*/
|
|
3146
3248
|
queryStateMachineUpdateByTimestamp({ statemachineId, commitmentTimestamp, chain, }: {
|
|
3147
3249
|
statemachineId: string;
|
|
@@ -3149,271 +3251,303 @@ declare class IndexerClient {
|
|
|
3149
3251
|
chain: string;
|
|
3150
3252
|
}): Promise<StateMachineUpdate | undefined>;
|
|
3151
3253
|
/**
|
|
3152
|
-
* Query for the latest state machine update height
|
|
3153
|
-
* @params statemachineId - ID of the state machine
|
|
3154
|
-
* @params chain - The identifier for the chain where the state machine update should be queried (corresponds to a stateMachineId)
|
|
3155
|
-
* @returns Latest height or undefined if no updates found
|
|
3254
|
+
* Query for the latest state machine update height.
|
|
3156
3255
|
*/
|
|
3157
3256
|
queryLatestStateMachineHeight({ statemachineId, chain, }: {
|
|
3158
3257
|
statemachineId: string;
|
|
3159
3258
|
chain: string;
|
|
3160
3259
|
}): Promise<bigint | undefined>;
|
|
3161
3260
|
/**
|
|
3162
|
-
* Queries a request by
|
|
3163
|
-
*
|
|
3164
|
-
* @param commitment_hash - Can be commitment
|
|
3165
|
-
* @returns Latest status and block metadata of the request
|
|
3261
|
+
* Queries a POST request by commitment hash.
|
|
3166
3262
|
*/
|
|
3167
|
-
queryPostRequest(
|
|
3263
|
+
queryPostRequest(commitmentHash: HexString): Promise<PostRequestWithStatus | undefined>;
|
|
3168
3264
|
/**
|
|
3169
|
-
* Queries a request by any of its associated hashes
|
|
3170
|
-
* Statuses will be one of SOURCE, HYPERBRIDGE_DELIVERED and DESTINATION
|
|
3171
|
-
* @param hash - Can be commitment, hyperbridge tx hash, source tx hash, destination tx hash, or timeout tx hash
|
|
3172
|
-
* @returns Latest status and block metadata of the request
|
|
3265
|
+
* Queries a GET request by any of its associated hashes.
|
|
3173
3266
|
*/
|
|
3174
3267
|
queryGetRequest(hash: HexString): Promise<GetRequestWithStatus | undefined>;
|
|
3175
3268
|
/**
|
|
3176
|
-
* Queries the response associated with a specific request ID and returns its commitment
|
|
3177
|
-
* @param requestId - The ID of the request to find the associated response for
|
|
3178
|
-
* @returns The response associated with the given request ID, or undefined if not found
|
|
3269
|
+
* Queries the response associated with a specific request ID and returns its commitment.
|
|
3179
3270
|
*/
|
|
3180
3271
|
queryResponseByRequestId(requestId: string): Promise<ResponseCommitmentWithValues | undefined>;
|
|
3272
|
+
}
|
|
3273
|
+
|
|
3274
|
+
/**
|
|
3275
|
+
* GET request status tracking — snapshot + streaming flows. Responses travel
|
|
3276
|
+
* back to the origin chain, so finality work happens against `source` rather
|
|
3277
|
+
* than `dest`.
|
|
3278
|
+
*/
|
|
3279
|
+
declare class GetRequestClient {
|
|
3280
|
+
private readonly ctx;
|
|
3281
|
+
private readonly queries;
|
|
3282
|
+
private readonly logger;
|
|
3283
|
+
constructor(ctx: ClientContext, queries: Queries);
|
|
3284
|
+
/**
|
|
3285
|
+
* Enhances a GET request with finality events (`SOURCE_FINALIZED`,
|
|
3286
|
+
* `HYPERBRIDGE_FINALIZED`).
|
|
3287
|
+
*/
|
|
3288
|
+
addGetRequestFinalityEvents(request: GetRequestWithStatus): Promise<GetRequestWithStatus>;
|
|
3289
|
+
/**
|
|
3290
|
+
* Snapshot query with all inferred finality events sorted.
|
|
3291
|
+
*/
|
|
3292
|
+
queryGetRequestWithStatus(hash: HexString): Promise<GetRequestWithStatus | undefined>;
|
|
3293
|
+
/**
|
|
3294
|
+
* Streaming status updates for a GET request. Ends when the request reaches
|
|
3295
|
+
* the destination or a timeout becomes pending.
|
|
3296
|
+
*/
|
|
3297
|
+
getRequestStatusStream(hash: HexString): AsyncGenerator<RequestStatusWithMetadata, void>;
|
|
3298
|
+
private streamInternal;
|
|
3299
|
+
/**
|
|
3300
|
+
* Snapshot helper: returns the `HYPERBRIDGE_FINALIZED` event with source-chain
|
|
3301
|
+
* calldata if prerequisites are met, or `undefined` if we're still waiting
|
|
3302
|
+
* for a consensus proof.
|
|
3303
|
+
* Requires the matching response to already exist in the indexer.
|
|
3304
|
+
*/
|
|
3305
|
+
private buildFinalized;
|
|
3306
|
+
/**
|
|
3307
|
+
* Streaming helper: waits (via `waitOrAbort`) for the consensus proof or
|
|
3308
|
+
* state machine update, fetches the messaging proof, and returns the
|
|
3309
|
+
* finalized event. Caller has already observed `HYPERBRIDGE_DELIVERED` and
|
|
3310
|
+
* provides the index into `request.statuses` that carries it plus the
|
|
3311
|
+
* indexed response (looked up separately because GET responses live in a
|
|
3312
|
+
* different GraphQL entity from requests).
|
|
3313
|
+
*/
|
|
3314
|
+
private streamFinalized;
|
|
3315
|
+
}
|
|
3316
|
+
|
|
3317
|
+
/**
|
|
3318
|
+
* POST request lifecycle — snapshot status, streaming status, and the full
|
|
3319
|
+
* timeout flow (pending → destination-finalized → hyperbridge-finalized → timed-out).
|
|
3320
|
+
* Also hosts `aggregateTransactionWithCommitment`, which relays a dispatched
|
|
3321
|
+
* post request through Hyperbridge from source-chain state.
|
|
3322
|
+
*/
|
|
3323
|
+
declare class PostRequestClient {
|
|
3324
|
+
private readonly ctx;
|
|
3325
|
+
private readonly queries;
|
|
3326
|
+
private readonly logger;
|
|
3327
|
+
constructor(ctx: ClientContext, queries: Queries);
|
|
3181
3328
|
/**
|
|
3182
3329
|
* Enhances a request with finality events by querying state machine updates.
|
|
3183
|
-
*
|
|
3184
|
-
|
|
3185
|
-
|
|
3186
|
-
|
|
3187
|
-
*
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
*
|
|
3192
|
-
*
|
|
3193
|
-
|
|
3194
|
-
|
|
3330
|
+
* Adds `SOURCE_FINALIZED` and `HYPERBRIDGE_FINALIZED` when applicable.
|
|
3331
|
+
*/
|
|
3332
|
+
addRequestFinalityEvents(request: PostRequestWithStatus): Promise<PostRequestWithStatus>;
|
|
3333
|
+
/**
|
|
3334
|
+
* Snapshot query: request + all inferred finality/timeout events, sorted.
|
|
3335
|
+
*/
|
|
3336
|
+
queryRequestWithStatus(hash: HexString): Promise<PostRequestWithStatus | undefined>;
|
|
3337
|
+
/**
|
|
3338
|
+
* Streaming status updates for a post request. Ends when the request reaches
|
|
3339
|
+
* the destination or a timeout becomes pending.
|
|
3340
|
+
*/
|
|
3341
|
+
postRequestStatusStream(hash: HexString): AsyncGenerator<RequestStatusWithMetadata, void>;
|
|
3342
|
+
private streamStatusInternal;
|
|
3343
|
+
/**
|
|
3344
|
+
* Populates timeout-related status events (`PENDING_TIMEOUT`,
|
|
3345
|
+
* `DESTINATION_FINALIZED_TIMEOUT`, `HYPERBRIDGE_FINALIZED_TIMEOUT`) and the
|
|
3346
|
+
* accompanying timeout-proof calldata.
|
|
3347
|
+
*/
|
|
3348
|
+
addTimeoutFinalityEvents(request: PostRequestWithStatus): Promise<PostRequestWithStatus>;
|
|
3349
|
+
/**
|
|
3350
|
+
* Streaming status updates for a timed-out post request.
|
|
3351
|
+
*/
|
|
3352
|
+
postRequestTimeoutStream(hash: HexString): AsyncGenerator<PostRequestTimeoutStatus, void>;
|
|
3353
|
+
private streamTimeoutInternal;
|
|
3354
|
+
/**
|
|
3355
|
+
* Snapshot helper: returns the `HYPERBRIDGE_FINALIZED` event with relayer
|
|
3356
|
+
* calldata if prerequisites are met, or `undefined` if we're still waiting
|
|
3357
|
+
* for a consensus proof.
|
|
3358
|
+
*/
|
|
3359
|
+
private buildFinalized;
|
|
3360
|
+
/**
|
|
3361
|
+
* Streaming helper: waits for the consensus proof, fetches the messaging
|
|
3362
|
+
* proof with retry, and returns the finalized event. Caller has already
|
|
3363
|
+
* observed `HYPERBRIDGE_DELIVERED` and provides the index into
|
|
3364
|
+
* `request.statuses` that carries it.
|
|
3365
|
+
*/
|
|
3366
|
+
private streamFinalized;
|
|
3367
|
+
/**
|
|
3368
|
+
* Retry-wrapped `hyperbridge.queryProof`. Fails after 6 retries (~2 minutes at
|
|
3369
|
+
* 2s backoff) so a hung Hyperbridge node doesn't stall the stream forever.
|
|
3195
3370
|
*/
|
|
3196
|
-
private
|
|
3371
|
+
private fetchProofWithRetry;
|
|
3372
|
+
/**
|
|
3373
|
+
* Relay a post-request to Hyperbridge from source-chain state, returning
|
|
3374
|
+
* the finalized Hyperbridge extrinsic receipt.
|
|
3375
|
+
*/
|
|
3376
|
+
aggregateTransactionWithCommitment(commitment: HexString): Promise<Awaited<ReturnType<SubstrateChain["submitUnsigned"]>>>;
|
|
3377
|
+
}
|
|
3378
|
+
|
|
3379
|
+
/**
|
|
3380
|
+
* Shared dependencies passed to every sub-module of {@link IsmpClient}.
|
|
3381
|
+
*
|
|
3382
|
+
* Sub-modules read their chain configuration, GraphQL client, logger, and
|
|
3383
|
+
* retry helpers off of this object rather than reaching back into the facade.
|
|
3384
|
+
*
|
|
3385
|
+
* Internal — not part of the public SDK surface.
|
|
3386
|
+
*/
|
|
3387
|
+
interface ClientContext {
|
|
3388
|
+
/** Chain configuration + indexer poll interval. `pollInterval` is guaranteed set. */
|
|
3389
|
+
config: ClientConfig & {
|
|
3390
|
+
pollInterval: number;
|
|
3391
|
+
};
|
|
3392
|
+
/** GraphQL client used to query the Hyperbridge indexer. */
|
|
3393
|
+
graphql: IndexerQueryClient;
|
|
3394
|
+
/** Structured logger (tag-scoped per sub-module). */
|
|
3395
|
+
logger: ConsolaInstance;
|
|
3396
|
+
/** Default retry config — sub-modules may override per-call. */
|
|
3397
|
+
defaultRetryConfig: RetryConfig;
|
|
3398
|
+
}
|
|
3399
|
+
/**
|
|
3400
|
+
* `IsmpClient` tracks ISMP POST/GET requests and their timeout flows across
|
|
3401
|
+
* source, Hyperbridge, and destination chains.
|
|
3402
|
+
*
|
|
3403
|
+
* The client:
|
|
3404
|
+
* - queries the Hyperbridge indexer for request status,
|
|
3405
|
+
* - augments status trails with derived finality events (`SOURCE_FINALIZED`,
|
|
3406
|
+
* `HYPERBRIDGE_FINALIZED`, timeout events),
|
|
3407
|
+
* - streams live updates while a request is in flight, and
|
|
3408
|
+
* - generates the calldata a relayer needs to finalize a request on the
|
|
3409
|
+
* counterparty chain (including the HandlerV2 batch path).
|
|
3410
|
+
*
|
|
3411
|
+
* The RPC URLs in {@link ClientConfig} must point to archive nodes — timeout
|
|
3412
|
+
* and challenge-period flows reach back into older blocks for storage proofs.
|
|
3413
|
+
*
|
|
3414
|
+
* @example
|
|
3415
|
+
* ```typescript
|
|
3416
|
+
* const client = new IsmpClient({
|
|
3417
|
+
* queryClient,
|
|
3418
|
+
* source: sourceChain,
|
|
3419
|
+
* dest: destChain,
|
|
3420
|
+
* hyperbridge: hyperbridgeChain,
|
|
3421
|
+
* pollInterval: 2000,
|
|
3422
|
+
* })
|
|
3423
|
+
*
|
|
3424
|
+
* const status = await client.queryRequestWithStatus("0x1234...")
|
|
3425
|
+
*
|
|
3426
|
+
* for await (const update of client.postRequestStatusStream("0x1234...")) {
|
|
3427
|
+
* console.log(`Request status: ${update.status}`)
|
|
3428
|
+
* }
|
|
3429
|
+
* ```
|
|
3430
|
+
*/
|
|
3431
|
+
declare class IsmpClient {
|
|
3432
|
+
/** Shared context threaded through every sub-module. */
|
|
3433
|
+
protected readonly ctx: ClientContext;
|
|
3434
|
+
/** Indexer read-only queries (state machine updates, post/get requests). */
|
|
3435
|
+
protected readonly queries: Queries;
|
|
3436
|
+
/** POST request lifecycle: snapshot + streaming status, timeout flow, aggregation. */
|
|
3437
|
+
protected readonly postRequest: PostRequestClient;
|
|
3438
|
+
/** GET request snapshot + streaming status. */
|
|
3439
|
+
protected readonly getRequest: GetRequestClient;
|
|
3440
|
+
constructor(config: PartialClientConfig);
|
|
3441
|
+
/** Source chain instance. */
|
|
3442
|
+
get source(): IChain;
|
|
3443
|
+
/** Destination chain instance. */
|
|
3444
|
+
get dest(): IChain;
|
|
3445
|
+
/** Hyperbridge chain instance. */
|
|
3446
|
+
get hyperbridge(): IChain;
|
|
3197
3447
|
/**
|
|
3198
|
-
*
|
|
3199
|
-
*
|
|
3200
|
-
*
|
|
3201
|
-
* This method enhances a request object with additional status events related to the
|
|
3202
|
-
* timeout flow, including:
|
|
3203
|
-
* - PENDING_TIMEOUT: When a request has passed its timeout timestamp
|
|
3204
|
-
* - DESTINATION_FINALIZED: When the destination chain has finalized the timeout timestamp
|
|
3205
|
-
* - HYPERBRIDGE_FINALIZED_TIMEOUT: When hyperbridge has finalized the timeout state
|
|
3448
|
+
* Query for the first state machine update at or after `height` for the given
|
|
3449
|
+
* state machine on the indicated counterparty chain.
|
|
3206
3450
|
*
|
|
3207
|
-
* The
|
|
3208
|
-
*
|
|
3209
|
-
* @param request - Request to fill timeout events for
|
|
3210
|
-
* @returns Request with timeout events filled in, including any proof calldata for timeout submissions
|
|
3211
|
-
* @private
|
|
3451
|
+
* @returns The matching update, or `undefined` if none has been indexed yet.
|
|
3212
3452
|
*/
|
|
3213
|
-
|
|
3453
|
+
queryStateMachineUpdateByHeight(args: {
|
|
3454
|
+
/** State machine id whose commitment is being looked up (e.g. `EVM-1`). */
|
|
3455
|
+
statemachineId: string;
|
|
3456
|
+
/** Chain id where the update was applied (e.g. `POLKADOT-3367`). */
|
|
3457
|
+
chain: string;
|
|
3458
|
+
/** Lower bound on the update height. */
|
|
3459
|
+
height: number;
|
|
3460
|
+
}): Promise<StateMachineUpdate | undefined>;
|
|
3214
3461
|
/**
|
|
3215
|
-
*
|
|
3216
|
-
*
|
|
3217
|
-
*
|
|
3218
|
-
* @returns Full request data with all inferred status events, including SOURCE_FINALIZED and HYPERBRIDGE_FINALIZED
|
|
3219
|
-
* @remarks Unlike queryRequest(), this method adds derived finalization status events by querying state machine updates
|
|
3462
|
+
* Query for the first state machine update whose commitment timestamp is at
|
|
3463
|
+
* or after `commitmentTimestamp`. Used by timeout flows to find when a
|
|
3464
|
+
* counterparty chain finalized a state past the request's deadline.
|
|
3220
3465
|
*/
|
|
3221
|
-
|
|
3466
|
+
queryStateMachineUpdateByTimestamp(args: {
|
|
3467
|
+
statemachineId: string;
|
|
3468
|
+
commitmentTimestamp: bigint;
|
|
3469
|
+
chain: string;
|
|
3470
|
+
}): Promise<StateMachineUpdate | undefined>;
|
|
3222
3471
|
/**
|
|
3223
|
-
*
|
|
3224
|
-
*
|
|
3225
|
-
* @param hash - Can be commitment, hyperbridge tx hash, source tx hash, destination tx hash, or timeout tx hash
|
|
3226
|
-
* @returns Full GET request data with all inferred status events, including SOURCE_FINALIZED and HYPERBRIDGE_FINALIZED
|
|
3227
|
-
* @remarks Unlike queryGetRequest(), this method adds derived finalization status events by querying state machine updates
|
|
3472
|
+
* Returns the latest known state machine height for a given state machine,
|
|
3473
|
+
* or `undefined` if the indexer has no record yet.
|
|
3228
3474
|
*/
|
|
3229
|
-
|
|
3475
|
+
queryLatestStateMachineHeight(args: {
|
|
3476
|
+
statemachineId: string;
|
|
3477
|
+
chain: string;
|
|
3478
|
+
}): Promise<bigint | undefined>;
|
|
3230
3479
|
/**
|
|
3231
|
-
*
|
|
3232
|
-
*
|
|
3233
|
-
*
|
|
3234
|
-
* that represent chain finality confirmations. It adds:
|
|
3235
|
-
* - SOURCE_FINALIZED: When the source chain has finalized the request
|
|
3236
|
-
* - HYPERBRIDGE_FINALIZED: When Hyperbridge has finalized the delivery confirmation and response is ready
|
|
3237
|
-
*
|
|
3238
|
-
* The method also generates appropriate calldata for submitting cross-chain proofs
|
|
3239
|
-
* when applicable.
|
|
3240
|
-
*
|
|
3241
|
-
* @param request - The GET request to enhance with finality events
|
|
3242
|
-
* @returns The request with finality events added
|
|
3243
|
-
* @private
|
|
3480
|
+
* Queries a POST request by any of its associated hashes (commitment,
|
|
3481
|
+
* source/destination/hyperbridge tx hash, or timeout tx hash). Returns the
|
|
3482
|
+
* raw indexed record without derived finality events.
|
|
3244
3483
|
*/
|
|
3245
|
-
|
|
3484
|
+
queryPostRequest(commitmentHash: HexString): Promise<PostRequestWithStatus | undefined>;
|
|
3246
3485
|
/**
|
|
3247
|
-
*
|
|
3248
|
-
*
|
|
3249
|
-
* If the stream yields TimeoutStatus.PENDING_TIMEOUT, use postRequestTimeoutStream() to begin timeout processing.
|
|
3250
|
-
* @param hash - Can be commitment, hyperbridge tx hash, source tx hash, destination tx hash, or timeout tx hash
|
|
3251
|
-
* @returns AsyncGenerator that emits status updates until a terminal state is reached
|
|
3252
|
-
* @example
|
|
3253
|
-
*
|
|
3254
|
-
* let client = new IndexerClient(config)
|
|
3255
|
-
* let stream = client.postRequestStatusStream(hash)
|
|
3256
|
-
*
|
|
3257
|
-
* // you can use a for-await-of loop
|
|
3258
|
-
* for await (const status of stream) {
|
|
3259
|
-
* console.log(status)
|
|
3260
|
-
* }
|
|
3261
|
-
*
|
|
3262
|
-
* // you can also use a while loop
|
|
3263
|
-
* while (true) {
|
|
3264
|
-
* const status = await stream.next()
|
|
3265
|
-
* if (status.done) {
|
|
3266
|
-
* break
|
|
3267
|
-
* }
|
|
3268
|
-
* console.log(status.value)
|
|
3269
|
-
* }
|
|
3270
|
-
*
|
|
3486
|
+
* Queries a GET request by any of its associated hashes. Returns the raw
|
|
3487
|
+
* indexed record without derived finality events.
|
|
3271
3488
|
*/
|
|
3272
|
-
|
|
3273
|
-
timeoutStream(timeoutTimestamp: bigint, chain: IChain): AsyncGenerator<RequestStatusWithMetadata, void>;
|
|
3489
|
+
queryGetRequest(hash: HexString): Promise<GetRequestWithStatus | undefined>;
|
|
3274
3490
|
/**
|
|
3275
|
-
*
|
|
3276
|
-
*
|
|
3277
|
-
* @returns AsyncGenerator that emits status updates until a terminal state is reached
|
|
3491
|
+
* Queries the response a GET request's values come from, by the request's id.
|
|
3492
|
+
* Returns the response commitment plus the indexed storage values.
|
|
3278
3493
|
*/
|
|
3279
|
-
|
|
3280
|
-
private sleep_for;
|
|
3281
|
-
private sleep_for_interval;
|
|
3494
|
+
queryResponseByRequestId(requestId: string): Promise<ResponseCommitmentWithValues | undefined>;
|
|
3282
3495
|
/**
|
|
3283
|
-
*
|
|
3284
|
-
*
|
|
3285
|
-
*
|
|
3286
|
-
* @param hash - Can be commitment, hyperbridge tx hash, source tx hash, destination tx hash, or timeout tx hash
|
|
3287
|
-
* @returns AsyncGenerator that emits status updates until a terminal state is reached
|
|
3288
|
-
* @example
|
|
3289
|
-
*
|
|
3290
|
-
* let client = new IndexerClient(config)
|
|
3291
|
-
* let stream = client.getRequestStatusStream(hash)
|
|
3292
|
-
*
|
|
3293
|
-
* // you can use a for-await-of loop
|
|
3294
|
-
* for await (const status of stream) {
|
|
3295
|
-
* console.log(status)
|
|
3296
|
-
* }
|
|
3496
|
+
* Snapshot query for a POST request: returns the indexed record with all
|
|
3497
|
+
* inferred finality and timeout events (`SOURCE_FINALIZED`,
|
|
3498
|
+
* `HYPERBRIDGE_FINALIZED`, `PENDING_TIMEOUT`, …) sorted by progress weight.
|
|
3297
3499
|
*
|
|
3298
|
-
*
|
|
3299
|
-
*
|
|
3300
|
-
* const status = await stream.next()
|
|
3301
|
-
* if (status.done) {
|
|
3302
|
-
* break
|
|
3303
|
-
* }
|
|
3304
|
-
* console.log(status.value)
|
|
3305
|
-
* }
|
|
3306
|
-
*
|
|
3307
|
-
*/
|
|
3308
|
-
getRequestStatusStream(hash: HexString): AsyncGenerator<RequestStatusWithMetadata, void>;
|
|
3309
|
-
/**
|
|
3310
|
-
* Create a Stream of status updates
|
|
3311
|
-
* @param hash - Can be commitment, hyperbridge tx hash, source tx hash, destination tx hash, or timeout tx hash
|
|
3312
|
-
* @returns AsyncGenerator that emits status updates until a terminal state is reached
|
|
3500
|
+
* Unlike {@link postRequestStatusStream} this does not poll; each call
|
|
3501
|
+
* returns a fresh snapshot based on the indexer's current state.
|
|
3313
3502
|
*/
|
|
3314
|
-
|
|
3503
|
+
queryRequestWithStatus(hash: HexString): Promise<PostRequestWithStatus | undefined>;
|
|
3315
3504
|
/**
|
|
3316
|
-
*
|
|
3317
|
-
*
|
|
3318
|
-
*
|
|
3319
|
-
* @example
|
|
3320
|
-
*
|
|
3321
|
-
* let client = new IndexerClient(config)
|
|
3322
|
-
* let stream = client.postRequestTimeoutStream(hash)
|
|
3505
|
+
* Streams status updates for a POST request as it progresses through the
|
|
3506
|
+
* source → Hyperbridge → destination lifecycle. Ends when the request
|
|
3507
|
+
* reaches its destination or its timeout becomes pending.
|
|
3323
3508
|
*
|
|
3324
|
-
*
|
|
3325
|
-
*
|
|
3326
|
-
*
|
|
3327
|
-
*
|
|
3328
|
-
*
|
|
3329
|
-
* // you can also use a while loop
|
|
3330
|
-
* while (true) {
|
|
3331
|
-
* const status = await stream.next()
|
|
3332
|
-
* if (status.done) {
|
|
3333
|
-
* break
|
|
3334
|
-
* }
|
|
3335
|
-
* console.log(status.value)
|
|
3336
|
-
* }
|
|
3509
|
+
* Yields the `HYPERBRIDGE_FINALIZED` event with relayer calldata attached —
|
|
3510
|
+
* this is the calldata a caller submits to the destination handler to
|
|
3511
|
+
* deliver the request (bundled `handleConsensus` + `handlePostRequests` via
|
|
3512
|
+
* `batchCall`).
|
|
3337
3513
|
*/
|
|
3338
|
-
|
|
3514
|
+
postRequestStatusStream(hash: HexString): AsyncGenerator<RequestStatusWithMetadata, void>;
|
|
3339
3515
|
/**
|
|
3340
|
-
*
|
|
3341
|
-
*
|
|
3342
|
-
*
|
|
3516
|
+
* Streams timeout status updates for a POST request past its
|
|
3517
|
+
* `timeoutTimestamp`. Drives the `PENDING_TIMEOUT →
|
|
3518
|
+
* DESTINATION_FINALIZED_TIMEOUT → HYPERBRIDGE_FINALIZED_TIMEOUT → TIMED_OUT`
|
|
3519
|
+
* progression, submitting unsigned extrinsics to Hyperbridge where required
|
|
3520
|
+
* and yielding source-chain timeout calldata at the final step.
|
|
3343
3521
|
*/
|
|
3344
|
-
|
|
3522
|
+
postRequestTimeoutStream(hash: HexString): AsyncGenerator<PostRequestTimeoutStatus, void>;
|
|
3345
3523
|
/**
|
|
3346
|
-
*
|
|
3347
|
-
*
|
|
3348
|
-
*
|
|
3349
|
-
*
|
|
3350
|
-
* @throws Last encountered error after all retries are exhausted
|
|
3351
|
-
*
|
|
3352
|
-
* @example
|
|
3353
|
-
* const result = await this.withRetry(() => this.queryStatus(hash));
|
|
3524
|
+
* Relays a POST request to Hyperbridge from source-chain state (when the
|
|
3525
|
+
* request wasn't aggregated there yet) and returns the finalized Hyperbridge
|
|
3526
|
+
* extrinsic receipt. Used to bootstrap status tracking for requests that
|
|
3527
|
+
* Hyperbridge hasn't seen.
|
|
3354
3528
|
*/
|
|
3355
|
-
|
|
3529
|
+
aggregateTransactionWithCommitment(commitment: HexString): Promise<Awaited<ReturnType<SubstrateChain["submitUnsigned"]>>>;
|
|
3356
3530
|
/**
|
|
3357
|
-
*
|
|
3358
|
-
*
|
|
3359
|
-
*
|
|
3531
|
+
* Snapshot query for a GET request: returns the indexed record with all
|
|
3532
|
+
* inferred finality events (`SOURCE_FINALIZED`, `HYPERBRIDGE_FINALIZED`)
|
|
3533
|
+
* sorted by progress weight.
|
|
3360
3534
|
*/
|
|
3361
|
-
|
|
3535
|
+
queryGetRequestWithStatus(hash: HexString): Promise<GetRequestWithStatus | undefined>;
|
|
3362
3536
|
/**
|
|
3363
|
-
*
|
|
3364
|
-
*
|
|
3365
|
-
*
|
|
3366
|
-
*
|
|
3367
|
-
*
|
|
3368
|
-
*
|
|
3369
|
-
* let client = new IndexerClient(config)
|
|
3370
|
-
* let stream = client.orderStatusStream(commitment)
|
|
3371
|
-
*
|
|
3372
|
-
* // you can use a for-await-of loop
|
|
3373
|
-
* for await (const status of stream) {
|
|
3374
|
-
* console.log(status)
|
|
3375
|
-
* }
|
|
3376
|
-
*
|
|
3377
|
-
* // you can also use a while loop
|
|
3378
|
-
* while (true) {
|
|
3379
|
-
* const status = await stream.next()
|
|
3380
|
-
* if (status.done) {
|
|
3381
|
-
* break
|
|
3382
|
-
* }
|
|
3383
|
-
* console.log(status.value)
|
|
3384
|
-
* }
|
|
3537
|
+
* Streams status updates for a GET request. Ends when the response is
|
|
3538
|
+
* delivered back to the source chain or the request's timeout elapses.
|
|
3539
|
+
* Yields the `HYPERBRIDGE_FINALIZED` event with source-chain calldata for
|
|
3540
|
+
* submitting the response (bundled `handleConsensus` + `handleGetResponses`
|
|
3541
|
+
* via `batchCall`).
|
|
3385
3542
|
*/
|
|
3386
|
-
|
|
3387
|
-
status: OrderStatus;
|
|
3388
|
-
metadata: {
|
|
3389
|
-
blockHash: string;
|
|
3390
|
-
blockNumber: number;
|
|
3391
|
-
transactionHash: string;
|
|
3392
|
-
timestamp: bigint;
|
|
3393
|
-
filler?: string;
|
|
3394
|
-
};
|
|
3395
|
-
}, void>;
|
|
3396
|
-
tokenGatewayAssetTeleportedStatusStream(commitment: HexString): AsyncGenerator<{
|
|
3397
|
-
status: TeleportStatus;
|
|
3398
|
-
metadata: {
|
|
3399
|
-
blockHash: string;
|
|
3400
|
-
blockNumber: number;
|
|
3401
|
-
transactionHash: string;
|
|
3402
|
-
timestamp: bigint;
|
|
3403
|
-
};
|
|
3404
|
-
}, void>;
|
|
3405
|
-
private queryTokenGatewayAssetTeleported;
|
|
3543
|
+
getRequestStatusStream(hash: HexString): AsyncGenerator<RequestStatusWithMetadata, void>;
|
|
3406
3544
|
/**
|
|
3407
|
-
*
|
|
3408
|
-
*
|
|
3409
|
-
*
|
|
3545
|
+
* Low-level watcher that yields a single `PENDING_TIMEOUT` event once
|
|
3546
|
+
* `chain.timestamp()` passes `timeoutTimestamp`. Used internally by the
|
|
3547
|
+
* status streams; exposed for callers that want to race their own logic
|
|
3548
|
+
* against a request's deadline.
|
|
3410
3549
|
*/
|
|
3411
|
-
|
|
3412
|
-
waitOrAbort<T>(params: {
|
|
3413
|
-
signal: AbortSignal;
|
|
3414
|
-
promise: () => Promise<T>;
|
|
3415
|
-
predicate?: (a: T) => boolean;
|
|
3416
|
-
}): Promise<NonNullable<T>>;
|
|
3550
|
+
timeoutStream(timeoutTimestamp: bigint, chain: IChain): AsyncGenerator<RequestStatusWithMetadata, void>;
|
|
3417
3551
|
}
|
|
3418
3552
|
interface PartialClientConfig extends Omit<ClientConfig, "pollInterval"> {
|
|
3419
3553
|
pollInterval?: number;
|
|
@@ -4078,7 +4212,7 @@ declare class IntentGateway {
|
|
|
4078
4212
|
* Defaults to `false` (source-side cancellation).
|
|
4079
4213
|
* @yields {@link CancelEvent} objects describing each cancellation stage.
|
|
4080
4214
|
*/
|
|
4081
|
-
cancelOrder(order: Order, indexerClient:
|
|
4215
|
+
cancelOrder(order: Order, indexerClient: IsmpClient, fromDest?: boolean): AsyncGenerator<CancelEvent>;
|
|
4082
4216
|
/**
|
|
4083
4217
|
* Constructs a signed `PackedUserOperation` for a solver to submit as a bid.
|
|
4084
4218
|
*
|
|
@@ -4154,6 +4288,50 @@ declare class IntentGateway {
|
|
|
4154
4288
|
* in the `_orders` mapping on the source chain.
|
|
4155
4289
|
*/
|
|
4156
4290
|
isOrderRefunded(order: Order): Promise<boolean>;
|
|
4291
|
+
/**
|
|
4292
|
+
* Optional indexer context for {@link queryOrder} / {@link orderStatusStream}.
|
|
4293
|
+
* Configured via {@link withQueryClient}; unset by default since not every
|
|
4294
|
+
* IntentGateway caller needs indexer access.
|
|
4295
|
+
*/
|
|
4296
|
+
private indexer?;
|
|
4297
|
+
/**
|
|
4298
|
+
* Attaches an indexer GraphQL client to this IntentGateway so that
|
|
4299
|
+
* {@link queryOrder} and {@link orderStatusStream} become available.
|
|
4300
|
+
* Returns `this` for chaining.
|
|
4301
|
+
*
|
|
4302
|
+
* @example
|
|
4303
|
+
* ```ts
|
|
4304
|
+
* const gateway = (await IntentGateway.create(source, dest)).withQueryClient(queryClient)
|
|
4305
|
+
* const order = await gateway.queryOrder("0x...")
|
|
4306
|
+
* ```
|
|
4307
|
+
*/
|
|
4308
|
+
withQueryClient(queryClient: IndexerQueryClient, options?: {
|
|
4309
|
+
pollInterval?: number;
|
|
4310
|
+
tracing?: boolean;
|
|
4311
|
+
}): this;
|
|
4312
|
+
private requireIndexer;
|
|
4313
|
+
/**
|
|
4314
|
+
* Queries an order by its commitment hash.
|
|
4315
|
+
*
|
|
4316
|
+
* Requires a prior call to {@link withQueryClient}.
|
|
4317
|
+
*/
|
|
4318
|
+
queryOrder(commitment: HexString): Promise<OrderWithStatus | undefined>;
|
|
4319
|
+
/**
|
|
4320
|
+
* Streams status updates for an order until it reaches a terminal state
|
|
4321
|
+
* (FILLED, REDEEMED, or REFUNDED).
|
|
4322
|
+
*
|
|
4323
|
+
* Requires a prior call to {@link withQueryClient}.
|
|
4324
|
+
*/
|
|
4325
|
+
orderStatusStream(commitment: HexString): AsyncGenerator<{
|
|
4326
|
+
status: OrderStatus;
|
|
4327
|
+
metadata: {
|
|
4328
|
+
blockHash: string;
|
|
4329
|
+
blockNumber: number;
|
|
4330
|
+
transactionHash: string;
|
|
4331
|
+
timestamp: bigint;
|
|
4332
|
+
filler?: string;
|
|
4333
|
+
};
|
|
4334
|
+
}, void>;
|
|
4157
4335
|
}
|
|
4158
4336
|
|
|
4159
4337
|
/**
|
|
@@ -4277,6 +4455,165 @@ declare const PACKED_USEROP_TYPEHASH: `0x${string}`;
|
|
|
4277
4455
|
* IntentGatewayV2 protocol.
|
|
4278
4456
|
*/
|
|
4279
4457
|
declare const DOMAIN_TYPEHASH: `0x${string}`;
|
|
4458
|
+
/**
|
|
4459
|
+
* Crypto and encoding utilities for IntentGatewayV2.
|
|
4460
|
+
*
|
|
4461
|
+
* Provides helpers for EIP-712 domain separation, UserOperation hashing,
|
|
4462
|
+
* gas-limit packing/unpacking, bundler JSON-RPC calls, and ERC-7821
|
|
4463
|
+
* batch-execute encoding and decoding. All methods are stateless with respect
|
|
4464
|
+
* to the protocol but require the shared {@link IntentGatewayContext} for the
|
|
4465
|
+
* bundler URL.
|
|
4466
|
+
*/
|
|
4467
|
+
declare class CryptoUtils {
|
|
4468
|
+
private readonly ctx;
|
|
4469
|
+
/**
|
|
4470
|
+
* @param ctx - Shared IntentsV2 context; used to access the bundler URL for
|
|
4471
|
+
* JSON-RPC calls.
|
|
4472
|
+
*/
|
|
4473
|
+
constructor(ctx: IntentGatewayContext);
|
|
4474
|
+
/**
|
|
4475
|
+
* Computes an EIP-712 domain separator for a given contract.
|
|
4476
|
+
*
|
|
4477
|
+
* @param contractName - Human-readable name of the contract (e.g. `"IntentGateway"`).
|
|
4478
|
+
* @param version - Version string (e.g. `"2"`).
|
|
4479
|
+
* @param chainId - Chain ID of the network the contract is deployed on.
|
|
4480
|
+
* @param contractAddress - Address of the verifying contract.
|
|
4481
|
+
* @returns The 32-byte domain separator as a hex string.
|
|
4482
|
+
*/
|
|
4483
|
+
static getDomainSeparator(contractName: string, version: string, chainId: bigint, contractAddress: HexString): HexString;
|
|
4484
|
+
/**
|
|
4485
|
+
* Signs a `SelectSolver` EIP-712 message with a session key.
|
|
4486
|
+
*
|
|
4487
|
+
* The session key authorises the selection of a specific solver for the
|
|
4488
|
+
* given order commitment. The resulting signature is appended to the
|
|
4489
|
+
* solver's UserOperation signature before bundle submission.
|
|
4490
|
+
*
|
|
4491
|
+
* @param commitment - The order commitment (bytes32) being fulfilled.
|
|
4492
|
+
* @param solverAddress - Address of the solver account selected to fill the order.
|
|
4493
|
+
* @param domainSeparator - EIP-712 domain separator for the IntentGatewayV2 contract.
|
|
4494
|
+
* @param privateKey - Hex-encoded private key of the session key that signs the message.
|
|
4495
|
+
* @returns The ECDSA signature as a hex string, or `null` if signing fails.
|
|
4496
|
+
*/
|
|
4497
|
+
static signSolverSelection(commitment: HexString, solverAddress: HexString, domainSeparator: HexString, privateKey: HexString): Promise<HexString | null>;
|
|
4498
|
+
/**
|
|
4499
|
+
* Computes the EIP-712 hash of a `PackedUserOperation` as defined by
|
|
4500
|
+
* ERC-4337 EntryPoint v0.8.
|
|
4501
|
+
*
|
|
4502
|
+
* @param userOp - The packed UserOperation to hash.
|
|
4503
|
+
* @param entryPoint - Address of the EntryPoint v0.8 contract.
|
|
4504
|
+
* @param chainId - Chain ID of the network on which the operation will execute.
|
|
4505
|
+
* @returns The UserOperation hash as a hex string.
|
|
4506
|
+
*/
|
|
4507
|
+
static computeUserOpHash(userOp: PackedUserOperation, entryPoint: Hex, chainId: bigint): Hex;
|
|
4508
|
+
/**
|
|
4509
|
+
* Computes the EIP-712 struct hash of a `PackedUserOperation`.
|
|
4510
|
+
*
|
|
4511
|
+
* Hashes dynamic fields (`initCode`, `callData`, `paymasterAndData`) before
|
|
4512
|
+
* ABI-encoding so the final hash is a fixed-length 32-byte value.
|
|
4513
|
+
*
|
|
4514
|
+
* @param userOp - The packed UserOperation to hash.
|
|
4515
|
+
* @returns The struct hash as a 32-byte hex string.
|
|
4516
|
+
*/
|
|
4517
|
+
static getPackedUserStructHash(userOp: PackedUserOperation): HexString;
|
|
4518
|
+
/**
|
|
4519
|
+
* Packs `verificationGasLimit` and `callGasLimit` into the ERC-4337
|
|
4520
|
+
* `accountGasLimits` bytes32 field.
|
|
4521
|
+
*
|
|
4522
|
+
* The high 16 bytes hold `verificationGasLimit` and the low 16 bytes hold
|
|
4523
|
+
* `callGasLimit`, matching the EntryPoint v0.8 packed representation.
|
|
4524
|
+
*
|
|
4525
|
+
* @param verificationGasLimit - Gas limit for the account verification step.
|
|
4526
|
+
* @param callGasLimit - Gas limit for the main execution call.
|
|
4527
|
+
* @returns A 32-byte hex string with both limits packed.
|
|
4528
|
+
*/
|
|
4529
|
+
static packGasLimits(verificationGasLimit: bigint, callGasLimit: bigint): HexString;
|
|
4530
|
+
/**
|
|
4531
|
+
* Packs `maxPriorityFeePerGas` and `maxFeePerGas` into the ERC-4337
|
|
4532
|
+
* `gasFees` bytes32 field.
|
|
4533
|
+
*
|
|
4534
|
+
* The high 16 bytes hold `maxPriorityFeePerGas` and the low 16 bytes hold
|
|
4535
|
+
* `maxFeePerGas`, matching the EntryPoint v0.8 packed representation.
|
|
4536
|
+
*
|
|
4537
|
+
* @param maxPriorityFeePerGas - Maximum tip per gas (EIP-1559).
|
|
4538
|
+
* @param maxFeePerGas - Maximum total fee per gas (EIP-1559).
|
|
4539
|
+
* @returns A 32-byte hex string with both fee values packed.
|
|
4540
|
+
*/
|
|
4541
|
+
static packGasFees(maxPriorityFeePerGas: bigint, maxFeePerGas: bigint): HexString;
|
|
4542
|
+
/**
|
|
4543
|
+
* Unpacks the `accountGasLimits` bytes32 field back into its constituent
|
|
4544
|
+
* gas limits.
|
|
4545
|
+
*
|
|
4546
|
+
* @param accountGasLimits - The packed 32-byte gas limits field from a `PackedUserOperation`.
|
|
4547
|
+
* @returns Object with `verificationGasLimit` and `callGasLimit` as bigints.
|
|
4548
|
+
*/
|
|
4549
|
+
static unpackGasLimits(accountGasLimits: HexString): {
|
|
4550
|
+
verificationGasLimit: bigint;
|
|
4551
|
+
callGasLimit: bigint;
|
|
4552
|
+
};
|
|
4553
|
+
/**
|
|
4554
|
+
* Unpacks the `gasFees` bytes32 field back into its constituent fee values.
|
|
4555
|
+
*
|
|
4556
|
+
* @param gasFees - The packed 32-byte gas fees field from a `PackedUserOperation`.
|
|
4557
|
+
* @returns Object with `maxPriorityFeePerGas` and `maxFeePerGas` as bigints.
|
|
4558
|
+
*/
|
|
4559
|
+
static unpackGasFees(gasFees: HexString): {
|
|
4560
|
+
maxPriorityFeePerGas: bigint;
|
|
4561
|
+
maxFeePerGas: bigint;
|
|
4562
|
+
};
|
|
4563
|
+
/**
|
|
4564
|
+
* Converts a packed `PackedUserOperation` into the JSON object format
|
|
4565
|
+
* expected by ERC-4337 bundler JSON-RPC endpoints.
|
|
4566
|
+
*
|
|
4567
|
+
* Unpacks `accountGasLimits` and `gasFees`, separates optional factory and
|
|
4568
|
+
* paymaster fields, and converts all numeric fields to hex strings.
|
|
4569
|
+
*
|
|
4570
|
+
* @param userOp - The packed UserOperation to convert.
|
|
4571
|
+
* @returns A plain object safe to pass as the first element of bundler RPC params.
|
|
4572
|
+
*/
|
|
4573
|
+
static prepareBundlerCall(userOp: PackedUserOperation): Record<string, unknown>;
|
|
4574
|
+
/**
|
|
4575
|
+
* Sends a JSON-RPC request to the configured ERC-4337 bundler endpoint.
|
|
4576
|
+
*
|
|
4577
|
+
* @param method - The JSON-RPC method name (one of {@link BundlerMethod}).
|
|
4578
|
+
* @param params - Array of parameters for the RPC call.
|
|
4579
|
+
* @returns Resolves with the `result` field of the bundler's JSON-RPC response,
|
|
4580
|
+
* typed as `T`.
|
|
4581
|
+
* @throws If the bundler URL is not configured or the bundler returns an error.
|
|
4582
|
+
*/
|
|
4583
|
+
sendBundler<T = unknown>(method: BundlerMethod, params?: unknown[]): Promise<T>;
|
|
4584
|
+
/**
|
|
4585
|
+
* Sends multiple JSON-RPC requests to the bundler in a single HTTP call
|
|
4586
|
+
* using JSON-RPC 2.0 batch syntax. Results are returned in the same order
|
|
4587
|
+
* as the input `requests` array.
|
|
4588
|
+
*
|
|
4589
|
+
* @throws If the bundler URL is not configured, the HTTP call fails, or any
|
|
4590
|
+
* individual response contains an error.
|
|
4591
|
+
*/
|
|
4592
|
+
sendBundlerBatch<T extends unknown[]>(requests: {
|
|
4593
|
+
method: BundlerMethod;
|
|
4594
|
+
params: unknown[];
|
|
4595
|
+
}[]): Promise<T>;
|
|
4596
|
+
/**
|
|
4597
|
+
* Encodes a list of calls into ERC-7821 `execute` calldata using
|
|
4598
|
+
* single-batch mode (`ERC7821_BATCH_MODE`).
|
|
4599
|
+
*
|
|
4600
|
+
* @param calls - Ordered list of calls to batch; each specifies a `target`
|
|
4601
|
+
* address, ETH `value`, and `data`.
|
|
4602
|
+
* @returns ABI-encoded calldata for the ERC-7821 `execute(bytes32,bytes)` function.
|
|
4603
|
+
*/
|
|
4604
|
+
encodeERC7821Execute(calls: ERC7821Call[]): HexString;
|
|
4605
|
+
/**
|
|
4606
|
+
* Decodes ERC-7821 `execute` calldata back into its constituent calls.
|
|
4607
|
+
*
|
|
4608
|
+
* Returns `null` if the calldata does not match the expected `execute`
|
|
4609
|
+
* function signature or cannot be decoded.
|
|
4610
|
+
*
|
|
4611
|
+
* @param callData - Hex-encoded calldata previously produced by
|
|
4612
|
+
* {@link encodeERC7821Execute} or an equivalent encoder.
|
|
4613
|
+
* @returns Array of decoded {@link ERC7821Call} objects, or `null` on failure.
|
|
4614
|
+
*/
|
|
4615
|
+
decodeERC7821Execute(callData: HexString): ERC7821Call[] | null;
|
|
4616
|
+
}
|
|
4280
4617
|
|
|
4281
4618
|
declare const ABI$1: readonly [{
|
|
4282
4619
|
readonly type: "constructor";
|
|
@@ -7787,6 +8124,41 @@ declare class TokenGateway {
|
|
|
7787
8124
|
* @private
|
|
7788
8125
|
*/
|
|
7789
8126
|
private convertNativeToFeeToken;
|
|
8127
|
+
/**
|
|
8128
|
+
* Optional indexer context for {@link queryAssetTeleported} /
|
|
8129
|
+
* {@link assetTeleportedStatusStream}. Configured via {@link withQueryClient}.
|
|
8130
|
+
*/
|
|
8131
|
+
private indexer?;
|
|
8132
|
+
/**
|
|
8133
|
+
* Attaches an indexer GraphQL client so {@link queryAssetTeleported} and
|
|
8134
|
+
* {@link assetTeleportedStatusStream} become available. Returns `this` for chaining.
|
|
8135
|
+
*/
|
|
8136
|
+
withQueryClient(queryClient: IndexerQueryClient, options?: {
|
|
8137
|
+
pollInterval?: number;
|
|
8138
|
+
tracing?: boolean;
|
|
8139
|
+
}): this;
|
|
8140
|
+
private requireIndexer;
|
|
8141
|
+
/**
|
|
8142
|
+
* Queries a token gateway asset-teleported event by commitment hash.
|
|
8143
|
+
*
|
|
8144
|
+
* Requires a prior call to {@link withQueryClient}.
|
|
8145
|
+
*/
|
|
8146
|
+
queryAssetTeleported(commitment: HexString): Promise<TokenGatewayAssetTeleportedWithStatus | undefined>;
|
|
8147
|
+
/**
|
|
8148
|
+
* Streams status updates for an asset-teleported event until a terminal
|
|
8149
|
+
* state (`RECEIVED` or `REFUNDED`).
|
|
8150
|
+
*
|
|
8151
|
+
* Requires a prior call to {@link withQueryClient}.
|
|
8152
|
+
*/
|
|
8153
|
+
assetTeleportedStatusStream(commitment: HexString): AsyncGenerator<{
|
|
8154
|
+
status: TeleportStatus;
|
|
8155
|
+
metadata: {
|
|
8156
|
+
blockHash: string;
|
|
8157
|
+
blockNumber: number;
|
|
8158
|
+
transactionHash: string;
|
|
8159
|
+
timestamp: bigint;
|
|
8160
|
+
};
|
|
8161
|
+
}, void>;
|
|
7790
8162
|
}
|
|
7791
8163
|
|
|
7792
8164
|
/**
|
|
@@ -8006,7 +8378,9 @@ declare enum Chains {
|
|
|
8006
8378
|
POLYGON_AMOY = "EVM-80002",
|
|
8007
8379
|
POLKADOT_ASSET_HUB_PASEO = "EVM-420420417",
|
|
8008
8380
|
TRON_MAINNET = "EVM-728126428",
|
|
8009
|
-
TRON_NILE = "EVM-3448148188"
|
|
8381
|
+
TRON_NILE = "EVM-3448148188",
|
|
8382
|
+
PHAROS_MAINNET = "EVM-688600",
|
|
8383
|
+
PHAROS_ATLANTIC = "EVM-688689"
|
|
8010
8384
|
}
|
|
8011
8385
|
/** Polkadot Asset Hub Paseo testnet (chain ID 420420417) — not in viem/chains */
|
|
8012
8386
|
declare const polkadotAssetHubPaseo: {
|
|
@@ -8056,6 +8430,114 @@ declare const polkadotAssetHubPaseo: {
|
|
|
8056
8430
|
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
8057
8431
|
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
8058
8432
|
};
|
|
8433
|
+
/** Pharos Mainnet (chain ID 688600) — not in viem/chains */
|
|
8434
|
+
declare const pharosMainnet: {
|
|
8435
|
+
blockExplorers?: {
|
|
8436
|
+
[key: string]: {
|
|
8437
|
+
name: string;
|
|
8438
|
+
url: string;
|
|
8439
|
+
apiUrl?: string | undefined;
|
|
8440
|
+
};
|
|
8441
|
+
default: {
|
|
8442
|
+
name: string;
|
|
8443
|
+
url: string;
|
|
8444
|
+
apiUrl?: string | undefined;
|
|
8445
|
+
};
|
|
8446
|
+
} | undefined | undefined;
|
|
8447
|
+
blockTime?: number | undefined | undefined;
|
|
8448
|
+
contracts?: {
|
|
8449
|
+
[x: string]: viem.ChainContract | {
|
|
8450
|
+
[sourceId: number]: viem.ChainContract | undefined;
|
|
8451
|
+
} | undefined;
|
|
8452
|
+
ensRegistry?: viem.ChainContract | undefined;
|
|
8453
|
+
ensUniversalResolver?: viem.ChainContract | undefined;
|
|
8454
|
+
multicall3?: viem.ChainContract | undefined;
|
|
8455
|
+
erc6492Verifier?: viem.ChainContract | undefined;
|
|
8456
|
+
} | undefined;
|
|
8457
|
+
ensTlds?: readonly string[] | undefined;
|
|
8458
|
+
id: 688600;
|
|
8459
|
+
name: "Pharos Mainnet";
|
|
8460
|
+
nativeCurrency: {
|
|
8461
|
+
readonly name: "PHRS";
|
|
8462
|
+
readonly symbol: "PHRS";
|
|
8463
|
+
readonly decimals: 18;
|
|
8464
|
+
};
|
|
8465
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
8466
|
+
rpcUrls: {
|
|
8467
|
+
readonly default: {
|
|
8468
|
+
readonly http: readonly ["https://atlantic.dplabs-internal.com"];
|
|
8469
|
+
};
|
|
8470
|
+
};
|
|
8471
|
+
sourceId?: number | undefined | undefined;
|
|
8472
|
+
testnet?: boolean | undefined | undefined;
|
|
8473
|
+
custom?: Record<string, unknown> | undefined;
|
|
8474
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
8475
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
8476
|
+
formatters?: undefined;
|
|
8477
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
8478
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
8479
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
8480
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
8481
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
8482
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
8483
|
+
}] | undefined;
|
|
8484
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
8485
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
8486
|
+
};
|
|
8487
|
+
/** Pharos Atlantic Testnet (chain ID 688689) — not in viem/chains */
|
|
8488
|
+
declare const pharosAtlantic: {
|
|
8489
|
+
blockExplorers?: {
|
|
8490
|
+
[key: string]: {
|
|
8491
|
+
name: string;
|
|
8492
|
+
url: string;
|
|
8493
|
+
apiUrl?: string | undefined;
|
|
8494
|
+
};
|
|
8495
|
+
default: {
|
|
8496
|
+
name: string;
|
|
8497
|
+
url: string;
|
|
8498
|
+
apiUrl?: string | undefined;
|
|
8499
|
+
};
|
|
8500
|
+
} | undefined | undefined;
|
|
8501
|
+
blockTime?: number | undefined | undefined;
|
|
8502
|
+
contracts?: {
|
|
8503
|
+
[x: string]: viem.ChainContract | {
|
|
8504
|
+
[sourceId: number]: viem.ChainContract | undefined;
|
|
8505
|
+
} | undefined;
|
|
8506
|
+
ensRegistry?: viem.ChainContract | undefined;
|
|
8507
|
+
ensUniversalResolver?: viem.ChainContract | undefined;
|
|
8508
|
+
multicall3?: viem.ChainContract | undefined;
|
|
8509
|
+
erc6492Verifier?: viem.ChainContract | undefined;
|
|
8510
|
+
} | undefined;
|
|
8511
|
+
ensTlds?: readonly string[] | undefined;
|
|
8512
|
+
id: 688689;
|
|
8513
|
+
name: "Pharos Atlantic Testnet";
|
|
8514
|
+
nativeCurrency: {
|
|
8515
|
+
readonly name: "PHRS";
|
|
8516
|
+
readonly symbol: "PHRS";
|
|
8517
|
+
readonly decimals: 18;
|
|
8518
|
+
};
|
|
8519
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
8520
|
+
rpcUrls: {
|
|
8521
|
+
readonly default: {
|
|
8522
|
+
readonly http: readonly ["https://atlantic.dplabs-internal.com"];
|
|
8523
|
+
};
|
|
8524
|
+
};
|
|
8525
|
+
sourceId?: number | undefined | undefined;
|
|
8526
|
+
testnet?: boolean | undefined | undefined;
|
|
8527
|
+
custom?: Record<string, unknown> | undefined;
|
|
8528
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
8529
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
8530
|
+
formatters?: undefined;
|
|
8531
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
8532
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
8533
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
8534
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
8535
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
8536
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
8537
|
+
}] | undefined;
|
|
8538
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
8539
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
8540
|
+
};
|
|
8059
8541
|
/** Tron Nile Testnet (chain ID 3448148188) — not in viem/chains */
|
|
8060
8542
|
declare const tronNile: {
|
|
8061
8543
|
blockExplorers: {
|
|
@@ -8169,8 +8651,8 @@ interface ChainConfigData {
|
|
|
8169
8651
|
UniswapV4PoolManager?: `0x${string}`;
|
|
8170
8652
|
/** Uniswap V4 StateView (canonical CREATE2 address) for pool state reads via extsload */
|
|
8171
8653
|
UniswapV4StateView?: `0x${string}`;
|
|
8172
|
-
/** Circle Paymaster
|
|
8173
|
-
|
|
8654
|
+
/** Circle Paymaster contract address (USDC-based ERC-4337 paymaster) */
|
|
8655
|
+
CirclePaymaster?: `0x${string}`;
|
|
8174
8656
|
};
|
|
8175
8657
|
rpcEnvKey?: string;
|
|
8176
8658
|
defaultRpcUrl?: string;
|
|
@@ -8186,4 +8668,4 @@ declare const getChainId: (stateMachineId: string) => number | undefined;
|
|
|
8186
8668
|
declare const getViemChain: (chainId: number) => Chain | undefined;
|
|
8187
8669
|
declare const hyperbridgeAddress = "";
|
|
8188
8670
|
|
|
8189
|
-
export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BundlerGasEstimate, BundlerMethod, type CancelEvent, type CancelOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type DispatchGet, type DispatchInfo, type DispatchPost, ERC20Method, type ERC7821Call, ERC7821_BATCH_MODE, type EstimateFillOrderParams, type EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, type ExecuteIntentOrderOptions, type ExecutionResult, type FillOptions, type FillOrderEstimate, 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 IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage,
|
|
8671
|
+
export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BundlerGasEstimate, BundlerMethod, type CancelEvent, type CancelOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type DispatchGet, type DispatchInfo, type DispatchPost, ERC20Method, type ERC7821Call, ERC7821_BATCH_MODE, type EstimateFillOrderParams, type EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, type ExecuteIntentOrderOptions, type ExecutionResult, type FillOptions, type FillOrderEstimate, type FillerBid, type FillerConfig, type GetRequestResponse, type GetRequestWithStatus, type GetResponseByRequestIdResponse, type GetResponseStorageValues, type HexString, type HostParams, HyperClientStatus, type HyperbridgeTxEvents, type IBatchConsensusAndGetResponseMessage, type IBatchConsensusAndPostRequestMessage, type IChain, type IConfig, type IConsensusMessage, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPharosConfig, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, type IndexerQueryClient, IntentGateway, type IntentGatewayContext, type IntentGatewayParams, ABI$1 as IntentGatewayV2ABI, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, IntentsCoprocessor, IsmpClient, type IsmpRequest, MOCK_ADDRESS, type NewDeployment, ORDER_V2_PARAM_TYPE, type Order, type OrderResponse, OrderStatus, OrderStatusChecker, type OrderStatusMetadata, type OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, type PackedUserOperation, type Params, type PaymentInfo, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, 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 ResumeIntentOrderOptions, type RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, type SelectBidResult, type SelectOptions, type SigningAccount, 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 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, createEvmChain, createQueryClient, decodeUserOpScale, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, orderCommitment, parseStateMachineId, pharosAtlantic, pharosMainnet, polkadotAssetHubPaseo, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|