@hyperbridge/sdk 2.6.1 → 2.8.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 +563 -411
- package/dist/browser/index.js +260 -60
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +260 -58
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +44 -12
- package/dist/node/index.d.ts +44 -12
- package/dist/node/index.js +260 -60
- package/dist/node/index.js.map +1 -1
- package/dist/node/{IntentGatewayV2-BJUF1dsr.d.cts → intents-helpers-gyGREuyu.d.cts} +1943 -248
- package/dist/node/{IntentGatewayV2-BJUF1dsr.d.ts → intents-helpers-gyGREuyu.d.ts} +1943 -248
- package/dist/node/intents-helpers.cjs +113 -19
- package/dist/node/intents-helpers.cjs.map +1 -1
- package/dist/node/intents-helpers.d.cts +3 -1506
- package/dist/node/intents-helpers.d.ts +3 -1506
- package/dist/node/intents-helpers.js +111 -21
- 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 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
|
|
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 OrderFeesQuote, L as ERC7821Call, M as OrderWithStatus, N as OrderStatus, Q as TokenGatewayAssetTeleportedWithStatus, U as TeleportStatus, V as DecodedOrderPlacedLog, W as DecodedPostRequestEvent, X as DecodedPostResponseEvent } from './intents-helpers-gyGREuyu.cjs';
|
|
2
|
+
export { Y as AllStatusKey, Z as AssetTeleportedResponse, _ as AvailableLiquidityByChain, $ as BidStorageEntry, a0 as BidSubmissionResult, a1 as BlockMetadata, a2 as BytesLikeHex, a3 as CancelOptions, a4 as ChainConfig, a5 as ChainConfigData, a6 as Chains, a7 as ConfiguredAssetSymbol, a8 as Deployment, a9 as DispatchGet, aa as DispatchInfo, ab as DispatchPost, ac as Erc4626VaultConfigData, ad as ExecuteIntentOrderOptions, ae as ExecutionResult, af as FillOptions, ag as FillerConfig, ah as GetRequestResponse, ai as GetResponseByRequestIdResponse, aj as GetResponseStorageValues, ak as HostParams, al as HyperClientStatus, am as IBatchConsensusAndGetResponseMessage, an as IBatchConsensusAndPostRequestMessage, ao as IConfig, ap as IConsensusMessage, aq as IGetRequestMessage, ar as IGetResponse, as as IGetResponseMessage, at as IHyperbridgeConfig, au as IPostResponse, av as IRequestMessage, aw as ISubstrateConfig, ax as ITimeoutPostRequestMessage, ay as IntentGatewayABI, az as IntentGatewayParams, aA as IntentOrderStatus, aB as IntentOrderStatusKey, aC as IsmpRequest, aD as OrderResponse, aE as OrderStatusMetadata, aF as PaymentInfo, aG as PhantomOrderEvent, aH as PhantomOrderLeg, aI as PhantomOrderPriceSnapshot, aJ as PhantomOrderPriceSnapshotsResponse, aK as PollPhantomOrdersOptions, aL as PostRequestStatus, aM as RequestBody, aN as RequestCommitment, aO as RequestKind, aP as RequestResponse, aQ as RequestStatus, aR as RequestStatusKey, aS as SelectOptions, aT as SigningAccount, aU as StateMachineId, aV as StateMachineResponse, aW as StorageFacade, aX as TimeoutStatus, aY as TimeoutStatusKey, aZ as TokenGatewayAssetTeleportedResponse, a_ as TokenInfo, a$ as TokenPrice, b0 as TokenPricesResponse, b1 as UniswapV4PoolConfigData, b2 as chainConfigs, b3 as convertCodecToIGetRequest, b4 as convertCodecToIProof, b5 as convertIGetRequestToCodec, b6 as convertIProofToCodec, b7 as convertStateIdToStateMachineId, b8 as convertStateMachineEnumToString, b9 as convertStateMachineIdToEnum, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bf as encodeISMPMessage, bg as encodeUserOpScale, bh as getChainId, bi as getConfigByStateMachineId, bj as getViemChain, bk as hyperbridgeAddress, bl as pharosAtlantic, bm as pharosMainnet, bn as polkadotAssetHubPaseo, bo as polkadotHubMainnet, bp as tronChainIds, bq as tronNile } from './intents-helpers-gyGREuyu.cjs';
|
|
3
3
|
import { ConsolaInstance } from 'consola';
|
|
4
4
|
import { GraphQLClient } from 'graphql-request';
|
|
5
5
|
import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
|
|
@@ -9,9 +9,9 @@ import { SignerOptions, SubmittableExtrinsic } from '@polkadot/api/types';
|
|
|
9
9
|
import { ISubmittableResult } from '@polkadot/types/types';
|
|
10
10
|
import { TronWeb } from 'tronweb';
|
|
11
11
|
export { Account as ViemAccount } from 'viem/accounts';
|
|
12
|
-
import '@polkadot/keyring/types';
|
|
13
12
|
import 'decimal.js';
|
|
14
13
|
import 'viem/chains';
|
|
14
|
+
import '@polkadot/keyring/types';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* The default address used as fallback when no address is provided.
|
|
@@ -1917,14 +1917,22 @@ declare class IntentGateway {
|
|
|
1917
1917
|
* placement, fee estimation, bid collection, and execution.
|
|
1918
1918
|
*
|
|
1919
1919
|
* **Yield/receive protocol:**
|
|
1920
|
-
* 1. If `order.fees` is unset or zero,
|
|
1921
|
-
*
|
|
1922
|
-
*
|
|
1923
|
-
*
|
|
1924
|
-
* the whole sum — strictly above the solver's
|
|
1925
|
-
*
|
|
1926
|
-
*
|
|
1927
|
-
*
|
|
1920
|
+
* 1. If `order.fees` is unset or zero, prices the fee on an internal copy
|
|
1921
|
+
* via {@link quoteOrderFees}: same-chain fees are twice the fill-gas
|
|
1922
|
+
* estimate without a gas-price bump; cross-chain gas is priced 10% above
|
|
1923
|
+
* the live price before attaching (fill gas + the settlement relayer fee)
|
|
1924
|
+
* with a further 5% buffer over the whole sum — strictly above the solver's
|
|
1925
|
+
* unpadded requirement. Direct solver estimates remain unbumped. The wei
|
|
1926
|
+
* cost used for the `value` field receives a 2% buffer.
|
|
1927
|
+
* 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, nativeFee,
|
|
1928
|
+
* feeTokenAmount, feeTokenAddress, sessionPrivateKey }`. `value` carries
|
|
1929
|
+
* only the order's native-token input amounts; `nativeFee` is the native
|
|
1930
|
+
* amount that funds `order.fees` (`0n` when the caller set `order.fees`);
|
|
1931
|
+
* `feeTokenAmount`/`feeTokenAddress` are the exact fee encoded in `data`
|
|
1932
|
+
* and the source-chain token it is charged in. To pay the fee in native
|
|
1933
|
+
* token, sign the transaction with `value + nativeFee`; with a fee-token
|
|
1934
|
+
* allowance, `value` alone. Pass the signed transaction back via
|
|
1935
|
+
* `gen.next(signedTx)`.
|
|
1928
1936
|
* 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
|
|
1929
1937
|
* the `OrderPlaced` event is confirmed.
|
|
1930
1938
|
* 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
|
|
@@ -2137,6 +2145,30 @@ declare class IntentGateway {
|
|
|
2137
2145
|
* @returns A {@link FillOrderEstimate} with all gas components.
|
|
2138
2146
|
*/
|
|
2139
2147
|
estimateFillOrder(params: EstimateFillOrderParams): Promise<FillOrderEstimate>;
|
|
2148
|
+
/**
|
|
2149
|
+
* Quotes the solver fee for an order using the same policy {@link execute} /
|
|
2150
|
+
* {@link executeBest} apply when `order.fees` is `0n`.
|
|
2151
|
+
*
|
|
2152
|
+
* Use this before placing to display the fee, or to check what the user can
|
|
2153
|
+
* afford: pay `fees` in the source-chain fee token (check balance and
|
|
2154
|
+
* allowance, then set `order.fees` and submit with `value: 0`), or leave
|
|
2155
|
+
* `order.fees` at `0n` and let the SDK attach `nativeValue` to the placement
|
|
2156
|
+
* transaction (check the native balance).
|
|
2157
|
+
*
|
|
2158
|
+
* @param order - The order to quote. `order.fees` is ignored and not mutated.
|
|
2159
|
+
* Gas prices used to derive cross-chain `fees` receive 10% SDK-only headroom.
|
|
2160
|
+
* Same-chain quotes and direct calls to {@link estimateFillOrder}, including
|
|
2161
|
+
* Simplex solver estimates, remain unbumped.
|
|
2162
|
+
*
|
|
2163
|
+
* @param options - Optional transaction gas-price bump percentages, as in {@link execute}.
|
|
2164
|
+
* @returns An {@link OrderFeesQuote} with the fee-token amount, the native
|
|
2165
|
+
* value for the native rail, and the underlying estimate.
|
|
2166
|
+
* @throws If gas estimation returns zero.
|
|
2167
|
+
*/
|
|
2168
|
+
quoteOrderFees(order: Order, options?: {
|
|
2169
|
+
maxPriorityFeePerGasBumpPercent?: number;
|
|
2170
|
+
maxFeePerGasBumpPercent?: number;
|
|
2171
|
+
}): Promise<OrderFeesQuote>;
|
|
2140
2172
|
/**
|
|
2141
2173
|
* Encodes a list of calls into ERC-7821 `execute` calldata using
|
|
2142
2174
|
* single-batch mode.
|
|
@@ -6023,4 +6055,4 @@ declare function teleport(teleport_param: {
|
|
|
6023
6055
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
6024
6056
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
6025
6057
|
|
|
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 };
|
|
6058
|
+
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, OrderFeesQuote, 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 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
|
|
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 OrderFeesQuote, L as ERC7821Call, M as OrderWithStatus, N as OrderStatus, Q as TokenGatewayAssetTeleportedWithStatus, U as TeleportStatus, V as DecodedOrderPlacedLog, W as DecodedPostRequestEvent, X as DecodedPostResponseEvent } from './intents-helpers-gyGREuyu.js';
|
|
2
|
+
export { Y as AllStatusKey, Z as AssetTeleportedResponse, _ as AvailableLiquidityByChain, $ as BidStorageEntry, a0 as BidSubmissionResult, a1 as BlockMetadata, a2 as BytesLikeHex, a3 as CancelOptions, a4 as ChainConfig, a5 as ChainConfigData, a6 as Chains, a7 as ConfiguredAssetSymbol, a8 as Deployment, a9 as DispatchGet, aa as DispatchInfo, ab as DispatchPost, ac as Erc4626VaultConfigData, ad as ExecuteIntentOrderOptions, ae as ExecutionResult, af as FillOptions, ag as FillerConfig, ah as GetRequestResponse, ai as GetResponseByRequestIdResponse, aj as GetResponseStorageValues, ak as HostParams, al as HyperClientStatus, am as IBatchConsensusAndGetResponseMessage, an as IBatchConsensusAndPostRequestMessage, ao as IConfig, ap as IConsensusMessage, aq as IGetRequestMessage, ar as IGetResponse, as as IGetResponseMessage, at as IHyperbridgeConfig, au as IPostResponse, av as IRequestMessage, aw as ISubstrateConfig, ax as ITimeoutPostRequestMessage, ay as IntentGatewayABI, az as IntentGatewayParams, aA as IntentOrderStatus, aB as IntentOrderStatusKey, aC as IsmpRequest, aD as OrderResponse, aE as OrderStatusMetadata, aF as PaymentInfo, aG as PhantomOrderEvent, aH as PhantomOrderLeg, aI as PhantomOrderPriceSnapshot, aJ as PhantomOrderPriceSnapshotsResponse, aK as PollPhantomOrdersOptions, aL as PostRequestStatus, aM as RequestBody, aN as RequestCommitment, aO as RequestKind, aP as RequestResponse, aQ as RequestStatus, aR as RequestStatusKey, aS as SelectOptions, aT as SigningAccount, aU as StateMachineId, aV as StateMachineResponse, aW as StorageFacade, aX as TimeoutStatus, aY as TimeoutStatusKey, aZ as TokenGatewayAssetTeleportedResponse, a_ as TokenInfo, a$ as TokenPrice, b0 as TokenPricesResponse, b1 as UniswapV4PoolConfigData, b2 as chainConfigs, b3 as convertCodecToIGetRequest, b4 as convertCodecToIProof, b5 as convertIGetRequestToCodec, b6 as convertIProofToCodec, b7 as convertStateIdToStateMachineId, b8 as convertStateMachineEnumToString, b9 as convertStateMachineIdToEnum, ba as decodeAcceptedSourceChains, bb as decodeERC7821ExecuteBatch, bc as decodeUserOpScale, bd as encodeAcceptedSourceChains, be as encodeERC7821ExecuteBatch, bf as encodeISMPMessage, bg as encodeUserOpScale, bh as getChainId, bi as getConfigByStateMachineId, bj as getViemChain, bk as hyperbridgeAddress, bl as pharosAtlantic, bm as pharosMainnet, bn as polkadotAssetHubPaseo, bo as polkadotHubMainnet, bp as tronChainIds, bq as tronNile } from './intents-helpers-gyGREuyu.js';
|
|
3
3
|
import { ConsolaInstance } from 'consola';
|
|
4
4
|
import { GraphQLClient } from 'graphql-request';
|
|
5
5
|
import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
|
|
@@ -9,9 +9,9 @@ import { SignerOptions, SubmittableExtrinsic } from '@polkadot/api/types';
|
|
|
9
9
|
import { ISubmittableResult } from '@polkadot/types/types';
|
|
10
10
|
import { TronWeb } from 'tronweb';
|
|
11
11
|
export { Account as ViemAccount } from 'viem/accounts';
|
|
12
|
-
import '@polkadot/keyring/types';
|
|
13
12
|
import 'decimal.js';
|
|
14
13
|
import 'viem/chains';
|
|
14
|
+
import '@polkadot/keyring/types';
|
|
15
15
|
|
|
16
16
|
/**
|
|
17
17
|
* The default address used as fallback when no address is provided.
|
|
@@ -1917,14 +1917,22 @@ declare class IntentGateway {
|
|
|
1917
1917
|
* placement, fee estimation, bid collection, and execution.
|
|
1918
1918
|
*
|
|
1919
1919
|
* **Yield/receive protocol:**
|
|
1920
|
-
* 1. If `order.fees` is unset or zero,
|
|
1921
|
-
*
|
|
1922
|
-
*
|
|
1923
|
-
*
|
|
1924
|
-
* the whole sum — strictly above the solver's
|
|
1925
|
-
*
|
|
1926
|
-
*
|
|
1927
|
-
*
|
|
1920
|
+
* 1. If `order.fees` is unset or zero, prices the fee on an internal copy
|
|
1921
|
+
* via {@link quoteOrderFees}: same-chain fees are twice the fill-gas
|
|
1922
|
+
* estimate without a gas-price bump; cross-chain gas is priced 10% above
|
|
1923
|
+
* the live price before attaching (fill gas + the settlement relayer fee)
|
|
1924
|
+
* with a further 5% buffer over the whole sum — strictly above the solver's
|
|
1925
|
+
* unpadded requirement. Direct solver estimates remain unbumped. The wei
|
|
1926
|
+
* cost used for the `value` field receives a 2% buffer.
|
|
1927
|
+
* 2. Yields `AWAITING_PLACE_ORDER` with `{ to, data, value, nativeFee,
|
|
1928
|
+
* feeTokenAmount, feeTokenAddress, sessionPrivateKey }`. `value` carries
|
|
1929
|
+
* only the order's native-token input amounts; `nativeFee` is the native
|
|
1930
|
+
* amount that funds `order.fees` (`0n` when the caller set `order.fees`);
|
|
1931
|
+
* `feeTokenAmount`/`feeTokenAddress` are the exact fee encoded in `data`
|
|
1932
|
+
* and the source-chain token it is charged in. To pay the fee in native
|
|
1933
|
+
* token, sign the transaction with `value + nativeFee`; with a fee-token
|
|
1934
|
+
* allowance, `value` alone. Pass the signed transaction back via
|
|
1935
|
+
* `gen.next(signedTx)`.
|
|
1928
1936
|
* 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
|
|
1929
1937
|
* the `OrderPlaced` event is confirmed.
|
|
1930
1938
|
* 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
|
|
@@ -2137,6 +2145,30 @@ declare class IntentGateway {
|
|
|
2137
2145
|
* @returns A {@link FillOrderEstimate} with all gas components.
|
|
2138
2146
|
*/
|
|
2139
2147
|
estimateFillOrder(params: EstimateFillOrderParams): Promise<FillOrderEstimate>;
|
|
2148
|
+
/**
|
|
2149
|
+
* Quotes the solver fee for an order using the same policy {@link execute} /
|
|
2150
|
+
* {@link executeBest} apply when `order.fees` is `0n`.
|
|
2151
|
+
*
|
|
2152
|
+
* Use this before placing to display the fee, or to check what the user can
|
|
2153
|
+
* afford: pay `fees` in the source-chain fee token (check balance and
|
|
2154
|
+
* allowance, then set `order.fees` and submit with `value: 0`), or leave
|
|
2155
|
+
* `order.fees` at `0n` and let the SDK attach `nativeValue` to the placement
|
|
2156
|
+
* transaction (check the native balance).
|
|
2157
|
+
*
|
|
2158
|
+
* @param order - The order to quote. `order.fees` is ignored and not mutated.
|
|
2159
|
+
* Gas prices used to derive cross-chain `fees` receive 10% SDK-only headroom.
|
|
2160
|
+
* Same-chain quotes and direct calls to {@link estimateFillOrder}, including
|
|
2161
|
+
* Simplex solver estimates, remain unbumped.
|
|
2162
|
+
*
|
|
2163
|
+
* @param options - Optional transaction gas-price bump percentages, as in {@link execute}.
|
|
2164
|
+
* @returns An {@link OrderFeesQuote} with the fee-token amount, the native
|
|
2165
|
+
* value for the native rail, and the underlying estimate.
|
|
2166
|
+
* @throws If gas estimation returns zero.
|
|
2167
|
+
*/
|
|
2168
|
+
quoteOrderFees(order: Order, options?: {
|
|
2169
|
+
maxPriorityFeePerGasBumpPercent?: number;
|
|
2170
|
+
maxFeePerGasBumpPercent?: number;
|
|
2171
|
+
}): Promise<OrderFeesQuote>;
|
|
2140
2172
|
/**
|
|
2141
2173
|
* Encodes a list of calls into ERC-7821 `execute` calldata using
|
|
2142
2174
|
* single-batch mode.
|
|
@@ -6023,4 +6055,4 @@ declare function teleport(teleport_param: {
|
|
|
6023
6055
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
6024
6056
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
6025
6057
|
|
|
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 };
|
|
6058
|
+
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, OrderFeesQuote, 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 };
|