@hyperbridge/sdk 1.8.0 → 1.8.2
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/dist/browser/index.d.ts +556 -675
- package/dist/browser/index.js +10998 -10984
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.d.ts +556 -675
- package/dist/node/index.js +10998 -10984
- package/dist/node/index.js.map +1 -1
- package/package.json +2 -3
package/dist/node/index.d.ts
CHANGED
|
@@ -590,6 +590,307 @@ declare const _default: {
|
|
|
590
590
|
}];
|
|
591
591
|
};
|
|
592
592
|
|
|
593
|
+
declare class ChainConfigService {
|
|
594
|
+
private rpcUrls;
|
|
595
|
+
constructor(env?: NodeJS.ProcessEnv);
|
|
596
|
+
private getConfig;
|
|
597
|
+
getChainConfig(chain: string): ChainConfig;
|
|
598
|
+
getIntentGatewayAddress(chain: string): HexString;
|
|
599
|
+
getTokenGatewayAddress(chain: string): HexString;
|
|
600
|
+
getHostAddress(chain: string): HexString;
|
|
601
|
+
getWrappedNativeAssetWithDecimals(chain: string): {
|
|
602
|
+
asset: HexString;
|
|
603
|
+
decimals: number;
|
|
604
|
+
};
|
|
605
|
+
getDaiAsset(chain: string): HexString;
|
|
606
|
+
getUsdtAsset(chain: string): HexString;
|
|
607
|
+
getUsdcAsset(chain: string): HexString;
|
|
608
|
+
getUsdcDecimals(chain: string): number;
|
|
609
|
+
getUsdtDecimals(chain: string): number;
|
|
610
|
+
getCNgnAsset(chain: string): HexString | undefined;
|
|
611
|
+
getCNgnDecimals(chain: string): number | undefined;
|
|
612
|
+
getExtAsset(chain: string): HexString | undefined;
|
|
613
|
+
getExtDecimals(chain: string): number | undefined;
|
|
614
|
+
getChainId(chain: string): number;
|
|
615
|
+
getConsensusStateId(chain: string): HexString;
|
|
616
|
+
getHyperbridgeChainId(): number;
|
|
617
|
+
getRpcUrl(chain: string): string;
|
|
618
|
+
getUniswapRouterV2Address(chain: string): HexString;
|
|
619
|
+
getUniswapV2FactoryAddress(chain: string): HexString;
|
|
620
|
+
getUniswapV3FactoryAddress(chain: string): HexString;
|
|
621
|
+
getUniversalRouterAddress(chain: string): HexString;
|
|
622
|
+
getUniswapV3QuoterAddress(chain: string): HexString;
|
|
623
|
+
getUniswapV4QuoterAddress(chain: string): HexString;
|
|
624
|
+
getPermit2Address(chain: string): HexString;
|
|
625
|
+
getSolverAccountAddress(chain: string): HexString | undefined;
|
|
626
|
+
getCoingeckoId(chain: string): string | undefined;
|
|
627
|
+
getEtherscanApiKey(): string | undefined;
|
|
628
|
+
getCalldispatcherAddress(chain: string): HexString;
|
|
629
|
+
getTokenStorageSlots(chain: string, tokenAddress: string): {
|
|
630
|
+
balanceSlot: number;
|
|
631
|
+
allowanceSlot: number;
|
|
632
|
+
} | undefined;
|
|
633
|
+
getPopularTokens(chain: string): string[];
|
|
634
|
+
getIntentGatewayV2Address(chain: string): HexString;
|
|
635
|
+
getEntryPointV08Address(chain: string): HexString;
|
|
636
|
+
getHyperbridgeAddress(): string;
|
|
637
|
+
/**
|
|
638
|
+
* Get the LayerZero Endpoint ID for the chain
|
|
639
|
+
* Used for USDT0 cross-chain transfers via LayerZero OFT
|
|
640
|
+
*/
|
|
641
|
+
getLayerZeroEid(chain: string): number | undefined;
|
|
642
|
+
/**
|
|
643
|
+
* Get the USDT0 OFT contract address for the chain
|
|
644
|
+
* On Ethereum: OFT Adapter (locks/unlocks USDT)
|
|
645
|
+
* On other chains: OFT contract (mints/burns USDT0)
|
|
646
|
+
*/
|
|
647
|
+
getUsdt0OftAddress(chain: string): HexString | undefined;
|
|
648
|
+
}
|
|
649
|
+
|
|
650
|
+
/**
|
|
651
|
+
* The default address used as fallback when no address is provided.
|
|
652
|
+
* This represents the zero address in EVM chains.
|
|
653
|
+
*/
|
|
654
|
+
declare const DEFAULT_ADDRESS = "0x0000000000000000000000000000000000000000";
|
|
655
|
+
/**
|
|
656
|
+
* Parameters for an EVM chain.
|
|
657
|
+
*/
|
|
658
|
+
interface EvmChainParams {
|
|
659
|
+
/**
|
|
660
|
+
* The chain ID of the EVM chain
|
|
661
|
+
*/
|
|
662
|
+
chainId: number;
|
|
663
|
+
/**
|
|
664
|
+
* The RPC URL of the EVM chain
|
|
665
|
+
*/
|
|
666
|
+
rpcUrl: string;
|
|
667
|
+
/**
|
|
668
|
+
* The host address of the EVM chain (IsmpHost contract address)
|
|
669
|
+
*/
|
|
670
|
+
host: HexString;
|
|
671
|
+
/**
|
|
672
|
+
* Consensus state identifier of this chain on hyperbridge
|
|
673
|
+
*/
|
|
674
|
+
consensusStateId?: string;
|
|
675
|
+
/**
|
|
676
|
+
* Optional ERC-4337 bundler URL for account abstraction support
|
|
677
|
+
*/
|
|
678
|
+
bundlerUrl?: string;
|
|
679
|
+
}
|
|
680
|
+
/**
|
|
681
|
+
* Encapsulates an EVM chain.
|
|
682
|
+
*/
|
|
683
|
+
declare class EvmChain implements IChain {
|
|
684
|
+
private readonly params;
|
|
685
|
+
private publicClient;
|
|
686
|
+
private chainConfigService;
|
|
687
|
+
private constructor();
|
|
688
|
+
/**
|
|
689
|
+
* Creates an `EvmChain` instance directly from a fully-specified config object.
|
|
690
|
+
* Use this when you already know the chain ID, host address, and other parameters.
|
|
691
|
+
*
|
|
692
|
+
* This is the only public way to construct an `EvmChain` with explicit params — the constructor is private.
|
|
693
|
+
*
|
|
694
|
+
* @param params - Full EVM chain configuration
|
|
695
|
+
* @returns An `EvmChain` instance
|
|
696
|
+
*/
|
|
697
|
+
static fromParams(params: EvmChainParams): EvmChain;
|
|
698
|
+
/**
|
|
699
|
+
* Creates an `EvmChain` instance by auto-detecting the chain ID from the RPC endpoint
|
|
700
|
+
* and resolving the correct `IsmpHost` contract address for that chain.
|
|
701
|
+
*
|
|
702
|
+
* This is the only public way to construct an `EvmChain` — the constructor is private.
|
|
703
|
+
*
|
|
704
|
+
* @param rpcUrl - HTTP(S) RPC URL of the EVM node
|
|
705
|
+
* @param bundlerUrl - Optional ERC-4337 bundler URL for account abstraction support
|
|
706
|
+
* @returns A fully initialised `EvmChain` ready for use
|
|
707
|
+
* @throws If the chain ID returned by the RPC is not a known Hyperbridge deployment
|
|
708
|
+
*
|
|
709
|
+
* @example
|
|
710
|
+
* ```typescript
|
|
711
|
+
* const chain = await EvmChain.create("https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY")
|
|
712
|
+
* const chain = await EvmChain.create("https://mainnet.base.org", "https://bundler.example.com")
|
|
713
|
+
* ```
|
|
714
|
+
*/
|
|
715
|
+
static create(rpcUrl: string, bundlerUrl?: string): Promise<EvmChain>;
|
|
716
|
+
get client(): PublicClient;
|
|
717
|
+
get host(): HexString;
|
|
718
|
+
get bundlerUrl(): string | undefined;
|
|
719
|
+
get config(): IEvmConfig;
|
|
720
|
+
get configService(): ChainConfigService;
|
|
721
|
+
/**
|
|
722
|
+
* Derives the key for the request receipt.
|
|
723
|
+
* @param {HexString} commitment - The commitment to derive the key from.
|
|
724
|
+
* @returns {HexString} The derived key.
|
|
725
|
+
*/
|
|
726
|
+
requestReceiptKey(commitment: HexString): HexString;
|
|
727
|
+
/**
|
|
728
|
+
* Queries the request receipt.
|
|
729
|
+
* @param {HexString} commitment - The commitment to query.
|
|
730
|
+
* @returns {Promise<HexString | undefined>} The relayer address responsible for delivering the request.
|
|
731
|
+
*/
|
|
732
|
+
queryRequestReceipt(commitment: HexString): Promise<HexString | undefined>;
|
|
733
|
+
/**
|
|
734
|
+
* Queries the proof of the commitments.
|
|
735
|
+
* @param {IMessage} message - The message to query.
|
|
736
|
+
* @param {string} counterparty - The counterparty address.
|
|
737
|
+
* @param {bigint} [at] - The block number to query at.
|
|
738
|
+
* @returns {Promise<HexString>} The proof.
|
|
739
|
+
*/
|
|
740
|
+
queryProof(message: IMessage, counterparty: string, at?: bigint): Promise<HexString>;
|
|
741
|
+
/**
|
|
742
|
+
* Query and return the encoded storage proof for the provided keys at the given height.
|
|
743
|
+
* @param {bigint} at - The block height at which to query the storage proof.
|
|
744
|
+
* @param {HexString[]} keys - The keys for which to query the storage proof.
|
|
745
|
+
* @param {HexString} address - Optional contract address to fetch storage proof else default to host contract
|
|
746
|
+
* @returns {Promise<HexString>} The encoded storage proof.
|
|
747
|
+
*/
|
|
748
|
+
queryStateProof(at: bigint, keys: HexString[], address?: HexString): Promise<HexString>;
|
|
749
|
+
/**
|
|
750
|
+
* Returns the current timestamp of the chain.
|
|
751
|
+
* @returns {Promise<bigint>} The current timestamp.
|
|
752
|
+
*/
|
|
753
|
+
timestamp(): Promise<bigint>;
|
|
754
|
+
/**
|
|
755
|
+
* Get the latest state machine height for a given state machine ID.
|
|
756
|
+
* @param {StateMachineIdParams} stateMachineId - The state machine ID.
|
|
757
|
+
* @returns {Promise<bigint>} The latest state machine height.
|
|
758
|
+
*/
|
|
759
|
+
latestStateMachineHeight(stateMachineId: StateMachineIdParams): Promise<bigint>;
|
|
760
|
+
/**
|
|
761
|
+
* Get the state machine update time for a given state machine height.
|
|
762
|
+
* @param {StateMachineHeight} stateMachineHeight - The state machine height.
|
|
763
|
+
* @returns {Promise<bigint>} The statemachine update time in seconds.
|
|
764
|
+
*/
|
|
765
|
+
stateMachineUpdateTime(stateMachineHeight: StateMachineHeight): Promise<bigint>;
|
|
766
|
+
/**
|
|
767
|
+
* Retrieves the placeOrder calldata from a transaction using debug_traceTransaction.
|
|
768
|
+
*/
|
|
769
|
+
getPlaceOrderCalldata(txHash: string, intentGatewayAddress: string): Promise<HexString>;
|
|
770
|
+
/**
|
|
771
|
+
* Get the challenge period for a given state machine id.
|
|
772
|
+
* @param {StateMachineIdParams} stateMachineId - The state machine ID.
|
|
773
|
+
* @returns {Promise<bigint>} The challenge period in seconds.
|
|
774
|
+
*/
|
|
775
|
+
challengePeriod(stateMachineId: StateMachineIdParams): Promise<bigint>;
|
|
776
|
+
/**
|
|
777
|
+
* Encodes an ISMP message for the EVM chain.
|
|
778
|
+
* @param {IIsmpMessage} message The ISMP message to encode.
|
|
779
|
+
* @returns {HexString} The encoded calldata.
|
|
780
|
+
*/
|
|
781
|
+
encode(message: IIsmpMessage): HexString;
|
|
782
|
+
/**
|
|
783
|
+
* Calculates the fee required to send a post request to the destination chain.
|
|
784
|
+
* The fee is calculated based on the per-byte fee for the destination chain
|
|
785
|
+
* multiplied by the size of the request body.
|
|
786
|
+
*
|
|
787
|
+
* @param request - The post request to calculate the fee for
|
|
788
|
+
* @returns The total fee in wei required to send the post request
|
|
789
|
+
*/
|
|
790
|
+
quote(request: IPostRequest | IGetRequest): Promise<bigint>;
|
|
791
|
+
quoteNative(request: IPostRequest | IGetRequest, fee: bigint): Promise<bigint>;
|
|
792
|
+
private getAmountsIn;
|
|
793
|
+
/**
|
|
794
|
+
* Estimates the gas required for a post request execution on this chain.
|
|
795
|
+
* This function generates mock proofs for the post request, creates a state override
|
|
796
|
+
* with the necessary overlay root, and estimates the gas cost for executing the
|
|
797
|
+
* handlePostRequests transaction on the handler contract.
|
|
798
|
+
*
|
|
799
|
+
* @param request - The post request to estimate gas for
|
|
800
|
+
* @param paraId - The ID of the parachain (Hyperbridge) that will process the request
|
|
801
|
+
* @returns The estimated gas amount in gas units and the generated calldata
|
|
802
|
+
*/
|
|
803
|
+
estimateGas(request: IPostRequest): Promise<{
|
|
804
|
+
gas: bigint;
|
|
805
|
+
postRequestCalldata: HexString;
|
|
806
|
+
}>;
|
|
807
|
+
/**
|
|
808
|
+
* Gets the fee token address and decimals for the chain.
|
|
809
|
+
* This function gets the fee token address and decimals for the chain.
|
|
810
|
+
*
|
|
811
|
+
* @returns The fee token address and decimals
|
|
812
|
+
*/
|
|
813
|
+
getFeeTokenWithDecimals(): Promise<{
|
|
814
|
+
address: HexString;
|
|
815
|
+
decimals: number;
|
|
816
|
+
}>;
|
|
817
|
+
/**
|
|
818
|
+
* Gets the nonce of the host.
|
|
819
|
+
* This function gets the nonce of the host.
|
|
820
|
+
*
|
|
821
|
+
* @returns The nonce of the host
|
|
822
|
+
*/
|
|
823
|
+
getHostNonce(): Promise<bigint>;
|
|
824
|
+
broadcastTransaction(signedTransaction: HexString): Promise<TransactionReceipt>;
|
|
825
|
+
getTransactionReceipt(hash: HexString): Promise<TransactionReceipt>;
|
|
826
|
+
}
|
|
827
|
+
/**
|
|
828
|
+
* Factory function for creating EVM chain instances with common defaults
|
|
829
|
+
*
|
|
830
|
+
* @param chainId - The EVM chain ID
|
|
831
|
+
* @param host - The IsmpHost contract address
|
|
832
|
+
* @param options - Optional configuration overrides
|
|
833
|
+
* @returns A new EvmChain instance
|
|
834
|
+
*
|
|
835
|
+
* @example
|
|
836
|
+
* ```typescript
|
|
837
|
+
* // Create with minimal config
|
|
838
|
+
* const ethChain = createEvmChain(1, "0x87ea45..", {
|
|
839
|
+
* rpcUrl: "https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"
|
|
840
|
+
* })
|
|
841
|
+
*
|
|
842
|
+
* // Create with custom consensus state ID
|
|
843
|
+
* const arbChain = createEvmChain(42161, "0x87ea42345..", {
|
|
844
|
+
* rpcUrl: "https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY",
|
|
845
|
+
* consensusStateId: "ARB_CUSTOM"
|
|
846
|
+
* })
|
|
847
|
+
* ```
|
|
848
|
+
*/
|
|
849
|
+
declare function createEvmChain(chainId: number, host: HexString, options: {
|
|
850
|
+
rpcUrl: string;
|
|
851
|
+
consensusStateId?: string;
|
|
852
|
+
}): EvmChain;
|
|
853
|
+
/**
|
|
854
|
+
* Slot for storing request commitments.
|
|
855
|
+
*/
|
|
856
|
+
declare const REQUEST_COMMITMENTS_SLOT = 0n;
|
|
857
|
+
/**
|
|
858
|
+
* Slot index for response commitments map
|
|
859
|
+
*/
|
|
860
|
+
declare const RESPONSE_COMMITMENTS_SLOT = 1n;
|
|
861
|
+
/**
|
|
862
|
+
* Slot index for requests receipts map
|
|
863
|
+
*/
|
|
864
|
+
declare const REQUEST_RECEIPTS_SLOT = 2n;
|
|
865
|
+
/**
|
|
866
|
+
* Slot index for response receipts map
|
|
867
|
+
*/
|
|
868
|
+
declare const RESPONSE_RECEIPTS_SLOT = 3n;
|
|
869
|
+
/**
|
|
870
|
+
* Slot index for state commitment map
|
|
871
|
+
*/
|
|
872
|
+
declare const STATE_COMMITMENTS_SLOT = 5n;
|
|
873
|
+
declare function requestCommitmentKey(key: Hex): {
|
|
874
|
+
slot1: Hex;
|
|
875
|
+
slot2: Hex;
|
|
876
|
+
};
|
|
877
|
+
/**
|
|
878
|
+
* Derives the storage slot for a specific field in the StateCommitment struct
|
|
879
|
+
*
|
|
880
|
+
* struct StateCommitment {
|
|
881
|
+
* uint256 timestamp; // slot + 0
|
|
882
|
+
* bytes32 overlayRoot; // slot + 1
|
|
883
|
+
* bytes32 stateRoot; // slot + 2
|
|
884
|
+
* }
|
|
885
|
+
*
|
|
886
|
+
* @param stateMachineId - The state machine ID
|
|
887
|
+
* @param height - The block height
|
|
888
|
+
* @param field - The field index in the struct (0 for timestamp, 1 for overlayRoot, 2 for stateRoot)
|
|
889
|
+
* @returns The storage slot for the specific field
|
|
890
|
+
*/
|
|
891
|
+
declare function getStateCommitmentFieldSlot(stateMachineId: bigint, height: bigint, field: 0 | 1 | 2): HexString;
|
|
892
|
+
declare function getStateCommitmentSlot(stateMachineId: bigint, height: bigint): HexString;
|
|
893
|
+
|
|
593
894
|
/**
|
|
594
895
|
* Generates a Merkle Mountain Range (MMR) root hash and proof for a post request.
|
|
595
896
|
*
|
|
@@ -674,9 +975,6 @@ declare function postRequestCommitment(post: IPostRequest): {
|
|
|
674
975
|
commitment: HexString;
|
|
675
976
|
encodePacked: HexString;
|
|
676
977
|
};
|
|
677
|
-
declare function orderCommitment(order: Order): HexString;
|
|
678
|
-
/** Calculates the order commitment hash */
|
|
679
|
-
declare function orderV2Commitment(order: OrderV2): HexString;
|
|
680
978
|
/**
|
|
681
979
|
* Converts a bytes32 token address to bytes20 format
|
|
682
980
|
* This removes the extra padded zeros from the address
|
|
@@ -719,18 +1017,18 @@ declare function estimateGasForPost(params: {
|
|
|
719
1017
|
* Used as the GET-request context for cancel-from-source, and as the inner
|
|
720
1018
|
* payload (after the RequestKind prefix) for POST-based escrow operations.
|
|
721
1019
|
*/
|
|
722
|
-
declare function encodeWithdrawalRequest(order: Order |
|
|
1020
|
+
declare function encodeWithdrawalRequest(order: Order | Order, beneficiary: HexString): HexString;
|
|
723
1021
|
/**
|
|
724
1022
|
* Constructs the request body for a redeem escrow operation.
|
|
725
1023
|
* This function encodes the order commitment, beneficiary address, and token inputs
|
|
726
1024
|
* to match the format expected by the IntentGateway contract.
|
|
727
1025
|
*/
|
|
728
|
-
declare function constructRedeemEscrowRequestBody(order: Order |
|
|
1026
|
+
declare function constructRedeemEscrowRequestBody(order: Order | Order, beneficiary: HexString): HexString;
|
|
729
1027
|
/**
|
|
730
1028
|
* Constructs the request body for a refund escrow operation (cancel from destination).
|
|
731
1029
|
* Uses RequestKind.RefundEscrow to match the IntentGatewayV2 contract's _cancelFromDest.
|
|
732
1030
|
*/
|
|
733
|
-
declare function constructRefundEscrowRequestBody(order: Order |
|
|
1031
|
+
declare function constructRefundEscrowRequestBody(order: Order | Order, beneficiary: HexString): HexString;
|
|
734
1032
|
declare function fetchPrice(identifier: string | undefined, chainId?: number, apiKey?: string): Promise<number>;
|
|
735
1033
|
/**
|
|
736
1034
|
* Fetches the current network gas price from an Etherscan-family explorer API.
|
|
@@ -819,373 +1117,94 @@ declare const USE_ETHERSCAN_CHAINS: Set<string>;
|
|
|
819
1117
|
*/
|
|
820
1118
|
declare const TESTNET_CHAINS: Set<string>;
|
|
821
1119
|
/**
|
|
822
|
-
* Retrieves the calldata used to call a target contract within a transaction using debug_traceTransaction
|
|
823
|
-
* with the callTracer. Unlike the indexer helper, this returns the calldata whether the target is called
|
|
824
|
-
* directly by the transaction or via nested calls.
|
|
825
|
-
*
|
|
826
|
-
* @param client - viem PublicClient connected to an RPC node with debug API enabled
|
|
827
|
-
* @param txHash - The transaction hash
|
|
828
|
-
* @param targetContractAddress - The target contract address to find the call for
|
|
829
|
-
* @returns The input (calldata) as a hex string, or null if the target is not found in the trace
|
|
830
|
-
* @throws Error if the RPC call fails or returns an unexpected response
|
|
831
|
-
*/
|
|
832
|
-
declare function getContractCallInput(client: PublicClient, txHash: HexString, targetContractAddress: string): Promise<HexString | null>;
|
|
833
|
-
/**
|
|
834
|
-
* Calculates the balance mapping location for a given slot and holder address.
|
|
835
|
-
* This function handles the different encoding formats used by Solidity and Vyper.
|
|
836
|
-
*
|
|
837
|
-
* @param slot - The slot number to calculate the mapping location for.
|
|
838
|
-
* @param holder - The address of the holder to calculate the mapping location for.
|
|
839
|
-
* @param language - The language of the contract.
|
|
840
|
-
* @returns The balance mapping location as a HexString.
|
|
841
|
-
*/
|
|
842
|
-
declare function calculateBalanceMappingLocation(slot: bigint, holder: string, language: EvmLanguage): HexString;
|
|
843
|
-
/**
|
|
844
|
-
* Calculates the allowance mapping location for a given slot, owner, and spender.
|
|
845
|
-
* ERC20 allowance is a nested mapping: mapping(address owner => mapping(address spender => uint256))
|
|
846
|
-
*
|
|
847
|
-
* @param slot - The base slot number for the allowance mapping
|
|
848
|
-
* @param owner - The address of the token owner (first parameter in allowance(owner, spender))
|
|
849
|
-
* @param spender - The address approved to spend tokens (second parameter)
|
|
850
|
-
* @param language - The language of the contract (Solidity or Vyper)
|
|
851
|
-
* @returns The allowance mapping location as a HexString
|
|
852
|
-
*/
|
|
853
|
-
declare function calculateAllowanceMappingLocation(slot: bigint, owner: string, spender: string, language: EvmLanguage): HexString;
|
|
854
|
-
|
|
855
|
-
declare class SubstrateChain implements IChain {
|
|
856
|
-
private readonly params;
|
|
857
|
-
api?: ApiPromise;
|
|
858
|
-
private rpcClient;
|
|
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>;
|
|
868
|
-
get config(): ISubstrateConfig;
|
|
869
|
-
/**
|
|
870
|
-
* Connects to the Substrate chain using the provided WebSocket URL.
|
|
871
|
-
*/
|
|
872
|
-
connect(): Promise<void>;
|
|
873
|
-
/**
|
|
874
|
-
* Disconnects the Substrate chain connection.
|
|
875
|
-
*/
|
|
876
|
-
disconnect(): Promise<void>;
|
|
877
|
-
/**
|
|
878
|
-
* Returns the storage key for a request receipt in the child trie
|
|
879
|
-
* The request commitment is the key
|
|
880
|
-
* @param key - The H256 hash key (as a 0x-prefixed hex string)
|
|
881
|
-
* @returns The storage key as a hex string
|
|
882
|
-
*/
|
|
883
|
-
requestReceiptKey(key: HexString): HexString;
|
|
884
|
-
/**
|
|
885
|
-
* Returns the storage key for a request commitment in the child trie
|
|
886
|
-
* The request commitment is the key
|
|
887
|
-
* @param key - The H256 hash key (as a 0x-prefixed hex string)
|
|
888
|
-
* @returns The storage key as a hex string
|
|
889
|
-
*/
|
|
890
|
-
requestCommitmentKey(key: HexString): HexString;
|
|
891
|
-
/**
|
|
892
|
-
* Queries a request commitment from the ISMP child trie storage.
|
|
893
|
-
* @param {HexString} commitment - The commitment hash to look up.
|
|
894
|
-
* @returns {Promise<HexString | undefined>} The commitment data if found, undefined otherwise.
|
|
895
|
-
*/
|
|
896
|
-
queryRequestCommitment(commitment: HexString): Promise<HexString | undefined>;
|
|
897
|
-
/**
|
|
898
|
-
* Queries the request receipt.
|
|
899
|
-
* @param {HexString} commitment - The commitment to query.
|
|
900
|
-
* @returns {Promise<HexString | undefined>} The relayer address responsible for delivering the request.
|
|
901
|
-
*/
|
|
902
|
-
queryRequestReceipt(commitment: HexString): Promise<HexString | undefined>;
|
|
903
|
-
/**
|
|
904
|
-
* Returns the current timestamp of the chain.
|
|
905
|
-
* @returns {Promise<bigint>} The current timestamp.
|
|
906
|
-
*/
|
|
907
|
-
timestamp(): Promise<bigint>;
|
|
908
|
-
/**
|
|
909
|
-
* Queries the proof of the commitments.
|
|
910
|
-
* @param {IMessage} message - The message to query.
|
|
911
|
-
* @param {string} counterparty - The counterparty address.
|
|
912
|
-
* @param {bigint} [at] - The block number to query at.
|
|
913
|
-
* @returns {Promise<HexString>} The proof.
|
|
914
|
-
*/
|
|
915
|
-
queryProof(message: IMessage, counterparty: string, at?: bigint): Promise<HexString>;
|
|
916
|
-
/**
|
|
917
|
-
* Submit an unsigned ISMP transaction to the chain. Resolves when the transaction is finalized.
|
|
918
|
-
* @param message - The message to be submitted.
|
|
919
|
-
* @returns A promise that resolves to an object containing the transaction hash, block hash, and block number.
|
|
920
|
-
*/
|
|
921
|
-
submitUnsigned(message: IIsmpMessage): Promise<{
|
|
922
|
-
transactionHash: string;
|
|
923
|
-
blockHash: string;
|
|
924
|
-
blockNumber: number;
|
|
925
|
-
timestamp: number;
|
|
926
|
-
}>;
|
|
927
|
-
/**
|
|
928
|
-
* Query the state proof for a given set of keys at a specific block height.
|
|
929
|
-
* @param at The block height to query the state proof at.
|
|
930
|
-
* @param keys The keys to query the state proof for.
|
|
931
|
-
* @param _address - Optional address (ignored for Substrate; present for IChain compatibility).
|
|
932
|
-
* @returns The state proof as a hexadecimal string.
|
|
933
|
-
*/
|
|
934
|
-
queryStateProof(at: bigint, keys: HexString[], _address?: HexString): Promise<HexString>;
|
|
935
|
-
/**
|
|
936
|
-
* Get the latest state machine height for a given state machine ID.
|
|
937
|
-
* @param {StateMachineIdParams} stateMachineId - The state machine ID.
|
|
938
|
-
* @returns {Promise<bigint>} The latest state machine height.
|
|
939
|
-
*/
|
|
940
|
-
latestStateMachineHeight(stateMachineId: StateMachineIdParams): Promise<bigint>;
|
|
941
|
-
/**
|
|
942
|
-
* Get the state machine update time for a given state machine height.
|
|
943
|
-
* @param {StateMachineHeight} stateMachineHeight - The state machine height.
|
|
944
|
-
* @returns {Promise<bigint>} The statemachine update time in seconds.
|
|
945
|
-
*/
|
|
946
|
-
stateMachineUpdateTime(stateMachineHeight: StateMachineHeight): Promise<bigint>;
|
|
947
|
-
/**
|
|
948
|
-
* Get the challenge period for a given state machine id.
|
|
949
|
-
* @param {StateMachineIdParams} stateMachineId - The state machine ID.
|
|
950
|
-
* @returns {Promise<bigint>} The challenge period in seconds.
|
|
951
|
-
*/
|
|
952
|
-
challengePeriod(stateMachineId: StateMachineIdParams): Promise<bigint>;
|
|
953
|
-
/**
|
|
954
|
-
* Encode an ISMP calldata for a substrate chain.
|
|
955
|
-
* @param message The ISMP message to encode.
|
|
956
|
-
* @returns The encoded message as a hexadecimal string.
|
|
957
|
-
*/
|
|
958
|
-
encode(message: IIsmpMessage): HexString;
|
|
959
|
-
/**
|
|
960
|
-
* Returns the index of a pallet by its name, by looking up the pallets in the runtime metadata.
|
|
961
|
-
* @param {string} name - The name of the pallet.
|
|
962
|
-
* @returns {number} The index of the pallet.
|
|
963
|
-
*/
|
|
964
|
-
private getPalletIndex;
|
|
965
|
-
}
|
|
966
|
-
/**
|
|
967
|
-
* Converts a state machine ID string to an enum value.
|
|
968
|
-
* @param {string} id - The state machine ID string.
|
|
969
|
-
* @returns {IStateMachine} The corresponding enum value.
|
|
970
|
-
*/
|
|
971
|
-
declare function convertStateMachineIdToEnum(id: string): IStateMachine;
|
|
972
|
-
/**
|
|
973
|
-
* Converts a state machine enum representation to a string.
|
|
974
|
-
* @param {IStateMachine} stateMachine - The state machine enum object.
|
|
975
|
-
* @returns {string} The state machine ID string like "EVM-97" or "SUBSTRATE-cere".
|
|
976
|
-
*/
|
|
977
|
-
declare function convertStateMachineEnumToString(stateMachine: {
|
|
978
|
-
tag: string;
|
|
979
|
-
value: number | number[];
|
|
980
|
-
}): string;
|
|
981
|
-
/**
|
|
982
|
-
* Converts a stateId object back to the state_id format used by the RPC.
|
|
983
|
-
* @param stateId - The stateId object from StateMachineIdParams
|
|
984
|
-
* @returns The string representation like "EVM-11155111" or "SUBSTRATE-cere"
|
|
985
|
-
*/
|
|
986
|
-
declare function convertStateIdToStateMachineId(stateId: {
|
|
987
|
-
Evm?: number;
|
|
988
|
-
Substrate?: HexString;
|
|
989
|
-
Polkadot?: number;
|
|
990
|
-
Kusama?: number;
|
|
991
|
-
}): string;
|
|
992
|
-
/**
|
|
993
|
-
* Converts an IGetRequest object to a codec representation.
|
|
994
|
-
* @param {IGetRequest} request - The IGetRequest object.
|
|
995
|
-
* @returns The codec representation of the request.
|
|
996
|
-
*/
|
|
997
|
-
declare function convertIGetRequestToCodec(request: IGetRequest): {
|
|
998
|
-
readonly source: IStateMachine;
|
|
999
|
-
readonly dest: IStateMachine;
|
|
1000
|
-
readonly from: number[];
|
|
1001
|
-
readonly nonce: bigint;
|
|
1002
|
-
readonly keys: number[][];
|
|
1003
|
-
readonly context: number[];
|
|
1004
|
-
readonly timeoutTimestamp: bigint;
|
|
1005
|
-
readonly height: bigint;
|
|
1006
|
-
};
|
|
1007
|
-
/**
|
|
1008
|
-
* Convert codec representation back to IGetRequest
|
|
1009
|
-
*/
|
|
1010
|
-
declare function convertCodecToIGetRequest(codec: {
|
|
1011
|
-
source: {
|
|
1012
|
-
tag: string;
|
|
1013
|
-
value: number | number[];
|
|
1014
|
-
};
|
|
1015
|
-
dest: {
|
|
1016
|
-
tag: string;
|
|
1017
|
-
value: number | number[];
|
|
1018
|
-
};
|
|
1019
|
-
from: number[];
|
|
1020
|
-
nonce: bigint;
|
|
1021
|
-
keys: number[][];
|
|
1022
|
-
height: bigint;
|
|
1023
|
-
context: number[];
|
|
1024
|
-
timeoutTimestamp: bigint;
|
|
1025
|
-
}): IGetRequest;
|
|
1026
|
-
/**
|
|
1027
|
-
* Converts an IProof object to a codec representation.
|
|
1028
|
-
* @param {IProof} proof - The IProof object.
|
|
1029
|
-
* @returns The codec representation of the proof.
|
|
1030
|
-
*/
|
|
1031
|
-
declare function convertIProofToCodec(proof: IProof): {
|
|
1032
|
-
readonly height: {
|
|
1033
|
-
readonly height: bigint;
|
|
1034
|
-
readonly id: {
|
|
1035
|
-
readonly consensusStateId: number[];
|
|
1036
|
-
readonly id: IStateMachine;
|
|
1037
|
-
};
|
|
1038
|
-
};
|
|
1039
|
-
readonly proof: number[];
|
|
1040
|
-
};
|
|
1041
|
-
/**
|
|
1042
|
-
* Converts a codec representation back to an IProof object.
|
|
1043
|
-
* @param {any} codec - The codec representation of the proof.
|
|
1044
|
-
* @returns {IProof} The IProof object.
|
|
1120
|
+
* Retrieves the calldata used to call a target contract within a transaction using debug_traceTransaction
|
|
1121
|
+
* with the callTracer. Unlike the indexer helper, this returns the calldata whether the target is called
|
|
1122
|
+
* directly by the transaction or via nested calls.
|
|
1123
|
+
*
|
|
1124
|
+
* @param client - viem PublicClient connected to an RPC node with debug API enabled
|
|
1125
|
+
* @param txHash - The transaction hash
|
|
1126
|
+
* @param targetContractAddress - The target contract address to find the call for
|
|
1127
|
+
* @returns The input (calldata) as a hex string, or null if the target is not found in the trace
|
|
1128
|
+
* @throws Error if the RPC call fails or returns an unexpected response
|
|
1045
1129
|
*/
|
|
1046
|
-
declare function
|
|
1047
|
-
height: {
|
|
1048
|
-
height: bigint;
|
|
1049
|
-
id: {
|
|
1050
|
-
consensusStateId: number[];
|
|
1051
|
-
id: {
|
|
1052
|
-
tag: string;
|
|
1053
|
-
value: number | number[];
|
|
1054
|
-
};
|
|
1055
|
-
};
|
|
1056
|
-
};
|
|
1057
|
-
proof: number[];
|
|
1058
|
-
}): IProof;
|
|
1059
|
-
declare function encodeISMPMessage(message: IIsmpMessage): Uint8Array;
|
|
1060
|
-
|
|
1061
|
-
declare class ChainConfigService {
|
|
1062
|
-
private rpcUrls;
|
|
1063
|
-
constructor(env?: NodeJS.ProcessEnv);
|
|
1064
|
-
private getConfig;
|
|
1065
|
-
getChainConfig(chain: string): ChainConfig;
|
|
1066
|
-
getIntentGatewayAddress(chain: string): HexString;
|
|
1067
|
-
getTokenGatewayAddress(chain: string): HexString;
|
|
1068
|
-
getHostAddress(chain: string): HexString;
|
|
1069
|
-
getWrappedNativeAssetWithDecimals(chain: string): {
|
|
1070
|
-
asset: HexString;
|
|
1071
|
-
decimals: number;
|
|
1072
|
-
};
|
|
1073
|
-
getDaiAsset(chain: string): HexString;
|
|
1074
|
-
getUsdtAsset(chain: string): HexString;
|
|
1075
|
-
getUsdcAsset(chain: string): HexString;
|
|
1076
|
-
getUsdcDecimals(chain: string): number;
|
|
1077
|
-
getUsdtDecimals(chain: string): number;
|
|
1078
|
-
getCNgnAsset(chain: string): HexString | undefined;
|
|
1079
|
-
getCNgnDecimals(chain: string): number | undefined;
|
|
1080
|
-
getExtAsset(chain: string): HexString | undefined;
|
|
1081
|
-
getExtDecimals(chain: string): number | undefined;
|
|
1082
|
-
getChainId(chain: string): number;
|
|
1083
|
-
getConsensusStateId(chain: string): HexString;
|
|
1084
|
-
getHyperbridgeChainId(): number;
|
|
1085
|
-
getRpcUrl(chain: string): string;
|
|
1086
|
-
getUniswapRouterV2Address(chain: string): HexString;
|
|
1087
|
-
getUniswapV2FactoryAddress(chain: string): HexString;
|
|
1088
|
-
getUniswapV3FactoryAddress(chain: string): HexString;
|
|
1089
|
-
getUniversalRouterAddress(chain: string): HexString;
|
|
1090
|
-
getUniswapV3QuoterAddress(chain: string): HexString;
|
|
1091
|
-
getUniswapV4QuoterAddress(chain: string): HexString;
|
|
1092
|
-
getPermit2Address(chain: string): HexString;
|
|
1093
|
-
getSolverAccountAddress(chain: string): HexString | undefined;
|
|
1094
|
-
getCoingeckoId(chain: string): string | undefined;
|
|
1095
|
-
getEtherscanApiKey(): string | undefined;
|
|
1096
|
-
getCalldispatcherAddress(chain: string): HexString;
|
|
1097
|
-
getTokenStorageSlots(chain: string, tokenAddress: string): {
|
|
1098
|
-
balanceSlot: number;
|
|
1099
|
-
allowanceSlot: number;
|
|
1100
|
-
} | undefined;
|
|
1101
|
-
getPopularTokens(chain: string): string[];
|
|
1102
|
-
getIntentGatewayV2Address(chain: string): HexString;
|
|
1103
|
-
getEntryPointV08Address(chain: string): HexString;
|
|
1104
|
-
getHyperbridgeAddress(): string;
|
|
1105
|
-
/**
|
|
1106
|
-
* Get the LayerZero Endpoint ID for the chain
|
|
1107
|
-
* Used for USDT0 cross-chain transfers via LayerZero OFT
|
|
1108
|
-
*/
|
|
1109
|
-
getLayerZeroEid(chain: string): number | undefined;
|
|
1110
|
-
/**
|
|
1111
|
-
* Get the USDT0 OFT contract address for the chain
|
|
1112
|
-
* On Ethereum: OFT Adapter (locks/unlocks USDT)
|
|
1113
|
-
* On other chains: OFT contract (mints/burns USDT0)
|
|
1114
|
-
*/
|
|
1115
|
-
getUsdt0OftAddress(chain: string): HexString | undefined;
|
|
1116
|
-
}
|
|
1117
|
-
|
|
1130
|
+
declare function getContractCallInput(client: PublicClient, txHash: HexString, targetContractAddress: string): Promise<HexString | null>;
|
|
1118
1131
|
/**
|
|
1119
|
-
*
|
|
1120
|
-
* This
|
|
1132
|
+
* Calculates the balance mapping location for a given slot and holder address.
|
|
1133
|
+
* This function handles the different encoding formats used by Solidity and Vyper.
|
|
1134
|
+
*
|
|
1135
|
+
* @param slot - The slot number to calculate the mapping location for.
|
|
1136
|
+
* @param holder - The address of the holder to calculate the mapping location for.
|
|
1137
|
+
* @param language - The language of the contract.
|
|
1138
|
+
* @returns The balance mapping location as a HexString.
|
|
1121
1139
|
*/
|
|
1122
|
-
declare
|
|
1140
|
+
declare function calculateBalanceMappingLocation(slot: bigint, holder: string, language: EvmLanguage): HexString;
|
|
1123
1141
|
/**
|
|
1124
|
-
*
|
|
1142
|
+
* Calculates the allowance mapping location for a given slot, owner, and spender.
|
|
1143
|
+
* ERC20 allowance is a nested mapping: mapping(address owner => mapping(address spender => uint256))
|
|
1144
|
+
*
|
|
1145
|
+
* @param slot - The base slot number for the allowance mapping
|
|
1146
|
+
* @param owner - The address of the token owner (first parameter in allowance(owner, spender))
|
|
1147
|
+
* @param spender - The address approved to spend tokens (second parameter)
|
|
1148
|
+
* @param language - The language of the contract (Solidity or Vyper)
|
|
1149
|
+
* @returns The allowance mapping location as a HexString
|
|
1125
1150
|
*/
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1151
|
+
declare function calculateAllowanceMappingLocation(slot: bigint, owner: string, spender: string, language: EvmLanguage): HexString;
|
|
1152
|
+
|
|
1153
|
+
declare class SubstrateChain implements IChain {
|
|
1154
|
+
private readonly params;
|
|
1155
|
+
api?: ApiPromise;
|
|
1156
|
+
private rpcClient;
|
|
1157
|
+
private constructor();
|
|
1131
1158
|
/**
|
|
1132
|
-
*
|
|
1159
|
+
* Creates a `SubstrateChain` instance and immediately connects to the
|
|
1160
|
+
* WebSocket endpoint, returning a fully initialised chain client.
|
|
1161
|
+
*
|
|
1162
|
+
* This is the only public way to construct a `SubstrateChain` — the constructor is private.
|
|
1163
|
+
*
|
|
1164
|
+
* @param params - Substrate chain configuration (wsUrl, stateMachineId, etc.).
|
|
1165
|
+
* @returns A connected `SubstrateChain` instance.
|
|
1133
1166
|
*/
|
|
1134
|
-
|
|
1167
|
+
static connect(params: ISubstrateConfig): Promise<SubstrateChain>;
|
|
1168
|
+
get config(): ISubstrateConfig;
|
|
1135
1169
|
/**
|
|
1136
|
-
*
|
|
1170
|
+
* Connects to the Substrate chain using the provided WebSocket URL.
|
|
1137
1171
|
*/
|
|
1138
|
-
|
|
1172
|
+
connect(): Promise<void>;
|
|
1139
1173
|
/**
|
|
1140
|
-
*
|
|
1174
|
+
* Disconnects the Substrate chain connection.
|
|
1141
1175
|
*/
|
|
1142
|
-
|
|
1176
|
+
disconnect(): Promise<void>;
|
|
1143
1177
|
/**
|
|
1144
|
-
*
|
|
1178
|
+
* Returns the storage key for a request receipt in the child trie
|
|
1179
|
+
* The request commitment is the key
|
|
1180
|
+
* @param key - The H256 hash key (as a 0x-prefixed hex string)
|
|
1181
|
+
* @returns The storage key as a hex string
|
|
1145
1182
|
*/
|
|
1146
|
-
|
|
1147
|
-
}
|
|
1148
|
-
/**
|
|
1149
|
-
* Encapsulates an EVM chain.
|
|
1150
|
-
*/
|
|
1151
|
-
declare class EvmChain implements IChain {
|
|
1152
|
-
private readonly params;
|
|
1153
|
-
private publicClient;
|
|
1154
|
-
private chainConfigService;
|
|
1155
|
-
constructor(params: EvmChainParams);
|
|
1183
|
+
requestReceiptKey(key: HexString): HexString;
|
|
1156
1184
|
/**
|
|
1157
|
-
*
|
|
1158
|
-
*
|
|
1159
|
-
*
|
|
1160
|
-
* @
|
|
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
|
-
* ```
|
|
1185
|
+
* Returns the storage key for a request commitment in the child trie
|
|
1186
|
+
* The request commitment is the key
|
|
1187
|
+
* @param key - The H256 hash key (as a 0x-prefixed hex string)
|
|
1188
|
+
* @returns The storage key as a hex string
|
|
1170
1189
|
*/
|
|
1171
|
-
|
|
1172
|
-
get client(): PublicClient;
|
|
1173
|
-
get host(): HexString;
|
|
1174
|
-
get bundlerUrl(): string | undefined;
|
|
1175
|
-
get config(): IEvmConfig;
|
|
1176
|
-
get configService(): ChainConfigService;
|
|
1190
|
+
requestCommitmentKey(key: HexString): HexString;
|
|
1177
1191
|
/**
|
|
1178
|
-
*
|
|
1179
|
-
* @param {HexString} commitment - The commitment to
|
|
1180
|
-
* @returns {HexString} The
|
|
1192
|
+
* Queries a request commitment from the ISMP child trie storage.
|
|
1193
|
+
* @param {HexString} commitment - The commitment hash to look up.
|
|
1194
|
+
* @returns {Promise<HexString | undefined>} The commitment data if found, undefined otherwise.
|
|
1181
1195
|
*/
|
|
1182
|
-
|
|
1196
|
+
queryRequestCommitment(commitment: HexString): Promise<HexString | undefined>;
|
|
1183
1197
|
/**
|
|
1184
1198
|
* Queries the request receipt.
|
|
1185
1199
|
* @param {HexString} commitment - The commitment to query.
|
|
1186
1200
|
* @returns {Promise<HexString | undefined>} The relayer address responsible for delivering the request.
|
|
1187
1201
|
*/
|
|
1188
1202
|
queryRequestReceipt(commitment: HexString): Promise<HexString | undefined>;
|
|
1203
|
+
/**
|
|
1204
|
+
* Returns the current timestamp of the chain.
|
|
1205
|
+
* @returns {Promise<bigint>} The current timestamp.
|
|
1206
|
+
*/
|
|
1207
|
+
timestamp(): Promise<bigint>;
|
|
1189
1208
|
/**
|
|
1190
1209
|
* Queries the proof of the commitments.
|
|
1191
1210
|
* @param {IMessage} message - The message to query.
|
|
@@ -1195,18 +1214,24 @@ declare class EvmChain implements IChain {
|
|
|
1195
1214
|
*/
|
|
1196
1215
|
queryProof(message: IMessage, counterparty: string, at?: bigint): Promise<HexString>;
|
|
1197
1216
|
/**
|
|
1198
|
-
*
|
|
1199
|
-
* @param
|
|
1200
|
-
* @
|
|
1201
|
-
* @param {HexString} address - Optional contract address to fetch storage proof else default to host contract
|
|
1202
|
-
* @returns {Promise<HexString>} The encoded storage proof.
|
|
1217
|
+
* Submit an unsigned ISMP transaction to the chain. Resolves when the transaction is finalized.
|
|
1218
|
+
* @param message - The message to be submitted.
|
|
1219
|
+
* @returns A promise that resolves to an object containing the transaction hash, block hash, and block number.
|
|
1203
1220
|
*/
|
|
1204
|
-
|
|
1221
|
+
submitUnsigned(message: IIsmpMessage): Promise<{
|
|
1222
|
+
transactionHash: string;
|
|
1223
|
+
blockHash: string;
|
|
1224
|
+
blockNumber: number;
|
|
1225
|
+
timestamp: number;
|
|
1226
|
+
}>;
|
|
1205
1227
|
/**
|
|
1206
|
-
*
|
|
1207
|
-
* @
|
|
1228
|
+
* Query the state proof for a given set of keys at a specific block height.
|
|
1229
|
+
* @param at The block height to query the state proof at.
|
|
1230
|
+
* @param keys The keys to query the state proof for.
|
|
1231
|
+
* @param _address - Optional address (ignored for Substrate; present for IChain compatibility).
|
|
1232
|
+
* @returns The state proof as a hexadecimal string.
|
|
1208
1233
|
*/
|
|
1209
|
-
|
|
1234
|
+
queryStateProof(at: bigint, keys: HexString[], _address?: HexString): Promise<HexString>;
|
|
1210
1235
|
/**
|
|
1211
1236
|
* Get the latest state machine height for a given state machine ID.
|
|
1212
1237
|
* @param {StateMachineIdParams} stateMachineId - The state machine ID.
|
|
@@ -1219,10 +1244,6 @@ declare class EvmChain implements IChain {
|
|
|
1219
1244
|
* @returns {Promise<bigint>} The statemachine update time in seconds.
|
|
1220
1245
|
*/
|
|
1221
1246
|
stateMachineUpdateTime(stateMachineHeight: StateMachineHeight): Promise<bigint>;
|
|
1222
|
-
/**
|
|
1223
|
-
* Retrieves the placeOrder calldata from a transaction using debug_traceTransaction.
|
|
1224
|
-
*/
|
|
1225
|
-
getPlaceOrderCalldata(txHash: string, intentGatewayAddress: string): Promise<HexString>;
|
|
1226
1247
|
/**
|
|
1227
1248
|
* Get the challenge period for a given state machine id.
|
|
1228
1249
|
* @param {StateMachineIdParams} stateMachineId - The state machine ID.
|
|
@@ -1230,122 +1251,112 @@ declare class EvmChain implements IChain {
|
|
|
1230
1251
|
*/
|
|
1231
1252
|
challengePeriod(stateMachineId: StateMachineIdParams): Promise<bigint>;
|
|
1232
1253
|
/**
|
|
1233
|
-
*
|
|
1234
|
-
* @param
|
|
1235
|
-
* @returns
|
|
1254
|
+
* Encode an ISMP calldata for a substrate chain.
|
|
1255
|
+
* @param message The ISMP message to encode.
|
|
1256
|
+
* @returns The encoded message as a hexadecimal string.
|
|
1236
1257
|
*/
|
|
1237
1258
|
encode(message: IIsmpMessage): HexString;
|
|
1238
1259
|
/**
|
|
1239
|
-
*
|
|
1240
|
-
*
|
|
1241
|
-
*
|
|
1242
|
-
*
|
|
1243
|
-
* @param request - The post request to calculate the fee for
|
|
1244
|
-
* @returns The total fee in wei required to send the post request
|
|
1245
|
-
*/
|
|
1246
|
-
quote(request: IPostRequest | IGetRequest): Promise<bigint>;
|
|
1247
|
-
quoteNative(request: IPostRequest | IGetRequest, fee: bigint): Promise<bigint>;
|
|
1248
|
-
private getAmountsIn;
|
|
1249
|
-
/**
|
|
1250
|
-
* Estimates the gas required for a post request execution on this chain.
|
|
1251
|
-
* This function generates mock proofs for the post request, creates a state override
|
|
1252
|
-
* with the necessary overlay root, and estimates the gas cost for executing the
|
|
1253
|
-
* handlePostRequests transaction on the handler contract.
|
|
1254
|
-
*
|
|
1255
|
-
* @param request - The post request to estimate gas for
|
|
1256
|
-
* @param paraId - The ID of the parachain (Hyperbridge) that will process the request
|
|
1257
|
-
* @returns The estimated gas amount in gas units and the generated calldata
|
|
1258
|
-
*/
|
|
1259
|
-
estimateGas(request: IPostRequest): Promise<{
|
|
1260
|
-
gas: bigint;
|
|
1261
|
-
postRequestCalldata: HexString;
|
|
1262
|
-
}>;
|
|
1263
|
-
/**
|
|
1264
|
-
* Gets the fee token address and decimals for the chain.
|
|
1265
|
-
* This function gets the fee token address and decimals for the chain.
|
|
1266
|
-
*
|
|
1267
|
-
* @returns The fee token address and decimals
|
|
1268
|
-
*/
|
|
1269
|
-
getFeeTokenWithDecimals(): Promise<{
|
|
1270
|
-
address: HexString;
|
|
1271
|
-
decimals: number;
|
|
1272
|
-
}>;
|
|
1273
|
-
/**
|
|
1274
|
-
* Gets the nonce of the host.
|
|
1275
|
-
* This function gets the nonce of the host.
|
|
1276
|
-
*
|
|
1277
|
-
* @returns The nonce of the host
|
|
1260
|
+
* Returns the index of a pallet by its name, by looking up the pallets in the runtime metadata.
|
|
1261
|
+
* @param {string} name - The name of the pallet.
|
|
1262
|
+
* @returns {number} The index of the pallet.
|
|
1278
1263
|
*/
|
|
1279
|
-
|
|
1280
|
-
broadcastTransaction(signedTransaction: HexString): Promise<TransactionReceipt>;
|
|
1281
|
-
getTransactionReceipt(hash: HexString): Promise<TransactionReceipt>;
|
|
1264
|
+
private getPalletIndex;
|
|
1282
1265
|
}
|
|
1283
1266
|
/**
|
|
1284
|
-
*
|
|
1285
|
-
*
|
|
1286
|
-
* @
|
|
1287
|
-
* @param host - The IsmpHost contract address
|
|
1288
|
-
* @param options - Optional configuration overrides
|
|
1289
|
-
* @returns A new EvmChain instance
|
|
1290
|
-
*
|
|
1291
|
-
* @example
|
|
1292
|
-
* ```typescript
|
|
1293
|
-
* // Create with minimal config
|
|
1294
|
-
* const ethChain = createEvmChain(1, "0x87ea45..", {
|
|
1295
|
-
* rpcUrl: "https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"
|
|
1296
|
-
* })
|
|
1297
|
-
*
|
|
1298
|
-
* // Create with custom consensus state ID
|
|
1299
|
-
* const arbChain = createEvmChain(42161, "0x87ea42345..", {
|
|
1300
|
-
* rpcUrl: "https://arb-mainnet.g.alchemy.com/v2/YOUR_KEY",
|
|
1301
|
-
* consensusStateId: "ARB_CUSTOM"
|
|
1302
|
-
* })
|
|
1303
|
-
* ```
|
|
1267
|
+
* Converts a state machine ID string to an enum value.
|
|
1268
|
+
* @param {string} id - The state machine ID string.
|
|
1269
|
+
* @returns {IStateMachine} The corresponding enum value.
|
|
1304
1270
|
*/
|
|
1305
|
-
declare function
|
|
1306
|
-
rpcUrl: string;
|
|
1307
|
-
consensusStateId?: string;
|
|
1308
|
-
}): EvmChain;
|
|
1271
|
+
declare function convertStateMachineIdToEnum(id: string): IStateMachine;
|
|
1309
1272
|
/**
|
|
1310
|
-
*
|
|
1273
|
+
* Converts a state machine enum representation to a string.
|
|
1274
|
+
* @param {IStateMachine} stateMachine - The state machine enum object.
|
|
1275
|
+
* @returns {string} The state machine ID string like "EVM-97" or "SUBSTRATE-cere".
|
|
1311
1276
|
*/
|
|
1312
|
-
declare
|
|
1277
|
+
declare function convertStateMachineEnumToString(stateMachine: {
|
|
1278
|
+
tag: string;
|
|
1279
|
+
value: number | number[];
|
|
1280
|
+
}): string;
|
|
1313
1281
|
/**
|
|
1314
|
-
*
|
|
1282
|
+
* Converts a stateId object back to the state_id format used by the RPC.
|
|
1283
|
+
* @param stateId - The stateId object from StateMachineIdParams
|
|
1284
|
+
* @returns The string representation like "EVM-11155111" or "SUBSTRATE-cere"
|
|
1315
1285
|
*/
|
|
1316
|
-
declare
|
|
1286
|
+
declare function convertStateIdToStateMachineId(stateId: {
|
|
1287
|
+
Evm?: number;
|
|
1288
|
+
Substrate?: HexString;
|
|
1289
|
+
Polkadot?: number;
|
|
1290
|
+
Kusama?: number;
|
|
1291
|
+
}): string;
|
|
1317
1292
|
/**
|
|
1318
|
-
*
|
|
1293
|
+
* Converts an IGetRequest object to a codec representation.
|
|
1294
|
+
* @param {IGetRequest} request - The IGetRequest object.
|
|
1295
|
+
* @returns The codec representation of the request.
|
|
1319
1296
|
*/
|
|
1320
|
-
declare
|
|
1297
|
+
declare function convertIGetRequestToCodec(request: IGetRequest): {
|
|
1298
|
+
readonly source: IStateMachine;
|
|
1299
|
+
readonly dest: IStateMachine;
|
|
1300
|
+
readonly from: number[];
|
|
1301
|
+
readonly nonce: bigint;
|
|
1302
|
+
readonly keys: number[][];
|
|
1303
|
+
readonly context: number[];
|
|
1304
|
+
readonly timeoutTimestamp: bigint;
|
|
1305
|
+
readonly height: bigint;
|
|
1306
|
+
};
|
|
1321
1307
|
/**
|
|
1322
|
-
*
|
|
1308
|
+
* Convert codec representation back to IGetRequest
|
|
1323
1309
|
*/
|
|
1324
|
-
declare
|
|
1310
|
+
declare function convertCodecToIGetRequest(codec: {
|
|
1311
|
+
source: {
|
|
1312
|
+
tag: string;
|
|
1313
|
+
value: number | number[];
|
|
1314
|
+
};
|
|
1315
|
+
dest: {
|
|
1316
|
+
tag: string;
|
|
1317
|
+
value: number | number[];
|
|
1318
|
+
};
|
|
1319
|
+
from: number[];
|
|
1320
|
+
nonce: bigint;
|
|
1321
|
+
keys: number[][];
|
|
1322
|
+
height: bigint;
|
|
1323
|
+
context: number[];
|
|
1324
|
+
timeoutTimestamp: bigint;
|
|
1325
|
+
}): IGetRequest;
|
|
1325
1326
|
/**
|
|
1326
|
-
*
|
|
1327
|
+
* Converts an IProof object to a codec representation.
|
|
1328
|
+
* @param {IProof} proof - The IProof object.
|
|
1329
|
+
* @returns The codec representation of the proof.
|
|
1327
1330
|
*/
|
|
1328
|
-
declare
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1331
|
+
declare function convertIProofToCodec(proof: IProof): {
|
|
1332
|
+
readonly height: {
|
|
1333
|
+
readonly height: bigint;
|
|
1334
|
+
readonly id: {
|
|
1335
|
+
readonly consensusStateId: number[];
|
|
1336
|
+
readonly id: IStateMachine;
|
|
1337
|
+
};
|
|
1338
|
+
};
|
|
1339
|
+
readonly proof: number[];
|
|
1332
1340
|
};
|
|
1333
1341
|
/**
|
|
1334
|
-
*
|
|
1335
|
-
*
|
|
1336
|
-
*
|
|
1337
|
-
* uint256 timestamp; // slot + 0
|
|
1338
|
-
* bytes32 overlayRoot; // slot + 1
|
|
1339
|
-
* bytes32 stateRoot; // slot + 2
|
|
1340
|
-
* }
|
|
1341
|
-
*
|
|
1342
|
-
* @param stateMachineId - The state machine ID
|
|
1343
|
-
* @param height - The block height
|
|
1344
|
-
* @param field - The field index in the struct (0 for timestamp, 1 for overlayRoot, 2 for stateRoot)
|
|
1345
|
-
* @returns The storage slot for the specific field
|
|
1342
|
+
* Converts a codec representation back to an IProof object.
|
|
1343
|
+
* @param {any} codec - The codec representation of the proof.
|
|
1344
|
+
* @returns {IProof} The IProof object.
|
|
1346
1345
|
*/
|
|
1347
|
-
declare function
|
|
1348
|
-
|
|
1346
|
+
declare function convertCodecToIProof(codec: {
|
|
1347
|
+
height: {
|
|
1348
|
+
height: bigint;
|
|
1349
|
+
id: {
|
|
1350
|
+
consensusStateId: number[];
|
|
1351
|
+
id: {
|
|
1352
|
+
tag: string;
|
|
1353
|
+
value: number | number[];
|
|
1354
|
+
};
|
|
1355
|
+
};
|
|
1356
|
+
};
|
|
1357
|
+
proof: number[];
|
|
1358
|
+
}): IProof;
|
|
1359
|
+
declare function encodeISMPMessage(message: IIsmpMessage): Uint8Array;
|
|
1349
1360
|
|
|
1350
1361
|
/**
|
|
1351
1362
|
* Encodes a PackedUserOperation using SCALE codec for submission to Hyperbridge.
|
|
@@ -1409,11 +1420,6 @@ declare class IntentsCoprocessor {
|
|
|
1409
1420
|
* Supports both hex seed (without 0x prefix) and mnemonic phrases
|
|
1410
1421
|
*/
|
|
1411
1422
|
getKeyPair(): KeyringPair;
|
|
1412
|
-
/**
|
|
1413
|
-
* Checks if the connected node exposes intents_* RPC methods.
|
|
1414
|
-
* Result is cached after the first check.
|
|
1415
|
-
*/
|
|
1416
|
-
private checkIntentsRpc;
|
|
1417
1423
|
/**
|
|
1418
1424
|
* Signs and sends an extrinsic, handling status updates and errors
|
|
1419
1425
|
* Implements retry logic with progressive tip increases for stuck transactions
|
|
@@ -1484,7 +1490,16 @@ declare class TronChain implements IChain {
|
|
|
1484
1490
|
private readonly params;
|
|
1485
1491
|
private readonly evm;
|
|
1486
1492
|
private readonly tronWebInstance;
|
|
1487
|
-
|
|
1493
|
+
/**
|
|
1494
|
+
* Creates a `TronChain` instance from a fully-specified config object.
|
|
1495
|
+
*
|
|
1496
|
+
* This is the only public way to construct a `TronChain` — the constructor is private.
|
|
1497
|
+
*
|
|
1498
|
+
* @param params - Tron chain configuration
|
|
1499
|
+
* @returns A `TronChain` instance
|
|
1500
|
+
*/
|
|
1501
|
+
static fromParams(params: TronChainParams): Promise<TronChain>;
|
|
1502
|
+
private constructor();
|
|
1488
1503
|
/** Underlying viem public client (delegated from the internal EvmChain) */
|
|
1489
1504
|
get client(): PublicClient;
|
|
1490
1505
|
/** Host contract address for this chain (delegated from the internal EvmChain) */
|
|
@@ -1693,21 +1708,6 @@ interface IEvmChain extends IChain {
|
|
|
1693
1708
|
broadcastTransaction(signedTransaction: HexString): Promise<TransactionReceipt>;
|
|
1694
1709
|
getTransactionReceipt(hash: HexString): Promise<TransactionReceipt>;
|
|
1695
1710
|
}
|
|
1696
|
-
/**
|
|
1697
|
-
* Returns the chain interface for a given state machine identifier.
|
|
1698
|
-
*
|
|
1699
|
-
* - For standard EVM chains, returns an `EvmChain`.
|
|
1700
|
-
* - For Substrate chains, returns a connected `SubstrateChain`.
|
|
1701
|
-
* - For Tron chains (identified by chain ID), constructs a `TronChain`
|
|
1702
|
-
* that delegates EVM behavior to an internal `EvmChain` and manages
|
|
1703
|
-
* its own TronWeb instance using the provided RPC URL.
|
|
1704
|
-
*
|
|
1705
|
-
* @param chainConfig - Chain configuration
|
|
1706
|
-
* @returns Chain interface
|
|
1707
|
-
*/
|
|
1708
|
-
declare function getChain(chainConfig: IEvmConfig | ISubstrateConfig): Promise<IChain>;
|
|
1709
|
-
declare function getEvmChain(chainConfig: IEvmConfig): IChain;
|
|
1710
|
-
declare function getSubstrateChain(chainConfig: ISubstrateConfig): Promise<SubstrateChain>;
|
|
1711
1711
|
|
|
1712
1712
|
type EstimateGasCallData = ContractFunctionArgs<typeof _default.ABI, "nonpayable" | "payable", "handlePostRequests">;
|
|
1713
1713
|
type HexString = `0x${string}`;
|
|
@@ -2155,87 +2155,7 @@ interface TokenInfo {
|
|
|
2155
2155
|
*/
|
|
2156
2156
|
amount: bigint;
|
|
2157
2157
|
}
|
|
2158
|
-
/**
|
|
2159
|
-
* Represents payment information for an order
|
|
2160
|
-
*/
|
|
2161
|
-
interface PaymentInfo extends TokenInfo {
|
|
2162
|
-
/**
|
|
2163
|
-
* The address to receive the output tokens
|
|
2164
|
-
*/
|
|
2165
|
-
beneficiary: HexString;
|
|
2166
|
-
}
|
|
2167
|
-
/**
|
|
2168
|
-
* Represents an order in the IntentGateway
|
|
2169
|
-
*/
|
|
2170
|
-
interface Order {
|
|
2171
|
-
/**
|
|
2172
|
-
* The unique identifier for the order
|
|
2173
|
-
*/
|
|
2174
|
-
id?: string;
|
|
2175
|
-
/**
|
|
2176
|
-
* The address of the user who is initiating the transfer
|
|
2177
|
-
*/
|
|
2178
|
-
user: HexString;
|
|
2179
|
-
/**
|
|
2180
|
-
* The state machine identifier of the origin chain
|
|
2181
|
-
*/
|
|
2182
|
-
sourceChain: string;
|
|
2183
|
-
/**
|
|
2184
|
-
* The state machine identifier of the destination chain
|
|
2185
|
-
*/
|
|
2186
|
-
destChain: string;
|
|
2187
|
-
/**
|
|
2188
|
-
* The block number by which the order must be filled on the destination chain
|
|
2189
|
-
*/
|
|
2190
|
-
deadline: bigint;
|
|
2191
|
-
/**
|
|
2192
|
-
* The nonce of the order
|
|
2193
|
-
*/
|
|
2194
|
-
nonce: bigint;
|
|
2195
|
-
/**
|
|
2196
|
-
* Represents the dispatch fees associated with the IntentGateway
|
|
2197
|
-
*/
|
|
2198
|
-
fees: bigint;
|
|
2199
|
-
/**
|
|
2200
|
-
* The tokens that the filler will provide
|
|
2201
|
-
*/
|
|
2202
|
-
outputs: PaymentInfo[];
|
|
2203
|
-
/**
|
|
2204
|
-
* The tokens that are escrowed for the filler
|
|
2205
|
-
*/
|
|
2206
|
-
inputs: TokenInfo[];
|
|
2207
|
-
/**
|
|
2208
|
-
* A bytes array to store the calls if any
|
|
2209
|
-
*/
|
|
2210
|
-
callData: HexString;
|
|
2211
|
-
/**
|
|
2212
|
-
* The transaction hash of the order
|
|
2213
|
-
*/
|
|
2214
|
-
transactionHash?: HexString;
|
|
2215
|
-
}
|
|
2216
2158
|
interface DecodedOrderPlacedLog extends Log {
|
|
2217
|
-
eventName: string;
|
|
2218
|
-
args: {
|
|
2219
|
-
user: HexString;
|
|
2220
|
-
sourceChain: Hex;
|
|
2221
|
-
destChain: Hex;
|
|
2222
|
-
deadline: bigint;
|
|
2223
|
-
nonce: bigint;
|
|
2224
|
-
fees: bigint;
|
|
2225
|
-
outputs: Array<{
|
|
2226
|
-
token: HexString;
|
|
2227
|
-
amount: bigint;
|
|
2228
|
-
beneficiary: HexString;
|
|
2229
|
-
}>;
|
|
2230
|
-
inputs: Array<{
|
|
2231
|
-
token: HexString;
|
|
2232
|
-
amount: bigint;
|
|
2233
|
-
}>;
|
|
2234
|
-
callData: HexString;
|
|
2235
|
-
};
|
|
2236
|
-
transactionHash: HexString;
|
|
2237
|
-
}
|
|
2238
|
-
interface DecodedOrderV2PlacedLog extends Log {
|
|
2239
2159
|
eventName: string;
|
|
2240
2160
|
args: {
|
|
2241
2161
|
user: HexString;
|
|
@@ -2291,15 +2211,6 @@ interface DecodedPostResponseEvent extends Log {
|
|
|
2291
2211
|
};
|
|
2292
2212
|
transactionHash: HexString;
|
|
2293
2213
|
}
|
|
2294
|
-
/**
|
|
2295
|
-
* Options for filling an order
|
|
2296
|
-
*/
|
|
2297
|
-
interface FillOptions {
|
|
2298
|
-
/**
|
|
2299
|
-
* The fee paid to the relayer for processing transactions
|
|
2300
|
-
*/
|
|
2301
|
-
relayerFee: bigint;
|
|
2302
|
-
}
|
|
2303
2214
|
/**
|
|
2304
2215
|
* Options for canceling an order
|
|
2305
2216
|
*/
|
|
@@ -2756,20 +2667,16 @@ interface StorageFacade {
|
|
|
2756
2667
|
set<T>(key: string, value: T): Promise<void>;
|
|
2757
2668
|
delete(key: string): Promise<void>;
|
|
2758
2669
|
}
|
|
2759
|
-
interface
|
|
2760
|
-
token: HexString;
|
|
2761
|
-
amount: bigint;
|
|
2762
|
-
}
|
|
2763
|
-
interface PaymentInfoV2 {
|
|
2670
|
+
interface PaymentInfo {
|
|
2764
2671
|
beneficiary: HexString;
|
|
2765
|
-
assets:
|
|
2672
|
+
assets: TokenInfo[];
|
|
2766
2673
|
call: HexString;
|
|
2767
2674
|
}
|
|
2768
|
-
interface
|
|
2769
|
-
assets:
|
|
2675
|
+
interface DispatchInfo {
|
|
2676
|
+
assets: TokenInfo[];
|
|
2770
2677
|
call: HexString;
|
|
2771
2678
|
}
|
|
2772
|
-
interface
|
|
2679
|
+
interface Order {
|
|
2773
2680
|
id?: string;
|
|
2774
2681
|
user: HexString;
|
|
2775
2682
|
source: HexString;
|
|
@@ -2778,15 +2685,14 @@ interface OrderV2 {
|
|
|
2778
2685
|
nonce: bigint;
|
|
2779
2686
|
fees: bigint;
|
|
2780
2687
|
session: HexString;
|
|
2781
|
-
predispatch:
|
|
2782
|
-
inputs:
|
|
2783
|
-
output:
|
|
2784
|
-
transactionHash?: HexString;
|
|
2688
|
+
predispatch: DispatchInfo;
|
|
2689
|
+
inputs: TokenInfo[];
|
|
2690
|
+
output: PaymentInfo;
|
|
2785
2691
|
}
|
|
2786
|
-
interface
|
|
2692
|
+
interface FillOptions {
|
|
2787
2693
|
relayerFee: bigint;
|
|
2788
2694
|
nativeDispatchFee: bigint;
|
|
2789
|
-
outputs:
|
|
2695
|
+
outputs: TokenInfo[];
|
|
2790
2696
|
}
|
|
2791
2697
|
interface PackedUserOperation {
|
|
2792
2698
|
sender: HexString;
|
|
@@ -2800,8 +2706,8 @@ interface PackedUserOperation {
|
|
|
2800
2706
|
signature: HexString;
|
|
2801
2707
|
}
|
|
2802
2708
|
interface SubmitBidOptions {
|
|
2803
|
-
order:
|
|
2804
|
-
fillOptions:
|
|
2709
|
+
order: Order;
|
|
2710
|
+
fillOptions: FillOptions;
|
|
2805
2711
|
solverAccount: HexString;
|
|
2806
2712
|
solverPrivateKey: HexString;
|
|
2807
2713
|
nonce: bigint;
|
|
@@ -2814,8 +2720,8 @@ interface SubmitBidOptions {
|
|
|
2814
2720
|
/** Pre-built ERC-7821 calldata encoding the UserOp execution (approvals + fillOrder). */
|
|
2815
2721
|
callData: HexString;
|
|
2816
2722
|
}
|
|
2817
|
-
interface
|
|
2818
|
-
order:
|
|
2723
|
+
interface EstimateFillOrderParams {
|
|
2724
|
+
order: Order;
|
|
2819
2725
|
/**
|
|
2820
2726
|
* Optional percentage to bump maxPriorityFeePerGas.
|
|
2821
2727
|
* This is added on top of the base gasPrice.
|
|
@@ -2829,8 +2735,8 @@ interface EstimateFillOrderV2Params {
|
|
|
2829
2735
|
*/
|
|
2830
2736
|
maxFeePerGasBumpPercent?: number;
|
|
2831
2737
|
}
|
|
2832
|
-
interface
|
|
2833
|
-
fillOptions:
|
|
2738
|
+
interface FillOrderEstimate {
|
|
2739
|
+
fillOptions: FillOptions;
|
|
2834
2740
|
callGasLimit: bigint;
|
|
2835
2741
|
verificationGasLimit: bigint;
|
|
2836
2742
|
preVerificationGas: bigint;
|
|
@@ -2920,13 +2826,13 @@ type IntentOrderStatusUpdate = {
|
|
|
2920
2826
|
sessionPrivateKey: HexString;
|
|
2921
2827
|
} | {
|
|
2922
2828
|
status: "ORDER_PLACED";
|
|
2923
|
-
order:
|
|
2924
|
-
|
|
2829
|
+
order: Order;
|
|
2830
|
+
receipt: TransactionReceipt;
|
|
2925
2831
|
} | {
|
|
2926
2832
|
status: "AWAITING_BIDS";
|
|
2927
2833
|
commitment: HexString;
|
|
2928
|
-
|
|
2929
|
-
|
|
2834
|
+
totalFilledAssets: TokenInfo[];
|
|
2835
|
+
remainingAssets: TokenInfo[];
|
|
2930
2836
|
} | {
|
|
2931
2837
|
status: "BIDS_RECEIVED";
|
|
2932
2838
|
commitment: HexString;
|
|
@@ -2950,28 +2856,28 @@ type IntentOrderStatusUpdate = {
|
|
|
2950
2856
|
userOpHash: HexString;
|
|
2951
2857
|
selectedSolver: HexString;
|
|
2952
2858
|
transactionHash?: HexString;
|
|
2953
|
-
|
|
2954
|
-
|
|
2859
|
+
totalFilledAssets: TokenInfo[];
|
|
2860
|
+
remainingAssets: TokenInfo[];
|
|
2955
2861
|
} | {
|
|
2956
2862
|
status: "PARTIAL_FILL";
|
|
2957
2863
|
commitment: HexString;
|
|
2958
2864
|
userOpHash: HexString;
|
|
2959
2865
|
selectedSolver: HexString;
|
|
2960
2866
|
transactionHash?: HexString;
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2867
|
+
filledAssets: TokenInfo[];
|
|
2868
|
+
totalFilledAssets: TokenInfo[];
|
|
2869
|
+
remainingAssets: TokenInfo[];
|
|
2964
2870
|
} | {
|
|
2965
2871
|
status: "PARTIAL_FILL_EXHAUSTED";
|
|
2966
2872
|
commitment: HexString;
|
|
2967
|
-
|
|
2968
|
-
|
|
2873
|
+
totalFilledAssets?: TokenInfo[];
|
|
2874
|
+
remainingAssets?: TokenInfo[];
|
|
2969
2875
|
error: string;
|
|
2970
2876
|
} | {
|
|
2971
2877
|
status: "FAILED";
|
|
2972
2878
|
commitment?: HexString;
|
|
2973
|
-
|
|
2974
|
-
|
|
2879
|
+
totalFilledAssets?: TokenInfo[];
|
|
2880
|
+
remainingAssets?: TokenInfo[];
|
|
2975
2881
|
error: string;
|
|
2976
2882
|
};
|
|
2977
2883
|
/** Result of selecting a bid and submitting to the bundler */
|
|
@@ -2982,16 +2888,26 @@ interface SelectBidResult {
|
|
|
2982
2888
|
commitment: HexString;
|
|
2983
2889
|
txnHash?: HexString;
|
|
2984
2890
|
fillStatus?: "full" | "partial";
|
|
2985
|
-
/**
|
|
2986
|
-
|
|
2891
|
+
/** Assets filled in this user operation (best-effort, based on on-chain PartialFill logs) */
|
|
2892
|
+
filledAssets?: TokenInfo[];
|
|
2987
2893
|
}
|
|
2988
2894
|
/** Options for executing an intent order */
|
|
2989
2895
|
interface ExecuteIntentOrderOptions {
|
|
2990
|
-
order:
|
|
2896
|
+
order: Order;
|
|
2991
2897
|
sessionPrivateKey?: HexString;
|
|
2992
2898
|
minBids?: number;
|
|
2993
2899
|
bidTimeoutMs?: number;
|
|
2994
2900
|
pollIntervalMs?: number;
|
|
2901
|
+
/**
|
|
2902
|
+
* If set, bids are restricted to the given solver until `timeoutMs` elapses,
|
|
2903
|
+
* after which any solver is accepted.
|
|
2904
|
+
*/
|
|
2905
|
+
solver?: {
|
|
2906
|
+
/** Only bids from this address (matched against userOp.sender) will be considered */
|
|
2907
|
+
address: HexString;
|
|
2908
|
+
/** After this many ms without a matching bid, execution falls back to any solver */
|
|
2909
|
+
timeoutMs: number;
|
|
2910
|
+
};
|
|
2995
2911
|
}
|
|
2996
2912
|
/** Type for ERC-7821 Call struct */
|
|
2997
2913
|
type ERC7821Call = {
|
|
@@ -3000,29 +2916,6 @@ type ERC7821Call = {
|
|
|
3000
2916
|
data: `0x${string}`;
|
|
3001
2917
|
};
|
|
3002
2918
|
|
|
3003
|
-
/**
|
|
3004
|
-
* Helper function to create chain configuration from legacy config format
|
|
3005
|
-
* This helps migrate from the old config format to the new IChain-based format
|
|
3006
|
-
*
|
|
3007
|
-
* @param config - Legacy configuration object (IEvmConfig, ISubstrateConfig, or IHyperbridgeConfig)
|
|
3008
|
-
* @returns Promise resolving to chain configuration with IChain instance
|
|
3009
|
-
*/
|
|
3010
|
-
declare function createChain(config: IEvmConfig | ISubstrateConfig | IHyperbridgeConfig): Promise<IChain>;
|
|
3011
|
-
/**
|
|
3012
|
-
* Helper function to create IndexerClient with legacy config format
|
|
3013
|
-
* @deprecated Use the constructor with IChain instances directly for better performance
|
|
3014
|
-
*
|
|
3015
|
-
* @param config - Legacy configuration with IEvmConfig/ISubstrateConfig/IHyperbridgeConfig
|
|
3016
|
-
* @returns Promise resolving to IndexerClient instance
|
|
3017
|
-
*/
|
|
3018
|
-
declare function createIndexerClient(config: {
|
|
3019
|
-
pollInterval?: number;
|
|
3020
|
-
queryClient: IndexerQueryClient;
|
|
3021
|
-
tracing?: boolean;
|
|
3022
|
-
source: IEvmConfig | ISubstrateConfig;
|
|
3023
|
-
dest: IEvmConfig | ISubstrateConfig;
|
|
3024
|
-
hyperbridge: IHyperbridgeConfig;
|
|
3025
|
-
}): Promise<IndexerClient>;
|
|
3026
2919
|
/**
|
|
3027
2920
|
* IndexerClient provides methods for interacting with the Hyperbridge indexer.
|
|
3028
2921
|
*
|
|
@@ -3045,14 +2938,13 @@ declare function createIndexerClient(config: {
|
|
|
3045
2938
|
*
|
|
3046
2939
|
* @example
|
|
3047
2940
|
* ```typescript
|
|
3048
|
-
*
|
|
3049
|
-
* const sourceChain = new EvmChain({
|
|
2941
|
+
* const sourceChain = EvmChain.fromParams({
|
|
3050
2942
|
* chainId: 1,
|
|
3051
2943
|
* rpcUrl: "https://eth-rpc.com",
|
|
3052
2944
|
* host: "0x87ea45..",
|
|
3053
2945
|
* consensusStateId: "ETH0"
|
|
3054
2946
|
* })
|
|
3055
|
-
* const destChain =
|
|
2947
|
+
* const destChain = EvmChain.fromParams({
|
|
3056
2948
|
* chainId: 42161,
|
|
3057
2949
|
* rpcUrl: "https://arb-rpc.com",
|
|
3058
2950
|
* host: "0x87ea42345..",
|
|
@@ -3073,29 +2965,6 @@ declare function createIndexerClient(config: {
|
|
|
3073
2965
|
* hyperbridge: hyperbridgeChain
|
|
3074
2966
|
* });
|
|
3075
2967
|
*
|
|
3076
|
-
* // Legacy approach: Use the helper function (deprecated)
|
|
3077
|
-
* const client = await createIndexerClient({
|
|
3078
|
-
* queryClient: queryClient,
|
|
3079
|
-
* pollInterval: 2000,
|
|
3080
|
-
* source: {
|
|
3081
|
-
* stateMachineId: "EVM-1",
|
|
3082
|
-
* consensusStateId: "ETH0",
|
|
3083
|
-
* rpcUrl: "https://eth-rpc.com",
|
|
3084
|
-
* host: "0x87ea45.."
|
|
3085
|
-
* },
|
|
3086
|
-
* dest: {
|
|
3087
|
-
* stateMachineId: "EVM-42161",
|
|
3088
|
-
* consensusStateId: "ETH0",
|
|
3089
|
-
* rpcUrl: "https://arb-rpc.com",
|
|
3090
|
-
* host: "0x87ea42345.."
|
|
3091
|
-
* },
|
|
3092
|
-
* hyperbridge: {
|
|
3093
|
-
* stateMachineId: "POLKADOT-3367",
|
|
3094
|
-
* consensusStateId: "DOT0",
|
|
3095
|
-
* wsUrl: "ws://localhost:9944"
|
|
3096
|
-
* }
|
|
3097
|
-
* });
|
|
3098
|
-
*
|
|
3099
2968
|
* // Query a request status
|
|
3100
2969
|
* const status = await client.queryRequestWithStatus("0x1234...");
|
|
3101
2970
|
*
|
|
@@ -3842,10 +3711,10 @@ interface BundlerGasEstimate {
|
|
|
3842
3711
|
*
|
|
3843
3712
|
* - `DESTINATION_FINALIZED` – a state proof from the destination chain is ready.
|
|
3844
3713
|
* - `AWAITING_CANCEL_TRANSACTION` – the caller must sign and submit the cancel tx.
|
|
3714
|
+
* - `CANCEL_STARTED` – the cancel transaction was confirmed on-chain.
|
|
3845
3715
|
* - `SOURCE_FINALIZED` – the cancel request has been finalised on the source chain.
|
|
3846
3716
|
* - `HYPERBRIDGE_DELIVERED` – the cancel message has been delivered to Hyperbridge.
|
|
3847
3717
|
* - `HYPERBRIDGE_FINALIZED` – the cancel message has been finalised on Hyperbridge.
|
|
3848
|
-
* - `SOURCE_PROOF_RECEIVED` – a proof of the source-chain state has been received.
|
|
3849
3718
|
* - `CANCELLATION_COMPLETE` – the escrow has been refunded; cancellation is done.
|
|
3850
3719
|
*/
|
|
3851
3720
|
type CancelEvent = {
|
|
@@ -3874,9 +3743,6 @@ type CancelEvent = {
|
|
|
3874
3743
|
metadata: Extract<RequestStatusWithMetadata, {
|
|
3875
3744
|
status: "HYPERBRIDGE_FINALIZED";
|
|
3876
3745
|
}>["metadata"];
|
|
3877
|
-
} | {
|
|
3878
|
-
status: "SOURCE_PROOF_RECEIVED";
|
|
3879
|
-
proof: IProof;
|
|
3880
3746
|
} | {
|
|
3881
3747
|
status: "CANCELLATION_COMPLETE";
|
|
3882
3748
|
blockNumber: number;
|
|
@@ -4031,12 +3897,16 @@ declare class IntentGateway {
|
|
|
4031
3897
|
* @throws If the `placeOrder` generator behaves unexpectedly, or if gas
|
|
4032
3898
|
* estimation returns zero.
|
|
4033
3899
|
*/
|
|
4034
|
-
execute(order:
|
|
3900
|
+
execute(order: Order, graffiti?: HexString, options?: {
|
|
4035
3901
|
maxPriorityFeePerGasBumpPercent?: number;
|
|
4036
3902
|
maxFeePerGasBumpPercent?: number;
|
|
4037
3903
|
minBids?: number;
|
|
4038
3904
|
bidTimeoutMs?: number;
|
|
4039
3905
|
pollIntervalMs?: number;
|
|
3906
|
+
solver?: {
|
|
3907
|
+
address: HexString;
|
|
3908
|
+
timeoutMs: number;
|
|
3909
|
+
};
|
|
4040
3910
|
}): AsyncGenerator<IntentOrderStatusUpdate, void, HexString>;
|
|
4041
3911
|
/**
|
|
4042
3912
|
* Quotes the native token cost for cancelling an order.
|
|
@@ -4048,7 +3918,7 @@ declare class IntentGateway {
|
|
|
4048
3918
|
* Defaults to `false` (source-side cancellation).
|
|
4049
3919
|
* @returns The native token amount required to submit the cancel transaction.
|
|
4050
3920
|
*/
|
|
4051
|
-
quoteCancelNative(order:
|
|
3921
|
+
quoteCancelNative(order: Order, fromDest?: boolean): Promise<bigint>;
|
|
4052
3922
|
/**
|
|
4053
3923
|
* Async generator that cancels an order and streams status events until
|
|
4054
3924
|
* cancellation is complete.
|
|
@@ -4061,7 +3931,7 @@ declare class IntentGateway {
|
|
|
4061
3931
|
* Defaults to `false` (source-side cancellation).
|
|
4062
3932
|
* @yields {@link CancelEvent} objects describing each cancellation stage.
|
|
4063
3933
|
*/
|
|
4064
|
-
cancelOrder(order:
|
|
3934
|
+
cancelOrder(order: Order, indexerClient: IndexerClient, fromDest?: boolean): AsyncGenerator<CancelEvent>;
|
|
4065
3935
|
/**
|
|
4066
3936
|
* Constructs a signed `PackedUserOperation` for a solver to submit as a bid.
|
|
4067
3937
|
*
|
|
@@ -4085,18 +3955,18 @@ declare class IntentGateway {
|
|
|
4085
3955
|
* @returns A {@link SelectBidResult} with the submitted UserOperation, hashes,
|
|
4086
3956
|
* and fill status.
|
|
4087
3957
|
*/
|
|
4088
|
-
selectBid(order:
|
|
3958
|
+
selectBid(order: Order, bids: FillerBid[], sessionPrivateKey?: HexString): Promise<SelectBidResult>;
|
|
4089
3959
|
/**
|
|
4090
3960
|
* Estimates the gas cost for filling the given order, returning individual
|
|
4091
3961
|
* gas components and fee-token-denominated totals.
|
|
4092
3962
|
*
|
|
4093
|
-
* Delegates to {@link GasEstimator.
|
|
3963
|
+
* Delegates to {@link GasEstimator.estimateFillOrder}.
|
|
4094
3964
|
*
|
|
4095
3965
|
* @param params - Estimation parameters including the order and optional
|
|
4096
3966
|
* gas-price bump percentages.
|
|
4097
|
-
* @returns A {@link
|
|
3967
|
+
* @returns A {@link FillOrderEstimate} with all gas components.
|
|
4098
3968
|
*/
|
|
4099
|
-
|
|
3969
|
+
estimateFillOrder(params: EstimateFillOrderParams): Promise<FillOrderEstimate>;
|
|
4100
3970
|
/**
|
|
4101
3971
|
* Encodes a list of calls into ERC-7821 `execute` calldata using
|
|
4102
3972
|
* single-batch mode.
|
|
@@ -4125,7 +3995,7 @@ declare class IntentGateway {
|
|
|
4125
3995
|
* @returns `true` if the order's commitment slot on the destination chain is
|
|
4126
3996
|
* non-zero (i.e. `fillOrder` has been called successfully).
|
|
4127
3997
|
*/
|
|
4128
|
-
isOrderFilled(order:
|
|
3998
|
+
isOrderFilled(order: Order): Promise<boolean>;
|
|
4129
3999
|
/**
|
|
4130
4000
|
* Checks whether all escrowed inputs for an order have been refunded on the
|
|
4131
4001
|
* source chain.
|
|
@@ -4136,7 +4006,7 @@ declare class IntentGateway {
|
|
|
4136
4006
|
* @returns `true` if every input token's escrowed amount has been zeroed out
|
|
4137
4007
|
* in the `_orders` mapping on the source chain.
|
|
4138
4008
|
*/
|
|
4139
|
-
isOrderRefunded(order:
|
|
4009
|
+
isOrderRefunded(order: Order): Promise<boolean>;
|
|
4140
4010
|
}
|
|
4141
4011
|
|
|
4142
4012
|
/**
|
|
@@ -4162,7 +4032,7 @@ declare class OrderStatusChecker {
|
|
|
4162
4032
|
* @param order - The V2 order to check. `order.id` is used as the commitment; if not set it is computed.
|
|
4163
4033
|
* @returns True if the order has been filled on the destination chain, false otherwise.
|
|
4164
4034
|
*/
|
|
4165
|
-
isOrderFilled(order:
|
|
4035
|
+
isOrderFilled(order: Order): Promise<boolean>;
|
|
4166
4036
|
/**
|
|
4167
4037
|
* Checks if a V2 order has been refunded by reading the `_orders` mapping on the source chain.
|
|
4168
4038
|
*
|
|
@@ -4173,7 +4043,7 @@ declare class OrderStatusChecker {
|
|
|
4173
4043
|
* @param order - The V2 order to check. `order.id` is used as the commitment; if not set it is computed.
|
|
4174
4044
|
* @returns True if all escrowed inputs have been returned to the user on the source chain, false otherwise.
|
|
4175
4045
|
*/
|
|
4176
|
-
isOrderRefunded(order:
|
|
4046
|
+
isOrderRefunded(order: Order): Promise<boolean>;
|
|
4177
4047
|
}
|
|
4178
4048
|
|
|
4179
4049
|
/**
|
|
@@ -4208,10 +4078,10 @@ declare function encodeERC7821ExecuteBatch(calls: ERC7821Call[]): HexString;
|
|
|
4208
4078
|
*/
|
|
4209
4079
|
declare function fetchSourceProof(commitment: HexString, source: IEvmChain, sourceStateMachine: string, sourceConsensusStateId: string, sourceHeight: bigint): Promise<IProof>;
|
|
4210
4080
|
/**
|
|
4211
|
-
* Strips SDK-only fields from an {@link
|
|
4081
|
+
* Strips SDK-only fields from an {@link Order} and normalises all fields to
|
|
4212
4082
|
* the encoding the IntentGatewayV2 contract ABI expects:
|
|
4213
4083
|
*
|
|
4214
|
-
* - `id`
|
|
4084
|
+
* - `id` is removed (not part of the on-chain struct).
|
|
4215
4085
|
* - `source` and `destination` are hex-encoded if currently plain string
|
|
4216
4086
|
* state-machine IDs.
|
|
4217
4087
|
* - `inputs[i].token`, `output.beneficiary`, `output.assets[i].token`, and
|
|
@@ -4221,9 +4091,20 @@ declare function fetchSourceProof(commitment: HexString, source: IEvmChain, sour
|
|
|
4221
4091
|
* these fields back to `address`. Values already at 32 bytes are unchanged.
|
|
4222
4092
|
*
|
|
4223
4093
|
* @param order - The SDK-level order to transform.
|
|
4224
|
-
* @returns A contract-compatible order struct without `id
|
|
4094
|
+
* @returns A contract-compatible order struct without `id`.
|
|
4095
|
+
*/
|
|
4096
|
+
declare function transformOrderForContract(order: Order): Omit<Order, "id">;
|
|
4097
|
+
/**
|
|
4098
|
+
* Calculates the commitment hash for an order by ABI-encoding the
|
|
4099
|
+
* contract-normalised form of the order and hashing it.
|
|
4100
|
+
*
|
|
4101
|
+
* Calls `transformOrderForContract` before encoding to ensure all address
|
|
4102
|
+
* fields are padded to 32 bytes and SDK-only fields are stripped.
|
|
4103
|
+
*
|
|
4104
|
+
* @param order - The SDK-level order to hash.
|
|
4105
|
+
* @returns The keccak256 commitment hash.
|
|
4225
4106
|
*/
|
|
4226
|
-
declare function
|
|
4107
|
+
declare function orderCommitment(order: Order): HexString;
|
|
4227
4108
|
|
|
4228
4109
|
/**
|
|
4229
4110
|
* EIP-712 type hash for the `SelectSolver` struct.
|
|
@@ -8148,4 +8029,4 @@ declare const getChainId: (stateMachineId: string) => number | undefined;
|
|
|
8148
8029
|
declare const getViemChain: (chainId: number) => Chain | undefined;
|
|
8149
8030
|
declare const hyperbridgeAddress = "";
|
|
8150
8031
|
|
|
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
|
|
8032
|
+
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 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 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 OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, type PackedUserOperation, type Params, type PaymentInfo, 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 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, polkadotAssetHubPaseo, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, requestCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|