@hyperbridge/sdk 1.8.8 → 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.
- package/dist/browser/index.d.ts +40 -11
- package/dist/browser/index.js +293 -175
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.d.ts +40 -11
- package/dist/node/index.js +293 -175
- package/dist/node/index.js.map +1 -1
- package/package.json +1 -1
package/dist/browser/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";
|
|
@@ -2987,7 +2981,6 @@ interface ExecuteIntentOrderOptions {
|
|
|
2987
2981
|
order: Order;
|
|
2988
2982
|
sessionPrivateKey?: HexString;
|
|
2989
2983
|
minBids?: number;
|
|
2990
|
-
bidTimeoutMs?: number;
|
|
2991
2984
|
pollIntervalMs?: number;
|
|
2992
2985
|
/**
|
|
2993
2986
|
* If set, bids are restricted to the given solver until `timeoutMs` elapses,
|
|
@@ -3000,6 +2993,16 @@ interface ExecuteIntentOrderOptions {
|
|
|
3000
2993
|
timeoutMs: number;
|
|
3001
2994
|
};
|
|
3002
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
|
+
}
|
|
3003
3006
|
/** Type for ERC-7821 Call struct */
|
|
3004
3007
|
type ERC7821Call = {
|
|
3005
3008
|
target: `0x${string}`;
|
|
@@ -3973,7 +3976,7 @@ declare class IntentGateway {
|
|
|
3973
3976
|
* The caller must sign the transaction and pass it back via `gen.next(signedTx)`.
|
|
3974
3977
|
* 3. Yields `ORDER_PLACED` with the finalised order and transaction hash once
|
|
3975
3978
|
* the `OrderPlaced` event is confirmed.
|
|
3976
|
-
* 4. Delegates to {@link OrderExecutor.
|
|
3979
|
+
* 4. Delegates to {@link OrderExecutor.executeOrder} and forwards all
|
|
3977
3980
|
* subsequent status updates until the order is filled, exhausted, or fails.
|
|
3978
3981
|
*
|
|
3979
3982
|
* @param order - The order to place and execute. `order.fees` may be 0; it
|
|
@@ -3984,7 +3987,6 @@ declare class IntentGateway {
|
|
|
3984
3987
|
* - `maxPriorityFeePerGasBumpPercent` — bump % for the priority fee estimate (default 8).
|
|
3985
3988
|
* - `maxFeePerGasBumpPercent` — bump % for the max fee estimate (default 10).
|
|
3986
3989
|
* - `minBids` — minimum bids to collect before selecting (default 1).
|
|
3987
|
-
* - `bidTimeoutMs` — how long to poll for bids before giving up (default 60 000 ms).
|
|
3988
3990
|
* - `pollIntervalMs` — interval between bid-polling attempts.
|
|
3989
3991
|
* @yields {@link IntentOrderStatusUpdate} at each lifecycle stage.
|
|
3990
3992
|
* @throws If the `placeOrder` generator behaves unexpectedly, or if gas
|
|
@@ -3994,13 +3996,40 @@ declare class IntentGateway {
|
|
|
3994
3996
|
maxPriorityFeePerGasBumpPercent?: number;
|
|
3995
3997
|
maxFeePerGasBumpPercent?: number;
|
|
3996
3998
|
minBids?: number;
|
|
3997
|
-
bidTimeoutMs?: number;
|
|
3998
3999
|
pollIntervalMs?: number;
|
|
3999
4000
|
solver?: {
|
|
4000
4001
|
address: HexString;
|
|
4001
4002
|
timeoutMs: number;
|
|
4002
4003
|
};
|
|
4003
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>;
|
|
4004
4033
|
/**
|
|
4005
4034
|
* Returns both the native token cost and the relayer fee for cancelling an
|
|
4006
4035
|
* order. Use `relayerFee` to approve the ERC-20 spend before submitting.
|
|
@@ -8131,4 +8160,4 @@ declare const getChainId: (stateMachineId: string) => number | undefined;
|
|
|
8131
8160
|
declare const getViemChain: (chainId: number) => Chain | undefined;
|
|
8132
8161
|
declare const hyperbridgeAddress = "";
|
|
8133
8162
|
|
|
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 };
|
|
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 };
|