@hyperbridge/sdk 2.8.18 → 2.8.19
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 +14 -1
- package/dist/browser/index.js +137 -10
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +137 -10
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +11 -3
- package/dist/node/index.d.ts +11 -3
- package/dist/node/index.js +137 -10
- package/dist/node/index.js.map +1 -1
- package/dist/node/{intents-helpers-BHl2If1T.d.cts → intents-helpers-D0JcQNDm.d.cts} +6 -1
- package/dist/node/{intents-helpers-BHl2If1T.d.ts → intents-helpers-D0JcQNDm.d.ts} +6 -1
- package/dist/node/intents-helpers.d.cts +1 -1
- package/dist/node/intents-helpers.d.ts +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 Chains, t as ConfiguredAssetSymbol, Q as QueryBuyAndSellRatesParams, u as IntentOrderStatusUpdate, v as SelectBidResult, w as ResumeIntentOrderOptions, x as CancelOrderOptions, y as CancelQuote, z as SubmitBidOptions, B as PackedUserOperation, F as FillerBid, D as Bid, J as EstimateFillOrderParams, K as FillOrderEstimate, L 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 Chains, t as ConfiguredAssetSymbol, Q as QueryBuyAndSellRatesParams, u as IntentOrderStatusUpdate, v as SelectBidResult, w as ResumeIntentOrderOptions, x as CancelOrderOptions, y as CancelQuote, z as SubmitBidOptions, B as PackedUserOperation, F as FillerBid, D as Bid, J as EstimateFillOrderParams, K as FillOrderEstimate, L as BidPreVerificationGasParams, M as OrderFeesQuote, N as ERC7821Call, U as TokenInfo, V as OrderWithStatus, W as OrderStatus, X as FillOptions, Y as TokenGatewayAssetTeleportedWithStatus, Z as TeleportStatus, _ as DecodedOrderPlacedLog, $ as DecodedPostRequestEvent, a0 as DecodedPostResponseEvent } from './intents-helpers-D0JcQNDm.cjs';
|
|
2
|
+
export { a1 as AllStatusKey, a2 as AssetTeleportedResponse, a3 as BidStorageEntry, a4 as BidSubmissionResult, a5 as BlockMetadata, a6 as BytesLikeHex, a7 as CancelOptions, a8 as ChainConfig, a9 as ChainConfigData, aa as ConfiguredAssetSymbolInput, ab as Deployment, ac as DispatchGet, ad as DispatchInfo, ae as DispatchPost, af as Erc4626VaultConfigData, ag as ExecuteIntentOrderOptions, ah as ExecutionResult, ai as FillerConfig, aj as GetRequestResponse, ak as GetResponseByRequestIdResponse, al as GetResponseStorageValues, am as HostParams, an as HyperClientStatus, ao as IBatchConsensusAndGetResponseMessage, ap as IBatchConsensusAndPostRequestMessage, aq as IConfig, ar as IConsensusMessage, as as IGetRequestMessage, at as IGetResponse, au as IGetResponseMessage, av as IHyperbridgeConfig, aw as INCLUSION_TIMEOUT_MS, ax as IPostResponse, ay as IRequestMessage, az as ISubstrateConfig, aA as ITimeoutPostRequestMessage, aB as IntentGatewayABI, aC as IntentGatewayParams, aD as IntentOrderStatus, aE as IntentOrderStatusKey, aF as IsmpRequest, aG as MAX_DECLARED_ENTRIES, aH as OrderResponse, aI as OrderStatusMetadata, aJ as PERMIT2_SPONSORSHIP_BYTES, aK as PaymentInfo, aL as PhantomBidDeclaration, aM as PhantomBidPaymasterAndData, aN as PhantomBidSponsorship, aO as PostRequestStatus, aP as RequestBody, aQ as RequestCommitment, aR as RequestKind, aS as RequestResponse, aT as RequestStatus, aU as RequestStatusKey, aV as RpcBidInfo, aW as SelectOptions, aX as SigningAccount, aY as StateMachineId, aZ as StateMachineResponse, a_ as StorageFacade, a$ as TimeoutStatus, b0 as TimeoutStatusKey, b1 as TokenGatewayAssetTeleportedResponse, b2 as TokenPrice, b3 as TokenPricesResponse, b4 as chainConfigs, b5 as convertCodecToIGetRequest, b6 as convertCodecToIProof, b7 as convertIGetRequestToCodec, b8 as convertIProofToCodec, b9 as convertStateIdToStateMachineId, ba as convertStateMachineEnumToString, bb as convertStateMachineIdToEnum, bc as decodeAcceptedSourceChains, bd as decodeERC7821ExecuteBatch, be as decodePhantomBidDeclaration, bf as decodePhantomBidPaymasterAndData, bg as decodeUserOpScale, bh as deriveHttpUrl, bi as encodeAcceptedSourceChains, bj as encodeERC7821ExecuteBatch, bk as encodeISMPMessage, bl as encodePhantomBidDeclaration, bm as encodePhantomBidPaymasterAndData, bn as encodeUserOpScale, bo as getChainId, bp as getConfigByStateMachineId, bq as getViemChain, br as hyperbridgeAddress, bs as pharosAtlantic, bt as pharosMainnet, bu as polkadotAssetHubPaseo, bv as polkadotHubMainnet, bw as poolSlug, bx as sortPoolSymbols, by as tronChainIds, bz as tronNile } from './intents-helpers-D0JcQNDm.cjs';
|
|
3
3
|
import { ConsolaInstance } from 'consola';
|
|
4
4
|
import { GraphQLClient } from 'graphql-request';
|
|
5
5
|
import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
|
|
@@ -2397,6 +2397,14 @@ declare class IntentGateway {
|
|
|
2397
2397
|
* @returns A {@link FillOrderEstimate} with all gas components.
|
|
2398
2398
|
*/
|
|
2399
2399
|
estimateFillOrder(params: EstimateFillOrderParams): Promise<FillOrderEstimate>;
|
|
2400
|
+
/**
|
|
2401
|
+
* Asks the bundler for the `preVerificationGas` of a bid as it will be signed, priced at
|
|
2402
|
+
* the gas price its bundle pays. Call it with the final calldata and `paymasterAndData`,
|
|
2403
|
+
* before {@link prepareSubmitBid} signs the op.
|
|
2404
|
+
*
|
|
2405
|
+
* Delegates to {@link GasEstimator.estimateBidPreVerificationGas}.
|
|
2406
|
+
*/
|
|
2407
|
+
estimateBidPreVerificationGas(params: BidPreVerificationGasParams): Promise<bigint>;
|
|
2400
2408
|
/**
|
|
2401
2409
|
* Quotes the solver fee for an order using the same policy {@link execute} /
|
|
2402
2410
|
* {@link executeBest} apply when `order.fees` is `0n`.
|
|
@@ -6447,4 +6455,4 @@ declare function teleport(teleport_param: {
|
|
|
6447
6455
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
6448
6456
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
6449
6457
|
|
|
6450
|
-
export { ADDRESS_ZERO, AssetTeleported, type AvailableLiquidity, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BuyAndSellRates, CONTRACT_VERSION_ABI, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, Chains, ClientConfig, ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedFillOrder, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FILL_ORDER_SELECTOR, FillOptions, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, HyperFxOrderbook, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteLeg, IntentsCoprocessor, IsmpClient, MOCK_ADDRESS, ORDERBOOK_DECIMALS, ORDERBOOK_QUERIES, ORDERBOOK_URLS, ORDER_V2_PARAM_TYPE, Order, OrderFeesQuote, OrderStatus, OrderStatusChecker, OrderWithStatus, type OrderbookBook, type OrderbookLevelQuote, type OrderbookQuoteFill, OrderbookQuoteNotConvergedError, type OrderbookRate, OrderbookRequestError, type OrderbookRoute, type OrderbookRouteKind, type OrderbookRouteLiquidity, type OrderbookSide, type OrderbookSwapQuote, type OrderbookTopOfBook, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PessimisticQuoteIntentResult, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, QueryBuyAndSellRatesParams, 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 RateFillPreview, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SUPPORTED_INTENTS_VERSION, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, TokenInfo, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, assertGatewayRelease, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, decodeFillOrder, encodeFillOrder, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, isCanonicalEvmToken, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, orderbookUrlFor, parseStateMachineId, postRequestCommitment, previewRateFill, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readLegEscrow, readLegPartialFill, requestCommitmentKey, responseCommitmentKey, retryPromise, supportsRateFills, teleport, teleportDot, transformOrderForContract };
|
|
6458
|
+
export { ADDRESS_ZERO, AssetTeleported, type AvailableLiquidity, Bid, BidPreVerificationGasParams, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BuyAndSellRates, CONTRACT_VERSION_ABI, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, Chains, ClientConfig, ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedFillOrder, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FILL_ORDER_SELECTOR, FillOptions, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, HyperFxOrderbook, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteLeg, IntentsCoprocessor, IsmpClient, MOCK_ADDRESS, ORDERBOOK_DECIMALS, ORDERBOOK_QUERIES, ORDERBOOK_URLS, ORDER_V2_PARAM_TYPE, Order, OrderFeesQuote, OrderStatus, OrderStatusChecker, OrderWithStatus, type OrderbookBook, type OrderbookLevelQuote, type OrderbookQuoteFill, OrderbookQuoteNotConvergedError, type OrderbookRate, OrderbookRequestError, type OrderbookRoute, type OrderbookRouteKind, type OrderbookRouteLiquidity, type OrderbookSide, type OrderbookSwapQuote, type OrderbookTopOfBook, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PessimisticQuoteIntentResult, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, QueryBuyAndSellRatesParams, 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 RateFillPreview, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SUPPORTED_INTENTS_VERSION, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, TokenInfo, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, assertGatewayRelease, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, decodeFillOrder, encodeFillOrder, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, isCanonicalEvmToken, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, orderbookUrlFor, parseStateMachineId, postRequestCommitment, previewRateFill, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readLegEscrow, readLegPartialFill, requestCommitmentKey, responseCommitmentKey, retryPromise, supportsRateFills, 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 Chains, t as ConfiguredAssetSymbol, Q as QueryBuyAndSellRatesParams, u as IntentOrderStatusUpdate, v as SelectBidResult, w as ResumeIntentOrderOptions, x as CancelOrderOptions, y as CancelQuote, z as SubmitBidOptions, B as PackedUserOperation, F as FillerBid, D as Bid, J as EstimateFillOrderParams, K as FillOrderEstimate, L 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 Chains, t as ConfiguredAssetSymbol, Q as QueryBuyAndSellRatesParams, u as IntentOrderStatusUpdate, v as SelectBidResult, w as ResumeIntentOrderOptions, x as CancelOrderOptions, y as CancelQuote, z as SubmitBidOptions, B as PackedUserOperation, F as FillerBid, D as Bid, J as EstimateFillOrderParams, K as FillOrderEstimate, L as BidPreVerificationGasParams, M as OrderFeesQuote, N as ERC7821Call, U as TokenInfo, V as OrderWithStatus, W as OrderStatus, X as FillOptions, Y as TokenGatewayAssetTeleportedWithStatus, Z as TeleportStatus, _ as DecodedOrderPlacedLog, $ as DecodedPostRequestEvent, a0 as DecodedPostResponseEvent } from './intents-helpers-D0JcQNDm.js';
|
|
2
|
+
export { a1 as AllStatusKey, a2 as AssetTeleportedResponse, a3 as BidStorageEntry, a4 as BidSubmissionResult, a5 as BlockMetadata, a6 as BytesLikeHex, a7 as CancelOptions, a8 as ChainConfig, a9 as ChainConfigData, aa as ConfiguredAssetSymbolInput, ab as Deployment, ac as DispatchGet, ad as DispatchInfo, ae as DispatchPost, af as Erc4626VaultConfigData, ag as ExecuteIntentOrderOptions, ah as ExecutionResult, ai as FillerConfig, aj as GetRequestResponse, ak as GetResponseByRequestIdResponse, al as GetResponseStorageValues, am as HostParams, an as HyperClientStatus, ao as IBatchConsensusAndGetResponseMessage, ap as IBatchConsensusAndPostRequestMessage, aq as IConfig, ar as IConsensusMessage, as as IGetRequestMessage, at as IGetResponse, au as IGetResponseMessage, av as IHyperbridgeConfig, aw as INCLUSION_TIMEOUT_MS, ax as IPostResponse, ay as IRequestMessage, az as ISubstrateConfig, aA as ITimeoutPostRequestMessage, aB as IntentGatewayABI, aC as IntentGatewayParams, aD as IntentOrderStatus, aE as IntentOrderStatusKey, aF as IsmpRequest, aG as MAX_DECLARED_ENTRIES, aH as OrderResponse, aI as OrderStatusMetadata, aJ as PERMIT2_SPONSORSHIP_BYTES, aK as PaymentInfo, aL as PhantomBidDeclaration, aM as PhantomBidPaymasterAndData, aN as PhantomBidSponsorship, aO as PostRequestStatus, aP as RequestBody, aQ as RequestCommitment, aR as RequestKind, aS as RequestResponse, aT as RequestStatus, aU as RequestStatusKey, aV as RpcBidInfo, aW as SelectOptions, aX as SigningAccount, aY as StateMachineId, aZ as StateMachineResponse, a_ as StorageFacade, a$ as TimeoutStatus, b0 as TimeoutStatusKey, b1 as TokenGatewayAssetTeleportedResponse, b2 as TokenPrice, b3 as TokenPricesResponse, b4 as chainConfigs, b5 as convertCodecToIGetRequest, b6 as convertCodecToIProof, b7 as convertIGetRequestToCodec, b8 as convertIProofToCodec, b9 as convertStateIdToStateMachineId, ba as convertStateMachineEnumToString, bb as convertStateMachineIdToEnum, bc as decodeAcceptedSourceChains, bd as decodeERC7821ExecuteBatch, be as decodePhantomBidDeclaration, bf as decodePhantomBidPaymasterAndData, bg as decodeUserOpScale, bh as deriveHttpUrl, bi as encodeAcceptedSourceChains, bj as encodeERC7821ExecuteBatch, bk as encodeISMPMessage, bl as encodePhantomBidDeclaration, bm as encodePhantomBidPaymasterAndData, bn as encodeUserOpScale, bo as getChainId, bp as getConfigByStateMachineId, bq as getViemChain, br as hyperbridgeAddress, bs as pharosAtlantic, bt as pharosMainnet, bu as polkadotAssetHubPaseo, bv as polkadotHubMainnet, bw as poolSlug, bx as sortPoolSymbols, by as tronChainIds, bz as tronNile } from './intents-helpers-D0JcQNDm.js';
|
|
3
3
|
import { ConsolaInstance } from 'consola';
|
|
4
4
|
import { GraphQLClient } from 'graphql-request';
|
|
5
5
|
import { PublicClient, TransactionReceipt, Hex, Address } from 'viem';
|
|
@@ -2397,6 +2397,14 @@ declare class IntentGateway {
|
|
|
2397
2397
|
* @returns A {@link FillOrderEstimate} with all gas components.
|
|
2398
2398
|
*/
|
|
2399
2399
|
estimateFillOrder(params: EstimateFillOrderParams): Promise<FillOrderEstimate>;
|
|
2400
|
+
/**
|
|
2401
|
+
* Asks the bundler for the `preVerificationGas` of a bid as it will be signed, priced at
|
|
2402
|
+
* the gas price its bundle pays. Call it with the final calldata and `paymasterAndData`,
|
|
2403
|
+
* before {@link prepareSubmitBid} signs the op.
|
|
2404
|
+
*
|
|
2405
|
+
* Delegates to {@link GasEstimator.estimateBidPreVerificationGas}.
|
|
2406
|
+
*/
|
|
2407
|
+
estimateBidPreVerificationGas(params: BidPreVerificationGasParams): Promise<bigint>;
|
|
2400
2408
|
/**
|
|
2401
2409
|
* Quotes the solver fee for an order using the same policy {@link execute} /
|
|
2402
2410
|
* {@link executeBest} apply when `order.fees` is `0n`.
|
|
@@ -6447,4 +6455,4 @@ declare function teleport(teleport_param: {
|
|
|
6447
6455
|
extrinsics?: Array<SubmittableExtrinsic<"promise", ISubmittableResult>>;
|
|
6448
6456
|
}): Promise<ReadableStream<HyperbridgeTxEvents>>;
|
|
6449
6457
|
|
|
6450
|
-
export { ADDRESS_ZERO, AssetTeleported, type AvailableLiquidity, Bid, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BuyAndSellRates, CONTRACT_VERSION_ABI, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, Chains, ClientConfig, ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedFillOrder, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FILL_ORDER_SELECTOR, FillOptions, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, HyperFxOrderbook, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteLeg, IntentsCoprocessor, IsmpClient, MOCK_ADDRESS, ORDERBOOK_DECIMALS, ORDERBOOK_QUERIES, ORDERBOOK_URLS, ORDER_V2_PARAM_TYPE, Order, OrderFeesQuote, OrderStatus, OrderStatusChecker, OrderWithStatus, type OrderbookBook, type OrderbookLevelQuote, type OrderbookQuoteFill, OrderbookQuoteNotConvergedError, type OrderbookRate, OrderbookRequestError, type OrderbookRoute, type OrderbookRouteKind, type OrderbookRouteLiquidity, type OrderbookSide, type OrderbookSwapQuote, type OrderbookTopOfBook, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PessimisticQuoteIntentResult, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, QueryBuyAndSellRatesParams, 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 RateFillPreview, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SUPPORTED_INTENTS_VERSION, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, TokenInfo, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, assertGatewayRelease, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, decodeFillOrder, encodeFillOrder, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, isCanonicalEvmToken, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, orderbookUrlFor, parseStateMachineId, postRequestCommitment, previewRateFill, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readLegEscrow, readLegPartialFill, requestCommitmentKey, responseCommitmentKey, retryPromise, supportsRateFills, teleport, teleportDot, transformOrderForContract };
|
|
6458
|
+
export { ADDRESS_ZERO, AssetTeleported, type AvailableLiquidity, Bid, BidPreVerificationGasParams, type BridgeParams, type BridgeStep, type BundlerGasEstimate, BundlerMethod, type BuyAndSellRates, CONTRACT_VERSION_ABI, type CancelEvent, CancelOrderOptions, CancelQuote, ChainConfigService, Chains, ClientConfig, ConfiguredAssetSymbol, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedFillOrder, DecodedOrderPlacedLog, DecodedPostRequestEvent, DecodedPostResponseEvent, ERC20Method, ERC7821Call, ERC7821_BATCH_MODE, EstimateFillOrderParams, EstimateGasCallData, EvmChain, type EvmChainParams, ABI as EvmHostABI, EvmLanguage, FILL_ORDER_SELECTOR, FillOptions, FillOrderEstimate, FillerBid, GetRequestWithStatus, HexString, HyperFungibleToken, HyperFungibleTokenABI, HyperFxOrderbook, type HyperbridgeTxEvents, IChain, IEvmChain, IEvmConfig, IGetRequest, IIsmpMessage, IMessage, IPharosConfig, IPolkadotHubConfig, IPostRequest, IProof, IndexerQueryClient, IntentGateway, type IntentGatewayContext, IntentOrderStatusUpdate, type IntentQuoteLeg, IntentsCoprocessor, IsmpClient, MOCK_ADDRESS, ORDERBOOK_DECIMALS, ORDERBOOK_QUERIES, ORDERBOOK_URLS, ORDER_V2_PARAM_TYPE, Order, OrderFeesQuote, OrderStatus, OrderStatusChecker, OrderWithStatus, type OrderbookBook, type OrderbookLevelQuote, type OrderbookQuoteFill, OrderbookQuoteNotConvergedError, type OrderbookRate, OrderbookRequestError, type OrderbookRoute, type OrderbookRouteKind, type OrderbookRouteLiquidity, type OrderbookSide, type OrderbookSwapQuote, type OrderbookTopOfBook, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PackedUserOperation, type Params, type PessimisticQuoteIntentResult, PharosChain, type PharosChainParams, PolkadotHubChain, type PolkadotHubChainParams, PostRequestTimeoutStatus, PostRequestWithStatus, QueryBuyAndSellRatesParams, 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 RateFillPreview, RequestStatusWithMetadata, ResponseCommitmentWithValues, ResumeIntentOrderOptions, RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SUPPORTED_INTENTS_VERSION, SelectBidResult, StateMachineHeight, StateMachineIdParams, StateMachineUpdate, SubmitBidOptions, SubstrateChain, Swap, TESTNET_CHAINS, type TeleportParams, TeleportStatus, TokenGateway, TokenGatewayAssetTeleportedWithStatus, TokenInfo, Transaction, TronChain, type TronChainParams, USE_ETHERSCAN_CHAINS, type UniswapProtocol, type UniswapQuote, type UniswapQuoteToken, type UniswapTradeType, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, type XcmGatewayParams, __test, adjustDecimals, assertGatewayRelease, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, createEvmChain, createQueryClient, decodeFillOrder, encodeFillOrder, encodeStateMachineId, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getContractCallInput, getContractCallInputs, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, hexToString, isCanonicalEvmToken, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, orderbookUrlFor, parseStateMachineId, postRequestCommitment, previewRateFill, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readLegEscrow, readLegPartialFill, requestCommitmentKey, responseCommitmentKey, retryPromise, supportsRateFills, teleport, teleportDot, transformOrderForContract };
|
package/dist/node/index.js
CHANGED
|
@@ -18253,6 +18253,16 @@ var NO_BUNDLER_FILL_GAS_BASE = 700000n;
|
|
|
18253
18253
|
var NO_BUNDLER_FILL_GAS_PER_OUTPUT = 150000n;
|
|
18254
18254
|
var NO_BUNDLER_PAYMASTER_VERIFICATION_GAS = 250000n;
|
|
18255
18255
|
var NO_BUNDLER_PAYMASTER_POST_OP_GAS = 100000n;
|
|
18256
|
+
var BID_PVG_ESTIMATION_ACCOUNT_CODE = "0x60003560e01c631626ba7e1460145760206000f35b631626ba7e60e01b60005260206000f3";
|
|
18257
|
+
var SELECTED_BID_SIGNATURE_BYTES = 32 + 65 + 65;
|
|
18258
|
+
var BID_PVG_HEADROOM_PERCENT = 10n;
|
|
18259
|
+
var ESCROW_MAPPING_SLOT = 9n;
|
|
18260
|
+
function escrowSlot(commitment, leg) {
|
|
18261
|
+
const byCommitment = keccak256(
|
|
18262
|
+
encodeAbiParameters([{ type: "bytes32" }, { type: "uint256" }], [commitment, ESCROW_MAPPING_SLOT])
|
|
18263
|
+
);
|
|
18264
|
+
return keccak256(encodeAbiParameters([{ type: "uint256" }, { type: "bytes32" }], [BigInt(leg), byCommitment]));
|
|
18265
|
+
}
|
|
18256
18266
|
var GasEstimator = class {
|
|
18257
18267
|
/**
|
|
18258
18268
|
* @param ctx - Shared IntentsV2 context providing the source and destination
|
|
@@ -18331,6 +18341,7 @@ var GasEstimator = class {
|
|
|
18331
18341
|
assetsForOverrides.push({ token: feeTokenAsBytes32, amount: 0n });
|
|
18332
18342
|
}
|
|
18333
18343
|
const isSameChain = souceStateMachineId === destStateMachineId;
|
|
18344
|
+
const commitment = orderCommitment(order);
|
|
18334
18345
|
const [stateOverridesResult, crossChainFees] = await Promise.all([
|
|
18335
18346
|
this.ctx.bundlerUrl ? this.buildStateOverride({
|
|
18336
18347
|
accountAddress: solverAccountAddress,
|
|
@@ -18338,7 +18349,16 @@ var GasEstimator = class {
|
|
|
18338
18349
|
outputAssets: assetsForOverrides,
|
|
18339
18350
|
spenderAddress: intentGatewayV2Address,
|
|
18340
18351
|
intentGatewayV2Address,
|
|
18341
|
-
entryPointAddress
|
|
18352
|
+
entryPointAddress,
|
|
18353
|
+
// A fee quote runs before the order is placed, so nothing is escrowed under
|
|
18354
|
+
// its commitment yet. Cross-chain fills release escrow on the source chain.
|
|
18355
|
+
escrow: isSameChain ? {
|
|
18356
|
+
commitment,
|
|
18357
|
+
inputs: order.inputs.map((input) => ({
|
|
18358
|
+
token: normalizeAddressForEvmBytes32(input.token),
|
|
18359
|
+
amount: input.amount
|
|
18360
|
+
}))
|
|
18361
|
+
} : void 0
|
|
18342
18362
|
}) : Promise.resolve({ viem: [], bundler: {} }),
|
|
18343
18363
|
isSameChain ? Promise.resolve({ postRequestFee: 0n, relayerFeeInSourceFeeToken: 0n }) : this.estimateCrossChainFees(
|
|
18344
18364
|
sourceFeeToken,
|
|
@@ -18367,10 +18387,8 @@ var GasEstimator = class {
|
|
|
18367
18387
|
const maxFeeBumpPercent = params.maxFeePerGasBumpPercent ?? 10;
|
|
18368
18388
|
let maxPriorityFeePerGas = gasPrice + gasPrice * BigInt(priorityFeeBumpPercent) / 100n;
|
|
18369
18389
|
let maxFeePerGas = gasPrice + gasPrice * BigInt(maxFeeBumpPercent) / 100n;
|
|
18370
|
-
const orderForEstimation = { ...order, session: solverAccountAddress };
|
|
18371
|
-
const commitment = orderCommitment(orderForEstimation);
|
|
18372
18390
|
await assertGatewayRelease(this.ctx.dest.client, intentGatewayV2Address);
|
|
18373
|
-
const fillOrderCalldata = encodeFillOrder(transformOrderForContract(
|
|
18391
|
+
const fillOrderCalldata = encodeFillOrder(transformOrderForContract(order), fillOptions);
|
|
18374
18392
|
let callGasLimit = 500000n;
|
|
18375
18393
|
let verificationGasLimit = 100000n;
|
|
18376
18394
|
let preVerificationGas = 100000n;
|
|
@@ -18382,7 +18400,7 @@ var GasEstimator = class {
|
|
|
18382
18400
|
...params.prependCalls ?? [],
|
|
18383
18401
|
{ target: intentGatewayV2Address, value: totalNativeValue, data: fillOrderCalldata }
|
|
18384
18402
|
]);
|
|
18385
|
-
const accountGasLimits = CryptoUtils.packGasLimits(
|
|
18403
|
+
const accountGasLimits = CryptoUtils.packGasLimits(0n, 0n);
|
|
18386
18404
|
const gasFees = CryptoUtils.packGasFees(maxPriorityFeePerGas, maxFeePerGas);
|
|
18387
18405
|
const nonce = 0n;
|
|
18388
18406
|
const preliminaryUserOp = {
|
|
@@ -18391,7 +18409,7 @@ var GasEstimator = class {
|
|
|
18391
18409
|
initCode: "0x",
|
|
18392
18410
|
callData,
|
|
18393
18411
|
accountGasLimits,
|
|
18394
|
-
preVerificationGas:
|
|
18412
|
+
preVerificationGas: 0n,
|
|
18395
18413
|
gasFees,
|
|
18396
18414
|
paymasterAndData: "0x",
|
|
18397
18415
|
signature: "0x"
|
|
@@ -18521,6 +18539,53 @@ var GasEstimator = class {
|
|
|
18521
18539
|
inputs
|
|
18522
18540
|
};
|
|
18523
18541
|
}
|
|
18542
|
+
/**
|
|
18543
|
+
* Asks the bundler for the `preVerificationGas` of the bid UserOperation that will
|
|
18544
|
+
* actually be signed, with every funding call, approval and signature byte in it.
|
|
18545
|
+
*
|
|
18546
|
+
* On an L2, `preVerificationGas` also pays the L1 data fee for the op's bytes, a fixed
|
|
18547
|
+
* amount of wei that the bundler converts to gas at the price the op pays. A bundler
|
|
18548
|
+
* admits an op priced at its `maxFeePerGas`, but bundles it at the base fee plus its
|
|
18549
|
+
* priority fee, where the same wei costs more gas. An op sized only for admission is
|
|
18550
|
+
* accepted and then skipped in every bundle until it expires. The estimate is taken
|
|
18551
|
+
* at the bundle's price: the latest base fee plus the op's priority fee, capped at its
|
|
18552
|
+
* `maxFeePerGas`.
|
|
18553
|
+
*
|
|
18554
|
+
* The solver account's code is overridden with {@link BID_PVG_ESTIMATION_ACCOUNT_CODE}
|
|
18555
|
+
* for the call, so only the bytes are priced and the fill itself is not simulated.
|
|
18556
|
+
*
|
|
18557
|
+
* @param params - The bid's fields as they will be signed.
|
|
18558
|
+
* @returns The `preVerificationGas` to sign, with {@link BID_PVG_HEADROOM_PERCENT} added.
|
|
18559
|
+
* @throws If no bundler is configured or the bundler rejects the estimate.
|
|
18560
|
+
*/
|
|
18561
|
+
async estimateBidPreVerificationGas(params) {
|
|
18562
|
+
const { solverAccount, maxFeePerGas, maxPriorityFeePerGas } = params;
|
|
18563
|
+
const latestBlock = await this.ctx.dest.client.getBlock({ blockTag: "latest" });
|
|
18564
|
+
const baseFeePerGas = latestBlock.baseFeePerGas;
|
|
18565
|
+
const bundlePrice = baseFeePerGas == null || baseFeePerGas + maxPriorityFeePerGas > maxFeePerGas ? maxFeePerGas : baseFeePerGas + maxPriorityFeePerGas;
|
|
18566
|
+
const priorityFee = maxPriorityFeePerGas < bundlePrice ? maxPriorityFeePerGas : bundlePrice;
|
|
18567
|
+
const userOp = {
|
|
18568
|
+
sender: solverAccount,
|
|
18569
|
+
nonce: params.nonce,
|
|
18570
|
+
initCode: "0x",
|
|
18571
|
+
callData: params.callData,
|
|
18572
|
+
accountGasLimits: CryptoUtils.packGasLimits(params.verificationGasLimit, params.callGasLimit),
|
|
18573
|
+
// Bundlers return a non-zero preVerificationGas as given rather than estimating it.
|
|
18574
|
+
preVerificationGas: 0n,
|
|
18575
|
+
gasFees: CryptoUtils.packGasFees(priorityFee, bundlePrice),
|
|
18576
|
+
paymasterAndData: params.paymasterAndData ?? "0x",
|
|
18577
|
+
signature: `0x${"ff".repeat(SELECTED_BID_SIGNATURE_BYTES)}`
|
|
18578
|
+
};
|
|
18579
|
+
const estimate = await this.crypto.sendBundler(
|
|
18580
|
+
BundlerMethod.ETH_ESTIMATE_USER_OPERATION_GAS,
|
|
18581
|
+
[
|
|
18582
|
+
CryptoUtils.prepareBundlerCall(userOp),
|
|
18583
|
+
params.entryPointAddress,
|
|
18584
|
+
{ [solverAccount]: { code: BID_PVG_ESTIMATION_ACCOUNT_CODE } }
|
|
18585
|
+
]
|
|
18586
|
+
);
|
|
18587
|
+
return BigInt(estimate.preVerificationGas) * (100n + BID_PVG_HEADROOM_PERCENT) / 100n;
|
|
18588
|
+
}
|
|
18524
18589
|
/**
|
|
18525
18590
|
* Estimates the cross-chain ISMP POST request fee (the relayer fee for the
|
|
18526
18591
|
* RedeemEscrow message), in both the source and destination fee tokens.
|
|
@@ -18573,20 +18638,38 @@ var GasEstimator = class {
|
|
|
18573
18638
|
* @returns An object with `viem` and `bundler` state-override collections.
|
|
18574
18639
|
*/
|
|
18575
18640
|
async buildStateOverride(params) {
|
|
18576
|
-
const {
|
|
18577
|
-
|
|
18641
|
+
const {
|
|
18642
|
+
accountAddress,
|
|
18643
|
+
chain,
|
|
18644
|
+
outputAssets,
|
|
18645
|
+
spenderAddress,
|
|
18646
|
+
intentGatewayV2Address,
|
|
18647
|
+
entryPointAddress,
|
|
18648
|
+
escrow
|
|
18649
|
+
} = params;
|
|
18650
|
+
const testValue = toHex(2n ** 128n, { size: 32 });
|
|
18578
18651
|
const viemOverrides = [];
|
|
18579
18652
|
const bundlerOverrides = {};
|
|
18580
18653
|
if (intentGatewayV2Address) {
|
|
18581
18654
|
const paramsSlot5 = pad(toHex(5n), { size: 32 });
|
|
18582
18655
|
const dispatcherAddress = this.ctx.dest.configService.getCalldispatcherAddress(chain);
|
|
18583
18656
|
const newSlot5Value = "0x" + "0".repeat(22) + "00" + dispatcherAddress.slice(2).toLowerCase();
|
|
18657
|
+
const gatewayDiffs = [{ slot: paramsSlot5, value: newSlot5Value }];
|
|
18658
|
+
for (const [leg, input] of (escrow?.inputs ?? []).entries()) {
|
|
18659
|
+
gatewayDiffs.push({
|
|
18660
|
+
slot: escrowSlot(escrow.commitment, leg),
|
|
18661
|
+
value: toHex(input.amount, { size: 32 })
|
|
18662
|
+
});
|
|
18663
|
+
}
|
|
18664
|
+
const releasesNative = escrow?.inputs.some((input) => bytes32ToBytes20(input.token) === ADDRESS_ZERO2);
|
|
18584
18665
|
viemOverrides.push({
|
|
18585
18666
|
address: intentGatewayV2Address,
|
|
18586
|
-
|
|
18667
|
+
...releasesNative ? { balance: 2n ** 128n } : {},
|
|
18668
|
+
stateDiff: gatewayDiffs
|
|
18587
18669
|
});
|
|
18588
18670
|
bundlerOverrides[intentGatewayV2Address] = {
|
|
18589
|
-
|
|
18671
|
+
...releasesNative ? { balance: testValue } : {},
|
|
18672
|
+
stateDiff: Object.fromEntries(gatewayDiffs.map(({ slot, value }) => [slot, value]))
|
|
18590
18673
|
};
|
|
18591
18674
|
}
|
|
18592
18675
|
if (entryPointAddress) {
|
|
@@ -18617,6 +18700,25 @@ var GasEstimator = class {
|
|
|
18617
18700
|
bundlerOverrides[result.address] = { stateDiff: result.bundlerStateDiffs };
|
|
18618
18701
|
}
|
|
18619
18702
|
}
|
|
18703
|
+
if (intentGatewayV2Address && escrow) {
|
|
18704
|
+
const gatewayBalances = await Promise.all(
|
|
18705
|
+
escrow.inputs.map((input) => this.tokenBalanceSlot(input.token, intentGatewayV2Address, chain))
|
|
18706
|
+
);
|
|
18707
|
+
for (const override of gatewayBalances) {
|
|
18708
|
+
if (!override) continue;
|
|
18709
|
+
const existing = viemOverrides.find((entry) => entry.address === override.address && entry.stateDiff);
|
|
18710
|
+
if (existing) existing.stateDiff.push({ slot: override.slot, value: testValue });
|
|
18711
|
+
else
|
|
18712
|
+
viemOverrides.push({
|
|
18713
|
+
address: override.address,
|
|
18714
|
+
stateDiff: [{ slot: override.slot, value: testValue }]
|
|
18715
|
+
});
|
|
18716
|
+
bundlerOverrides[override.address] = {
|
|
18717
|
+
...bundlerOverrides[override.address],
|
|
18718
|
+
stateDiff: { ...bundlerOverrides[override.address]?.stateDiff, [override.slot]: testValue }
|
|
18719
|
+
};
|
|
18720
|
+
}
|
|
18721
|
+
}
|
|
18620
18722
|
const solverAccountContract = this.ctx.dest.configService.getSolverAccountAddress(chain);
|
|
18621
18723
|
if (solverAccountContract) {
|
|
18622
18724
|
try {
|
|
@@ -18639,6 +18741,21 @@ var GasEstimator = class {
|
|
|
18639
18741
|
}
|
|
18640
18742
|
return { viem: viemOverrides, bundler: bundlerOverrides };
|
|
18641
18743
|
}
|
|
18744
|
+
/**
|
|
18745
|
+
* The balance slot of `holder` in an ERC-20 token, for overriding. `null` for the native
|
|
18746
|
+
* token or when the slot cannot be discovered.
|
|
18747
|
+
*/
|
|
18748
|
+
async tokenBalanceSlot(tokenHex, holder, chain) {
|
|
18749
|
+
const tokenAddress = bytes32ToBytes20(tokenHex);
|
|
18750
|
+
if (tokenAddress === ADDRESS_ZERO2) return null;
|
|
18751
|
+
try {
|
|
18752
|
+
const balanceData = "0x70a08231" /* BALANCE_OF */ + bytes20ToBytes32(holder).slice(2);
|
|
18753
|
+
const slot = await getOrFetchStorageSlot(this.ctx.dest.client, chain, tokenAddress, balanceData);
|
|
18754
|
+
return slot ? { address: tokenAddress, slot } : null;
|
|
18755
|
+
} catch {
|
|
18756
|
+
return null;
|
|
18757
|
+
}
|
|
18758
|
+
}
|
|
18642
18759
|
/**
|
|
18643
18760
|
* Resolves the balance and allowance storage slot overrides for a single
|
|
18644
18761
|
* ERC-20 token in parallel. Returns `null` for native-ETH tokens or when
|
|
@@ -19752,6 +19869,16 @@ var IntentGateway = class _IntentGateway {
|
|
|
19752
19869
|
async estimateFillOrder(params) {
|
|
19753
19870
|
return this.gasEstimator.estimateFillOrder(params);
|
|
19754
19871
|
}
|
|
19872
|
+
/**
|
|
19873
|
+
* Asks the bundler for the `preVerificationGas` of a bid as it will be signed, priced at
|
|
19874
|
+
* the gas price its bundle pays. Call it with the final calldata and `paymasterAndData`,
|
|
19875
|
+
* before {@link prepareSubmitBid} signs the op.
|
|
19876
|
+
*
|
|
19877
|
+
* Delegates to {@link GasEstimator.estimateBidPreVerificationGas}.
|
|
19878
|
+
*/
|
|
19879
|
+
async estimateBidPreVerificationGas(params) {
|
|
19880
|
+
return this.gasEstimator.estimateBidPreVerificationGas(params);
|
|
19881
|
+
}
|
|
19755
19882
|
/**
|
|
19756
19883
|
* Quotes the solver fee for an order using the same policy {@link execute} /
|
|
19757
19884
|
* {@link executeBest} apply when `order.fees` is `0n`.
|