@defuse-protocol/intents-sdk 0.33.2 → 0.34.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/index.cjs CHANGED
@@ -32,6 +32,7 @@ exports.Chains = require_caip2.Chains;
32
32
  exports.DestinationExplicitNearAccountDoesntExistError = require_error.DestinationExplicitNearAccountDoesntExistError;
33
33
  exports.FailedToFetchFeeError = require_error$2.FailedToFetchFeeError;
34
34
  exports.FeeExceedsAmountError = require_errors.FeeExceedsAmountError;
35
+ exports.HotWithdrawalApiFeeRequestTimeoutError = require_error$1.HotWithdrawalApiFeeRequestTimeoutError;
35
36
  exports.HotWithdrawalCancelledError = require_error$1.HotWithdrawalCancelledError;
36
37
  exports.HotWithdrawalNotFoundError = require_error$1.HotWithdrawalNotFoundError;
37
38
  exports.HotWithdrawalPendingError = require_error$1.HotWithdrawalPendingError;
@@ -54,6 +55,7 @@ exports.MinWithdrawalAmountError = require_errors.MinWithdrawalAmountError;
54
55
  exports.OmniTokenNormalisationCheckError = require_error$2.OmniTokenNormalisationCheckError;
55
56
  exports.OmniTransferDestinationChainHashNotFoundError = require_error$2.OmniTransferDestinationChainHashNotFoundError;
56
57
  exports.OmniTransferNotFoundError = require_error$2.OmniTransferNotFoundError;
58
+ exports.OmniWithdrawalApiFeeRequestTimeoutError = require_error$2.OmniWithdrawalApiFeeRequestTimeoutError;
57
59
  Object.defineProperty(exports, 'PoaWithdrawalInvariantError', {
58
60
  enumerable: true,
59
61
  get: function () {
package/dist/index.d.cts CHANGED
@@ -12,8 +12,8 @@ import { createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSi
12
12
  import { createDefaultRoute, createHotBridgeRoute, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute } from "./src/lib/route-config-factory.cjs";
13
13
  import { FeeExceedsAmountError, FeeExceedsAmountErrorType, MinWithdrawalAmountError, MinWithdrawalAmountErrorType, TrustlineNotFoundError, TrustlineNotFoundErrorType, UnsupportedAssetIdError, UnsupportedAssetIdErrorType, UnsupportedDestinationMemoError, UnsupportedDestinationMemoErrorType } from "./src/classes/errors.cjs";
14
14
  import { DestinationExplicitNearAccountDoesntExistError, DestinationExplicitNearAccountDoesntExistErrorType } from "./src/bridges/direct-bridge/error.cjs";
15
- import { HotWithdrawalCancelledError, HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, HotWithdrawalPendingErrorType } from "./src/bridges/hot-bridge/error.cjs";
16
- import { FailedToFetchFeeError, FailedToFetchFeeErrorType, IntentsNearOmniAvailableBalanceTooLowError, IntentsNearOmniAvailableBalanceTooLowErrorType, OmniTokenNormalisationCheckError, OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, OmniTransferNotFoundErrorType, TokenNotFoundInDestinationChainError, TokenNotFoundInDestinationChainErrorType } from "./src/bridges/omni-bridge/error.cjs";
15
+ import { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalApiFeeRequestTimeoutErrorType, HotWithdrawalCancelledError, HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, HotWithdrawalPendingErrorType } from "./src/bridges/hot-bridge/error.cjs";
16
+ import { FailedToFetchFeeError, FailedToFetchFeeErrorType, IntentsNearOmniAvailableBalanceTooLowError, IntentsNearOmniAvailableBalanceTooLowErrorType, OmniTokenNormalisationCheckError, OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, OmniTransferNotFoundErrorType, OmniWithdrawalApiFeeRequestTimeoutError, OmniWithdrawalApiFeeRequestTimeoutErrorType, TokenNotFoundInDestinationChainError, TokenNotFoundInDestinationChainErrorType } from "./src/bridges/omni-bridge/error.cjs";
17
17
  import { computeIntentHash } from "./src/intents/intent-hash.cjs";
18
18
  import { AssertionError, AssertionErrorType, BaseError, BaseErrorType, HttpRequestError, HttpRequestErrorType, ILogger, IntentSettlementError, IntentSettlementErrorType, NearIntentsEnv, PoaWithdrawalInvariantError, PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, PoaWithdrawalPendingErrorType, QuoteError, QuoteErrorType, RelayPublishError, RelayPublishErrorType, RetryOptions, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType } from "@defuse-protocol/internal-utils";
19
- export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationExplicitNearAccountDoesntExistError, type DestinationExplicitNearAccountDoesntExistErrorType, FailedToFetchFeeError, type FailedToFetchFeeErrorType, type FeeEstimation, FeeExceedsAmountError, type FeeExceedsAmountErrorType, type HotBridgeRouteConfig, HotWithdrawalCancelledError, type HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, type HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, type HotWithdrawalPendingErrorType, HttpRequestError, type HttpRequestErrorType, type IIntentSigner, type ILogger, type IntentPayload, IntentPayloadBuilder, type IntentPayloadFactory, type IntentPrimitive, type IntentPublishResult, type IntentRelayParamsFactory, IntentSettlementError, type IntentSettlementErrorType, type IntentSettlementStatus, IntentsNearOmniAvailableBalanceTooLowError, type IntentsNearOmniAvailableBalanceTooLowErrorType, IntentsSDK, type IntentsSDKConfig, type InternalTransferRouteConfig, MinWithdrawalAmountError, type MinWithdrawalAmountErrorType, type MultiPayload, type NearIntentsEnv, type NearTxInfo, type NearWithdrawalRouteConfig, type OmniBridgeRouteConfig, OmniTokenNormalisationCheckError, type OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, type OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, type OmniTransferNotFoundErrorType, type OnBeforePublishIntentHook, type ParsedAssetInfo, type PoaBridgeRouteConfig, PoaWithdrawalInvariantError, type PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, type PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, type PoaWithdrawalPendingErrorType, type ProcessWithdrawalArgs, QuoteError, type QuoteErrorType, RelayPublishError, type RelayPublishErrorType, type RetryOptions, type RouteConfig, RouteEnum, type RouteEnumValues, RpcRequestError, type RpcRequestErrorType, type SignAndSendArgs, type SignAndSendWithdrawalArgs, type SignedIntentsComposition, TimeoutError, type TimeoutErrorType, TokenNotFoundInDestinationChainError, type TokenNotFoundInDestinationChainErrorType, TrustlineNotFoundError, type TrustlineNotFoundErrorType, type TxInfo, type TxNoInfo, UnsupportedAssetIdError, type UnsupportedAssetIdErrorType, UnsupportedDestinationMemoError, type UnsupportedDestinationMemoErrorType, VersionedNonceBuilder, type VirtualChainRouteConfig, type WithdrawalIdentifier, type WithdrawalParams, type WithdrawalResult, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute };
19
+ export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationExplicitNearAccountDoesntExistError, type DestinationExplicitNearAccountDoesntExistErrorType, FailedToFetchFeeError, type FailedToFetchFeeErrorType, type FeeEstimation, FeeExceedsAmountError, type FeeExceedsAmountErrorType, type HotBridgeRouteConfig, HotWithdrawalApiFeeRequestTimeoutError, type HotWithdrawalApiFeeRequestTimeoutErrorType, HotWithdrawalCancelledError, type HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, type HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, type HotWithdrawalPendingErrorType, HttpRequestError, type HttpRequestErrorType, type IIntentSigner, type ILogger, type IntentPayload, IntentPayloadBuilder, type IntentPayloadFactory, type IntentPrimitive, type IntentPublishResult, type IntentRelayParamsFactory, IntentSettlementError, type IntentSettlementErrorType, type IntentSettlementStatus, IntentsNearOmniAvailableBalanceTooLowError, type IntentsNearOmniAvailableBalanceTooLowErrorType, IntentsSDK, type IntentsSDKConfig, type InternalTransferRouteConfig, MinWithdrawalAmountError, type MinWithdrawalAmountErrorType, type MultiPayload, type NearIntentsEnv, type NearTxInfo, type NearWithdrawalRouteConfig, type OmniBridgeRouteConfig, OmniTokenNormalisationCheckError, type OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, type OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, type OmniTransferNotFoundErrorType, OmniWithdrawalApiFeeRequestTimeoutError, type OmniWithdrawalApiFeeRequestTimeoutErrorType, type OnBeforePublishIntentHook, type ParsedAssetInfo, type PoaBridgeRouteConfig, PoaWithdrawalInvariantError, type PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, type PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, type PoaWithdrawalPendingErrorType, type ProcessWithdrawalArgs, QuoteError, type QuoteErrorType, RelayPublishError, type RelayPublishErrorType, type RetryOptions, type RouteConfig, RouteEnum, type RouteEnumValues, RpcRequestError, type RpcRequestErrorType, type SignAndSendArgs, type SignAndSendWithdrawalArgs, type SignedIntentsComposition, TimeoutError, type TimeoutErrorType, TokenNotFoundInDestinationChainError, type TokenNotFoundInDestinationChainErrorType, TrustlineNotFoundError, type TrustlineNotFoundErrorType, type TxInfo, type TxNoInfo, UnsupportedAssetIdError, type UnsupportedAssetIdErrorType, UnsupportedDestinationMemoError, type UnsupportedDestinationMemoErrorType, VersionedNonceBuilder, type VirtualChainRouteConfig, type WithdrawalIdentifier, type WithdrawalParams, type WithdrawalResult, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute };
package/dist/index.d.ts CHANGED
@@ -12,8 +12,8 @@ import { createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSi
12
12
  import { createDefaultRoute, createHotBridgeRoute, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute } from "./src/lib/route-config-factory.js";
13
13
  import { FeeExceedsAmountError, FeeExceedsAmountErrorType, MinWithdrawalAmountError, MinWithdrawalAmountErrorType, TrustlineNotFoundError, TrustlineNotFoundErrorType, UnsupportedAssetIdError, UnsupportedAssetIdErrorType, UnsupportedDestinationMemoError, UnsupportedDestinationMemoErrorType } from "./src/classes/errors.js";
14
14
  import { DestinationExplicitNearAccountDoesntExistError, DestinationExplicitNearAccountDoesntExistErrorType } from "./src/bridges/direct-bridge/error.js";
15
- import { HotWithdrawalCancelledError, HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, HotWithdrawalPendingErrorType } from "./src/bridges/hot-bridge/error.js";
16
- import { FailedToFetchFeeError, FailedToFetchFeeErrorType, IntentsNearOmniAvailableBalanceTooLowError, IntentsNearOmniAvailableBalanceTooLowErrorType, OmniTokenNormalisationCheckError, OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, OmniTransferNotFoundErrorType, TokenNotFoundInDestinationChainError, TokenNotFoundInDestinationChainErrorType } from "./src/bridges/omni-bridge/error.js";
15
+ import { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalApiFeeRequestTimeoutErrorType, HotWithdrawalCancelledError, HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, HotWithdrawalPendingErrorType } from "./src/bridges/hot-bridge/error.js";
16
+ import { FailedToFetchFeeError, FailedToFetchFeeErrorType, IntentsNearOmniAvailableBalanceTooLowError, IntentsNearOmniAvailableBalanceTooLowErrorType, OmniTokenNormalisationCheckError, OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, OmniTransferNotFoundErrorType, OmniWithdrawalApiFeeRequestTimeoutError, OmniWithdrawalApiFeeRequestTimeoutErrorType, TokenNotFoundInDestinationChainError, TokenNotFoundInDestinationChainErrorType } from "./src/bridges/omni-bridge/error.js";
17
17
  import { computeIntentHash } from "./src/intents/intent-hash.js";
18
18
  import { AssertionError, AssertionErrorType, BaseError, BaseErrorType, HttpRequestError, HttpRequestErrorType, ILogger, IntentSettlementError, IntentSettlementErrorType, NearIntentsEnv, PoaWithdrawalInvariantError, PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, PoaWithdrawalPendingErrorType, QuoteError, QuoteErrorType, RelayPublishError, RelayPublishErrorType, RetryOptions, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType } from "@defuse-protocol/internal-utils";
19
- export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationExplicitNearAccountDoesntExistError, type DestinationExplicitNearAccountDoesntExistErrorType, FailedToFetchFeeError, type FailedToFetchFeeErrorType, type FeeEstimation, FeeExceedsAmountError, type FeeExceedsAmountErrorType, type HotBridgeRouteConfig, HotWithdrawalCancelledError, type HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, type HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, type HotWithdrawalPendingErrorType, HttpRequestError, type HttpRequestErrorType, type IIntentSigner, type ILogger, type IntentPayload, IntentPayloadBuilder, type IntentPayloadFactory, type IntentPrimitive, type IntentPublishResult, type IntentRelayParamsFactory, IntentSettlementError, type IntentSettlementErrorType, type IntentSettlementStatus, IntentsNearOmniAvailableBalanceTooLowError, type IntentsNearOmniAvailableBalanceTooLowErrorType, IntentsSDK, type IntentsSDKConfig, type InternalTransferRouteConfig, MinWithdrawalAmountError, type MinWithdrawalAmountErrorType, type MultiPayload, type NearIntentsEnv, type NearTxInfo, type NearWithdrawalRouteConfig, type OmniBridgeRouteConfig, OmniTokenNormalisationCheckError, type OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, type OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, type OmniTransferNotFoundErrorType, type OnBeforePublishIntentHook, type ParsedAssetInfo, type PoaBridgeRouteConfig, PoaWithdrawalInvariantError, type PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, type PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, type PoaWithdrawalPendingErrorType, type ProcessWithdrawalArgs, QuoteError, type QuoteErrorType, RelayPublishError, type RelayPublishErrorType, type RetryOptions, type RouteConfig, RouteEnum, type RouteEnumValues, RpcRequestError, type RpcRequestErrorType, type SignAndSendArgs, type SignAndSendWithdrawalArgs, type SignedIntentsComposition, TimeoutError, type TimeoutErrorType, TokenNotFoundInDestinationChainError, type TokenNotFoundInDestinationChainErrorType, TrustlineNotFoundError, type TrustlineNotFoundErrorType, type TxInfo, type TxNoInfo, UnsupportedAssetIdError, type UnsupportedAssetIdErrorType, UnsupportedDestinationMemoError, type UnsupportedDestinationMemoErrorType, VersionedNonceBuilder, type VirtualChainRouteConfig, type WithdrawalIdentifier, type WithdrawalParams, type WithdrawalResult, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute };
19
+ export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationExplicitNearAccountDoesntExistError, type DestinationExplicitNearAccountDoesntExistErrorType, FailedToFetchFeeError, type FailedToFetchFeeErrorType, type FeeEstimation, FeeExceedsAmountError, type FeeExceedsAmountErrorType, type HotBridgeRouteConfig, HotWithdrawalApiFeeRequestTimeoutError, type HotWithdrawalApiFeeRequestTimeoutErrorType, HotWithdrawalCancelledError, type HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, type HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, type HotWithdrawalPendingErrorType, HttpRequestError, type HttpRequestErrorType, type IIntentSigner, type ILogger, type IntentPayload, IntentPayloadBuilder, type IntentPayloadFactory, type IntentPrimitive, type IntentPublishResult, type IntentRelayParamsFactory, IntentSettlementError, type IntentSettlementErrorType, type IntentSettlementStatus, IntentsNearOmniAvailableBalanceTooLowError, type IntentsNearOmniAvailableBalanceTooLowErrorType, IntentsSDK, type IntentsSDKConfig, type InternalTransferRouteConfig, MinWithdrawalAmountError, type MinWithdrawalAmountErrorType, type MultiPayload, type NearIntentsEnv, type NearTxInfo, type NearWithdrawalRouteConfig, type OmniBridgeRouteConfig, OmniTokenNormalisationCheckError, type OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, type OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, type OmniTransferNotFoundErrorType, OmniWithdrawalApiFeeRequestTimeoutError, type OmniWithdrawalApiFeeRequestTimeoutErrorType, type OnBeforePublishIntentHook, type ParsedAssetInfo, type PoaBridgeRouteConfig, PoaWithdrawalInvariantError, type PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, type PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, type PoaWithdrawalPendingErrorType, type ProcessWithdrawalArgs, QuoteError, type QuoteErrorType, RelayPublishError, type RelayPublishErrorType, type RetryOptions, type RouteConfig, RouteEnum, type RouteEnumValues, RpcRequestError, type RpcRequestErrorType, type SignAndSendArgs, type SignAndSendWithdrawalArgs, type SignedIntentsComposition, TimeoutError, type TimeoutErrorType, TokenNotFoundInDestinationChainError, type TokenNotFoundInDestinationChainErrorType, TrustlineNotFoundError, type TrustlineNotFoundErrorType, type TxInfo, type TxNoInfo, UnsupportedAssetIdError, type UnsupportedAssetIdErrorType, UnsupportedDestinationMemoError, type UnsupportedDestinationMemoErrorType, VersionedNonceBuilder, type VirtualChainRouteConfig, type WithdrawalIdentifier, type WithdrawalParams, type WithdrawalResult, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute };
package/dist/index.js CHANGED
@@ -3,8 +3,8 @@ import { FeeExceedsAmountError, MinWithdrawalAmountError, TrustlineNotFoundError
3
3
  import { Chains } from "./src/lib/caip2.js";
4
4
  import { BridgeNameEnum } from "./src/constants/bridge-name-enum.js";
5
5
  import { DestinationExplicitNearAccountDoesntExistError } from "./src/bridges/direct-bridge/error.js";
6
- import { HotWithdrawalCancelledError, HotWithdrawalNotFoundError, HotWithdrawalPendingError } from "./src/bridges/hot-bridge/error.js";
7
- import { FailedToFetchFeeError, IntentsNearOmniAvailableBalanceTooLowError, OmniTokenNormalisationCheckError, OmniTransferDestinationChainHashNotFoundError, OmniTransferNotFoundError, TokenNotFoundInDestinationChainError } from "./src/bridges/omni-bridge/error.js";
6
+ import { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalCancelledError, HotWithdrawalNotFoundError, HotWithdrawalPendingError } from "./src/bridges/hot-bridge/error.js";
7
+ import { FailedToFetchFeeError, IntentsNearOmniAvailableBalanceTooLowError, OmniTokenNormalisationCheckError, OmniTransferDestinationChainHashNotFoundError, OmniTransferNotFoundError, OmniWithdrawalApiFeeRequestTimeoutError, TokenNotFoundInDestinationChainError } from "./src/bridges/omni-bridge/error.js";
8
8
  import { computeIntentHash } from "./src/intents/intent-hash.js";
9
9
  import { VersionedNonceBuilder } from "./src/intents/expirable-nonce.js";
10
10
  import { createDefaultRoute, createHotBridgeRoute, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute } from "./src/lib/route-config-factory.js";
@@ -13,4 +13,4 @@ import { IntentsSDK } from "./src/sdk.js";
13
13
  import { createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem } from "./src/intents/intent-signer-impl/factories.js";
14
14
  import { AssertionError, BaseError, HttpRequestError, IntentSettlementError, PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError, QuoteError, RelayPublishError, RpcRequestError, TimeoutError } from "@defuse-protocol/internal-utils";
15
15
 
16
- export { AssertionError, BaseError, BridgeNameEnum, Chains, DestinationExplicitNearAccountDoesntExistError, FailedToFetchFeeError, FeeExceedsAmountError, HotWithdrawalCancelledError, HotWithdrawalNotFoundError, HotWithdrawalPendingError, HttpRequestError, IntentPayloadBuilder, IntentSettlementError, IntentsNearOmniAvailableBalanceTooLowError, IntentsSDK, MinWithdrawalAmountError, OmniTokenNormalisationCheckError, OmniTransferDestinationChainHashNotFoundError, OmniTransferNotFoundError, PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError, QuoteError, RelayPublishError, RouteEnum, RpcRequestError, TimeoutError, TokenNotFoundInDestinationChainError, TrustlineNotFoundError, UnsupportedAssetIdError, UnsupportedDestinationMemoError, VersionedNonceBuilder, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute };
16
+ export { AssertionError, BaseError, BridgeNameEnum, Chains, DestinationExplicitNearAccountDoesntExistError, FailedToFetchFeeError, FeeExceedsAmountError, HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalCancelledError, HotWithdrawalNotFoundError, HotWithdrawalPendingError, HttpRequestError, IntentPayloadBuilder, IntentSettlementError, IntentsNearOmniAvailableBalanceTooLowError, IntentsSDK, MinWithdrawalAmountError, OmniTokenNormalisationCheckError, OmniTransferDestinationChainHashNotFoundError, OmniTransferNotFoundError, OmniWithdrawalApiFeeRequestTimeoutError, PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError, QuoteError, RelayPublishError, RouteEnum, RpcRequestError, TimeoutError, TokenNotFoundInDestinationChainError, TrustlineNotFoundError, UnsupportedAssetIdError, UnsupportedDestinationMemoError, VersionedNonceBuilder, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute };
@@ -33,8 +33,14 @@ var HotWithdrawalCancelledError = class extends __defuse_protocol_internal_utils
33
33
  this.index = index;
34
34
  }
35
35
  };
36
+ var HotWithdrawalApiFeeRequestTimeoutError = class extends __defuse_protocol_internal_utils.BaseError {
37
+ constructor() {
38
+ super("Hot bridge withdrawal fee request timed out.", { name: "HotWithdrawalApiFeeRequestTimeoutError" });
39
+ }
40
+ };
36
41
 
37
42
  //#endregion
43
+ exports.HotWithdrawalApiFeeRequestTimeoutError = HotWithdrawalApiFeeRequestTimeoutError;
38
44
  exports.HotWithdrawalCancelledError = HotWithdrawalCancelledError;
39
45
  exports.HotWithdrawalNotFoundError = HotWithdrawalNotFoundError;
40
46
  exports.HotWithdrawalPendingError = HotWithdrawalPendingError;
@@ -25,5 +25,11 @@ declare class HotWithdrawalCancelledError extends BaseError {
25
25
  index: number;
26
26
  constructor(txHash: string, index: number);
27
27
  }
28
+ type HotWithdrawalApiFeeRequestTimeoutErrorType = HotWithdrawalApiFeeRequestTimeoutError & {
29
+ name: "HotWithdrawalApiFeeRequestTimeoutError";
30
+ };
31
+ declare class HotWithdrawalApiFeeRequestTimeoutError extends BaseError {
32
+ constructor();
33
+ }
28
34
  //#endregion
29
- export { HotWithdrawalCancelledError, HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, HotWithdrawalPendingErrorType };
35
+ export { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalApiFeeRequestTimeoutErrorType, HotWithdrawalCancelledError, HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, HotWithdrawalPendingErrorType };
@@ -25,5 +25,11 @@ declare class HotWithdrawalCancelledError extends BaseError {
25
25
  index: number;
26
26
  constructor(txHash: string, index: number);
27
27
  }
28
+ type HotWithdrawalApiFeeRequestTimeoutErrorType = HotWithdrawalApiFeeRequestTimeoutError & {
29
+ name: "HotWithdrawalApiFeeRequestTimeoutError";
30
+ };
31
+ declare class HotWithdrawalApiFeeRequestTimeoutError extends BaseError {
32
+ constructor();
33
+ }
28
34
  //#endregion
29
- export { HotWithdrawalCancelledError, HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, HotWithdrawalPendingErrorType };
35
+ export { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalApiFeeRequestTimeoutErrorType, HotWithdrawalCancelledError, HotWithdrawalCancelledErrorType, HotWithdrawalNotFoundError, HotWithdrawalNotFoundErrorType, HotWithdrawalPendingError, HotWithdrawalPendingErrorType };
@@ -31,6 +31,11 @@ var HotWithdrawalCancelledError = class extends BaseError {
31
31
  this.index = index;
32
32
  }
33
33
  };
34
+ var HotWithdrawalApiFeeRequestTimeoutError = class extends BaseError {
35
+ constructor() {
36
+ super("Hot bridge withdrawal fee request timed out.", { name: "HotWithdrawalApiFeeRequestTimeoutError" });
37
+ }
38
+ };
34
39
 
35
40
  //#endregion
36
- export { HotWithdrawalCancelledError, HotWithdrawalNotFoundError, HotWithdrawalPendingError };
41
+ export { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalCancelledError, HotWithdrawalNotFoundError, HotWithdrawalPendingError };
@@ -103,10 +103,13 @@ var HotBridge = class {
103
103
  const assetInfo = this.parseAssetId(args.withdrawalParams.assetId);
104
104
  (0, __defuse_protocol_internal_utils.assert)(assetInfo != null, "Asset is not supported");
105
105
  require_hot_bridge_utils.hotBlockchainInvariant(assetInfo.blockchain);
106
- const { gasPrice: feeAmount } = await this.hotSdk.getGaslessWithdrawFee({
106
+ const { gasPrice: feeAmount } = await (0, __defuse_protocol_internal_utils.withTimeout)(() => this.hotSdk.getGaslessWithdrawFee({
107
107
  chain: require_hot_bridge_utils.toHotNetworkId(assetInfo.blockchain),
108
108
  token: "native" in assetInfo ? "native" : assetInfo.address,
109
109
  receiver: args.withdrawalParams.destinationAddress
110
+ }), {
111
+ errorInstance: new require_error.HotWithdrawalApiFeeRequestTimeoutError(),
112
+ timeout: typeof window !== "undefined" ? 1e4 : 3e3
110
113
  });
111
114
  const feeAssetId = require_hot_bridge_utils.getFeeAssetIdForChain(assetInfo.blockchain);
112
115
  const feeQuote = args.withdrawalParams.assetId === feeAssetId || feeAmount === 0n ? null : await require_estimate_fee.getFeeQuote({
@@ -5,11 +5,11 @@ import { getFeeQuote } from "../../lib/estimate-fee.js";
5
5
  import { Chains } from "../../lib/caip2.js";
6
6
  import { validateAddress } from "../../lib/validateAddress.js";
7
7
  import { BridgeNameEnum } from "../../constants/bridge-name-enum.js";
8
- import { HotWithdrawalCancelledError, HotWithdrawalNotFoundError, HotWithdrawalPendingError } from "./error.js";
8
+ import { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalCancelledError, HotWithdrawalNotFoundError, HotWithdrawalPendingError } from "./error.js";
9
9
  import { HotWithdrawStatus } from "./hot-bridge-constants.js";
10
10
  import { formatTxHash, getFeeAssetIdForChain, hotBlockchainInvariant, hotNetworkIdToCAIP2, toHotNetworkId } from "./hot-bridge-utils.js";
11
11
  import isHex from "../../lib/hex.js";
12
- import { RETRY_CONFIGS, assert } from "@defuse-protocol/internal-utils";
12
+ import { RETRY_CONFIGS, assert, withTimeout } from "@defuse-protocol/internal-utils";
13
13
  import { OMNI_HOT_V2, utils as utils$1 } from "@hot-labs/omni-sdk";
14
14
  import { retry } from "@lifeomic/attempt";
15
15
 
@@ -99,10 +99,13 @@ var HotBridge$1 = class {
99
99
  const assetInfo = this.parseAssetId(args.withdrawalParams.assetId);
100
100
  assert(assetInfo != null, "Asset is not supported");
101
101
  hotBlockchainInvariant(assetInfo.blockchain);
102
- const { gasPrice: feeAmount } = await this.hotSdk.getGaslessWithdrawFee({
102
+ const { gasPrice: feeAmount } = await withTimeout(() => this.hotSdk.getGaslessWithdrawFee({
103
103
  chain: toHotNetworkId(assetInfo.blockchain),
104
104
  token: "native" in assetInfo ? "native" : assetInfo.address,
105
105
  receiver: args.withdrawalParams.destinationAddress
106
+ }), {
107
+ errorInstance: new HotWithdrawalApiFeeRequestTimeoutError(),
108
+ timeout: typeof window !== "undefined" ? 1e4 : 3e3
106
109
  });
107
110
  const feeAssetId = getFeeAssetIdForChain(assetInfo.blockchain);
108
111
  const feeQuote = args.withdrawalParams.assetId === feeAssetId || feeAmount === 0n ? null : await getFeeQuote({
@@ -69,6 +69,11 @@ var IntentsNearOmniAvailableBalanceTooLowError = class extends __defuse_protocol
69
69
  this.balance = balance;
70
70
  }
71
71
  };
72
+ var OmniWithdrawalApiFeeRequestTimeoutError = class extends __defuse_protocol_internal_utils.BaseError {
73
+ constructor() {
74
+ super("Omni bridge withdrawal fee request timed out.", { name: "OmniWithdrawalApiFeeRequestTimeoutError" });
75
+ }
76
+ };
72
77
 
73
78
  //#endregion
74
79
  exports.FailedToFetchFeeError = FailedToFetchFeeError;
@@ -76,4 +81,5 @@ exports.IntentsNearOmniAvailableBalanceTooLowError = IntentsNearOmniAvailableBal
76
81
  exports.OmniTokenNormalisationCheckError = OmniTokenNormalisationCheckError;
77
82
  exports.OmniTransferDestinationChainHashNotFoundError = OmniTransferDestinationChainHashNotFoundError;
78
83
  exports.OmniTransferNotFoundError = OmniTransferNotFoundError;
84
+ exports.OmniWithdrawalApiFeeRequestTimeoutError = OmniWithdrawalApiFeeRequestTimeoutError;
79
85
  exports.TokenNotFoundInDestinationChainError = TokenNotFoundInDestinationChainError;
@@ -49,5 +49,11 @@ declare class IntentsNearOmniAvailableBalanceTooLowError extends BaseError {
49
49
  balance: string;
50
50
  constructor(balance: string);
51
51
  }
52
+ type OmniWithdrawalApiFeeRequestTimeoutErrorType = OmniWithdrawalApiFeeRequestTimeoutError & {
53
+ name: "OmniWithdrawalApiFeeRequestTimeoutError";
54
+ };
55
+ declare class OmniWithdrawalApiFeeRequestTimeoutError extends BaseError {
56
+ constructor();
57
+ }
52
58
  //#endregion
53
- export { FailedToFetchFeeError, FailedToFetchFeeErrorType, IntentsNearOmniAvailableBalanceTooLowError, IntentsNearOmniAvailableBalanceTooLowErrorType, OmniTokenNormalisationCheckError, OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, OmniTransferNotFoundErrorType, TokenNotFoundInDestinationChainError, TokenNotFoundInDestinationChainErrorType };
59
+ export { FailedToFetchFeeError, FailedToFetchFeeErrorType, IntentsNearOmniAvailableBalanceTooLowError, IntentsNearOmniAvailableBalanceTooLowErrorType, OmniTokenNormalisationCheckError, OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, OmniTransferNotFoundErrorType, OmniWithdrawalApiFeeRequestTimeoutError, OmniWithdrawalApiFeeRequestTimeoutErrorType, TokenNotFoundInDestinationChainError, TokenNotFoundInDestinationChainErrorType };
@@ -49,5 +49,11 @@ declare class IntentsNearOmniAvailableBalanceTooLowError extends BaseError {
49
49
  balance: string;
50
50
  constructor(balance: string);
51
51
  }
52
+ type OmniWithdrawalApiFeeRequestTimeoutErrorType = OmniWithdrawalApiFeeRequestTimeoutError & {
53
+ name: "OmniWithdrawalApiFeeRequestTimeoutError";
54
+ };
55
+ declare class OmniWithdrawalApiFeeRequestTimeoutError extends BaseError {
56
+ constructor();
57
+ }
52
58
  //#endregion
53
- export { FailedToFetchFeeError, FailedToFetchFeeErrorType, IntentsNearOmniAvailableBalanceTooLowError, IntentsNearOmniAvailableBalanceTooLowErrorType, OmniTokenNormalisationCheckError, OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, OmniTransferNotFoundErrorType, TokenNotFoundInDestinationChainError, TokenNotFoundInDestinationChainErrorType };
59
+ export { FailedToFetchFeeError, FailedToFetchFeeErrorType, IntentsNearOmniAvailableBalanceTooLowError, IntentsNearOmniAvailableBalanceTooLowErrorType, OmniTokenNormalisationCheckError, OmniTokenNormalisationCheckErrorType, OmniTransferDestinationChainHashNotFoundError, OmniTransferDestinationChainHashNotFoundErrorType, OmniTransferNotFoundError, OmniTransferNotFoundErrorType, OmniWithdrawalApiFeeRequestTimeoutError, OmniWithdrawalApiFeeRequestTimeoutErrorType, TokenNotFoundInDestinationChainError, TokenNotFoundInDestinationChainErrorType };
@@ -67,6 +67,11 @@ var IntentsNearOmniAvailableBalanceTooLowError = class extends BaseError {
67
67
  this.balance = balance;
68
68
  }
69
69
  };
70
+ var OmniWithdrawalApiFeeRequestTimeoutError = class extends BaseError {
71
+ constructor() {
72
+ super("Omni bridge withdrawal fee request timed out.", { name: "OmniWithdrawalApiFeeRequestTimeoutError" });
73
+ }
74
+ };
70
75
 
71
76
  //#endregion
72
- export { FailedToFetchFeeError, IntentsNearOmniAvailableBalanceTooLowError, OmniTokenNormalisationCheckError, OmniTransferDestinationChainHashNotFoundError, OmniTransferNotFoundError, TokenNotFoundInDestinationChainError };
77
+ export { FailedToFetchFeeError, IntentsNearOmniAvailableBalanceTooLowError, OmniTokenNormalisationCheckError, OmniTransferDestinationChainHashNotFoundError, OmniTransferNotFoundError, OmniWithdrawalApiFeeRequestTimeoutError, TokenNotFoundInDestinationChainError };
@@ -152,7 +152,10 @@ var OmniBridge = class {
152
152
  (0, __defuse_protocol_internal_utils.assert)(assetInfo !== null, `Asset ${args.withdrawalParams.assetId} is not supported by Omni Bridge`);
153
153
  const omniChainKind = require_omni_bridge_utils.caip2ToChainKind(assetInfo.blockchain);
154
154
  (0, __defuse_protocol_internal_utils.assert)(omniChainKind !== null, `Chain ${assetInfo.blockchain} is not supported by Omni Bridge`);
155
- const fee = await this.omniBridgeAPI.getFee((0, omni_bridge_sdk.omniAddress)(omni_bridge_sdk.ChainKind.Near, __defuse_protocol_internal_utils.configsByEnvironment[this.env].contractID), (0, omni_bridge_sdk.omniAddress)(omniChainKind, args.withdrawalParams.destinationAddress), (0, omni_bridge_sdk.omniAddress)(omni_bridge_sdk.ChainKind.Near, assetInfo.contractId));
155
+ const fee = await (0, __defuse_protocol_internal_utils.withTimeout)(() => this.omniBridgeAPI.getFee((0, omni_bridge_sdk.omniAddress)(omni_bridge_sdk.ChainKind.Near, __defuse_protocol_internal_utils.configsByEnvironment[this.env].contractID), (0, omni_bridge_sdk.omniAddress)(omniChainKind, args.withdrawalParams.destinationAddress), (0, omni_bridge_sdk.omniAddress)(omni_bridge_sdk.ChainKind.Near, assetInfo.contractId)), {
156
+ timeout: typeof window !== "undefined" ? 1e4 : 3e3,
157
+ errorInstance: new require_error.OmniWithdrawalApiFeeRequestTimeoutError()
158
+ });
156
159
  if (fee.native_token_fee === null) throw new require_error.FailedToFetchFeeError(args.withdrawalParams.assetId);
157
160
  const [minStorageBalance, currentStorageBalance] = await this.getCachedStorageDepositValue(assetInfo.contractId);
158
161
  const totalAmountToQuote = fee.native_token_fee + (minStorageBalance > currentStorageBalance ? minStorageBalance - currentStorageBalance : 0n);
@@ -4,10 +4,10 @@ import { parseDefuseAssetId } from "../../lib/parse-defuse-asset-id.js";
4
4
  import { getFeeQuote } from "../../lib/estimate-fee.js";
5
5
  import { validateAddress } from "../../lib/validateAddress.js";
6
6
  import { BridgeNameEnum } from "../../constants/bridge-name-enum.js";
7
- import { FailedToFetchFeeError, IntentsNearOmniAvailableBalanceTooLowError, OmniTokenNormalisationCheckError, OmniTransferDestinationChainHashNotFoundError, OmniTransferNotFoundError, TokenNotFoundInDestinationChainError } from "./error.js";
7
+ import { FailedToFetchFeeError, IntentsNearOmniAvailableBalanceTooLowError, OmniTokenNormalisationCheckError, OmniTransferDestinationChainHashNotFoundError, OmniTransferNotFoundError, OmniWithdrawalApiFeeRequestTimeoutError, TokenNotFoundInDestinationChainError } from "./error.js";
8
8
  import { MIN_ALLOWED_STORAGE_BALANCE_FOR_INTENTS_NEAR, NEAR_NATIVE_ASSET_ID, OMNI_BRIDGE_CONTRACT } from "./omni-bridge-constants.js";
9
9
  import { caip2ToChainKind, chainKindToCaip2, createWithdrawIntentsPrimitive, getAccountOmniStorageBalance, getBridgedToken, getTokenDecimals, validateOmniToken } from "./omni-bridge-utils.js";
10
- import { RETRY_CONFIGS, assert, configsByEnvironment, getNearNep141MinStorageBalance, getNearNep141StorageBalance } from "@defuse-protocol/internal-utils";
10
+ import { RETRY_CONFIGS, assert, configsByEnvironment, getNearNep141MinStorageBalance, getNearNep141StorageBalance, withTimeout } from "@defuse-protocol/internal-utils";
11
11
  import { LRUCache } from "lru-cache";
12
12
  import { retry } from "@lifeomic/attempt";
13
13
  import TTLCache from "@isaacs/ttlcache";
@@ -146,7 +146,10 @@ var OmniBridge = class {
146
146
  assert(assetInfo !== null, `Asset ${args.withdrawalParams.assetId} is not supported by Omni Bridge`);
147
147
  const omniChainKind = caip2ToChainKind(assetInfo.blockchain);
148
148
  assert(omniChainKind !== null, `Chain ${assetInfo.blockchain} is not supported by Omni Bridge`);
149
- const fee = await this.omniBridgeAPI.getFee(omniAddress(ChainKind.Near, configsByEnvironment[this.env].contractID), omniAddress(omniChainKind, args.withdrawalParams.destinationAddress), omniAddress(ChainKind.Near, assetInfo.contractId));
149
+ const fee = await withTimeout(() => this.omniBridgeAPI.getFee(omniAddress(ChainKind.Near, configsByEnvironment[this.env].contractID), omniAddress(omniChainKind, args.withdrawalParams.destinationAddress), omniAddress(ChainKind.Near, assetInfo.contractId)), {
150
+ timeout: typeof window !== "undefined" ? 1e4 : 3e3,
151
+ errorInstance: new OmniWithdrawalApiFeeRequestTimeoutError()
152
+ });
150
153
  if (fee.native_token_fee === null) throw new FailedToFetchFeeError(args.withdrawalParams.assetId);
151
154
  const [minStorageBalance, currentStorageBalance] = await this.getCachedStorageDepositValue(assetInfo.contractId);
152
155
  const totalAmountToQuote = fee.native_token_fee + (minStorageBalance > currentStorageBalance ? minStorageBalance - currentStorageBalance : 0n);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defuse-protocol/intents-sdk",
3
- "version": "0.33.2",
3
+ "version": "0.34.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -38,8 +38,8 @@
38
38
  "ripple-address-codec": "^5.0.0",
39
39
  "valibot": "^1.0.0",
40
40
  "viem": "^2.0.0",
41
- "@defuse-protocol/contract-types": "0.3.1",
42
- "@defuse-protocol/internal-utils": "0.19.1"
41
+ "@defuse-protocol/internal-utils": "0.19.1",
42
+ "@defuse-protocol/contract-types": "0.3.1"
43
43
  },
44
44
  "devDependencies": {
45
45
  "tsdown": "0.15.5",