@hyperbridge/sdk 1.3.5 → 1.3.7
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 +25 -24
- package/dist/browser/index.js +231 -149
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.d.ts +25 -24
- package/dist/node/index.js +231 -149
- package/dist/node/index.js.map +1 -1
- package/package.json +3 -2
package/dist/browser/index.d.ts
CHANGED
|
@@ -989,9 +989,7 @@ interface AssetTeleported {
|
|
|
989
989
|
blockNumber: number;
|
|
990
990
|
}
|
|
991
991
|
interface AssetTeleportedResponse {
|
|
992
|
-
|
|
993
|
-
nodes: AssetTeleported[];
|
|
994
|
-
};
|
|
992
|
+
assetTeleported: AssetTeleported;
|
|
995
993
|
}
|
|
996
994
|
interface StateMachineIdParams {
|
|
997
995
|
stateId: {
|
|
@@ -2024,7 +2022,7 @@ declare function encodeISMPMessage(message: IIsmpMessage): Uint8Array;
|
|
|
2024
2022
|
/**
|
|
2025
2023
|
* Type representing an ISMP message.
|
|
2026
2024
|
*/
|
|
2027
|
-
type IIsmpMessage = IRequestMessage | ITimeoutPostRequestMessage | IGetResponseMessage;
|
|
2025
|
+
type IIsmpMessage = IRequestMessage | ITimeoutPostRequestMessage | IGetResponseMessage | IGetRequestMessage;
|
|
2028
2026
|
interface IRequestMessage {
|
|
2029
2027
|
/**
|
|
2030
2028
|
* The kind of message.
|
|
@@ -2053,9 +2051,13 @@ interface IGetRequestMessage {
|
|
|
2053
2051
|
*/
|
|
2054
2052
|
requests: IGetRequest[];
|
|
2055
2053
|
/**
|
|
2056
|
-
* The proof of the requests.
|
|
2054
|
+
* The proof of the requests from the source chain.
|
|
2057
2055
|
*/
|
|
2058
|
-
|
|
2056
|
+
source: IProof;
|
|
2057
|
+
/**
|
|
2058
|
+
* The proof of the response from the target chain
|
|
2059
|
+
*/
|
|
2060
|
+
response: IProof;
|
|
2059
2061
|
/**
|
|
2060
2062
|
* The signer of the message.
|
|
2061
2063
|
*/
|
|
@@ -2441,14 +2443,6 @@ declare class IndexerClient {
|
|
|
2441
2443
|
* @returns AsyncGenerator that emits status updates until a terminal state is reached
|
|
2442
2444
|
*/
|
|
2443
2445
|
postRequestTimeoutStreamInternal(hash: HexString, signal: AbortSignal): AsyncGenerator<PostRequestTimeoutStatus, void>;
|
|
2444
|
-
/**
|
|
2445
|
-
* Query for asset teleported events by sender, recipient, and destination chain
|
|
2446
|
-
* @param from - The sender address
|
|
2447
|
-
* @param to - The recipient address
|
|
2448
|
-
* @param dest - The destination chain ID
|
|
2449
|
-
* @returns The asset teleported event if found, undefined otherwise
|
|
2450
|
-
*/
|
|
2451
|
-
queryAssetTeleported(from: string, to: string, dest: string, blockNumber: number): Promise<AssetTeleported | undefined>;
|
|
2452
2446
|
/**
|
|
2453
2447
|
* Executes an async operation with exponential backoff retry
|
|
2454
2448
|
* @param operation - Async function to execute
|
|
@@ -2593,8 +2587,7 @@ declare class IntentGateway {
|
|
|
2593
2587
|
* Uses USD pricing to convert between fee token amounts and native token costs.
|
|
2594
2588
|
*
|
|
2595
2589
|
* @param feeTokenAmount - The amount in fee token (DAI)
|
|
2596
|
-
* @param
|
|
2597
|
-
* @param feeTokenDecimals - The decimal places of the fee token
|
|
2590
|
+
* @param getQuoteIn - Whether to use "source" or "dest" chain for the conversion
|
|
2598
2591
|
* @returns The fee token amount converted to native token amount
|
|
2599
2592
|
* @private
|
|
2600
2593
|
*/
|
|
@@ -2604,18 +2597,24 @@ declare class IntentGateway {
|
|
|
2604
2597
|
* Uses USD pricing to convert between native token gas costs and fee token amounts.
|
|
2605
2598
|
*
|
|
2606
2599
|
* @param gasEstimate - The estimated gas units
|
|
2607
|
-
* @param
|
|
2608
|
-
* @param targetDecimals - The decimal places of the target fee token
|
|
2600
|
+
* @param gasEstimateIn - Whether to use "source" or "dest" chain for the conversion
|
|
2609
2601
|
* @returns The gas cost converted to fee token amount
|
|
2610
2602
|
* @private
|
|
2611
2603
|
*/
|
|
2612
2604
|
private convertGasToFeeToken;
|
|
2605
|
+
/**
|
|
2606
|
+
* Gets a quote for the native token cost of dispatching a post request.
|
|
2607
|
+
*
|
|
2608
|
+
* @param postRequest - The post request to quote
|
|
2609
|
+
* @param fee - The fee amount in fee token
|
|
2610
|
+
* @returns The native token amount required
|
|
2611
|
+
*/
|
|
2613
2612
|
quoteNative(postRequest: IPostRequest, fee: bigint): Promise<bigint>;
|
|
2614
2613
|
/**
|
|
2615
2614
|
* Finds the best Uniswap protocol (V2, V3, or V4) for swapping tokens given a desired output amount.
|
|
2616
2615
|
* Compares liquidity and pricing across different protocols and fee tiers.
|
|
2617
2616
|
*
|
|
2618
|
-
* @param
|
|
2617
|
+
* @param getQuoteIn - Whether to use "source" or "dest" chain for the swap
|
|
2619
2618
|
* @param tokenIn - The address of the input token
|
|
2620
2619
|
* @param tokenOut - The address of the output token
|
|
2621
2620
|
* @param amountOut - The desired output amount
|
|
@@ -2630,10 +2629,11 @@ declare class IntentGateway {
|
|
|
2630
2629
|
* Finds the best Uniswap protocol (V2, V3, or V4) for swapping tokens given an input amount.
|
|
2631
2630
|
* Compares liquidity and pricing across different protocols and fee tiers.
|
|
2632
2631
|
*
|
|
2633
|
-
* @param
|
|
2632
|
+
* @param getQuoteIn - Whether to use "source" or "dest" chain for the swap
|
|
2634
2633
|
* @param tokenIn - The address of the input token
|
|
2635
2634
|
* @param tokenOut - The address of the output token
|
|
2636
2635
|
* @param amountIn - The input amount to swap
|
|
2636
|
+
* @param selectedProtocol - Optional specific protocol to use ("v2", "v3", or "v4")
|
|
2637
2637
|
* @returns Object containing the best protocol, expected output amount, and fee tier (for V3/V4)
|
|
2638
2638
|
*/
|
|
2639
2639
|
findBestProtocolWithAmountIn(getQuoteIn: "source" | "dest", tokenIn: HexString, tokenOut: HexString, amountIn: bigint, selectedProtocol?: "v2" | "v3" | "v4"): Promise<{
|
|
@@ -2668,14 +2668,17 @@ declare class IntentGateway {
|
|
|
2668
2668
|
type HyperbridgeTxEvents = {
|
|
2669
2669
|
kind: "Ready";
|
|
2670
2670
|
transaction_hash: HexString;
|
|
2671
|
+
message_id?: HexString;
|
|
2671
2672
|
} | {
|
|
2672
2673
|
kind: "Dispatched";
|
|
2673
2674
|
transaction_hash: HexString;
|
|
2674
2675
|
block_number: bigint;
|
|
2676
|
+
message_id?: HexString;
|
|
2675
2677
|
commitment: HexString;
|
|
2676
2678
|
} | {
|
|
2677
2679
|
kind: "Finalized";
|
|
2678
2680
|
transaction_hash: HexString;
|
|
2681
|
+
message_id?: HexString;
|
|
2679
2682
|
block_number?: bigint;
|
|
2680
2683
|
commitment?: HexString;
|
|
2681
2684
|
} | {
|
|
@@ -2737,12 +2740,10 @@ type XcmGatewayParams = {
|
|
|
2737
2740
|
* @yields {HyperbridgeTxEvents} Stream of events indicating transaction status
|
|
2738
2741
|
*/
|
|
2739
2742
|
declare function teleportDot(param_: {
|
|
2740
|
-
|
|
2741
|
-
|
|
2743
|
+
sourceApi: ApiPromise;
|
|
2744
|
+
sourceIsAssetHub: boolean;
|
|
2742
2745
|
who: string;
|
|
2743
2746
|
xcmGatewayParams: XcmGatewayParams;
|
|
2744
|
-
indexerClient: IndexerClient;
|
|
2745
|
-
pollInterval?: number;
|
|
2746
2747
|
options: Partial<SignerOptions>;
|
|
2747
2748
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
2748
2749
|
|