@hyperbridge/sdk 1.3.10 → 1.3.12
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 +63 -18
- package/dist/browser/index.js +267 -135
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.d.ts +63 -18
- package/dist/node/index.js +267 -135
- package/dist/node/index.js.map +1 -1
- package/package.json +2 -2
package/dist/browser/index.d.ts
CHANGED
|
@@ -1919,6 +1919,7 @@ interface SubstrateChainParams {
|
|
|
1919
1919
|
declare class SubstrateChain implements IChain {
|
|
1920
1920
|
private readonly params;
|
|
1921
1921
|
api?: ApiPromise;
|
|
1922
|
+
private rpcClient;
|
|
1922
1923
|
constructor(params: SubstrateChainParams);
|
|
1923
1924
|
connect(): Promise<void>;
|
|
1924
1925
|
/**
|
|
@@ -2019,6 +2020,17 @@ declare class SubstrateChain implements IChain {
|
|
|
2019
2020
|
* @returns {IStateMachine} The corresponding enum value.
|
|
2020
2021
|
*/
|
|
2021
2022
|
declare function convertStateMachineIdToEnum(id: string): IStateMachine;
|
|
2023
|
+
/**
|
|
2024
|
+
* Converts a stateId object back to the state_id format used by the RPC.
|
|
2025
|
+
* @param stateId - The stateId object from StateMachineIdParams
|
|
2026
|
+
* @returns The string representation like "EVM-11155111" or "SUBSTRATE-cere"
|
|
2027
|
+
*/
|
|
2028
|
+
declare function convertStateIdToStateMachineId(stateId: {
|
|
2029
|
+
Evm?: number;
|
|
2030
|
+
Substrate?: HexString;
|
|
2031
|
+
Polkadot?: number;
|
|
2032
|
+
Kusama?: number;
|
|
2033
|
+
}): string;
|
|
2022
2034
|
declare function encodeISMPMessage(message: IIsmpMessage): Uint8Array;
|
|
2023
2035
|
|
|
2024
2036
|
/**
|
|
@@ -2575,9 +2587,6 @@ declare function queryGetRequest(params: {
|
|
|
2575
2587
|
declare class IntentGateway {
|
|
2576
2588
|
readonly source: EvmChain;
|
|
2577
2589
|
readonly dest: EvmChain;
|
|
2578
|
-
private destStateproofCache;
|
|
2579
|
-
getCachedProof(id: HexString): IProof | undefined;
|
|
2580
|
-
clearCachedProof(id: HexString): void;
|
|
2581
2590
|
/**
|
|
2582
2591
|
* Creates a new IntentGateway instance for cross-chain operations.
|
|
2583
2592
|
* @param source - The source EVM chain
|
|
@@ -2663,7 +2672,8 @@ declare class IntentGateway {
|
|
|
2663
2672
|
* @returns True if the order has been filled, false otherwise
|
|
2664
2673
|
*/
|
|
2665
2674
|
isOrderFilled(order: Order): Promise<boolean>;
|
|
2666
|
-
|
|
2675
|
+
submitAndConfirmReceipt(hyperbridge: SubstrateChain, commitment: HexString, message: IGetRequestMessage): Promise<void>;
|
|
2676
|
+
cancelOrder(order: Order, hyperbridgeConfig: IHyperbridgeConfig, indexerClient: IndexerClient, storedData?: StoredCancellationData): AsyncGenerator<{
|
|
2667
2677
|
status: RequestStatus["SOURCE"];
|
|
2668
2678
|
metadata: {
|
|
2669
2679
|
blockHash: string;
|
|
@@ -2747,31 +2757,39 @@ declare class IntentGateway {
|
|
|
2747
2757
|
} | {
|
|
2748
2758
|
status: string;
|
|
2749
2759
|
data: {
|
|
2750
|
-
|
|
2751
|
-
|
|
2752
|
-
|
|
2753
|
-
|
|
2760
|
+
proof: `0x${string}`;
|
|
2761
|
+
height: bigint;
|
|
2762
|
+
failedHeight?: undefined;
|
|
2763
|
+
error?: undefined;
|
|
2764
|
+
deadline?: undefined;
|
|
2754
2765
|
};
|
|
2755
2766
|
} | {
|
|
2756
2767
|
status: string;
|
|
2757
2768
|
data: {
|
|
2758
|
-
|
|
2759
|
-
currentHeight
|
|
2760
|
-
deadline
|
|
2769
|
+
lastFailedHeight?: bigint | undefined;
|
|
2770
|
+
currentHeight: bigint;
|
|
2771
|
+
deadline: bigint;
|
|
2761
2772
|
proof?: undefined;
|
|
2773
|
+
height?: undefined;
|
|
2774
|
+
failedHeight?: undefined;
|
|
2775
|
+
error?: undefined;
|
|
2762
2776
|
};
|
|
2763
2777
|
} | {
|
|
2764
2778
|
status: string;
|
|
2765
2779
|
data: {
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2780
|
+
failedHeight: bigint;
|
|
2781
|
+
error: string;
|
|
2782
|
+
deadline: bigint;
|
|
2783
|
+
proof?: undefined;
|
|
2784
|
+
height?: undefined;
|
|
2770
2785
|
};
|
|
2771
2786
|
} | {
|
|
2772
2787
|
status: string;
|
|
2773
2788
|
data?: undefined;
|
|
2774
|
-
}
|
|
2789
|
+
} | {
|
|
2790
|
+
status: string;
|
|
2791
|
+
data: IProof;
|
|
2792
|
+
}, void, IGetRequest>;
|
|
2775
2793
|
/**
|
|
2776
2794
|
* Returns the tick spacing for a given fee tier in Uniswap V4
|
|
2777
2795
|
* @param fee - The fee tier in basis points
|
|
@@ -2787,6 +2805,11 @@ declare class IntentGateway {
|
|
|
2787
2805
|
*/
|
|
2788
2806
|
private isWithinThreshold;
|
|
2789
2807
|
}
|
|
2808
|
+
interface StoredCancellationData {
|
|
2809
|
+
destIProof?: IProof;
|
|
2810
|
+
getRequest?: IGetRequest;
|
|
2811
|
+
sourceIProof?: IProof;
|
|
2812
|
+
}
|
|
2790
2813
|
|
|
2791
2814
|
type HyperbridgeTxEvents = {
|
|
2792
2815
|
kind: "Ready";
|
|
@@ -2952,7 +2975,9 @@ declare enum Chains {
|
|
|
2952
2975
|
MAINNET = "EVM-1",
|
|
2953
2976
|
BSC_MAINNET = "EVM-56",
|
|
2954
2977
|
ARBITRUM_MAINNET = "EVM-42161",
|
|
2955
|
-
BASE_MAINNET = "EVM-8453"
|
|
2978
|
+
BASE_MAINNET = "EVM-8453",
|
|
2979
|
+
POLYGON_MAINNET = "EVM-137",
|
|
2980
|
+
UNICHAIN_MAINNET = "EVM-130"
|
|
2956
2981
|
}
|
|
2957
2982
|
type AddressMap = {
|
|
2958
2983
|
[key: string]: {
|
|
@@ -2969,6 +2994,8 @@ declare const chainIds: {
|
|
|
2969
2994
|
readonly "EVM-56": 56;
|
|
2970
2995
|
readonly "EVM-42161": 42161;
|
|
2971
2996
|
readonly "EVM-8453": 8453;
|
|
2997
|
+
readonly "EVM-137": 137;
|
|
2998
|
+
readonly "EVM-130": 130;
|
|
2972
2999
|
};
|
|
2973
3000
|
type ChainId = typeof chainIds;
|
|
2974
3001
|
declare const viemChains: Record<string, Chain>;
|
|
@@ -2980,6 +3007,8 @@ declare const WrappedNativeDecimals: {
|
|
|
2980
3007
|
"EVM-56": number;
|
|
2981
3008
|
"EVM-42161": number;
|
|
2982
3009
|
"EVM-8453": number;
|
|
3010
|
+
"EVM-137": number;
|
|
3011
|
+
"EVM-130": number;
|
|
2983
3012
|
};
|
|
2984
3013
|
declare const assets: {
|
|
2985
3014
|
"EVM-97": {
|
|
@@ -3024,6 +3053,18 @@ declare const assets: {
|
|
|
3024
3053
|
USDC: string;
|
|
3025
3054
|
USDT: string;
|
|
3026
3055
|
};
|
|
3056
|
+
"EVM-137": {
|
|
3057
|
+
WETH: string;
|
|
3058
|
+
DAI: string;
|
|
3059
|
+
USDC: string;
|
|
3060
|
+
USDT: string;
|
|
3061
|
+
};
|
|
3062
|
+
"EVM-130": {
|
|
3063
|
+
WETH: string;
|
|
3064
|
+
DAI: string;
|
|
3065
|
+
USDC: string;
|
|
3066
|
+
USDT: string;
|
|
3067
|
+
};
|
|
3027
3068
|
};
|
|
3028
3069
|
declare const addresses: AddressMap;
|
|
3029
3070
|
declare const createRpcUrls: (env: NodeJS.ProcessEnv) => RpcMap;
|
|
@@ -3036,6 +3077,8 @@ declare const consensusStateIds: {
|
|
|
3036
3077
|
"EVM-56": string;
|
|
3037
3078
|
"EVM-42161": string;
|
|
3038
3079
|
"EVM-8453": string;
|
|
3080
|
+
"EVM-137": string;
|
|
3081
|
+
"EVM-130": string;
|
|
3039
3082
|
};
|
|
3040
3083
|
declare const coingeckoIds: {
|
|
3041
3084
|
"EVM-97": string;
|
|
@@ -3046,6 +3089,8 @@ declare const coingeckoIds: {
|
|
|
3046
3089
|
"EVM-56": string;
|
|
3047
3090
|
"EVM-42161": string;
|
|
3048
3091
|
"EVM-8453": string;
|
|
3092
|
+
"EVM-137": string;
|
|
3093
|
+
"EVM-130": string;
|
|
3049
3094
|
};
|
|
3050
3095
|
|
|
3051
|
-
export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type BlockMetadata, type CancelOptions, type ChainConfig, ChainConfigService, type ChainId, Chains, type ClientConfig, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DispatchGet, type DispatchPost, ERC20Method, type EstimateGasCallData, EvmChain, type EvmChainParams, type ExecutionResult, type FillOptions, type FillerConfig, type GetRequestResponse, type GetRequestWithStatus, type GetResponseByRequestIdResponse, type GetResponseStorageValues, type HexString, type HostParams, HyperClientStatus, type HyperbridgeTxEvents, type IChain, type IConfig, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, IndexerClient, type IndexerQueryClient, IntentGateway, type IntentGatewayParams, type IsmpRequest, type NewDeployment, type Order, type OrderResponse, OrderStatus, type OrderStatusMetadata, type OrderWithStatus, type Params, type PaymentInfo, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, 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, STATE_COMMITMENTS_SLOT, type StateMachineHeight, type StateMachineIdParams, type StateMachineResponse, type StateMachineUpdate, SubstrateChain, type SubstrateChainParams, TeleportStatus, TimeoutStatus, type TimeoutStatusKey, type TokenGatewayAssetTeleportedResponse, type TokenGatewayAssetTeleportedWithStatus, type TokenInfo, type TokenPrice, type TokenPricesResponse, type TokenRegistry, type TokenRegistryResponse, WrappedNativeDecimals, type XcmGatewayParams, __test, addresses, adjustFeeDecimals, assets, bytes20ToBytes32, bytes32ToBytes20, chainIds, coingeckoIds, consensusStateIds, constructRedeemEscrowRequestBody, convertStateMachineIdToEnum, createQueryClient, createRpcUrls, encodeISMPMessage, estimateGasForPost, fetchPrice, generateRootWithProof, getChain, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, orderCommitment, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, teleport, teleportDot, viemChains };
|
|
3096
|
+
export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type BlockMetadata, type CancelOptions, type ChainConfig, ChainConfigService, type ChainId, Chains, type ClientConfig, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DispatchGet, type DispatchPost, ERC20Method, type EstimateGasCallData, EvmChain, type EvmChainParams, type ExecutionResult, type FillOptions, type FillerConfig, type GetRequestResponse, type GetRequestWithStatus, type GetResponseByRequestIdResponse, type GetResponseStorageValues, type HexString, type HostParams, HyperClientStatus, type HyperbridgeTxEvents, type IChain, type IConfig, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, IndexerClient, type IndexerQueryClient, IntentGateway, type IntentGatewayParams, type IsmpRequest, type NewDeployment, type Order, type OrderResponse, OrderStatus, type OrderStatusMetadata, type OrderWithStatus, type Params, type PaymentInfo, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, 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, STATE_COMMITMENTS_SLOT, type StateMachineHeight, type StateMachineIdParams, type StateMachineResponse, type StateMachineUpdate, SubstrateChain, type SubstrateChainParams, TeleportStatus, TimeoutStatus, type TimeoutStatusKey, type TokenGatewayAssetTeleportedResponse, type TokenGatewayAssetTeleportedWithStatus, type TokenInfo, type TokenPrice, type TokenPricesResponse, type TokenRegistry, type TokenRegistryResponse, WrappedNativeDecimals, type XcmGatewayParams, __test, addresses, adjustFeeDecimals, assets, bytes20ToBytes32, bytes32ToBytes20, chainIds, coingeckoIds, consensusStateIds, constructRedeemEscrowRequestBody, convertStateIdToStateMachineId, convertStateMachineIdToEnum, createQueryClient, createRpcUrls, encodeISMPMessage, estimateGasForPost, fetchPrice, generateRootWithProof, getChain, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, orderCommitment, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, teleport, teleportDot, viemChains };
|