@hyperbridge/sdk 1.8.6 → 1.9.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.
@@ -617,11 +617,15 @@ declare class ChainConfigService {
617
617
  getHyperbridgeChainId(): number;
618
618
  getRpcUrl(chain: string): string;
619
619
  getUniswapRouterV2Address(chain: string): HexString;
620
+ getAerodromeRouterAddress(chain: string): HexString;
620
621
  getUniswapV2FactoryAddress(chain: string): HexString;
621
622
  getUniswapV3FactoryAddress(chain: string): HexString;
622
623
  getUniversalRouterAddress(chain: string): HexString;
623
624
  getUniswapV3QuoterAddress(chain: string): HexString;
624
625
  getUniswapV4QuoterAddress(chain: string): HexString;
626
+ getUniswapV4PositionManagerAddress(chain: string): HexString;
627
+ getUniswapV4PoolManagerAddress(chain: string): HexString;
628
+ getUniswapV4StateViewAddress(chain: string): HexString;
625
629
  getPermit2Address(chain: string): HexString;
626
630
  getSolverAccountAddress(chain: string): HexString | undefined;
627
631
  getCoingeckoId(chain: string): string | undefined;
@@ -2803,6 +2807,12 @@ interface SubmitBidOptions {
2803
2807
  }
2804
2808
  interface EstimateFillOrderParams {
2805
2809
  order: Order;
2810
+ /**
2811
+ * Optional ERC-7821 calls to prepend before the fillOrder call in the
2812
+ * simulated UserOp. Used for funding calls (e.g. LP withdrawal) so the
2813
+ * bundler estimates gas for the complete atomic batch.
2814
+ */
2815
+ prependCalls?: ERC7821Call[];
2806
2816
  /**
2807
2817
  * Optional percentage to bump maxPriorityFeePerGas.
2808
2818
  * This is added on top of the base gasPrice.
@@ -2890,10 +2900,9 @@ declare const IntentOrderStatus: Readonly<{
2890
2900
  AWAITING_BIDS: "AWAITING_BIDS";
2891
2901
  BIDS_RECEIVED: "BIDS_RECEIVED";
2892
2902
  BID_SELECTED: "BID_SELECTED";
2893
- USEROP_SUBMITTED: "USEROP_SUBMITTED";
2894
2903
  FILLED: "FILLED";
2895
2904
  PARTIAL_FILL: "PARTIAL_FILL";
2896
- PARTIAL_FILL_EXHAUSTED: "PARTIAL_FILL_EXHAUSTED";
2905
+ EXPIRED: "EXPIRED";
2897
2906
  FAILED: "FAILED";
2898
2907
  }>;
2899
2908
  type IntentOrderStatus = typeof IntentOrderStatus;
@@ -2925,11 +2934,6 @@ type IntentOrderStatusUpdate = {
2925
2934
  selectedSolver: HexString;
2926
2935
  userOpHash: HexString;
2927
2936
  userOp: PackedUserOperation;
2928
- } | {
2929
- status: "USEROP_SUBMITTED";
2930
- commitment: HexString;
2931
- userOpHash: HexString;
2932
- selectedSolver: HexString;
2933
2937
  transactionHash?: HexString;
2934
2938
  } | {
2935
2939
  status: "FILLED";
@@ -2949,7 +2953,7 @@ type IntentOrderStatusUpdate = {
2949
2953
  totalFilledAssets: TokenInfo[];
2950
2954
  remainingAssets: TokenInfo[];
2951
2955
  } | {
2952
- status: "PARTIAL_FILL_EXHAUSTED";
2956
+ status: "EXPIRED";
2953
2957
  commitment: HexString;
2954
2958
  totalFilledAssets?: TokenInfo[];
2955
2959
  remainingAssets?: TokenInfo[];
@@ -2977,7 +2981,6 @@ interface ExecuteIntentOrderOptions {
2977
2981
  order: Order;
2978
2982
  sessionPrivateKey?: HexString;
2979
2983
  minBids?: number;
2980
- bidTimeoutMs?: number;
2981
2984
  pollIntervalMs?: number;
2982
2985
  /**
2983
2986
  * If set, bids are restricted to the given solver until `timeoutMs` elapses,
@@ -2990,6 +2993,16 @@ interface ExecuteIntentOrderOptions {
2990
2993
  timeoutMs: number;
2991
2994
  };
2992
2995
  }
2996
+ /** Options for resuming execution of a previously placed intent order */
2997
+ interface ResumeIntentOrderOptions {
2998
+ sessionPrivateKey?: HexString;
2999
+ minBids?: number;
3000
+ pollIntervalMs?: number;
3001
+ solver?: {
3002
+ address: HexString;
3003
+ timeoutMs: number;
3004
+ };
3005
+ }
2993
3006
  /** Type for ERC-7821 Call struct */
2994
3007
  type ERC7821Call = {
2995
3008
  target: `0x${string}`;
@@ -3762,6 +3775,8 @@ declare const BundlerMethod: {
3762
3775
  readonly ETH_ESTIMATE_USER_OPERATION_GAS: "eth_estimateUserOperationGas";
3763
3776
  /** Pimlico-specific method to fetch recommended EIP-1559 gas prices for UserOperations. */
3764
3777
  readonly PIMLICO_GET_USER_OPERATION_GAS_PRICE: "pimlico_getUserOperationGasPrice";
3778
+ /** Alchemy (Rundler) method to fetch recommended priority fee for UserOperations. */
3779
+ readonly RUNDLER_MAX_PRIORITY_FEE_PER_GAS: "rundler_maxPriorityFeePerGas";
3765
3780
  };
3766
3781
  /** Union of all valid bundler RPC method name strings. */
3767
3782
  type BundlerMethod = (typeof BundlerMethod)[keyof typeof BundlerMethod];
@@ -3961,7 +3976,7 @@ declare class IntentGateway {
3961
3976
  * The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
3962
3977
  * 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
3963
3978
  * the `OrderPlaced` event is confirmed.
3964
- * 4. Delegates to {@link OrderExecutor.executeIntentOrder} and forwards all
3979
+ * 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
3965
3980
  * subsequent status updates until the order is filled, exhausted, or fails.
3966
3981
  *
3967
3982
  * @param order - The order to place and execute. `order.fees` may be 0; it
@@ -3972,7 +3987,6 @@ declare class IntentGateway {
3972
3987
  * - `maxPriorityFeePerGasBumpPercent` — bump % for the priority fee estimate (default 8).
3973
3988
  * - `maxFeePerGasBumpPercent` — bump % for the max fee estimate (default 10).
3974
3989
  * - `minBids` — minimum bids to collect before selecting (default 1).
3975
- * - `bidTimeoutMs` — how long to poll for bids before giving up (default 60 000 ms).
3976
3990
  * - `pollIntervalMs` — interval between bid-polling attempts.
3977
3991
  * @yields {@link IntentOrderStatusUpdate} at each lifecycle stage.
3978
3992
  * @throws If the `placeOrder` generator behaves unexpectedly, or if gas
@@ -3982,13 +3996,40 @@ declare class IntentGateway {
3982
3996
  maxPriorityFeePerGasBumpPercent?: number;
3983
3997
  maxFeePerGasBumpPercent?: number;
3984
3998
  minBids?: number;
3985
- bidTimeoutMs?: number;
3986
3999
  pollIntervalMs?: number;
3987
4000
  solver?: {
3988
4001
  address: HexString;
3989
4002
  timeoutMs: number;
3990
4003
  };
3991
4004
  }): AsyncGenerator<IntentOrderStatusUpdate, void, HexString>;
4005
+ /**
4006
+ * Validates that an order has the minimum fields required for post-placement
4007
+ * resume (i.e. it was previously placed and has an on-chain identity).
4008
+ *
4009
+ * @throws If `order.id` or `order.session` is missing or zero-valued.
4010
+ */
4011
+ private assertOrderCanResume;
4012
+ /**
4013
+ * Resumes execution of a previously placed order.
4014
+ *
4015
+ * Use this method after an app restart or crash to pick up where
4016
+ * {@link execute} left off. The order must already be placed on-chain
4017
+ * (i.e. it must have a valid `id` and `session`).
4018
+ *
4019
+ * Internally delegates to {@link OrderExecutor.executeOrder} and
4020
+ * yields the same status updates as the execution phase of {@link execute}:
4021
+ * `AWAITING_BIDS`, `BIDS_RECEIVED`, `BID_SELECTED`,
4022
+ * `FILLED`, `PARTIAL_FILL`, `EXPIRED`, or `FAILED`.
4023
+ *
4024
+ * Callers may check {@link isOrderFilled} or {@link isOrderRefunded} before
4025
+ * calling this method to avoid resuming an already-terminal order.
4026
+ *
4027
+ * @param order - A previously placed order with a valid `id` and `session`.
4028
+ * @param options - Optional tuning parameters for bid collection and execution.
4029
+ * @yields {@link IntentOrderStatusUpdate} at each execution stage.
4030
+ * @throws If the order is missing required fields for resumption.
4031
+ */
4032
+ resume(order: Order, options?: ResumeIntentOrderOptions): AsyncGenerator<IntentOrderStatusUpdate, void>;
3992
4033
  /**
3993
4034
  * Returns both the native token cost and the relayer fee for cancelling an
3994
4035
  * order. Use `relayerFee` to approve the ERC-20 spend before submitting.
@@ -8096,6 +8137,14 @@ interface ChainConfigData {
8096
8137
  Usdt0Oft?: `0x${string}`;
8097
8138
  /** SolverAccount contract address used for EIP-7702 delegation */
8098
8139
  SolverAccount?: `0x${string}`;
8140
+ /** Aerodrome (Solidly-style) router for LP removal / swaps on chains where Aerodrome is deployed */
8141
+ AerodromeRouter?: `0x${string}`;
8142
+ /** Uniswap V4 PositionManager (canonical CREATE2 address) for LP position management */
8143
+ UniswapV4PositionManager?: `0x${string}`;
8144
+ /** Uniswap V4 PoolManager (canonical CREATE2 address) for pool state reads via extsload */
8145
+ UniswapV4PoolManager?: `0x${string}`;
8146
+ /** Uniswap V4 StateView (canonical CREATE2 address) for pool state reads via extsload */
8147
+ UniswapV4StateView?: `0x${string}`;
8099
8148
  };
8100
8149
  rpcEnvKey?: string;
8101
8150
  defaultRpcUrl?: string;
@@ -8111,4 +8160,4 @@ declare const getChainId: (stateMachineId: string) => number | undefined;
8111
8160
  declare const getViemChain: (chainId: number) => Chain | undefined;
8112
8161
  declare const hyperbridgeAddress = "";
8113
8162
 
8114
- export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BundlerGasEstimate, BundlerMethod, type CancelEvent, type CancelOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, 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, type HyperbridgeTxEvents, type IChain, type IConfig, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, IndexerClient, type IndexerQueryClient, IntentGateway, type IntentGatewayContext, type IntentGatewayParams, ABI$1 as IntentGatewayV2ABI, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, IntentsCoprocessor, type IsmpRequest, MOCK_ADDRESS, type NewDeployment, 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, PolkadotHubChain, type PolkadotHubChainParams, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, type QuoteNativeResult, 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 RetryConfig, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, type SelectBidResult, type SelectOptions, type SigningAccount, type StateMachineHeight, 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 XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeUserOpScale, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, orderCommitment, parseStateMachineId, polkadotAssetHubPaseo, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
8163
+ export { ADDRESS_ZERO, type AllStatusKey, type AssetTeleported, type AssetTeleportedResponse, type BidStorageEntry, type BidSubmissionResult, type BlockMetadata, type BundlerGasEstimate, BundlerMethod, type CancelEvent, type CancelOptions, type CancelQuote, type ChainConfig, type ChainConfigData, ChainConfigService, Chains, type ClientConfig, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, type DecodedOrderPlacedLog, type DecodedPostRequestEvent, type DecodedPostResponseEvent, 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, type HyperbridgeTxEvents, type IChain, type IConfig, type IEvmChain, type IEvmConfig, type IGetRequest, type IGetRequestMessage, type IGetResponse, type IGetResponseMessage, type IHyperbridgeConfig, type IIsmpMessage, type IMessage, type IPolkadotHubConfig, type IPostRequest, type IPostResponse, type IProof, type IRequestMessage, type ISubstrateConfig, type ITimeoutPostRequestMessage, IndexerClient, type IndexerQueryClient, IntentGateway, type IntentGatewayContext, type IntentGatewayParams, ABI$1 as IntentGatewayV2ABI, IntentOrderStatus, type IntentOrderStatusKey, type IntentOrderStatusUpdate, IntentsCoprocessor, type IsmpRequest, MOCK_ADDRESS, type NewDeployment, 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, PolkadotHubChain, type PolkadotHubChainParams, type PostRequestStatus, type PostRequestTimeoutStatus, type PostRequestWithStatus, type QuoteNativeResult, 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 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 XcmGatewayParams, __test, adjustDecimals, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeUserOpScale, encodeERC7821ExecuteBatch, encodeISMPMessage, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, orderCommitment, parseStateMachineId, polkadotAssetHubPaseo, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, requestCommitmentKey, responseCommitmentKey, retryPromise, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };