lampamazaza-new-intents-sdk 0.47.1 → 0.47.2
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 +12 -12
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/src/bridges/aurora-engine-bridge/aurora-engine-bridge-utils.cjs +5 -5
- package/dist/src/bridges/aurora-engine-bridge/aurora-engine-bridge-utils.js +1 -1
- package/dist/src/bridges/aurora-engine-bridge/aurora-engine-bridge.cjs +5 -5
- package/dist/src/bridges/aurora-engine-bridge/aurora-engine-bridge.js +1 -1
- package/dist/src/bridges/direct-bridge/direct-bridge-utils.cjs +5 -5
- package/dist/src/bridges/direct-bridge/direct-bridge-utils.js +1 -1
- package/dist/src/bridges/direct-bridge/direct-bridge.cjs +6 -6
- package/dist/src/bridges/direct-bridge/direct-bridge.js +1 -1
- package/dist/src/bridges/direct-bridge/error.cjs +2 -2
- package/dist/src/bridges/direct-bridge/error.d.cts +1 -1
- package/dist/src/bridges/direct-bridge/error.d.ts +1 -1
- package/dist/src/bridges/direct-bridge/error.js +1 -1
- package/dist/src/bridges/hot-bridge/error.cjs +3 -3
- package/dist/src/bridges/hot-bridge/error.d.cts +1 -1
- package/dist/src/bridges/hot-bridge/error.d.ts +1 -1
- package/dist/src/bridges/hot-bridge/error.js +1 -1
- package/dist/src/bridges/hot-bridge/hot-bridge-utils.cjs +2 -2
- package/dist/src/bridges/hot-bridge/hot-bridge-utils.js +1 -1
- package/dist/src/bridges/hot-bridge/hot-bridge.cjs +10 -10
- package/dist/src/bridges/hot-bridge/hot-bridge.js +1 -1
- package/dist/src/bridges/omni-bridge/error.cjs +6 -6
- package/dist/src/bridges/omni-bridge/error.d.cts +1 -1
- package/dist/src/bridges/omni-bridge/error.d.ts +1 -1
- package/dist/src/bridges/omni-bridge/error.js +1 -1
- package/dist/src/bridges/omni-bridge/omni-bridge-utils.cjs +7 -7
- package/dist/src/bridges/omni-bridge/omni-bridge-utils.js +1 -1
- package/dist/src/bridges/omni-bridge/omni-bridge.cjs +23 -23
- package/dist/src/bridges/omni-bridge/omni-bridge.js +1 -1
- package/dist/src/bridges/poa-bridge/poa-bridge-utils.cjs +2 -2
- package/dist/src/bridges/poa-bridge/poa-bridge-utils.js +1 -1
- package/dist/src/bridges/poa-bridge/poa-bridge.cjs +11 -11
- package/dist/src/bridges/poa-bridge/poa-bridge.js +1 -1
- package/dist/src/classes/errors.cjs +7 -7
- package/dist/src/classes/errors.d.cts +1 -1
- package/dist/src/classes/errors.d.ts +1 -1
- package/dist/src/classes/errors.js +1 -1
- package/dist/src/core/withdrawal-watcher.cjs +8 -8
- package/dist/src/core/withdrawal-watcher.d.cts +1 -1
- package/dist/src/core/withdrawal-watcher.d.ts +1 -1
- package/dist/src/core/withdrawal-watcher.js +1 -1
- package/dist/src/intents/intent-executer-impl/intent-executer.d.cts +1 -1
- package/dist/src/intents/intent-executer-impl/intent-executer.d.ts +1 -1
- package/dist/src/intents/intent-hash.d.cts +1 -1
- package/dist/src/intents/intent-hash.d.ts +1 -1
- package/dist/src/intents/intent-hashes/sep53.cjs +2 -2
- package/dist/src/intents/intent-hashes/sep53.js +1 -1
- package/dist/src/intents/intent-payload-builder.cjs +2 -2
- package/dist/src/intents/intent-payload-builder.d.cts +1 -1
- package/dist/src/intents/intent-payload-builder.d.ts +1 -1
- package/dist/src/intents/intent-payload-builder.js +1 -1
- package/dist/src/intents/intent-relayer-impl/intent-relayer-public.cjs +3 -3
- package/dist/src/intents/intent-relayer-impl/intent-relayer-public.js +1 -1
- package/dist/src/intents/intent-signer-impl/intent-signer-viem.cjs +3 -3
- package/dist/src/intents/intent-signer-impl/intent-signer-viem.js +1 -1
- package/dist/src/intents/interfaces/intent-relayer.d.cts +1 -1
- package/dist/src/intents/interfaces/intent-relayer.d.ts +1 -1
- package/dist/src/intents/salt-manager.cjs +2 -2
- package/dist/src/intents/salt-manager.js +1 -1
- package/dist/src/intents/shared-types.d.cts +1 -1
- package/dist/src/intents/shared-types.d.ts +1 -1
- package/dist/src/lib/array.cjs +2 -2
- package/dist/src/lib/array.js +1 -1
- package/dist/src/lib/caip2.cjs +4 -4
- package/dist/src/lib/caip2.js +1 -1
- package/dist/src/lib/configure-rpc-config.cjs +3 -3
- package/dist/src/lib/configure-rpc-config.js +1 -1
- package/dist/src/lib/estimate-fee.cjs +4 -4
- package/dist/src/lib/estimate-fee.js +1 -1
- package/dist/src/lib/parse-defuse-asset-id.cjs +2 -2
- package/dist/src/lib/parse-defuse-asset-id.js +1 -1
- package/dist/src/lib/tokensUsdPricesHttpClient/apis.cjs +2 -2
- package/dist/src/lib/tokensUsdPricesHttpClient/apis.js +1 -1
- package/dist/src/lib/validateAddress.cjs +2 -2
- package/dist/src/lib/validateAddress.js +1 -1
- package/dist/src/sdk.cjs +11 -11
- package/dist/src/sdk.d.cts +1 -1
- package/dist/src/sdk.d.ts +1 -1
- package/dist/src/sdk.js +1 -1
- package/dist/src/shared-types.d.cts +1 -1
- package/dist/src/shared-types.d.ts +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -15,18 +15,18 @@ const require_intent_payload_builder = require('./src/intents/intent-payload-bui
|
|
|
15
15
|
const require_sdk = require('./src/sdk.cjs');
|
|
16
16
|
const require_factories = require('./src/intents/intent-signer-impl/factories.cjs');
|
|
17
17
|
const require_route_config_factory = require('./src/lib/route-config-factory.cjs');
|
|
18
|
-
let
|
|
18
|
+
let lampamazaza_new_internal_utils = require("lampamazaza-new-internal-utils");
|
|
19
19
|
|
|
20
20
|
Object.defineProperty(exports, 'AssertionError', {
|
|
21
21
|
enumerable: true,
|
|
22
22
|
get: function () {
|
|
23
|
-
return
|
|
23
|
+
return lampamazaza_new_internal_utils.AssertionError;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
Object.defineProperty(exports, 'BaseError', {
|
|
27
27
|
enumerable: true,
|
|
28
28
|
get: function () {
|
|
29
|
-
return
|
|
29
|
+
return lampamazaza_new_internal_utils.BaseError;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
exports.BridgeNameEnum = require_bridge_name_enum.BridgeNameEnum;
|
|
@@ -38,7 +38,7 @@ exports.HotWithdrawalNotFoundError = require_error$1.HotWithdrawalNotFoundError;
|
|
|
38
38
|
Object.defineProperty(exports, 'HttpRequestError', {
|
|
39
39
|
enumerable: true,
|
|
40
40
|
get: function () {
|
|
41
|
-
return
|
|
41
|
+
return lampamazaza_new_internal_utils.HttpRequestError;
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
44
|
exports.InsufficientUtxoForOmniBridgeWithdrawalError = require_error$2.InsufficientUtxoForOmniBridgeWithdrawalError;
|
|
@@ -46,7 +46,7 @@ exports.IntentPayloadBuilder = require_intent_payload_builder.IntentPayloadBuild
|
|
|
46
46
|
Object.defineProperty(exports, 'IntentSettlementError', {
|
|
47
47
|
enumerable: true,
|
|
48
48
|
get: function () {
|
|
49
|
-
return
|
|
49
|
+
return lampamazaza_new_internal_utils.IntentSettlementError;
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
exports.IntentsNearOmniAvailableBalanceTooLowError = require_error$2.IntentsNearOmniAvailableBalanceTooLowError;
|
|
@@ -58,44 +58,44 @@ exports.POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE = require_poa_tokens_routable_th
|
|
|
58
58
|
Object.defineProperty(exports, 'PoaWithdrawalInvariantError', {
|
|
59
59
|
enumerable: true,
|
|
60
60
|
get: function () {
|
|
61
|
-
return
|
|
61
|
+
return lampamazaza_new_internal_utils.PoaWithdrawalInvariantError;
|
|
62
62
|
}
|
|
63
63
|
});
|
|
64
64
|
Object.defineProperty(exports, 'PoaWithdrawalNotFoundError', {
|
|
65
65
|
enumerable: true,
|
|
66
66
|
get: function () {
|
|
67
|
-
return
|
|
67
|
+
return lampamazaza_new_internal_utils.PoaWithdrawalNotFoundError;
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, 'PoaWithdrawalPendingError', {
|
|
71
71
|
enumerable: true,
|
|
72
72
|
get: function () {
|
|
73
|
-
return
|
|
73
|
+
return lampamazaza_new_internal_utils.PoaWithdrawalPendingError;
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
Object.defineProperty(exports, 'QuoteError', {
|
|
77
77
|
enumerable: true,
|
|
78
78
|
get: function () {
|
|
79
|
-
return
|
|
79
|
+
return lampamazaza_new_internal_utils.QuoteError;
|
|
80
80
|
}
|
|
81
81
|
});
|
|
82
82
|
Object.defineProperty(exports, 'RelayPublishError', {
|
|
83
83
|
enumerable: true,
|
|
84
84
|
get: function () {
|
|
85
|
-
return
|
|
85
|
+
return lampamazaza_new_internal_utils.RelayPublishError;
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
exports.RouteEnum = require_route_enum.RouteEnum;
|
|
89
89
|
Object.defineProperty(exports, 'RpcRequestError', {
|
|
90
90
|
enumerable: true,
|
|
91
91
|
get: function () {
|
|
92
|
-
return
|
|
92
|
+
return lampamazaza_new_internal_utils.RpcRequestError;
|
|
93
93
|
}
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, 'TimeoutError', {
|
|
96
96
|
enumerable: true,
|
|
97
97
|
get: function () {
|
|
98
|
-
return
|
|
98
|
+
return lampamazaza_new_internal_utils.TimeoutError;
|
|
99
99
|
}
|
|
100
100
|
});
|
|
101
101
|
exports.TokenNotFoundInDestinationChainError = require_error$2.TokenNotFoundInDestinationChainError;
|
package/dist/index.d.cts
CHANGED
|
@@ -18,5 +18,5 @@ import { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalApiFeeRequestTimeo
|
|
|
18
18
|
import { InsufficientUtxoForOmniBridgeWithdrawalError, InsufficientUtxoForOmniBridgeWithdrawalErrorType, IntentsNearOmniAvailableBalanceTooLowError, IntentsNearOmniAvailableBalanceTooLowErrorType, InvalidFeeValueError, InvalidFeeValueErrorType, OmniWithdrawalApiFeeRequestTimeoutError, OmniWithdrawalApiFeeRequestTimeoutErrorType, TokenNotFoundInDestinationChainError, TokenNotFoundInDestinationChainErrorType } from "./src/bridges/omni-bridge/error.cjs";
|
|
19
19
|
import { computeIntentHash } from "./src/intents/intent-hash.cjs";
|
|
20
20
|
import { validateAddress } from "./src/lib/validateAddress.cjs";
|
|
21
|
-
import { AssertionError, AssertionErrorType, BaseError, BaseErrorType, EnvConfig, HttpRequestError, HttpRequestErrorType, ILogger, IntentSettlementError, IntentSettlementErrorType, NearIntentsEnv, PoaWithdrawalInvariantError, PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, PoaWithdrawalPendingErrorType, QuoteError, QuoteErrorType, RelayPublishError, RelayPublishErrorType, RetryOptions, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType } from "lampamazaza-internal-utils";
|
|
21
|
+
import { AssertionError, AssertionErrorType, BaseError, BaseErrorType, EnvConfig, HttpRequestError, HttpRequestErrorType, ILogger, IntentSettlementError, IntentSettlementErrorType, NearIntentsEnv, PoaWithdrawalInvariantError, PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, PoaWithdrawalPendingErrorType, QuoteError, QuoteErrorType, RelayPublishError, RelayPublishErrorType, RetryOptions, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType } from "lampamazaza-new-internal-utils";
|
|
22
22
|
export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationExplicitNearAccountDoesntExistError, type DestinationExplicitNearAccountDoesntExistErrorType, type EnvConfig, type FeeEstimation, FeeExceedsAmountError, type FeeExceedsAmountErrorType, type HotBridgeRouteConfig, HotWithdrawalApiFeeRequestTimeoutError, type HotWithdrawalApiFeeRequestTimeoutErrorType, HotWithdrawalNotFoundError, type HotWithdrawalNotFoundErrorType, HttpRequestError, type HttpRequestErrorType, type IIntentSigner, type ILogger, InsufficientUtxoForOmniBridgeWithdrawalError, type InsufficientUtxoForOmniBridgeWithdrawalErrorType, type IntentPayload, IntentPayloadBuilder, type IntentPayloadFactory, type IntentPrimitive, type IntentPublishResult, type IntentRelayParamsFactory, IntentSettlementError, type IntentSettlementErrorType, type IntentSettlementStatus, IntentsNearOmniAvailableBalanceTooLowError, type IntentsNearOmniAvailableBalanceTooLowErrorType, IntentsSDK, type IntentsSDKConfig, type InternalTransferRouteConfig, InvalidFeeValueError, type InvalidFeeValueErrorType, MinWithdrawalAmountError, type MinWithdrawalAmountErrorType, type MultiPayload, type NearIntentsEnv, type NearTxInfo, type NearWithdrawalRouteConfig, type OmniBridgeRouteConfig, OmniWithdrawalApiFeeRequestTimeoutError, type OmniWithdrawalApiFeeRequestTimeoutErrorType, type OnBeforePublishIntentHook, POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE, 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, WithdrawalFailedError, type WithdrawalFailedErrorType, type WithdrawalIdentifier, type WithdrawalParams, type WithdrawalResult, WithdrawalWatchError, type WithdrawalWatchErrorType, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute, validateAddress as validateAddressFormat };
|
package/dist/index.d.ts
CHANGED
|
@@ -18,5 +18,5 @@ import { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalApiFeeRequestTimeo
|
|
|
18
18
|
import { InsufficientUtxoForOmniBridgeWithdrawalError, InsufficientUtxoForOmniBridgeWithdrawalErrorType, IntentsNearOmniAvailableBalanceTooLowError, IntentsNearOmniAvailableBalanceTooLowErrorType, InvalidFeeValueError, InvalidFeeValueErrorType, OmniWithdrawalApiFeeRequestTimeoutError, OmniWithdrawalApiFeeRequestTimeoutErrorType, TokenNotFoundInDestinationChainError, TokenNotFoundInDestinationChainErrorType } from "./src/bridges/omni-bridge/error.js";
|
|
19
19
|
import { computeIntentHash } from "./src/intents/intent-hash.js";
|
|
20
20
|
import { validateAddress } from "./src/lib/validateAddress.js";
|
|
21
|
-
import { AssertionError, AssertionErrorType, BaseError, BaseErrorType, EnvConfig, HttpRequestError, HttpRequestErrorType, ILogger, IntentSettlementError, IntentSettlementErrorType, NearIntentsEnv, PoaWithdrawalInvariantError, PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, PoaWithdrawalPendingErrorType, QuoteError, QuoteErrorType, RelayPublishError, RelayPublishErrorType, RetryOptions, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType } from "lampamazaza-internal-utils";
|
|
21
|
+
import { AssertionError, AssertionErrorType, BaseError, BaseErrorType, EnvConfig, HttpRequestError, HttpRequestErrorType, ILogger, IntentSettlementError, IntentSettlementErrorType, NearIntentsEnv, PoaWithdrawalInvariantError, PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, PoaWithdrawalPendingErrorType, QuoteError, QuoteErrorType, RelayPublishError, RelayPublishErrorType, RetryOptions, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType } from "lampamazaza-new-internal-utils";
|
|
22
22
|
export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationExplicitNearAccountDoesntExistError, type DestinationExplicitNearAccountDoesntExistErrorType, type EnvConfig, type FeeEstimation, FeeExceedsAmountError, type FeeExceedsAmountErrorType, type HotBridgeRouteConfig, HotWithdrawalApiFeeRequestTimeoutError, type HotWithdrawalApiFeeRequestTimeoutErrorType, HotWithdrawalNotFoundError, type HotWithdrawalNotFoundErrorType, HttpRequestError, type HttpRequestErrorType, type IIntentSigner, type ILogger, InsufficientUtxoForOmniBridgeWithdrawalError, type InsufficientUtxoForOmniBridgeWithdrawalErrorType, type IntentPayload, IntentPayloadBuilder, type IntentPayloadFactory, type IntentPrimitive, type IntentPublishResult, type IntentRelayParamsFactory, IntentSettlementError, type IntentSettlementErrorType, type IntentSettlementStatus, IntentsNearOmniAvailableBalanceTooLowError, type IntentsNearOmniAvailableBalanceTooLowErrorType, IntentsSDK, type IntentsSDKConfig, type InternalTransferRouteConfig, InvalidFeeValueError, type InvalidFeeValueErrorType, MinWithdrawalAmountError, type MinWithdrawalAmountErrorType, type MultiPayload, type NearIntentsEnv, type NearTxInfo, type NearWithdrawalRouteConfig, type OmniBridgeRouteConfig, OmniWithdrawalApiFeeRequestTimeoutError, type OmniWithdrawalApiFeeRequestTimeoutErrorType, type OnBeforePublishIntentHook, POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE, 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, WithdrawalFailedError, type WithdrawalFailedErrorType, type WithdrawalIdentifier, type WithdrawalParams, type WithdrawalResult, WithdrawalWatchError, type WithdrawalWatchErrorType, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute, validateAddress as validateAddressFormat };
|
package/dist/index.js
CHANGED
|
@@ -14,6 +14,6 @@ import { IntentPayloadBuilder } from "./src/intents/intent-payload-builder.js";
|
|
|
14
14
|
import { IntentsSDK } from "./src/sdk.js";
|
|
15
15
|
import { createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem } from "./src/intents/intent-signer-impl/factories.js";
|
|
16
16
|
import { createDefaultRoute, createHotBridgeRoute, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute } from "./src/lib/route-config-factory.js";
|
|
17
|
-
import { AssertionError, BaseError, HttpRequestError, IntentSettlementError, PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError, QuoteError, RelayPublishError, RpcRequestError, TimeoutError } from "lampamazaza-internal-utils";
|
|
17
|
+
import { AssertionError, BaseError, HttpRequestError, IntentSettlementError, PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError, QuoteError, RelayPublishError, RpcRequestError, TimeoutError } from "lampamazaza-new-internal-utils";
|
|
18
18
|
|
|
19
19
|
export { AssertionError, BaseError, BridgeNameEnum, Chains, DestinationExplicitNearAccountDoesntExistError, FeeExceedsAmountError, HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalNotFoundError, HttpRequestError, InsufficientUtxoForOmniBridgeWithdrawalError, IntentPayloadBuilder, IntentSettlementError, IntentsNearOmniAvailableBalanceTooLowError, IntentsSDK, InvalidFeeValueError, MinWithdrawalAmountError, OmniWithdrawalApiFeeRequestTimeoutError, POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE, PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError, QuoteError, RelayPublishError, RouteEnum, RpcRequestError, TimeoutError, TokenNotFoundInDestinationChainError, TrustlineNotFoundError, UnsupportedAssetIdError, UnsupportedDestinationMemoError, VersionedNonceBuilder, WithdrawalFailedError, WithdrawalWatchError, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute, validateAddress as validateAddressFormat };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_route_enum = require('../../constants/route-enum.cjs');
|
|
3
3
|
const require_aurora_engine_bridge_constants = require('./aurora-engine-bridge-constants.cjs');
|
|
4
|
-
let
|
|
4
|
+
let lampamazaza_new_internal_utils = require("lampamazaza-new-internal-utils");
|
|
5
5
|
let viem = require("viem");
|
|
6
6
|
|
|
7
7
|
//#region src/bridges/aurora-engine-bridge/aurora-engine-bridge-utils.ts
|
|
8
8
|
function createWithdrawIntentPrimitive(params) {
|
|
9
|
-
const { contractId: tokenAccountId, standard } =
|
|
10
|
-
(0,
|
|
9
|
+
const { contractId: tokenAccountId, standard } = lampamazaza_new_internal_utils.utils.parseDefuseAssetId(params.assetId);
|
|
10
|
+
(0, lampamazaza_new_internal_utils.assert)(standard === "nep141", "Only NEP-141 is supported");
|
|
11
11
|
if (params.proxyTokenContractId == null) return {
|
|
12
12
|
intent: "ft_withdraw",
|
|
13
13
|
token: tokenAccountId,
|
|
@@ -35,8 +35,8 @@ function makeAuroraEngineDepositMsg(recipientAddress) {
|
|
|
35
35
|
return (0, viem.getAddress)(recipientAddress).slice(2).toLowerCase();
|
|
36
36
|
}
|
|
37
37
|
function withdrawalParamsInvariant(params) {
|
|
38
|
-
(0,
|
|
39
|
-
(0,
|
|
38
|
+
(0, lampamazaza_new_internal_utils.assert)(params.routeConfig != null, "Bridge config is required");
|
|
39
|
+
(0, lampamazaza_new_internal_utils.assert)(params.routeConfig.route === require_route_enum.RouteEnum.VirtualChain, "Bridge is not aurora_engine");
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RouteEnum } from "../../constants/route-enum.js";
|
|
2
2
|
import { MIN_GAS_AMOUNT, MIN_GAS_AMOUNT_NON_STANDARD_DECIMALS } from "./aurora-engine-bridge-constants.js";
|
|
3
|
-
import { assert, utils } from "lampamazaza-internal-utils";
|
|
3
|
+
import { assert, utils } from "lampamazaza-new-internal-utils";
|
|
4
4
|
import { getAddress } from "viem";
|
|
5
5
|
|
|
6
6
|
//#region src/bridges/aurora-engine-bridge/aurora-engine-bridge-utils.ts
|
|
@@ -7,7 +7,7 @@ const require_parse_defuse_asset_id = require('../../lib/parse-defuse-asset-id.c
|
|
|
7
7
|
const require_validateAddress = require('../../lib/validateAddress.cjs');
|
|
8
8
|
const require_aurora_engine_bridge_constants = require('./aurora-engine-bridge-constants.cjs');
|
|
9
9
|
const require_aurora_engine_bridge_utils = require('./aurora-engine-bridge-utils.cjs');
|
|
10
|
-
let
|
|
10
|
+
let lampamazaza_new_internal_utils = require("lampamazaza-new-internal-utils");
|
|
11
11
|
|
|
12
12
|
//#region src/bridges/aurora-engine-bridge/aurora-engine-bridge.ts
|
|
13
13
|
var AuroraEngineBridge = class {
|
|
@@ -59,12 +59,12 @@ var AuroraEngineBridge = class {
|
|
|
59
59
|
}
|
|
60
60
|
async estimateWithdrawalFee(args) {
|
|
61
61
|
require_aurora_engine_bridge_utils.withdrawalParamsInvariant(args.withdrawalParams);
|
|
62
|
-
const { contractId: tokenAccountId, standard } =
|
|
63
|
-
(0,
|
|
64
|
-
const [minStorageBalance, userStorageBalance] = await Promise.all([(0,
|
|
62
|
+
const { contractId: tokenAccountId, standard } = lampamazaza_new_internal_utils.utils.parseDefuseAssetId(args.withdrawalParams.assetId);
|
|
63
|
+
(0, lampamazaza_new_internal_utils.assert)(standard === "nep141", "Only NEP-141 is supported");
|
|
64
|
+
const [minStorageBalance, userStorageBalance] = await Promise.all([(0, lampamazaza_new_internal_utils.getNearNep141MinStorageBalance)({
|
|
65
65
|
contractId: tokenAccountId,
|
|
66
66
|
nearProvider: this.nearProvider
|
|
67
|
-
}), (0,
|
|
67
|
+
}), (0, lampamazaza_new_internal_utils.getNearNep141StorageBalance)({
|
|
68
68
|
contractId: tokenAccountId,
|
|
69
69
|
accountId: args.withdrawalParams.routeConfig.auroraEngineContractId,
|
|
70
70
|
nearProvider: this.nearProvider
|
|
@@ -6,7 +6,7 @@ import { parseDefuseAssetId } from "../../lib/parse-defuse-asset-id.js";
|
|
|
6
6
|
import { validateAddress } from "../../lib/validateAddress.js";
|
|
7
7
|
import { NEAR_NATIVE_ASSET_ID } from "./aurora-engine-bridge-constants.js";
|
|
8
8
|
import { createWithdrawIntentPrimitive, withdrawalParamsInvariant } from "./aurora-engine-bridge-utils.js";
|
|
9
|
-
import { assert, getNearNep141MinStorageBalance, getNearNep141StorageBalance, utils } from "lampamazaza-internal-utils";
|
|
9
|
+
import { assert, getNearNep141MinStorageBalance, getNearNep141StorageBalance, utils } from "lampamazaza-new-internal-utils";
|
|
10
10
|
|
|
11
11
|
//#region src/bridges/aurora-engine-bridge/aurora-engine-bridge.ts
|
|
12
12
|
var AuroraEngineBridge = class {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_route_enum = require('../../constants/route-enum.cjs');
|
|
3
3
|
const require_direct_bridge_constants = require('./direct-bridge-constants.cjs');
|
|
4
|
-
let
|
|
4
|
+
let lampamazaza_new_internal_utils = require("lampamazaza-new-internal-utils");
|
|
5
5
|
let near_api_js = require("near-api-js");
|
|
6
6
|
|
|
7
7
|
//#region src/bridges/direct-bridge/direct-bridge-utils.ts
|
|
@@ -11,8 +11,8 @@ function createWithdrawIntentPrimitive(params) {
|
|
|
11
11
|
receiver_id: params.destinationAddress,
|
|
12
12
|
amount: params.amount.toString()
|
|
13
13
|
};
|
|
14
|
-
const { contractId: tokenAccountId, standard } =
|
|
15
|
-
(0,
|
|
14
|
+
const { contractId: tokenAccountId, standard } = lampamazaza_new_internal_utils.utils.parseDefuseAssetId(params.assetId);
|
|
15
|
+
(0, lampamazaza_new_internal_utils.assert)(standard === "nep141", "Only NEP-141 is supported");
|
|
16
16
|
if (params.msg !== void 0) params.logger?.warn("min_gas is not set for direct-bridge withdrawal with msg, gas consumption is unpredictable");
|
|
17
17
|
return {
|
|
18
18
|
intent: "ft_withdraw",
|
|
@@ -25,11 +25,11 @@ function createWithdrawIntentPrimitive(params) {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
function withdrawalParamsInvariant(params) {
|
|
28
|
-
(0,
|
|
28
|
+
(0, lampamazaza_new_internal_utils.assert)(!params.routeConfig ? true : params.routeConfig.route === require_route_enum.RouteEnum.NearWithdrawal, "Bridge is not direct");
|
|
29
29
|
}
|
|
30
30
|
async function accountExistsInNEAR(provider, accountId) {
|
|
31
31
|
try {
|
|
32
|
-
await (0,
|
|
32
|
+
await (0, lampamazaza_new_internal_utils.unwrapNearFailoverRpcProvider)(provider).query({
|
|
33
33
|
request_type: "view_account",
|
|
34
34
|
account_id: accountId,
|
|
35
35
|
finality: "final"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RouteEnum } from "../../constants/route-enum.js";
|
|
2
2
|
import { MIN_GAS_AMOUNT, NEAR_NATIVE_ASSET_ID } from "./direct-bridge-constants.js";
|
|
3
|
-
import { assert, unwrapNearFailoverRpcProvider, utils } from "lampamazaza-internal-utils";
|
|
3
|
+
import { assert, unwrapNearFailoverRpcProvider, utils } from "lampamazaza-new-internal-utils";
|
|
4
4
|
import { providers } from "near-api-js";
|
|
5
5
|
|
|
6
6
|
//#region src/bridges/direct-bridge/direct-bridge-utils.ts
|
|
@@ -9,7 +9,7 @@ const require_bridge_name_enum = require('../../constants/bridge-name-enum.cjs')
|
|
|
9
9
|
const require_direct_bridge_constants = require('./direct-bridge-constants.cjs');
|
|
10
10
|
const require_direct_bridge_utils = require('./direct-bridge-utils.cjs');
|
|
11
11
|
const require_error = require('./error.cjs');
|
|
12
|
-
let
|
|
12
|
+
let lampamazaza_new_internal_utils = require("lampamazaza-new-internal-utils");
|
|
13
13
|
let lru_cache = require("lru-cache");
|
|
14
14
|
|
|
15
15
|
//#region src/bridges/direct-bridge/direct-bridge.ts
|
|
@@ -73,12 +73,12 @@ var DirectBridge = class {
|
|
|
73
73
|
*/
|
|
74
74
|
async validateWithdrawal(args) {
|
|
75
75
|
if (require_validateAddress.validateAddress(args.destinationAddress, require_caip2.Chains.Near) === false) throw new require_errors.InvalidDestinationAddressForWithdrawalError(args.destinationAddress, require_caip2.Chains.Near);
|
|
76
|
-
if (
|
|
76
|
+
if (lampamazaza_new_internal_utils.utils.isImplicitAccount(args.destinationAddress) === false && await this.getCachedAccountExistenceCheck(args.destinationAddress) === false) throw new require_error.DestinationExplicitNearAccountDoesntExistError(args.destinationAddress);
|
|
77
77
|
}
|
|
78
78
|
async estimateWithdrawalFee(args) {
|
|
79
79
|
require_direct_bridge_utils.withdrawalParamsInvariant(args.withdrawalParams);
|
|
80
|
-
const { contractId: tokenAccountId, standard } =
|
|
81
|
-
(0,
|
|
80
|
+
const { contractId: tokenAccountId, standard } = lampamazaza_new_internal_utils.utils.parseDefuseAssetId(args.withdrawalParams.assetId);
|
|
81
|
+
(0, lampamazaza_new_internal_utils.assert)(standard === "nep141", "Only NEP-141 is supported");
|
|
82
82
|
if (args.withdrawalParams.assetId === require_direct_bridge_constants.NEAR_NATIVE_ASSET_ID && args.withdrawalParams.routeConfig?.msg === void 0) return {
|
|
83
83
|
amount: 0n,
|
|
84
84
|
quote: null,
|
|
@@ -114,10 +114,10 @@ var DirectBridge = class {
|
|
|
114
114
|
const key = `${contractId}${accountId}`;
|
|
115
115
|
const cached = this.storageDepositCache.get(key);
|
|
116
116
|
if (cached !== void 0) return cached;
|
|
117
|
-
const result = await Promise.all([(0,
|
|
117
|
+
const result = await Promise.all([(0, lampamazaza_new_internal_utils.getNearNep141MinStorageBalance)({
|
|
118
118
|
contractId,
|
|
119
119
|
nearProvider: this.nearProvider
|
|
120
|
-
}), (0,
|
|
120
|
+
}), (0, lampamazaza_new_internal_utils.getNearNep141StorageBalance)({
|
|
121
121
|
contractId,
|
|
122
122
|
accountId,
|
|
123
123
|
nearProvider: this.nearProvider
|
|
@@ -8,7 +8,7 @@ import { BridgeNameEnum } from "../../constants/bridge-name-enum.js";
|
|
|
8
8
|
import { NEAR_NATIVE_ASSET_ID } from "./direct-bridge-constants.js";
|
|
9
9
|
import { accountExistsInNEAR, createWithdrawIntentPrimitive, withdrawalParamsInvariant } from "./direct-bridge-utils.js";
|
|
10
10
|
import { DestinationExplicitNearAccountDoesntExistError } from "./error.js";
|
|
11
|
-
import { assert, getNearNep141MinStorageBalance, getNearNep141StorageBalance, utils } from "lampamazaza-internal-utils";
|
|
11
|
+
import { assert, getNearNep141MinStorageBalance, getNearNep141StorageBalance, utils } from "lampamazaza-new-internal-utils";
|
|
12
12
|
import { LRUCache } from "lru-cache";
|
|
13
13
|
|
|
14
14
|
//#region src/bridges/direct-bridge/direct-bridge.ts
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let
|
|
2
|
+
let lampamazaza_new_internal_utils = require("lampamazaza-new-internal-utils");
|
|
3
3
|
|
|
4
4
|
//#region src/bridges/direct-bridge/error.ts
|
|
5
|
-
var DestinationExplicitNearAccountDoesntExistError = class extends
|
|
5
|
+
var DestinationExplicitNearAccountDoesntExistError = class extends lampamazaza_new_internal_utils.BaseError {
|
|
6
6
|
constructor(accountId) {
|
|
7
7
|
super("Destination explicit NEAR account doesn't exist.", {
|
|
8
8
|
metaMessages: [`Account Id: ${accountId}`],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError } from "lampamazaza-internal-utils";
|
|
1
|
+
import { BaseError } from "lampamazaza-new-internal-utils";
|
|
2
2
|
|
|
3
3
|
//#region src/bridges/direct-bridge/error.d.ts
|
|
4
4
|
type DestinationExplicitNearAccountDoesntExistErrorType = DestinationExplicitNearAccountDoesntExistError & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseError } from "lampamazaza-internal-utils";
|
|
1
|
+
import { BaseError } from "lampamazaza-new-internal-utils";
|
|
2
2
|
|
|
3
3
|
//#region src/bridges/direct-bridge/error.d.ts
|
|
4
4
|
type DestinationExplicitNearAccountDoesntExistErrorType = DestinationExplicitNearAccountDoesntExistError & {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let
|
|
2
|
+
let lampamazaza_new_internal_utils = require("lampamazaza-new-internal-utils");
|
|
3
3
|
|
|
4
4
|
//#region src/bridges/hot-bridge/error.ts
|
|
5
|
-
var HotWithdrawalNotFoundError = class extends
|
|
5
|
+
var HotWithdrawalNotFoundError = class extends lampamazaza_new_internal_utils.BaseError {
|
|
6
6
|
constructor(txHash, index) {
|
|
7
7
|
super("Withdrawal with given index is not found.", {
|
|
8
8
|
metaMessages: [`TxHash: ${txHash}`, `Index: ${index}`],
|
|
@@ -12,7 +12,7 @@ var HotWithdrawalNotFoundError = class extends lampamazaza_internal_utils.BaseEr
|
|
|
12
12
|
this.index = index;
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
var HotWithdrawalApiFeeRequestTimeoutError = class extends
|
|
15
|
+
var HotWithdrawalApiFeeRequestTimeoutError = class extends lampamazaza_new_internal_utils.BaseError {
|
|
16
16
|
constructor() {
|
|
17
17
|
super("Hot bridge withdrawal fee request timed out.", { name: "HotWithdrawalApiFeeRequestTimeoutError" });
|
|
18
18
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
2
|
const require_caip2 = require('../../lib/caip2.cjs');
|
|
3
3
|
const require_hot_bridge_chains = require('./hot-bridge-chains.cjs');
|
|
4
|
-
let
|
|
4
|
+
let lampamazaza_new_internal_utils = require("lampamazaza-new-internal-utils");
|
|
5
5
|
let _hot_labs_omni_sdk = require("@hot-labs/omni-sdk");
|
|
6
6
|
|
|
7
7
|
//#region src/bridges/hot-bridge/hot-bridge-utils.ts
|
|
@@ -55,7 +55,7 @@ function formatTxHash(txHash, caip2) {
|
|
|
55
55
|
return txHash;
|
|
56
56
|
}
|
|
57
57
|
function hotBlockchainInvariant(blockchain) {
|
|
58
|
-
(0,
|
|
58
|
+
(0, lampamazaza_new_internal_utils.assert)(require_hot_bridge_chains.HotBridgeChains.includes(blockchain), `${blockchain} is not a valid HOT Bridge blockchain. Supported values: ${require_hot_bridge_chains.HotBridgeChains.join()}`);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Chains } from "../../lib/caip2.js";
|
|
2
2
|
import { HotBridgeChains } from "./hot-bridge-chains.js";
|
|
3
|
-
import { assert } from "lampamazaza-internal-utils";
|
|
3
|
+
import { assert } from "lampamazaza-new-internal-utils";
|
|
4
4
|
import { Network } from "@hot-labs/omni-sdk";
|
|
5
5
|
|
|
6
6
|
//#region src/bridges/hot-bridge/hot-bridge-utils.ts
|
|
@@ -10,7 +10,7 @@ const require_error = require('./error.cjs');
|
|
|
10
10
|
const require_hot_bridge_constants = require('./hot-bridge-constants.cjs');
|
|
11
11
|
const require_hot_bridge_utils = require('./hot-bridge-utils.cjs');
|
|
12
12
|
const require_hex = require('../../lib/hex.cjs');
|
|
13
|
-
let
|
|
13
|
+
let lampamazaza_new_internal_utils = require("lampamazaza-new-internal-utils");
|
|
14
14
|
let _hot_labs_omni_sdk = require("@hot-labs/omni-sdk");
|
|
15
15
|
let lru_cache = require("lru-cache");
|
|
16
16
|
let valibot = require("valibot");
|
|
@@ -46,7 +46,7 @@ var HotBridge = class HotBridge {
|
|
|
46
46
|
max: 50,
|
|
47
47
|
ttl: 3600 * 1e3,
|
|
48
48
|
fetchMethod: async (_key, _staleValue, { context: tx }) => {
|
|
49
|
-
return (0,
|
|
49
|
+
return (0, lampamazaza_new_internal_utils.withTimeout)(() => this.hotSdk.near.parseWithdrawalNonces(tx.hash, tx.accountId), { timeout: HotBridge.NEAR_RPC_TIMEOUT_MS });
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
}
|
|
@@ -81,7 +81,7 @@ var HotBridge = class HotBridge {
|
|
|
81
81
|
}
|
|
82
82
|
async createWithdrawalIntents(args) {
|
|
83
83
|
const assetInfo = this.parseAssetId(args.withdrawalParams.assetId);
|
|
84
|
-
(0,
|
|
84
|
+
(0, lampamazaza_new_internal_utils.assert)(assetInfo != null, "Asset is not supported");
|
|
85
85
|
if (args.withdrawalParams.destinationMemo != null && args.withdrawalParams.destinationMemo !== "") throw new require_errors.UnsupportedDestinationMemoError(assetInfo.blockchain, args.withdrawalParams.assetId);
|
|
86
86
|
const intents = [];
|
|
87
87
|
const feeAmount = require_estimate_fee.getUnderlyingFee(args.feeEstimation, require_route_enum.RouteEnum.HotBridge, "relayerFee");
|
|
@@ -105,8 +105,8 @@ var HotBridge = class HotBridge {
|
|
|
105
105
|
amount,
|
|
106
106
|
receiver: args.withdrawalParams.destinationAddress
|
|
107
107
|
});
|
|
108
|
-
(0,
|
|
109
|
-
if (intent.amounts.length === 2) (0,
|
|
108
|
+
(0, lampamazaza_new_internal_utils.assert)(intent.amounts[0] === amount.toString(), "Amount is not correct");
|
|
109
|
+
if (intent.amounts.length === 2) (0, lampamazaza_new_internal_utils.assert)(intent.amounts[1] === feeAmount.toString(), "Amount is not correct");
|
|
110
110
|
const mtWithdrawIntent = intent;
|
|
111
111
|
mtWithdrawIntent.min_gas = require_hot_bridge_constants.MIN_GAS_AMOUNT;
|
|
112
112
|
intents.push(mtWithdrawIntent);
|
|
@@ -119,7 +119,7 @@ var HotBridge = class HotBridge {
|
|
|
119
119
|
*/
|
|
120
120
|
async validateWithdrawal(args) {
|
|
121
121
|
const assetInfo = this.parseAssetId(args.assetId);
|
|
122
|
-
(0,
|
|
122
|
+
(0, lampamazaza_new_internal_utils.assert)(assetInfo != null, "Asset is not supported");
|
|
123
123
|
require_hot_bridge_utils.hotBlockchainInvariant(assetInfo.blockchain);
|
|
124
124
|
if (require_validateAddress.validateAddress(args.destinationAddress, assetInfo.blockchain) === false) throw new require_errors.InvalidDestinationAddressForWithdrawalError(args.destinationAddress, assetInfo.blockchain);
|
|
125
125
|
if (assetInfo.blockchain === require_caip2.Chains.Stellar) {
|
|
@@ -129,10 +129,10 @@ var HotBridge = class HotBridge {
|
|
|
129
129
|
}
|
|
130
130
|
async estimateWithdrawalFee(args) {
|
|
131
131
|
const assetInfo = this.parseAssetId(args.withdrawalParams.assetId);
|
|
132
|
-
(0,
|
|
132
|
+
(0, lampamazaza_new_internal_utils.assert)(assetInfo != null, "Asset is not supported");
|
|
133
133
|
require_hot_bridge_utils.hotBlockchainInvariant(assetInfo.blockchain);
|
|
134
134
|
const feeAssetId = require_hot_bridge_utils.getFeeAssetIdForChain(assetInfo.blockchain);
|
|
135
|
-
const { gasPrice: feeAmount, blockNumber } = await (0,
|
|
135
|
+
const { gasPrice: feeAmount, blockNumber } = await (0, lampamazaza_new_internal_utils.withTimeout)(async () => {
|
|
136
136
|
const result = await this.hotSdk.getGaslessWithdrawFee({
|
|
137
137
|
chain: require_hot_bridge_utils.toHotNetworkId(assetInfo.blockchain),
|
|
138
138
|
token: "native" in assetInfo ? "native" : assetInfo.address,
|
|
@@ -164,7 +164,7 @@ var HotBridge = class HotBridge {
|
|
|
164
164
|
}
|
|
165
165
|
createWithdrawalIdentifier(args) {
|
|
166
166
|
const assetInfo = this.parseAssetId(args.withdrawalParams.assetId);
|
|
167
|
-
(0,
|
|
167
|
+
(0, lampamazaza_new_internal_utils.assert)(assetInfo != null, "Asset is not supported");
|
|
168
168
|
return {
|
|
169
169
|
landingChain: assetInfo.blockchain,
|
|
170
170
|
index: args.index,
|
|
@@ -209,7 +209,7 @@ var HotBridge = class HotBridge {
|
|
|
209
209
|
}
|
|
210
210
|
async fetchWithdrawalHashFromApi(nearTxHash, nonce, logger) {
|
|
211
211
|
try {
|
|
212
|
-
const data = await (await (0,
|
|
212
|
+
const data = await (await (0, lampamazaza_new_internal_utils.withTimeout)(() => this.hotSdk.api.requestApi(`/api/v1/evm/bridge_withdrawal_hash?near_trx=${nearTxHash}`, { method: "GET" }), { timeout: HotBridge.API_FALLBACK_TIMEOUT_MS })).json();
|
|
213
213
|
const parseResult = valibot.safeParse(HotApiWithdrawalResponseSchema, data);
|
|
214
214
|
if (!parseResult.success) {
|
|
215
215
|
logger?.debug("HOT API response parse failed", { issues: parseResult.issues });
|
|
@@ -9,7 +9,7 @@ import { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalNotFoundError } fr
|
|
|
9
9
|
import { HotWithdrawStatus, MIN_GAS_AMOUNT } 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 { assert, withTimeout } from "lampamazaza-internal-utils";
|
|
12
|
+
import { assert, withTimeout } from "lampamazaza-new-internal-utils";
|
|
13
13
|
import { OMNI_HOT_V2, utils as utils$1 } from "@hot-labs/omni-sdk";
|
|
14
14
|
import { LRUCache } from "lru-cache";
|
|
15
15
|
import * as v from "valibot";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let
|
|
2
|
+
let lampamazaza_new_internal_utils = require("lampamazaza-new-internal-utils");
|
|
3
3
|
|
|
4
4
|
//#region src/bridges/omni-bridge/error.ts
|
|
5
|
-
var TokenNotFoundInDestinationChainError = class extends
|
|
5
|
+
var TokenNotFoundInDestinationChainError = class extends lampamazaza_new_internal_utils.BaseError {
|
|
6
6
|
constructor(token, destinationChain) {
|
|
7
7
|
super(`The token ${token} doesn't exist in destination chain ${destinationChain}`, {
|
|
8
8
|
metaMessages: [`Token: ${token}`, `Destination Chain: ${destinationChain}`],
|
|
@@ -12,7 +12,7 @@ var TokenNotFoundInDestinationChainError = class extends lampamazaza_internal_ut
|
|
|
12
12
|
this.destinationChain = destinationChain;
|
|
13
13
|
}
|
|
14
14
|
};
|
|
15
|
-
var InvalidFeeValueError = class extends
|
|
15
|
+
var InvalidFeeValueError = class extends lampamazaza_new_internal_utils.BaseError {
|
|
16
16
|
constructor(token, value) {
|
|
17
17
|
super(`Invalid fee value`, {
|
|
18
18
|
metaMessages: [`Token: ${token}`, `Fee value: ${value}`],
|
|
@@ -21,7 +21,7 @@ var InvalidFeeValueError = class extends lampamazaza_internal_utils.BaseError {
|
|
|
21
21
|
this.token = token;
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
|
-
var IntentsNearOmniAvailableBalanceTooLowError = class extends
|
|
24
|
+
var IntentsNearOmniAvailableBalanceTooLowError = class extends lampamazaza_new_internal_utils.BaseError {
|
|
25
25
|
constructor(balance) {
|
|
26
26
|
super(`Omni storage balance of intents contract is too low to complete this transaction safely.`, {
|
|
27
27
|
metaMessages: [`Balance: ${balance}`],
|
|
@@ -31,12 +31,12 @@ var IntentsNearOmniAvailableBalanceTooLowError = class extends lampamazaza_inter
|
|
|
31
31
|
this.balance = balance;
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
var OmniWithdrawalApiFeeRequestTimeoutError = class extends
|
|
34
|
+
var OmniWithdrawalApiFeeRequestTimeoutError = class extends lampamazaza_new_internal_utils.BaseError {
|
|
35
35
|
constructor() {
|
|
36
36
|
super("Omni bridge withdrawal fee request timed out.", { name: "OmniWithdrawalApiFeeRequestTimeoutError" });
|
|
37
37
|
}
|
|
38
38
|
};
|
|
39
|
-
var InsufficientUtxoForOmniBridgeWithdrawalError = class extends
|
|
39
|
+
var InsufficientUtxoForOmniBridgeWithdrawalError = class extends lampamazaza_new_internal_utils.BaseError {
|
|
40
40
|
constructor(destinationChain) {
|
|
41
41
|
super("Insufficient utxo for withdrawal to a utxo chain.", {
|
|
42
42
|
metaMessages: [`Destination Chain: ${destinationChain}`],
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chain } from "../../lib/caip2.cjs";
|
|
2
|
-
import { BaseError } from "lampamazaza-internal-utils";
|
|
2
|
+
import { BaseError } from "lampamazaza-new-internal-utils";
|
|
3
3
|
|
|
4
4
|
//#region src/bridges/omni-bridge/error.d.ts
|
|
5
5
|
type TokenNotFoundInDestinationChainErrorType = TokenNotFoundInDestinationChainError & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Chain } from "../../lib/caip2.js";
|
|
2
|
-
import { BaseError } from "lampamazaza-internal-utils";
|
|
2
|
+
import { BaseError } from "lampamazaza-new-internal-utils";
|
|
3
3
|
|
|
4
4
|
//#region src/bridges/omni-bridge/error.d.ts
|
|
5
5
|
type TokenNotFoundInDestinationChainErrorType = TokenNotFoundInDestinationChainError & {
|