@hyperbridge/sdk 2.4.0 → 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 +184 -42
- package/dist/browser/index.js +978 -194
- package/dist/browser/index.js.map +1 -1
- package/dist/node/{IntentGatewayV2-SB851bZs.d.cts → IntentGatewayV2-tYGohDdW.d.cts} +100 -5
- package/dist/node/{IntentGatewayV2-SB851bZs.d.ts → IntentGatewayV2-tYGohDdW.d.ts} +100 -5
- package/dist/node/index.cjs +979 -192
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +87 -40
- package/dist/node/index.d.ts +87 -40
- package/dist/node/index.js +978 -194
- 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/browser/index.d.ts
CHANGED
|
@@ -963,6 +963,8 @@ interface ChainConfigData {
|
|
|
963
963
|
UniswapV4StateView?: `0x${string}`;
|
|
964
964
|
/** Circle Paymaster contract address (USDC-based ERC-4337 paymaster) */
|
|
965
965
|
CirclePaymaster?: `0x${string}`;
|
|
966
|
+
/** SimplexPaymaster contract address (ERC-4337 paymaster accepting USDC/USDT via Chainlink pricing) */
|
|
967
|
+
SimplexPaymaster?: `0x${string}`;
|
|
966
968
|
};
|
|
967
969
|
rpcEnvKey?: string;
|
|
968
970
|
defaultRpcUrl?: string;
|
|
@@ -993,6 +995,16 @@ declare class ChainConfigService {
|
|
|
993
995
|
};
|
|
994
996
|
getDaiAsset(chain: string): HexString;
|
|
995
997
|
getAssetAddress(chain: string, symbol: ConfiguredAssetSymbol): HexString | undefined;
|
|
998
|
+
/**
|
|
999
|
+
* Resolves configured token metadata from an address on a specific chain.
|
|
1000
|
+
* This is used by SDK helpers that accept token addresses rather than caller-
|
|
1001
|
+
* supplied symbols or decimals.
|
|
1002
|
+
*/
|
|
1003
|
+
getAssetMetadataByAddress(chain: string, address: HexString): {
|
|
1004
|
+
symbol: ConfiguredAssetSymbol;
|
|
1005
|
+
address: HexString;
|
|
1006
|
+
decimals?: number;
|
|
1007
|
+
} | undefined;
|
|
996
1008
|
getUsdtAsset(chain: string): HexString;
|
|
997
1009
|
getUsdcAsset(chain: string): HexString;
|
|
998
1010
|
getUsdcDecimals(chain: string): number;
|
|
@@ -1028,6 +1040,7 @@ declare class ChainConfigService {
|
|
|
1028
1040
|
getPopularTokens(chain: string): string[];
|
|
1029
1041
|
getEntryPointV08Address(chain: string): HexString;
|
|
1030
1042
|
getCirclePaymasterAddress(chain: string): HexString | undefined;
|
|
1043
|
+
getSimplexPaymasterAddress(chain: string): HexString | undefined;
|
|
1031
1044
|
getHyperbridgeAddress(): string;
|
|
1032
1045
|
/**
|
|
1033
1046
|
* Get the LayerZero Endpoint ID for the chain
|
|
@@ -1410,6 +1423,10 @@ declare function normalizeEvmChainId(chainId: number | string): {
|
|
|
1410
1423
|
};
|
|
1411
1424
|
declare function encodeStateMachineId(stateMachineId: string): HexString;
|
|
1412
1425
|
declare function normalizeAddressForEvmBytes32(address: string): HexString;
|
|
1426
|
+
/**
|
|
1427
|
+
* Validates an EVM address and returns its canonical lowercase representation.
|
|
1428
|
+
*/
|
|
1429
|
+
declare function normalizeEvmAddress(address: string, field?: string): HexString;
|
|
1413
1430
|
declare function normalizeAddressForStateMachine(address: string, stateMachineId: string): HexString;
|
|
1414
1431
|
/**
|
|
1415
1432
|
* Retries a promise-returning operation with exponential backoff.
|
|
@@ -1861,6 +1878,23 @@ interface PhantomOrderEvent {
|
|
|
1861
1878
|
tokenB: HexString;
|
|
1862
1879
|
standardAmount: bigint;
|
|
1863
1880
|
}
|
|
1881
|
+
interface PollPhantomOrdersOptions {
|
|
1882
|
+
/** How often to check for a new head. Defaults to 6s, roughly one block. */
|
|
1883
|
+
intervalMs?: number;
|
|
1884
|
+
/**
|
|
1885
|
+
* Most blocks scanned in a single poll, so a long outage catches up over several ticks instead of
|
|
1886
|
+
* one unbounded scan. Defaults to 500.
|
|
1887
|
+
*/
|
|
1888
|
+
maxBlocksPerPoll?: number;
|
|
1889
|
+
/**
|
|
1890
|
+
* How many blocks before the current head to start from on the first poll. Defaults to 0 (start
|
|
1891
|
+
* at the head). Set this to the runtime's bid window to have a restarting process pick up orders
|
|
1892
|
+
* whose window is still open.
|
|
1893
|
+
*/
|
|
1894
|
+
lookbackBlocks?: number;
|
|
1895
|
+
/** Notified when a poll fails; polling continues regardless. */
|
|
1896
|
+
onError?: (err: unknown) => void;
|
|
1897
|
+
}
|
|
1864
1898
|
/**
|
|
1865
1899
|
* Service for interacting with Hyperbridge's pallet-intents coprocessor.
|
|
1866
1900
|
* Handles bid submission and retrieval for the IntentGatewayV2 protocol.
|
|
@@ -2005,11 +2039,26 @@ declare class IntentsCoprocessor {
|
|
|
2005
2039
|
*/
|
|
2006
2040
|
fetchPhantomOrder(commitment: HexString): Promise<Order | null>;
|
|
2007
2041
|
/**
|
|
2008
|
-
*
|
|
2009
|
-
|
|
2010
|
-
|
|
2042
|
+
* Reads the PhantomOrderRegistered events emitted in a single block.
|
|
2043
|
+
*/
|
|
2044
|
+
getPhantomOrdersInBlock(blockNumber: number): Promise<PhantomOrderEvent[]>;
|
|
2045
|
+
/**
|
|
2046
|
+
* Polls for newly registered phantom orders, invoking the callback once per order.
|
|
2047
|
+
*
|
|
2048
|
+
* Each tick reads the current head and scans every block between the last one processed and that
|
|
2049
|
+
* head, so the block cursor — not the connection — determines what has been seen. This replaced a
|
|
2050
|
+
* system.events subscription, which was only as reliable as its socket: polkadot-js reconnects
|
|
2051
|
+
* the transport but does not reliably re-establish storage subscriptions, and anything emitted
|
|
2052
|
+
* while disconnected was lost silently. With a bid window measured in a handful of blocks, that
|
|
2053
|
+
* meant silently missed bids.
|
|
2054
|
+
*
|
|
2055
|
+
* Scanning a block range is gap-free rather than merely self-healing: an outage delays orders but
|
|
2056
|
+
* cannot drop them, because the cursor only advances past a block whose events were actually
|
|
2057
|
+
* read. Recovery replays the backlog.
|
|
2058
|
+
*
|
|
2059
|
+
* Returns a function that stops polling.
|
|
2011
2060
|
*/
|
|
2012
|
-
|
|
2061
|
+
pollPhantomOrders(callback: (event: PhantomOrderEvent) => void, options?: PollPhantomOrdersOptions): () => void;
|
|
2013
2062
|
}
|
|
2014
2063
|
|
|
2015
2064
|
/**
|
|
@@ -2495,6 +2544,8 @@ interface RetryConfig {
|
|
|
2495
2544
|
backoffMs: number;
|
|
2496
2545
|
logMessage?: string;
|
|
2497
2546
|
logger?: ConsolaInstance;
|
|
2547
|
+
/** Return false to stop retrying and immediately rethrow the error. */
|
|
2548
|
+
shouldRetry?: (error: unknown) => boolean;
|
|
2498
2549
|
}
|
|
2499
2550
|
interface IsmpRequest {
|
|
2500
2551
|
source: string;
|
|
@@ -3332,6 +3383,54 @@ interface OrderResponse {
|
|
|
3332
3383
|
}>;
|
|
3333
3384
|
};
|
|
3334
3385
|
}
|
|
3386
|
+
interface PhantomOrderPriceSnapshot {
|
|
3387
|
+
commitment: HexString;
|
|
3388
|
+
tokenA: HexString;
|
|
3389
|
+
tokenB: HexString;
|
|
3390
|
+
standardAmount: bigint;
|
|
3391
|
+
blockNumber: bigint;
|
|
3392
|
+
medianPrice: bigint;
|
|
3393
|
+
lowestPrice?: bigint;
|
|
3394
|
+
highestPrice?: bigint;
|
|
3395
|
+
bidCount: number;
|
|
3396
|
+
snapshotTime: Date;
|
|
3397
|
+
}
|
|
3398
|
+
interface PhantomOrderPriceSnapshotsResponse {
|
|
3399
|
+
phantomOrderPriceSnapshots: {
|
|
3400
|
+
nodes: Array<{
|
|
3401
|
+
commitment: string;
|
|
3402
|
+
tokenA: string;
|
|
3403
|
+
tokenB: string;
|
|
3404
|
+
standardAmount: string;
|
|
3405
|
+
blockNumber: string;
|
|
3406
|
+
medianPrice: string | null;
|
|
3407
|
+
lowestPrice: string | null;
|
|
3408
|
+
highestPrice: string | null;
|
|
3409
|
+
bidCount: number;
|
|
3410
|
+
snapshotTime: string;
|
|
3411
|
+
}>;
|
|
3412
|
+
};
|
|
3413
|
+
}
|
|
3414
|
+
/**
|
|
3415
|
+
* Total solver liquidity measured at one immutable Phantom price snapshot.
|
|
3416
|
+
*
|
|
3417
|
+
* Liquidity amounts are decimal strings formatted with the configured decimals
|
|
3418
|
+
* for their respective `tokenAddress` and chain.
|
|
3419
|
+
*/
|
|
3420
|
+
interface AvailableLiquiditySnapshot {
|
|
3421
|
+
totalLiquidity: string;
|
|
3422
|
+
providerCount: number;
|
|
3423
|
+
tokenAddress: HexString;
|
|
3424
|
+
snapshotTime: Date;
|
|
3425
|
+
liquidityByChain: AvailableLiquidityByChain[];
|
|
3426
|
+
}
|
|
3427
|
+
/** Liquidity for one chain/token balance group in an availability snapshot. */
|
|
3428
|
+
interface AvailableLiquidityByChain {
|
|
3429
|
+
chain: string;
|
|
3430
|
+
tokenAddress: HexString;
|
|
3431
|
+
totalLiquidity: string;
|
|
3432
|
+
providerCount: number;
|
|
3433
|
+
}
|
|
3335
3434
|
interface TokenPrice {
|
|
3336
3435
|
symbol: string;
|
|
3337
3436
|
address?: string;
|
|
@@ -4554,9 +4653,9 @@ interface BundlerGasEstimate {
|
|
|
4554
4653
|
* - `AWAITING_CANCEL_TRANSACTION` – the caller must sign and submit the cancel tx.
|
|
4555
4654
|
* - `CANCEL_STARTED` – the cancel transaction was confirmed on-chain.
|
|
4556
4655
|
* - `SOURCE_FINALIZED` – the cancel request has been finalised on the source chain.
|
|
4557
|
-
|
|
4558
|
-
|
|
4559
|
-
|
|
4656
|
+
* - `HYPERBRIDGE_DELIVERED` – the cancel message has been delivered to Hyperbridge.
|
|
4657
|
+
* - `HYPERBRIDGE_FINALIZED` – the cancel message has been finalised on Hyperbridge.
|
|
4658
|
+
* - `CANCELLATION_COMPLETE` – the escrow has been refunded; cancellation is done.
|
|
4560
4659
|
*/
|
|
4561
4660
|
type CancelEvent = {
|
|
4562
4661
|
status: "DESTINATION_FINALIZED";
|
|
@@ -4630,19 +4729,8 @@ interface IntentGatewayContext {
|
|
|
4630
4729
|
swap: Swap;
|
|
4631
4730
|
}
|
|
4632
4731
|
|
|
4633
|
-
type IntentQuoteStrategy = "uniswap_v4";
|
|
4732
|
+
type IntentQuoteStrategy = "uniswap_v4" | "phantom_snapshot";
|
|
4634
4733
|
type IntentQuoteTradeType = "EXACT_INPUT" | "EXACT_OUTPUT";
|
|
4635
|
-
/**
|
|
4636
|
-
* Token metadata required by intent quote strategies.
|
|
4637
|
-
*/
|
|
4638
|
-
interface IntentQuoteToken {
|
|
4639
|
-
/** Token contract address on the user/source side. */
|
|
4640
|
-
address: HexString;
|
|
4641
|
-
/** Token decimals for raw amount formatting by the caller. */
|
|
4642
|
-
decimals: number;
|
|
4643
|
-
/** Optional token symbol used only to match SDK-configured destination pools. */
|
|
4644
|
-
symbol?: string;
|
|
4645
|
-
}
|
|
4646
4734
|
/**
|
|
4647
4735
|
* Full Uniswap V4 PoolKey. V4 pools cannot be discovered from a token pair alone.
|
|
4648
4736
|
*/
|
|
@@ -4659,7 +4747,7 @@ interface UniswapV4IntentQuoteOptions {
|
|
|
4659
4747
|
quoterAddress?: HexString;
|
|
4660
4748
|
/**
|
|
4661
4749
|
* Destination-side address of the input currency. Defaults to
|
|
4662
|
-
* `tokenIn
|
|
4750
|
+
* `tokenIn`, which only works for same-chain quotes; pass this
|
|
4663
4751
|
* explicitly when source and destination chains differ. Must equal
|
|
4664
4752
|
* `currency0` or `currency1`.
|
|
4665
4753
|
*/
|
|
@@ -4670,13 +4758,17 @@ interface UniswapV4IntentQuoteOptions {
|
|
|
4670
4758
|
* Parameters for `IntentGateway.quoteIntent`. The source and destination
|
|
4671
4759
|
* chains come from the gateway instance itself.
|
|
4672
4760
|
*
|
|
4673
|
-
*
|
|
4674
|
-
*
|
|
4761
|
+
* Quotes default to `phantom_snapshot`. Pass `strategy: "uniswap_v4"` only to
|
|
4762
|
+
* explicitly request a Uniswap quote. `tokenIn` and `tokenOut` are token
|
|
4763
|
+
* addresses; the SDK resolves configured token metadata internally. Provide
|
|
4764
|
+
* exactly one of `amountIn` or `amountOut`.
|
|
4675
4765
|
*/
|
|
4676
4766
|
interface QuoteIntentParams {
|
|
4677
4767
|
strategy?: IntentQuoteStrategy;
|
|
4678
|
-
|
|
4679
|
-
|
|
4768
|
+
/** Token address on the source chain. */
|
|
4769
|
+
tokenIn: HexString;
|
|
4770
|
+
/** Token address on the destination chain. */
|
|
4771
|
+
tokenOut: HexString;
|
|
4680
4772
|
amountIn?: bigint;
|
|
4681
4773
|
amountOut?: bigint;
|
|
4682
4774
|
uniswapV4?: UniswapV4IntentQuoteOptions;
|
|
@@ -4693,21 +4785,46 @@ interface UniswapV4IntentQuoteMetadata {
|
|
|
4693
4785
|
*/
|
|
4694
4786
|
protocolFeeBps: bigint;
|
|
4695
4787
|
}
|
|
4788
|
+
interface PhantomSnapshotIntentQuoteMetadata {
|
|
4789
|
+
/** Canonical chain whose directional Phantom pair addresses identify the feed. */
|
|
4790
|
+
quoteChain: string;
|
|
4791
|
+
/** Phantom order whose bids produced this snapshot. */
|
|
4792
|
+
commitment: HexString;
|
|
4793
|
+
tokenA: HexString;
|
|
4794
|
+
tokenB: HexString;
|
|
4795
|
+
/** Benchmark input and liquidity-weighted median output, both in raw token units. */
|
|
4796
|
+
standardAmount: bigint;
|
|
4797
|
+
medianPrice: bigint;
|
|
4798
|
+
lowestPrice?: bigint;
|
|
4799
|
+
highestPrice?: bigint;
|
|
4800
|
+
blockNumber: bigint;
|
|
4801
|
+
snapshotTime: Date;
|
|
4802
|
+
bidCount: number;
|
|
4803
|
+
/** Source gateway protocol fee already reflected in the returned quote amounts. */
|
|
4804
|
+
protocolFeeBps: bigint;
|
|
4805
|
+
}
|
|
4696
4806
|
/**
|
|
4697
4807
|
* Quote data partners need before constructing an IntentGateway V2 order.
|
|
4698
4808
|
*
|
|
4699
4809
|
* `amountIn` and `amountOut` already account for the IntentGateway protocol
|
|
4700
4810
|
* fee that the gateway deducts from order inputs (see `quoteMetadata`). No
|
|
4701
|
-
* further fee adjustment is required before placing the order
|
|
4702
|
-
* own slippage tolerance.
|
|
4811
|
+
* further fee or slippage adjustment is required before placing the order.
|
|
4703
4812
|
*/
|
|
4704
|
-
interface
|
|
4813
|
+
interface UniswapV4QuoteIntentResult {
|
|
4705
4814
|
strategy: "uniswap_v4";
|
|
4706
4815
|
tradeType: IntentQuoteTradeType;
|
|
4707
4816
|
amountIn: bigint;
|
|
4708
4817
|
amountOut: bigint;
|
|
4709
4818
|
quoteMetadata: UniswapV4IntentQuoteMetadata;
|
|
4710
4819
|
}
|
|
4820
|
+
interface PhantomSnapshotQuoteIntentResult {
|
|
4821
|
+
strategy: "phantom_snapshot";
|
|
4822
|
+
tradeType: IntentQuoteTradeType;
|
|
4823
|
+
amountIn: bigint;
|
|
4824
|
+
amountOut: bigint;
|
|
4825
|
+
quoteMetadata: PhantomSnapshotIntentQuoteMetadata;
|
|
4826
|
+
}
|
|
4827
|
+
type QuoteIntentResult = UniswapV4QuoteIntentResult | PhantomSnapshotQuoteIntentResult;
|
|
4711
4828
|
declare class UnsupportedIntentQuoteStrategyError extends Error {
|
|
4712
4829
|
constructor(strategy: string);
|
|
4713
4830
|
}
|
|
@@ -4715,18 +4832,25 @@ declare class UnsupportedIntentQuotePairError extends Error {
|
|
|
4715
4832
|
constructor(params: {
|
|
4716
4833
|
source: string;
|
|
4717
4834
|
destination: string;
|
|
4718
|
-
tokenIn:
|
|
4719
|
-
tokenOut:
|
|
4835
|
+
tokenIn: HexString;
|
|
4836
|
+
tokenOut: HexString;
|
|
4837
|
+
quoteSource?: string;
|
|
4720
4838
|
});
|
|
4721
4839
|
}
|
|
4840
|
+
declare class PhantomSnapshotUnavailableError extends Error {
|
|
4841
|
+
constructor(tokenA: HexString, tokenB: HexString);
|
|
4842
|
+
}
|
|
4843
|
+
declare class InvalidPhantomSnapshotError extends Error {
|
|
4844
|
+
constructor(commitment: HexString, reason: string);
|
|
4845
|
+
}
|
|
4722
4846
|
|
|
4723
4847
|
/**
|
|
4724
4848
|
* High-level facade for the IntentGatewayV2 protocol.
|
|
4725
4849
|
*
|
|
4726
4850
|
* `IntentGateway` orchestrates the complete lifecycle of an intent-based
|
|
4727
4851
|
* cross-chain swap:
|
|
4728
|
-
* - **Quoting** — prices the order's input/output amounts via
|
|
4729
|
-
*
|
|
4852
|
+
* - **Quoting** — prices the order's input/output amounts via Phantom order
|
|
4853
|
+
* snapshots by default, with Uniswap V4 available as an explicit strategy.
|
|
4730
4854
|
* - **Order placement** — encodes and yields `placeOrder` calldata; caller
|
|
4731
4855
|
* signs and submits the transaction.
|
|
4732
4856
|
* - **Order execution** — polls the Hyperbridge coprocessor for solver bids,
|
|
@@ -4770,6 +4894,8 @@ declare class IntentGateway {
|
|
|
4770
4894
|
private readonly gasEstimator;
|
|
4771
4895
|
/** Quote strategies for pricing orders before placement, keyed by strategy name. */
|
|
4772
4896
|
private readonly quoteStrategies;
|
|
4897
|
+
/** Resolves order tokens to canonical Phantom snapshot market pairs. */
|
|
4898
|
+
private readonly phantomSnapshotPairResolver;
|
|
4773
4899
|
/**
|
|
4774
4900
|
* Private constructor — use {@link IntentGateway.create} instead.
|
|
4775
4901
|
*
|
|
@@ -4807,28 +4933,44 @@ declare class IntentGateway {
|
|
|
4807
4933
|
/**
|
|
4808
4934
|
* Quotes an intent between this gateway's source and destination chains.
|
|
4809
4935
|
*
|
|
4810
|
-
*
|
|
4811
|
-
*
|
|
4936
|
+
* Uses the latest directional Phantom order price snapshot from the attached
|
|
4937
|
+
* indexer by default. Pass `strategy: "uniswap_v4"` only when explicitly
|
|
4938
|
+
* requesting a Uniswap quote. Provide exactly one of `amountIn` or `amountOut`.
|
|
4812
4939
|
*
|
|
4813
|
-
*
|
|
4814
|
-
*
|
|
4940
|
+
* Both built-in strategies resolve their canonical market on Base,
|
|
4941
|
+
* regardless of this gateway's destination chain. Returned
|
|
4815
4942
|
* `amountIn`/`amountOut` already account for the gateway's protocol fee
|
|
4816
4943
|
* (`quoteMetadata.protocolFeeBps`), which the gateway deducts from order
|
|
4817
|
-
* inputs;
|
|
4944
|
+
* inputs; use the returned amounts directly when placing the order.
|
|
4818
4945
|
*
|
|
4819
4946
|
* @param params - Token pair, amount, and optional strategy/pool overrides.
|
|
4820
4947
|
* @returns The quoted amounts plus strategy-specific metadata.
|
|
4821
4948
|
* @throws {UnsupportedIntentQuoteStrategyError} For unknown strategies.
|
|
4822
|
-
* @throws {UnsupportedIntentQuotePairError} When
|
|
4949
|
+
* @throws {UnsupportedIntentQuotePairError} When the selected strategy does not support the pair.
|
|
4950
|
+
* @throws {PhantomSnapshotUnavailableError} When an eligible cNGN pair has no snapshot.
|
|
4823
4951
|
*/
|
|
4824
4952
|
quoteIntent(params: QuoteIntentParams): Promise<QuoteIntentResult>;
|
|
4953
|
+
/**
|
|
4954
|
+
* Returns the output-token liquidity measured in the latest directional
|
|
4955
|
+
* Phantom snapshot for this gateway's source and destination.
|
|
4956
|
+
*
|
|
4957
|
+
* Pair resolution uses the same canonical Base market as {@link quoteIntent}.
|
|
4958
|
+
* The snapshot itself determines the output token and chain to aggregate. The
|
|
4959
|
+
* amount is in the token's smallest unit and reflects the indexer's
|
|
4960
|
+
* `snapshotTime`; it is not a live reservation or fill guarantee.
|
|
4961
|
+
*
|
|
4962
|
+
* Requires a prior call to {@link withQueryClient}.
|
|
4963
|
+
*/
|
|
4964
|
+
queryAvailableLiquidity(params: Pick<QuoteIntentParams, "tokenIn" | "tokenOut">): Promise<AvailableLiquiditySnapshot | undefined>;
|
|
4825
4965
|
/**
|
|
4826
4966
|
* Bidirectional async generator that orchestrates the full order lifecycle:
|
|
4827
4967
|
* placement, fee estimation, bid collection, and execution.
|
|
4828
4968
|
*
|
|
4829
4969
|
* **Yield/receive protocol:**
|
|
4830
|
-
* 1. If `order.fees` is unset or zero, estimates gas and sets
|
|
4831
|
-
*
|
|
4970
|
+
* 1. If `order.fees` is unset or zero, estimates gas on an internal copy and sets
|
|
4971
|
+
* same-chain fees to twice the estimate. Cross-chain orders retain a 1% buffer
|
|
4972
|
+
* and include an additional 600k-gas fee uplift, while the wei cost used for
|
|
4973
|
+
* the `value` field receives a 2% buffer.
|
|
4832
4974
|
* 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, sessionPrivateKey }`.
|
|
4833
4975
|
* The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
|
|
4834
4976
|
* 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
|
|
@@ -4836,8 +4978,8 @@ declare class IntentGateway {
|
|
|
4836
4978
|
* 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
|
|
4837
4979
|
* subsequent status updates until the order is filled, exhausted, or fails.
|
|
4838
4980
|
*
|
|
4839
|
-
* @param order - The order to place and execute. `order.fees`
|
|
4840
|
-
*
|
|
4981
|
+
* @param order - The order to place and execute. It is not mutated. `order.fees`
|
|
4982
|
+
* may be 0; fees are estimated automatically if so.
|
|
4841
4983
|
* @param graffiti - Optional bytes32 tag for orderflow attribution /
|
|
4842
4984
|
* revenue share. Defaults to {@link DEFAULT_GRAFFITI}.
|
|
4843
4985
|
* @param options - Optional tuning parameters:
|
|
@@ -10322,4 +10464,4 @@ declare function teleport(teleport_param: {
|
|
|
10322
10464
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
10323
10465
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
10324
10466
|
|
|
10325
|
-
export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type Bid, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BytesLikeHex, type CancelEvent, type CancelOptions, type CancelOrderOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, type ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type Deployment, 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, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, type IBatchConsensusAndGetResponseMessage, type IBatchConsensusAndPostRequestMessage, type IChain, type IConfig, type IConsensusMessage, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPharosConfig, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, type IndexerQueryClient, IntentGateway, ABI$1 as IntentGatewayABI, type IntentGatewayContext, type IntentGatewayParams, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, type IntentQuoteStrategy, type
|
|
10467
|
+
export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type AvailableLiquidityByChain, type AvailableLiquiditySnapshot, type Bid, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BytesLikeHex, type CancelEvent, type CancelOptions, type CancelOrderOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, type ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, type Deployment, 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, HyperFungibleToken, HyperFungibleTokenABI, type HyperbridgeTxEvents, type IBatchConsensusAndGetResponseMessage, type IBatchConsensusAndPostRequestMessage, type IChain, type IConfig, type IConsensusMessage, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPharosConfig, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, type IndexerQueryClient, IntentGateway, ABI$1 as IntentGatewayABI, type IntentGatewayContext, type IntentGatewayParams, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, type IntentQuoteStrategy, type IntentQuoteTradeType, IntentsCoprocessor, InvalidPhantomSnapshotError, IsmpClient, type IsmpRequest, MOCK_ADDRESS, 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 PhantomOrderEvent, type PhantomOrderPriceSnapshot, type PhantomOrderPriceSnapshotsResponse, type PhantomSnapshotIntentQuoteMetadata, type PhantomSnapshotQuoteIntentResult, PhantomSnapshotUnavailableError, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, type PollPhantomOrdersOptions, type PostRequestStatus, type PostRequestTimeoutStatus, type 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, type RequestBody, type RequestCommitment, RequestKind, type RequestResponse, RequestStatus, type RequestStatusKey, type RequestStatusWithMetadata, type ResponseCommitmentWithValues, type ResumeIntentOrderOptions, type RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, type SelectBidResult, type SelectOptions, type SigningAccount, type StateMachineHeight, type StateMachineId, 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 UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, type UniswapV4IntentQuoteMetadata, type UniswapV4IntentQuoteOptions, type UniswapV4PoolConfigData, type UniswapV4PoolKey, type UniswapV4QuoteIntentResult, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeERC7821ExecuteBatch, decodeUserOpScale, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeStateMachineId, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, pharosAtlantic, pharosMainnet, polkadotAssetHubPaseo, polkadotHubMainnet, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|