@hyperbridge/sdk 1.8.8 → 1.9.1
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 +46 -15
- package/dist/browser/index.js +300 -178
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.d.ts +46 -15
- package/dist/node/index.js +300 -178
- package/dist/node/index.js.map +1 -1
- package/package.json +1 -1
package/dist/node/index.d.ts
CHANGED
|
@@ -2900,7 +2900,6 @@ declare const IntentOrderStatus: Readonly<{
|
|
|
2900
2900
|
AWAITING_BIDS: "AWAITING_BIDS";
|
|
2901
2901
|
BIDS_RECEIVED: "BIDS_RECEIVED";
|
|
2902
2902
|
BID_SELECTED: "BID_SELECTED";
|
|
2903
|
-
USEROP_SUBMITTED: "USEROP_SUBMITTED";
|
|
2904
2903
|
FILLED: "FILLED";
|
|
2905
2904
|
PARTIAL_FILL: "PARTIAL_FILL";
|
|
2906
2905
|
EXPIRED: "EXPIRED";
|
|
@@ -2935,11 +2934,6 @@ type IntentOrderStatusUpdate = {
|
|
|
2935
2934
|
selectedSolver: HexString;
|
|
2936
2935
|
userOpHash: HexString;
|
|
2937
2936
|
userOp: PackedUserOperation;
|
|
2938
|
-
} | {
|
|
2939
|
-
status: "USEROP_SUBMITTED";
|
|
2940
|
-
commitment: HexString;
|
|
2941
|
-
userOpHash: HexString;
|
|
2942
|
-
selectedSolver: HexString;
|
|
2943
2937
|
transactionHash?: HexString;
|
|
2944
2938
|
} | {
|
|
2945
2939
|
status: "FILLED";
|
|
@@ -2986,8 +2980,8 @@ interface SelectBidResult {
|
|
|
2986
2980
|
interface ExecuteIntentOrderOptions {
|
|
2987
2981
|
order: Order;
|
|
2988
2982
|
sessionPrivateKey?: HexString;
|
|
2989
|
-
|
|
2990
|
-
|
|
2983
|
+
/** Duration in ms to collect bids before selecting the best one. */
|
|
2984
|
+
auctionTimeMs: number;
|
|
2991
2985
|
pollIntervalMs?: number;
|
|
2992
2986
|
/**
|
|
2993
2987
|
* If set, bids are restricted to the given solver until `timeoutMs` elapses,
|
|
@@ -3000,6 +2994,17 @@ interface ExecuteIntentOrderOptions {
|
|
|
3000
2994
|
timeoutMs: number;
|
|
3001
2995
|
};
|
|
3002
2996
|
}
|
|
2997
|
+
/** Options for resuming execution of a previously placed intent order */
|
|
2998
|
+
interface ResumeIntentOrderOptions {
|
|
2999
|
+
sessionPrivateKey?: HexString;
|
|
3000
|
+
/** Duration in ms to collect bids before selecting the best one. */
|
|
3001
|
+
auctionTimeMs: number;
|
|
3002
|
+
pollIntervalMs?: number;
|
|
3003
|
+
solver?: {
|
|
3004
|
+
address: HexString;
|
|
3005
|
+
timeoutMs: number;
|
|
3006
|
+
};
|
|
3007
|
+
}
|
|
3003
3008
|
/** Type for ERC-7821 Call struct */
|
|
3004
3009
|
type ERC7821Call = {
|
|
3005
3010
|
target: `0x${string}`;
|
|
@@ -3973,7 +3978,7 @@ declare class IntentGateway {
|
|
|
3973
3978
|
* The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
|
|
3974
3979
|
* 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
|
|
3975
3980
|
* the `OrderPlaced` event is confirmed.
|
|
3976
|
-
* 4. Delegates to {@link OrderExecutor.
|
|
3981
|
+
* 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
|
|
3977
3982
|
* subsequent status updates until the order is filled, exhausted, or fails.
|
|
3978
3983
|
*
|
|
3979
3984
|
* @param order - The order to place and execute. `order.fees` may be 0; it
|
|
@@ -3983,24 +3988,50 @@ declare class IntentGateway {
|
|
|
3983
3988
|
* @param options - Optional tuning parameters:
|
|
3984
3989
|
* - `maxPriorityFeePerGasBumpPercent` — bump % for the priority fee estimate (default 8).
|
|
3985
3990
|
* - `maxFeePerGasBumpPercent` — bump % for the max fee estimate (default 10).
|
|
3986
|
-
* - `
|
|
3987
|
-
* - `bidTimeoutMs` — how long to poll for bids before giving up (default 60 000 ms).
|
|
3991
|
+
* - `auctionTimeMs` — duration in ms to collect bids before selecting the best one.
|
|
3988
3992
|
* - `pollIntervalMs` — interval between bid-polling attempts.
|
|
3989
3993
|
* @yields {@link IntentOrderStatusUpdate} at each lifecycle stage.
|
|
3990
3994
|
* @throws If the `placeOrder` generator behaves unexpectedly, or if gas
|
|
3991
3995
|
* estimation returns zero.
|
|
3992
3996
|
*/
|
|
3993
|
-
execute(order: Order, graffiti
|
|
3997
|
+
execute(order: Order, graffiti: HexString | undefined, options: {
|
|
3998
|
+
auctionTimeMs: number;
|
|
3994
3999
|
maxPriorityFeePerGasBumpPercent?: number;
|
|
3995
4000
|
maxFeePerGasBumpPercent?: number;
|
|
3996
|
-
minBids?: number;
|
|
3997
|
-
bidTimeoutMs?: number;
|
|
3998
4001
|
pollIntervalMs?: number;
|
|
3999
4002
|
solver?: {
|
|
4000
4003
|
address: HexString;
|
|
4001
4004
|
timeoutMs: number;
|
|
4002
4005
|
};
|
|
4003
4006
|
}): AsyncGenerator<IntentOrderStatusUpdate, void, HexString>;
|
|
4007
|
+
/**
|
|
4008
|
+
* Validates that an order has the minimum fields required for post-placement
|
|
4009
|
+
* resume (i.e. it was previously placed and has an on-chain identity).
|
|
4010
|
+
*
|
|
4011
|
+
* @throws If `order.id` or `order.session` is missing or zero-valued.
|
|
4012
|
+
*/
|
|
4013
|
+
private assertOrderCanResume;
|
|
4014
|
+
/**
|
|
4015
|
+
* Resumes execution of a previously placed order.
|
|
4016
|
+
*
|
|
4017
|
+
* Use this method after an app restart or crash to pick up where
|
|
4018
|
+
* {@link execute} left off. The order must already be placed on-chain
|
|
4019
|
+
* (i.e. it must have a valid `id` and `session`).
|
|
4020
|
+
*
|
|
4021
|
+
* Internally delegates to {@link OrderExecutor.executeOrder} and
|
|
4022
|
+
* yields the same status updates as the execution phase of {@link execute}:
|
|
4023
|
+
* `AWAITING_BIDS`, `BIDS_RECEIVED`, `BID_SELECTED`,
|
|
4024
|
+
* `FILLED`, `PARTIAL_FILL`, `EXPIRED`, or `FAILED`.
|
|
4025
|
+
*
|
|
4026
|
+
* Callers may check {@link isOrderFilled} or {@link isOrderRefunded} before
|
|
4027
|
+
* calling this method to avoid resuming an already-terminal order.
|
|
4028
|
+
*
|
|
4029
|
+
* @param order - A previously placed order with a valid `id` and `session`.
|
|
4030
|
+
* @param options - Optional tuning parameters for bid collection and execution.
|
|
4031
|
+
* @yields {@link IntentOrderStatusUpdate} at each execution stage.
|
|
4032
|
+
* @throws If the order is missing required fields for resumption.
|
|
4033
|
+
*/
|
|
4034
|
+
resume(order: Order, options: ResumeIntentOrderOptions): AsyncGenerator<IntentOrderStatusUpdate, void>;
|
|
4004
4035
|
/**
|
|
4005
4036
|
* Returns both the native token cost and the relayer fee for cancelling an
|
|
4006
4037
|
* order. Use `relayerFee` to approve the ERC-20 spend before submitting.
|
|
@@ -8131,4 +8162,4 @@ declare const getChainId: (stateMachineId: string) => number | undefined;
|
|
|
8131
8162
|
declare const getViemChain: (chainId: number) => Chain | undefined;
|
|
8132
8163
|
declare const hyperbridgeAddress = "";
|
|
8133
8164
|
|
|
8134
|
-
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 };
|
|
8165
|
+
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 };
|