@hyperbridge/sdk 2.4.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.d.ts +87 -12
- package/dist/browser/index.js +662 -92
- package/dist/browser/index.js.map +1 -1
- package/dist/node/{IntentGatewayV2-PzbhFn_7.d.cts → IntentGatewayV2-tYGohDdW.d.cts} +62 -5
- package/dist/node/{IntentGatewayV2-PzbhFn_7.d.ts → IntentGatewayV2-tYGohDdW.d.ts} +62 -5
- package/dist/node/index.cjs +661 -90
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +28 -10
- package/dist/node/index.d.ts +28 -10
- package/dist/node/index.js +662 -92
- package/dist/node/index.js.map +1 -1
- package/dist/node/intents-helpers.cjs +518 -7
- package/dist/node/intents-helpers.cjs.map +1 -1
- package/dist/node/intents-helpers.d.cts +52 -10
- package/dist/node/intents-helpers.d.ts +52 -10
- package/dist/node/intents-helpers.js +516 -9
- package/dist/node/intents-helpers.js.map +1 -1
- package/package.json +1 -1
package/dist/node/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IChain, H as HexString, a as IEvmConfig, C as ChainConfigService, b as IMessage, S as StateMachineIdParams, c as StateMachineHeight, d as IIsmpMessage, e as IPostRequest, f as IGetRequest, O as Order, E as EstimateGasCallData, R as RetryConfig, g as IPolkadotHubConfig, h as IPharosConfig, i as StateMachineUpdate, P as PostRequestWithStatus, G as GetRequestWithStatus, j as ResponseCommitmentWithValues, k as RequestStatusWithMetadata, l as PostRequestTimeoutStatus, m as SubstrateChain, n as ClientConfig, o as IndexerQueryClient, A as AssetTeleported, T as Transaction, p as IProof, q as IEvmChain, r as IntentsCoprocessor, s as
|
|
2
|
-
export {
|
|
1
|
+
import { I as IChain, H as HexString, a as IEvmConfig, C as ChainConfigService, b as IMessage, S as StateMachineIdParams, c as StateMachineHeight, d as IIsmpMessage, e as IPostRequest, f as IGetRequest, O as Order, E as EstimateGasCallData, R as RetryConfig, g as IPolkadotHubConfig, h as IPharosConfig, i as StateMachineUpdate, P as PostRequestWithStatus, G as GetRequestWithStatus, j as ResponseCommitmentWithValues, k as RequestStatusWithMetadata, l as PostRequestTimeoutStatus, m as SubstrateChain, n as ClientConfig, o as IndexerQueryClient, A as AssetTeleported, T as Transaction, p as IProof, q as IEvmChain, r as IntentsCoprocessor, s as AvailableLiquiditySnapshot, t as IntentOrderStatusUpdate, u as SelectBidResult, v as ResumeIntentOrderOptions, w as CancelOrderOptions, x as CancelQuote, y as SubmitBidOptions, z as PackedUserOperation, F as FillerBid, B as Bid, D as EstimateFillOrderParams, J as FillOrderEstimate, K as ERC7821Call, L as OrderWithStatus, M as OrderStatus, N as TokenGatewayAssetTeleportedWithStatus, Q as TeleportStatus, U as DecodedOrderPlacedLog, V as DecodedPostRequestEvent, W as DecodedPostResponseEvent } from './IntentGatewayV2-tYGohDdW.cjs';
|
|
2
|
+
export { X as AllStatusKey, Y as AssetTeleportedResponse, Z as AvailableLiquidityByChain, _ as BidStorageEntry, $ as BidSubmissionResult, a0 as BlockMetadata, a1 as BytesLikeHex, a2 as CancelOptions, a3 as ChainConfig, a4 as ChainConfigData, a5 as Chains, a6 as ConfiguredAssetSymbol, a7 as Deployment, a8 as DispatchGet, a9 as DispatchInfo, aa as DispatchPost, ab as ExecuteIntentOrderOptions, ac as ExecutionResult, ad as FillOptions, ae as FillerConfig, af as GetRequestResponse, ag as GetResponseByRequestIdResponse, ah as GetResponseStorageValues, ai as HostParams, aj as HyperClientStatus, ak as IBatchConsensusAndGetResponseMessage, al as IBatchConsensusAndPostRequestMessage, am as IConfig, an as IConsensusMessage, ao as IGetRequestMessage, ap as IGetResponse, aq as IGetResponseMessage, ar as IHyperbridgeConfig, as as IPostResponse, at as IRequestMessage, au as ISubstrateConfig, av as ITimeoutPostRequestMessage, aw as IntentGatewayABI, ax as IntentGatewayParams, ay as IntentOrderStatus, az as IntentOrderStatusKey, aA as IsmpRequest, aB as OrderResponse, aC as OrderStatusMetadata, aD as PaymentInfo, aE as PhantomOrderEvent, aF as PhantomOrderPriceSnapshot, aG as PhantomOrderPriceSnapshotsResponse, aH as PollPhantomOrdersOptions, aI as PostRequestStatus, aJ as RequestBody, aK as RequestCommitment, aL as RequestKind, aM as RequestResponse, aN as RequestStatus, aO as RequestStatusKey, aP as SelectOptions, aQ as SigningAccount, aR as StateMachineId, aS as StateMachineResponse, aT as StorageFacade, aU as TimeoutStatus, aV as TimeoutStatusKey, aW as TokenGatewayAssetTeleportedResponse, aX as TokenInfo, aY as TokenPrice, aZ as TokenPricesResponse, a_ as UniswapV4PoolConfigData, a$ as chainConfigs, b0 as convertCodecToIGetRequest, b1 as convertCodecToIProof, b2 as convertIGetRequestToCodec, b3 as convertIProofToCodec, b4 as convertStateIdToStateMachineId, b5 as convertStateMachineEnumToString, b6 as convertStateMachineIdToEnum, b7 as decodeERC7821ExecuteBatch, b8 as decodeUserOpScale, b9 as encodeERC7821ExecuteBatch, ba as encodeISMPMessage, bb as encodeUserOpScale, bc as getChainId, bd as getConfigByStateMachineId, be as getViemChain, bf as hyperbridgeAddress, bg as pharosAtlantic, bh as pharosMainnet, bi as polkadotAssetHubPaseo, bj as polkadotHubMainnet, bk as tronChainIds, bl as tronNile } from './IntentGatewayV2-tYGohDdW.cjs';
|
|
3
3
|
import { ConsolaInstance } from 'consola';
|
|
4
4
|
import { GraphQLClient } from 'graphql-request';
|
|
5
5
|
import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
|
|
@@ -364,6 +364,10 @@ declare function normalizeEvmChainId(chainId: number | string): {
|
|
|
364
364
|
};
|
|
365
365
|
declare function encodeStateMachineId(stateMachineId: string): HexString;
|
|
366
366
|
declare function normalizeAddressForEvmBytes32(address: string): HexString;
|
|
367
|
+
/**
|
|
368
|
+
* Validates an EVM address and returns its canonical lowercase representation.
|
|
369
|
+
*/
|
|
370
|
+
declare function normalizeEvmAddress(address: string, field?: string): HexString;
|
|
367
371
|
declare function normalizeAddressForStateMachine(address: string, stateMachineId: string): HexString;
|
|
368
372
|
/**
|
|
369
373
|
* Retries a promise-returning operation with exponential backoff.
|
|
@@ -1599,9 +1603,9 @@ interface BundlerGasEstimate {
|
|
|
1599
1603
|
* - `AWAITING_CANCEL_TRANSACTION` – the caller must sign and submit the cancel tx.
|
|
1600
1604
|
* - `CANCEL_STARTED` – the cancel transaction was confirmed on-chain.
|
|
1601
1605
|
* - `SOURCE_FINALIZED` – the cancel request has been finalised on the source chain.
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1606
|
+
* - `HYPERBRIDGE_DELIVERED` – the cancel message has been delivered to Hyperbridge.
|
|
1607
|
+
* - `HYPERBRIDGE_FINALIZED` – the cancel message has been finalised on Hyperbridge.
|
|
1608
|
+
* - `CANCELLATION_COMPLETE` – the escrow has been refunded; cancellation is done.
|
|
1605
1609
|
*/
|
|
1606
1610
|
type CancelEvent = {
|
|
1607
1611
|
status: "DESTINATION_FINALIZED";
|
|
@@ -1840,6 +1844,8 @@ declare class IntentGateway {
|
|
|
1840
1844
|
private readonly gasEstimator;
|
|
1841
1845
|
/** Quote strategies for pricing orders before placement, keyed by strategy name. */
|
|
1842
1846
|
private readonly quoteStrategies;
|
|
1847
|
+
/** Resolves order tokens to canonical Phantom snapshot market pairs. */
|
|
1848
|
+
private readonly phantomSnapshotPairResolver;
|
|
1843
1849
|
/**
|
|
1844
1850
|
* Private constructor — use {@link IntentGateway.create} instead.
|
|
1845
1851
|
*
|
|
@@ -1894,13 +1900,25 @@ declare class IntentGateway {
|
|
|
1894
1900
|
* @throws {PhantomSnapshotUnavailableError} When an eligible cNGN pair has no snapshot.
|
|
1895
1901
|
*/
|
|
1896
1902
|
quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult>;
|
|
1903
|
+
/**
|
|
1904
|
+
* Returns the output-token liquidity measured in the latest directional
|
|
1905
|
+
* Phantom snapshot for this gateway's source and destination.
|
|
1906
|
+
*
|
|
1907
|
+
* Pair resolution uses the same canonical Base market as {@link quoteIntent}.
|
|
1908
|
+
* The snapshot itself determines the output token and chain to aggregate. The
|
|
1909
|
+
* amount is in the token's smallest unit and reflects the indexer's
|
|
1910
|
+
* `snapshotTime`; it is not a live reservation or fill guarantee.
|
|
1911
|
+
*
|
|
1912
|
+
* Requires a prior call to {@link withQueryClient}.
|
|
1913
|
+
*/
|
|
1914
|
+
queryAvailableLiquidity(params: Pick<QuoteIntentParams, "tokenIn" | "tokenOut">): Promise<AvailableLiquiditySnapshot | undefined>;
|
|
1897
1915
|
/**
|
|
1898
1916
|
* Bidirectional async generator that orchestrates the full order lifecycle:
|
|
1899
1917
|
* placement, fee estimation, bid collection, and execution.
|
|
1900
1918
|
*
|
|
1901
1919
|
* **Yield/receive protocol:**
|
|
1902
|
-
* 1. If `order.fees` is unset or zero, estimates gas and sets
|
|
1903
|
-
*
|
|
1920
|
+
* 1. If `order.fees` is unset or zero, estimates gas on an internal copy and sets
|
|
1921
|
+
* same-chain fees to twice the estimate. Cross-chain orders retain a 1% buffer
|
|
1904
1922
|
* and include an additional 600k-gas fee uplift, while the wei cost used for
|
|
1905
1923
|
* the `value` field receives a 2% buffer.
|
|
1906
1924
|
* 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, sessionPrivateKey }`.
|
|
@@ -1910,8 +1928,8 @@ declare class IntentGateway {
|
|
|
1910
1928
|
* 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
|
|
1911
1929
|
* subsequent status updates until the order is filled, exhausted, or fails.
|
|
1912
1930
|
*
|
|
1913
|
-
* @param order - The order to place and execute. `order.fees`
|
|
1914
|
-
*
|
|
1931
|
+
* @param order - The order to place and execute. It is not mutated. `order.fees`
|
|
1932
|
+
* may be 0; fees are estimated automatically if so.
|
|
1915
1933
|
* @param graffiti - Optional bytes32 tag for orderflow attribution /
|
|
1916
1934
|
* revenue share. Defaults to {@link DEFAULT_GRAFFITI}.
|
|
1917
1935
|
* @param options - Optional tuning parameters:
|
|
@@ -6003,4 +6021,4 @@ declare function teleport(teleport_param: {
|
|
|
6003
6021
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
6004
6022
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
6005
6023
|
|
|
6006
|
-
export { ADDRESS_ZERO, AssetTeleported, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, ClientConfig, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteTradeType, IntentsCoprocessor, InvalidPhantomSnapshotError, IsmpClient, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, Order, OrderStatus, OrderStatusChecker, OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PhantomSnapshotIntentQuoteMetadata, type PhantomSnapshotQuoteIntentResult, PhantomSnapshotUnavailableError, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolKey, type UniswapV4QuoteIntentResult, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract };
|
|
6024
|
+
export { ADDRESS_ZERO, AssetTeleported, AvailableLiquiditySnapshot, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, ClientConfig, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteTradeType, IntentsCoprocessor, InvalidPhantomSnapshotError, IsmpClient, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, Order, OrderStatus, OrderStatusChecker, OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PhantomSnapshotIntentQuoteMetadata, type PhantomSnapshotQuoteIntentResult, PhantomSnapshotUnavailableError, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolKey, type UniswapV4QuoteIntentResult, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract };
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IChain, H as HexString, a as IEvmConfig, C as ChainConfigService, b as IMessage, S as StateMachineIdParams, c as StateMachineHeight, d as IIsmpMessage, e as IPostRequest, f as IGetRequest, O as Order, E as EstimateGasCallData, R as RetryConfig, g as IPolkadotHubConfig, h as IPharosConfig, i as StateMachineUpdate, P as PostRequestWithStatus, G as GetRequestWithStatus, j as ResponseCommitmentWithValues, k as RequestStatusWithMetadata, l as PostRequestTimeoutStatus, m as SubstrateChain, n as ClientConfig, o as IndexerQueryClient, A as AssetTeleported, T as Transaction, p as IProof, q as IEvmChain, r as IntentsCoprocessor, s as
|
|
2
|
-
export {
|
|
1
|
+
import { I as IChain, H as HexString, a as IEvmConfig, C as ChainConfigService, b as IMessage, S as StateMachineIdParams, c as StateMachineHeight, d as IIsmpMessage, e as IPostRequest, f as IGetRequest, O as Order, E as EstimateGasCallData, R as RetryConfig, g as IPolkadotHubConfig, h as IPharosConfig, i as StateMachineUpdate, P as PostRequestWithStatus, G as GetRequestWithStatus, j as ResponseCommitmentWithValues, k as RequestStatusWithMetadata, l as PostRequestTimeoutStatus, m as SubstrateChain, n as ClientConfig, o as IndexerQueryClient, A as AssetTeleported, T as Transaction, p as IProof, q as IEvmChain, r as IntentsCoprocessor, s as AvailableLiquiditySnapshot, t as IntentOrderStatusUpdate, u as SelectBidResult, v as ResumeIntentOrderOptions, w as CancelOrderOptions, x as CancelQuote, y as SubmitBidOptions, z as PackedUserOperation, F as FillerBid, B as Bid, D as EstimateFillOrderParams, J as FillOrderEstimate, K as ERC7821Call, L as OrderWithStatus, M as OrderStatus, N as TokenGatewayAssetTeleportedWithStatus, Q as TeleportStatus, U as DecodedOrderPlacedLog, V as DecodedPostRequestEvent, W as DecodedPostResponseEvent } from './IntentGatewayV2-tYGohDdW.js';
|
|
2
|
+
export { X as AllStatusKey, Y as AssetTeleportedResponse, Z as AvailableLiquidityByChain, _ as BidStorageEntry, $ as BidSubmissionResult, a0 as BlockMetadata, a1 as BytesLikeHex, a2 as CancelOptions, a3 as ChainConfig, a4 as ChainConfigData, a5 as Chains, a6 as ConfiguredAssetSymbol, a7 as Deployment, a8 as DispatchGet, a9 as DispatchInfo, aa as DispatchPost, ab as ExecuteIntentOrderOptions, ac as ExecutionResult, ad as FillOptions, ae as FillerConfig, af as GetRequestResponse, ag as GetResponseByRequestIdResponse, ah as GetResponseStorageValues, ai as HostParams, aj as HyperClientStatus, ak as IBatchConsensusAndGetResponseMessage, al as IBatchConsensusAndPostRequestMessage, am as IConfig, an as IConsensusMessage, ao as IGetRequestMessage, ap as IGetResponse, aq as IGetResponseMessage, ar as IHyperbridgeConfig, as as IPostResponse, at as IRequestMessage, au as ISubstrateConfig, av as ITimeoutPostRequestMessage, aw as IntentGatewayABI, ax as IntentGatewayParams, ay as IntentOrderStatus, az as IntentOrderStatusKey, aA as IsmpRequest, aB as OrderResponse, aC as OrderStatusMetadata, aD as PaymentInfo, aE as PhantomOrderEvent, aF as PhantomOrderPriceSnapshot, aG as PhantomOrderPriceSnapshotsResponse, aH as PollPhantomOrdersOptions, aI as PostRequestStatus, aJ as RequestBody, aK as RequestCommitment, aL as RequestKind, aM as RequestResponse, aN as RequestStatus, aO as RequestStatusKey, aP as SelectOptions, aQ as SigningAccount, aR as StateMachineId, aS as StateMachineResponse, aT as StorageFacade, aU as TimeoutStatus, aV as TimeoutStatusKey, aW as TokenGatewayAssetTeleportedResponse, aX as TokenInfo, aY as TokenPrice, aZ as TokenPricesResponse, a_ as UniswapV4PoolConfigData, a$ as chainConfigs, b0 as convertCodecToIGetRequest, b1 as convertCodecToIProof, b2 as convertIGetRequestToCodec, b3 as convertIProofToCodec, b4 as convertStateIdToStateMachineId, b5 as convertStateMachineEnumToString, b6 as convertStateMachineIdToEnum, b7 as decodeERC7821ExecuteBatch, b8 as decodeUserOpScale, b9 as encodeERC7821ExecuteBatch, ba as encodeISMPMessage, bb as encodeUserOpScale, bc as getChainId, bd as getConfigByStateMachineId, be as getViemChain, bf as hyperbridgeAddress, bg as pharosAtlantic, bh as pharosMainnet, bi as polkadotAssetHubPaseo, bj as polkadotHubMainnet, bk as tronChainIds, bl as tronNile } from './IntentGatewayV2-tYGohDdW.js';
|
|
3
3
|
import { ConsolaInstance } from 'consola';
|
|
4
4
|
import { GraphQLClient } from 'graphql-request';
|
|
5
5
|
import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
|
|
@@ -364,6 +364,10 @@ declare function normalizeEvmChainId(chainId: number | string): {
|
|
|
364
364
|
};
|
|
365
365
|
declare function encodeStateMachineId(stateMachineId: string): HexString;
|
|
366
366
|
declare function normalizeAddressForEvmBytes32(address: string): HexString;
|
|
367
|
+
/**
|
|
368
|
+
* Validates an EVM address and returns its canonical lowercase representation.
|
|
369
|
+
*/
|
|
370
|
+
declare function normalizeEvmAddress(address: string, field?: string): HexString;
|
|
367
371
|
declare function normalizeAddressForStateMachine(address: string, stateMachineId: string): HexString;
|
|
368
372
|
/**
|
|
369
373
|
* Retries a promise-returning operation with exponential backoff.
|
|
@@ -1599,9 +1603,9 @@ interface BundlerGasEstimate {
|
|
|
1599
1603
|
* - `AWAITING_CANCEL_TRANSACTION` – the caller must sign and submit the cancel tx.
|
|
1600
1604
|
* - `CANCEL_STARTED` – the cancel transaction was confirmed on-chain.
|
|
1601
1605
|
* - `SOURCE_FINALIZED` – the cancel request has been finalised on the source chain.
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1606
|
+
* - `HYPERBRIDGE_DELIVERED` – the cancel message has been delivered to Hyperbridge.
|
|
1607
|
+
* - `HYPERBRIDGE_FINALIZED` – the cancel message has been finalised on Hyperbridge.
|
|
1608
|
+
* - `CANCELLATION_COMPLETE` – the escrow has been refunded; cancellation is done.
|
|
1605
1609
|
*/
|
|
1606
1610
|
type CancelEvent = {
|
|
1607
1611
|
status: "DESTINATION_FINALIZED";
|
|
@@ -1840,6 +1844,8 @@ declare class IntentGateway {
|
|
|
1840
1844
|
private readonly gasEstimator;
|
|
1841
1845
|
/** Quote strategies for pricing orders before placement, keyed by strategy name. */
|
|
1842
1846
|
private readonly quoteStrategies;
|
|
1847
|
+
/** Resolves order tokens to canonical Phantom snapshot market pairs. */
|
|
1848
|
+
private readonly phantomSnapshotPairResolver;
|
|
1843
1849
|
/**
|
|
1844
1850
|
* Private constructor — use {@link IntentGateway.create} instead.
|
|
1845
1851
|
*
|
|
@@ -1894,13 +1900,25 @@ declare class IntentGateway {
|
|
|
1894
1900
|
* @throws {PhantomSnapshotUnavailableError} When an eligible cNGN pair has no snapshot.
|
|
1895
1901
|
*/
|
|
1896
1902
|
quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult>;
|
|
1903
|
+
/**
|
|
1904
|
+
* Returns the output-token liquidity measured in the latest directional
|
|
1905
|
+
* Phantom snapshot for this gateway's source and destination.
|
|
1906
|
+
*
|
|
1907
|
+
* Pair resolution uses the same canonical Base market as {@link quoteIntent}.
|
|
1908
|
+
* The snapshot itself determines the output token and chain to aggregate. The
|
|
1909
|
+
* amount is in the token's smallest unit and reflects the indexer's
|
|
1910
|
+
* `snapshotTime`; it is not a live reservation or fill guarantee.
|
|
1911
|
+
*
|
|
1912
|
+
* Requires a prior call to {@link withQueryClient}.
|
|
1913
|
+
*/
|
|
1914
|
+
queryAvailableLiquidity(params: Pick<QuoteIntentParams, "tokenIn" | "tokenOut">): Promise<AvailableLiquiditySnapshot | undefined>;
|
|
1897
1915
|
/**
|
|
1898
1916
|
* Bidirectional async generator that orchestrates the full order lifecycle:
|
|
1899
1917
|
* placement, fee estimation, bid collection, and execution.
|
|
1900
1918
|
*
|
|
1901
1919
|
* **Yield/receive protocol:**
|
|
1902
|
-
* 1. If `order.fees` is unset or zero, estimates gas and sets
|
|
1903
|
-
*
|
|
1920
|
+
* 1. If `order.fees` is unset or zero, estimates gas on an internal copy and sets
|
|
1921
|
+
* same-chain fees to twice the estimate. Cross-chain orders retain a 1% buffer
|
|
1904
1922
|
* and include an additional 600k-gas fee uplift, while the wei cost used for
|
|
1905
1923
|
* the `value` field receives a 2% buffer.
|
|
1906
1924
|
* 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, sessionPrivateKey }`.
|
|
@@ -1910,8 +1928,8 @@ declare class IntentGateway {
|
|
|
1910
1928
|
* 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
|
|
1911
1929
|
* subsequent status updates until the order is filled, exhausted, or fails.
|
|
1912
1930
|
*
|
|
1913
|
-
* @param order - The order to place and execute. `order.fees`
|
|
1914
|
-
*
|
|
1931
|
+
* @param order - The order to place and execute. It is not mutated. `order.fees`
|
|
1932
|
+
* may be 0; fees are estimated automatically if so.
|
|
1915
1933
|
* @param graffiti - Optional bytes32 tag for orderflow attribution /
|
|
1916
1934
|
* revenue share. Defaults to {@link DEFAULT_GRAFFITI}.
|
|
1917
1935
|
* @param options - Optional tuning parameters:
|
|
@@ -6003,4 +6021,4 @@ declare function teleport(teleport_param: {
|
|
|
6003
6021
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
6004
6022
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
6005
6023
|
|
|
6006
|
-
export { ADDRESS_ZERO, AssetTeleported, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, ClientConfig, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteTradeType, IntentsCoprocessor, InvalidPhantomSnapshotError, IsmpClient, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, Order, OrderStatus, OrderStatusChecker, OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PhantomSnapshotIntentQuoteMetadata, type PhantomSnapshotQuoteIntentResult, PhantomSnapshotUnavailableError, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolKey, type UniswapV4QuoteIntentResult, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract };
|
|
6024
|
+
export { ADDRESS_ZERO, AssetTeleported, AvailableLiquiditySnapshot, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, ClientConfig, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteTradeType, IntentsCoprocessor, InvalidPhantomSnapshotError, IsmpClient, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, Order, OrderStatus, OrderStatusChecker, OrderWithStatus, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PhantomSnapshotIntentQuoteMetadata, type PhantomSnapshotQuoteIntentResult, PhantomSnapshotUnavailableError, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, type QuoteIntentParams, type QuoteIntentResult, type QuoteNativeResult, type QuoteResult, type QuoteUniswapParams, type QuoteUniswapResult, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolKey, type UniswapV4QuoteIntentResult, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract };
|