@hyperbridge/sdk 2.4.2 → 2.6.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 +109 -14
- package/dist/browser/index.js +721 -131
- package/dist/browser/index.js.map +1 -1
- package/dist/node/{IntentGatewayV2-PzbhFn_7.d.cts → IntentGatewayV2-DuSwlT02.d.cts} +80 -5
- package/dist/node/{IntentGatewayV2-PzbhFn_7.d.ts → IntentGatewayV2-DuSwlT02.d.ts} +80 -5
- package/dist/node/index.cjs +720 -129
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +32 -12
- package/dist/node/index.d.ts +32 -12
- package/dist/node/index.js +721 -131
- 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-DuSwlT02.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-DuSwlT02.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,15 +1900,29 @@ 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
|
|
1903
|
-
*
|
|
1904
|
-
*
|
|
1905
|
-
* the
|
|
1920
|
+
* 1. If `order.fees` is unset or zero, estimates gas on an internal copy and
|
|
1921
|
+
* sets same-chain fees to twice the estimate. Cross-chain orders attach
|
|
1922
|
+
* (fill gas + a settlement-message uplift of `RELAYER_MESSAGE_GAS`, the
|
|
1923
|
+
* same gas budget the solver's relayer fee uses) with a 5% buffer over
|
|
1924
|
+
* the whole sum — strictly above the solver's unpadded requirement. The
|
|
1925
|
+
* wei cost used for the `value` field receives a 2% buffer.
|
|
1906
1926
|
* 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, sessionPrivateKey }`.
|
|
1907
1927
|
* The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
|
|
1908
1928
|
* 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
|
|
@@ -1910,8 +1930,8 @@ declare class IntentGateway {
|
|
|
1910
1930
|
* 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
|
|
1911
1931
|
* subsequent status updates until the order is filled, exhausted, or fails.
|
|
1912
1932
|
*
|
|
1913
|
-
* @param order - The order to place and execute. `order.fees`
|
|
1914
|
-
*
|
|
1933
|
+
* @param order - The order to place and execute. It is not mutated. `order.fees`
|
|
1934
|
+
* may be 0; fees are estimated automatically if so.
|
|
1915
1935
|
* @param graffiti - Optional bytes32 tag for orderflow attribution /
|
|
1916
1936
|
* revenue share. Defaults to {@link DEFAULT_GRAFFITI}.
|
|
1917
1937
|
* @param options - Optional tuning parameters:
|
|
@@ -6003,4 +6023,4 @@ declare function teleport(teleport_param: {
|
|
|
6003
6023
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
6004
6024
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
6005
6025
|
|
|
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 };
|
|
6026
|
+
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-DuSwlT02.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-DuSwlT02.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,15 +1900,29 @@ 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
|
|
1903
|
-
*
|
|
1904
|
-
*
|
|
1905
|
-
* the
|
|
1920
|
+
* 1. If `order.fees` is unset or zero, estimates gas on an internal copy and
|
|
1921
|
+
* sets same-chain fees to twice the estimate. Cross-chain orders attach
|
|
1922
|
+
* (fill gas + a settlement-message uplift of `RELAYER_MESSAGE_GAS`, the
|
|
1923
|
+
* same gas budget the solver's relayer fee uses) with a 5% buffer over
|
|
1924
|
+
* the whole sum — strictly above the solver's unpadded requirement. The
|
|
1925
|
+
* wei cost used for the `value` field receives a 2% buffer.
|
|
1906
1926
|
* 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, sessionPrivateKey }`.
|
|
1907
1927
|
* The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
|
|
1908
1928
|
* 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
|
|
@@ -1910,8 +1930,8 @@ declare class IntentGateway {
|
|
|
1910
1930
|
* 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
|
|
1911
1931
|
* subsequent status updates until the order is filled, exhausted, or fails.
|
|
1912
1932
|
*
|
|
1913
|
-
* @param order - The order to place and execute. `order.fees`
|
|
1914
|
-
*
|
|
1933
|
+
* @param order - The order to place and execute. It is not mutated. `order.fees`
|
|
1934
|
+
* may be 0; fees are estimated automatically if so.
|
|
1915
1935
|
* @param graffiti - Optional bytes32 tag for orderflow attribution /
|
|
1916
1936
|
* revenue share. Defaults to {@link DEFAULT_GRAFFITI}.
|
|
1917
1937
|
* @param options - Optional tuning parameters:
|
|
@@ -6003,4 +6023,4 @@ declare function teleport(teleport_param: {
|
|
|
6003
6023
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
6004
6024
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
6005
6025
|
|
|
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 };
|
|
6026
|
+
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 };
|