@defuse-protocol/intents-sdk 0.71.0 → 0.73.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.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/src/bridges/omni-bridge/omni-bridge.cjs +5 -3
- package/dist/src/bridges/omni-bridge/omni-bridge.js +5 -3
- package/dist/src/bridges/poa-bridge/poa-bridge.cjs +2 -2
- package/dist/src/bridges/poa-bridge/poa-bridge.js +2 -2
- package/dist/src/sdk.cjs +2 -1
- package/dist/src/sdk.d.cts +2 -1
- package/dist/src/sdk.d.ts +2 -1
- package/dist/src/sdk.js +2 -1
- package/dist/src/shared-types.d.cts +11 -1
- package/dist/src/shared-types.d.ts +11 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ import { IntentPayload, IntentPayloadFactory, IntentPrimitive, IntentRelayParams
|
|
|
5
5
|
import { IIntentSigner } from "./src/intents/interfaces/intent-signer.cjs";
|
|
6
6
|
import { OnBeforePublishIntentHook } from "./src/intents/intent-executer-impl/intent-executer.cjs";
|
|
7
7
|
import { Chain, Chains } from "./src/lib/caip2.cjs";
|
|
8
|
-
import { BatchWithdrawalResult, FeeEstimation, HotBridgeRouteConfig, IntentPublishResult, IntentSettlementStatus, InternalTransferRouteConfig, NearTxInfo, NearWithdrawalRouteConfig, OmniBridgeRouteConfig, ParsedAssetInfo, PoaBridgeRouteConfig, ProcessWithdrawalArgs, RouteConfig, SignAndSendArgs, SignAndSendWithdrawalArgs, SignedIntentsComposition, TxInfo, TxNoInfo, VirtualChainRouteConfig, WithdrawalIdentifier, WithdrawalParams, WithdrawalResult } from "./src/shared-types.cjs";
|
|
8
|
+
import { BatchWithdrawalResult, FeeEstimation, HotBridgeRouteConfig, IntentPublishResult, IntentSettlementStatus, InternalTransferRouteConfig, NearTxInfo, NearWithdrawalRouteConfig, OmniBridgeRouteConfig, ParsedAssetInfo, PoaBridgeRouteConfig, ProcessWithdrawalArgs, QuoteOptions, RouteConfig, SignAndSendArgs, SignAndSendWithdrawalArgs, SignedIntentsComposition, TxInfo, TxNoInfo, VirtualChainRouteConfig, WithdrawalIdentifier, WithdrawalParams, WithdrawalResult } from "./src/shared-types.cjs";
|
|
9
9
|
import { IntentPayloadBuilder } from "./src/intents/intent-payload-builder.cjs";
|
|
10
10
|
import { IntentsSDK, IntentsSDKConfig } from "./src/sdk.cjs";
|
|
11
11
|
import { Nep413RawPayload } from "./src/intents/intent-signer-impl/intent-signer-nep413.cjs";
|
|
@@ -22,4 +22,4 @@ import { XrplDepositAuthEnabledError, XrplDepositAuthEnabledErrorType, XrplDesti
|
|
|
22
22
|
import { computeIntentHash } from "./src/intents/intent-hash.cjs";
|
|
23
23
|
import { validateAddress } from "./src/lib/validateAddress.cjs";
|
|
24
24
|
import { AssertionError, AssertionErrorType, BaseError, BaseErrorType, EnvConfig, HttpRequestError, HttpRequestErrorType, ILogger, IntentSettlementError, IntentSettlementErrorType, NearIntentsEnv, PoaWithdrawalInvariantError, PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, PoaWithdrawalPendingErrorType, QuoteError, QuoteErrorType, RelayPublishError, RelayPublishErrorType, RelayPublishRejectedError, RelayPublishRejectedErrorType, RelayPublishResultUnknownError, RelayPublishResultUnknownErrorType, RetryOptions, RpcEndpoint, RpcEndpointConfig, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType } from "@defuse-protocol/internal-utils";
|
|
25
|
-
export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationExplicitNearAccountDoesntExistError, type DestinationExplicitNearAccountDoesntExistErrorType, type EnvConfig, type Erc191RawPayload, 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 Nep413RawPayload, 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, RelayPublishRejectedError, type RelayPublishRejectedErrorType, RelayPublishResultUnknownError, type RelayPublishResultUnknownErrorType, type RetryOptions, type RouteConfig, RouteEnum, type RouteEnumValues, type RpcEndpoint, type RpcEndpointConfig, 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, XrplDepositAuthEnabledError, type XrplDepositAuthEnabledErrorType, XrplDestinationTagRequiredError, type XrplDestinationTagRequiredErrorType, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute, validateAddress as validateAddressFormat };
|
|
25
|
+
export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationExplicitNearAccountDoesntExistError, type DestinationExplicitNearAccountDoesntExistErrorType, type EnvConfig, type Erc191RawPayload, 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 Nep413RawPayload, 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, type QuoteOptions, RelayPublishError, type RelayPublishErrorType, RelayPublishRejectedError, type RelayPublishRejectedErrorType, RelayPublishResultUnknownError, type RelayPublishResultUnknownErrorType, type RetryOptions, type RouteConfig, RouteEnum, type RouteEnumValues, type RpcEndpoint, type RpcEndpointConfig, 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, XrplDepositAuthEnabledError, type XrplDepositAuthEnabledErrorType, XrplDestinationTagRequiredError, type XrplDestinationTagRequiredErrorType, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute, validateAddress as validateAddressFormat };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { IntentPayload, IntentPayloadFactory, IntentPrimitive, IntentRelayParams
|
|
|
5
5
|
import { IIntentSigner } from "./src/intents/interfaces/intent-signer.js";
|
|
6
6
|
import { OnBeforePublishIntentHook } from "./src/intents/intent-executer-impl/intent-executer.js";
|
|
7
7
|
import { Chain, Chains } from "./src/lib/caip2.js";
|
|
8
|
-
import { BatchWithdrawalResult, FeeEstimation, HotBridgeRouteConfig, IntentPublishResult, IntentSettlementStatus, InternalTransferRouteConfig, NearTxInfo, NearWithdrawalRouteConfig, OmniBridgeRouteConfig, ParsedAssetInfo, PoaBridgeRouteConfig, ProcessWithdrawalArgs, RouteConfig, SignAndSendArgs, SignAndSendWithdrawalArgs, SignedIntentsComposition, TxInfo, TxNoInfo, VirtualChainRouteConfig, WithdrawalIdentifier, WithdrawalParams, WithdrawalResult } from "./src/shared-types.js";
|
|
8
|
+
import { BatchWithdrawalResult, FeeEstimation, HotBridgeRouteConfig, IntentPublishResult, IntentSettlementStatus, InternalTransferRouteConfig, NearTxInfo, NearWithdrawalRouteConfig, OmniBridgeRouteConfig, ParsedAssetInfo, PoaBridgeRouteConfig, ProcessWithdrawalArgs, QuoteOptions, RouteConfig, SignAndSendArgs, SignAndSendWithdrawalArgs, SignedIntentsComposition, TxInfo, TxNoInfo, VirtualChainRouteConfig, WithdrawalIdentifier, WithdrawalParams, WithdrawalResult } from "./src/shared-types.js";
|
|
9
9
|
import { IntentPayloadBuilder } from "./src/intents/intent-payload-builder.js";
|
|
10
10
|
import { IntentsSDK, IntentsSDKConfig } from "./src/sdk.js";
|
|
11
11
|
import { Nep413RawPayload } from "./src/intents/intent-signer-impl/intent-signer-nep413.js";
|
|
@@ -22,4 +22,4 @@ import { XrplDepositAuthEnabledError, XrplDepositAuthEnabledErrorType, XrplDesti
|
|
|
22
22
|
import { computeIntentHash } from "./src/intents/intent-hash.js";
|
|
23
23
|
import { validateAddress } from "./src/lib/validateAddress.js";
|
|
24
24
|
import { AssertionError, AssertionErrorType, BaseError, BaseErrorType, EnvConfig, HttpRequestError, HttpRequestErrorType, ILogger, IntentSettlementError, IntentSettlementErrorType, NearIntentsEnv, PoaWithdrawalInvariantError, PoaWithdrawalInvariantErrorType, PoaWithdrawalNotFoundError, PoaWithdrawalNotFoundErrorType, PoaWithdrawalPendingError, PoaWithdrawalPendingErrorType, QuoteError, QuoteErrorType, RelayPublishError, RelayPublishErrorType, RelayPublishRejectedError, RelayPublishRejectedErrorType, RelayPublishResultUnknownError, RelayPublishResultUnknownErrorType, RetryOptions, RpcEndpoint, RpcEndpointConfig, RpcRequestError, RpcRequestErrorType, TimeoutError, TimeoutErrorType } from "@defuse-protocol/internal-utils";
|
|
25
|
-
export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationExplicitNearAccountDoesntExistError, type DestinationExplicitNearAccountDoesntExistErrorType, type EnvConfig, type Erc191RawPayload, 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 Nep413RawPayload, 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, RelayPublishRejectedError, type RelayPublishRejectedErrorType, RelayPublishResultUnknownError, type RelayPublishResultUnknownErrorType, type RetryOptions, type RouteConfig, RouteEnum, type RouteEnumValues, type RpcEndpoint, type RpcEndpointConfig, 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, XrplDepositAuthEnabledError, type XrplDepositAuthEnabledErrorType, XrplDestinationTagRequiredError, type XrplDestinationTagRequiredErrorType, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute, validateAddress as validateAddressFormat };
|
|
25
|
+
export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationExplicitNearAccountDoesntExistError, type DestinationExplicitNearAccountDoesntExistErrorType, type EnvConfig, type Erc191RawPayload, 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 Nep413RawPayload, 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, type QuoteOptions, RelayPublishError, type RelayPublishErrorType, RelayPublishRejectedError, type RelayPublishRejectedErrorType, RelayPublishResultUnknownError, type RelayPublishResultUnknownErrorType, type RetryOptions, type RouteConfig, RouteEnum, type RouteEnumValues, type RpcEndpoint, type RpcEndpointConfig, 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, XrplDepositAuthEnabledError, type XrplDepositAuthEnabledErrorType, XrplDestinationTagRequiredError, type XrplDestinationTagRequiredErrorType, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute, validateAddress as validateAddressFormat };
|
|
@@ -18,7 +18,7 @@ let _omni_bridge_core = require("@omni-bridge/core");
|
|
|
18
18
|
|
|
19
19
|
//#region src/bridges/omni-bridge/omni-bridge.ts
|
|
20
20
|
var OmniBridge = class {
|
|
21
|
-
constructor({ envConfig, nearProvider, solverRelayApiKey, routeMigratedPoaTokensThroughOmniBridge }) {
|
|
21
|
+
constructor({ envConfig, nearProvider, solverRelayApiKey, routeMigratedPoaTokensThroughOmniBridge, bridgeConfig }) {
|
|
22
22
|
this.route = require_route_enum.RouteEnum.OmniBridge;
|
|
23
23
|
this.intentsStorageBalanceCache = new _isaacs_ttlcache.default({
|
|
24
24
|
max: 1,
|
|
@@ -35,6 +35,7 @@ var OmniBridge = class {
|
|
|
35
35
|
this.omniBridgeAPI = new _omni_bridge_core.BridgeAPI("mainnet");
|
|
36
36
|
this.solverRelayApiKey = solverRelayApiKey;
|
|
37
37
|
this.routeMigratedPoaTokensThroughOmniBridge = routeMigratedPoaTokensThroughOmniBridge ?? false;
|
|
38
|
+
this.bridgeConfig = { prefundedNativeFeeTokens: bridgeConfig?.prefundedNativeFeeTokens ?? [] };
|
|
38
39
|
}
|
|
39
40
|
is(routeConfig) {
|
|
40
41
|
return routeConfig.route === require_route_enum.RouteEnum.OmniBridge;
|
|
@@ -156,7 +157,8 @@ var OmniBridge = class {
|
|
|
156
157
|
}
|
|
157
158
|
async validateWithdrawal(args) {
|
|
158
159
|
const isFeeSubsidized = require_omni_bridge_constants.FEE_SUBSIDIZED_TOKENS.includes(args.assetId);
|
|
159
|
-
|
|
160
|
+
const isPrefundedWithdrawal = this.bridgeConfig.prefundedNativeFeeTokens.includes(args.assetId);
|
|
161
|
+
if (!isFeeSubsidized && !isPrefundedWithdrawal) (0, _defuse_protocol_internal_utils.assert)(args.feeEstimation.amount > 0n, `Invalid Omni Bridge fee: expected > 0, got ${args.feeEstimation.amount}`);
|
|
160
162
|
const assetInfo = this.makeAssetInfo(args.assetId, args.routeConfig);
|
|
161
163
|
(0, _defuse_protocol_internal_utils.assert)(assetInfo !== null, `Asset ${args.assetId} is not supported by Omni Bridge`);
|
|
162
164
|
if (require_validateAddress.validateAddress(args.destinationAddress, assetInfo.blockchain) === false) throw new require_errors.InvalidDestinationAddressForWithdrawalError(args.destinationAddress, assetInfo.blockchain);
|
|
@@ -224,7 +226,7 @@ var OmniBridge = class {
|
|
|
224
226
|
};
|
|
225
227
|
let amount = 0n;
|
|
226
228
|
let quote = null;
|
|
227
|
-
if (totalAmountToQuote > 0n) {
|
|
229
|
+
if (totalAmountToQuote > 0n && !this.bridgeConfig.prefundedNativeFeeTokens.includes(args.withdrawalParams.assetId)) {
|
|
228
230
|
quote = await require_estimate_fee.getFeeQuote({
|
|
229
231
|
feeAmount: totalAmountToQuote,
|
|
230
232
|
feeAssetId: require_omni_bridge_constants.NEAR_NATIVE_ASSET_ID,
|
|
@@ -16,7 +16,7 @@ import { BridgeAPI, ChainKind, getChain, getMinimumTransferableAmount, isEvmChai
|
|
|
16
16
|
|
|
17
17
|
//#region src/bridges/omni-bridge/omni-bridge.ts
|
|
18
18
|
var OmniBridge = class {
|
|
19
|
-
constructor({ envConfig, nearProvider, solverRelayApiKey, routeMigratedPoaTokensThroughOmniBridge }) {
|
|
19
|
+
constructor({ envConfig, nearProvider, solverRelayApiKey, routeMigratedPoaTokensThroughOmniBridge, bridgeConfig }) {
|
|
20
20
|
this.route = RouteEnum.OmniBridge;
|
|
21
21
|
this.intentsStorageBalanceCache = new TTLCache({
|
|
22
22
|
max: 1,
|
|
@@ -33,6 +33,7 @@ var OmniBridge = class {
|
|
|
33
33
|
this.omniBridgeAPI = new BridgeAPI("mainnet");
|
|
34
34
|
this.solverRelayApiKey = solverRelayApiKey;
|
|
35
35
|
this.routeMigratedPoaTokensThroughOmniBridge = routeMigratedPoaTokensThroughOmniBridge ?? false;
|
|
36
|
+
this.bridgeConfig = { prefundedNativeFeeTokens: bridgeConfig?.prefundedNativeFeeTokens ?? [] };
|
|
36
37
|
}
|
|
37
38
|
is(routeConfig) {
|
|
38
39
|
return routeConfig.route === RouteEnum.OmniBridge;
|
|
@@ -154,7 +155,8 @@ var OmniBridge = class {
|
|
|
154
155
|
}
|
|
155
156
|
async validateWithdrawal(args) {
|
|
156
157
|
const isFeeSubsidized = FEE_SUBSIDIZED_TOKENS.includes(args.assetId);
|
|
157
|
-
|
|
158
|
+
const isPrefundedWithdrawal = this.bridgeConfig.prefundedNativeFeeTokens.includes(args.assetId);
|
|
159
|
+
if (!isFeeSubsidized && !isPrefundedWithdrawal) assert(args.feeEstimation.amount > 0n, `Invalid Omni Bridge fee: expected > 0, got ${args.feeEstimation.amount}`);
|
|
158
160
|
const assetInfo = this.makeAssetInfo(args.assetId, args.routeConfig);
|
|
159
161
|
assert(assetInfo !== null, `Asset ${args.assetId} is not supported by Omni Bridge`);
|
|
160
162
|
if (validateAddress(args.destinationAddress, assetInfo.blockchain) === false) throw new InvalidDestinationAddressForWithdrawalError(args.destinationAddress, assetInfo.blockchain);
|
|
@@ -222,7 +224,7 @@ var OmniBridge = class {
|
|
|
222
224
|
};
|
|
223
225
|
let amount = 0n;
|
|
224
226
|
let quote = null;
|
|
225
|
-
if (totalAmountToQuote > 0n) {
|
|
227
|
+
if (totalAmountToQuote > 0n && !this.bridgeConfig.prefundedNativeFeeTokens.includes(args.withdrawalParams.assetId)) {
|
|
226
228
|
quote = await getFeeQuote({
|
|
227
229
|
feeAmount: totalAmountToQuote,
|
|
228
230
|
feeAssetId: NEAR_NATIVE_ASSET_ID,
|
|
@@ -55,7 +55,7 @@ var PoaBridge = class {
|
|
|
55
55
|
}
|
|
56
56
|
createWithdrawalIntents(args) {
|
|
57
57
|
const relayerFee = require_estimate_fee.getUnderlyingFee(args.feeEstimation, require_route_enum.RouteEnum.PoaBridge, "relayerFee");
|
|
58
|
-
(0, _defuse_protocol_internal_utils.assert)(relayerFee
|
|
58
|
+
(0, _defuse_protocol_internal_utils.assert)(relayerFee >= 0n, `Invalid POA bridge relayer fee: expected >= 0, got ${relayerFee}`);
|
|
59
59
|
const intent = require_poa_bridge_utils.createWithdrawIntentPrimitive({
|
|
60
60
|
...args.withdrawalParams,
|
|
61
61
|
amount: args.withdrawalParams.amount + relayerFee,
|
|
@@ -109,7 +109,7 @@ var PoaBridge = class {
|
|
|
109
109
|
logger: args.logger
|
|
110
110
|
});
|
|
111
111
|
const relayerFee = BigInt(estimation.withdrawalFee);
|
|
112
|
-
(0, _defuse_protocol_internal_utils.assert)(relayerFee
|
|
112
|
+
(0, _defuse_protocol_internal_utils.assert)(relayerFee >= 0n, `Invalid POA bridge relayer fee: expected >= 0, got ${relayerFee}`);
|
|
113
113
|
return {
|
|
114
114
|
amount: relayerFee,
|
|
115
115
|
quote: null,
|
|
@@ -53,7 +53,7 @@ var PoaBridge = class {
|
|
|
53
53
|
}
|
|
54
54
|
createWithdrawalIntents(args) {
|
|
55
55
|
const relayerFee = getUnderlyingFee(args.feeEstimation, RouteEnum.PoaBridge, "relayerFee");
|
|
56
|
-
assert(relayerFee
|
|
56
|
+
assert(relayerFee >= 0n, `Invalid POA bridge relayer fee: expected >= 0, got ${relayerFee}`);
|
|
57
57
|
const intent = createWithdrawIntentPrimitive({
|
|
58
58
|
...args.withdrawalParams,
|
|
59
59
|
amount: args.withdrawalParams.amount + relayerFee,
|
|
@@ -107,7 +107,7 @@ var PoaBridge = class {
|
|
|
107
107
|
logger: args.logger
|
|
108
108
|
});
|
|
109
109
|
const relayerFee = BigInt(estimation.withdrawalFee);
|
|
110
|
-
assert(relayerFee
|
|
110
|
+
assert(relayerFee >= 0n, `Invalid POA bridge relayer fee: expected >= 0, got ${relayerFee}`);
|
|
111
111
|
return {
|
|
112
112
|
amount: relayerFee,
|
|
113
113
|
quote: null,
|
package/dist/src/sdk.cjs
CHANGED
|
@@ -75,7 +75,8 @@ var IntentsSDK = class {
|
|
|
75
75
|
envConfig: this.envConfig,
|
|
76
76
|
nearProvider,
|
|
77
77
|
solverRelayApiKey: this.solverRelayApiKey,
|
|
78
|
-
routeMigratedPoaTokensThroughOmniBridge: args.features?.routeMigratedPoaTokensThroughOmniBridge
|
|
78
|
+
routeMigratedPoaTokensThroughOmniBridge: args.features?.routeMigratedPoaTokensThroughOmniBridge,
|
|
79
|
+
bridgeConfig: args.bridgeConfigs?.[require_route_enum.RouteEnum.OmniBridge]
|
|
79
80
|
}),
|
|
80
81
|
new require_direct_bridge.DirectBridge({
|
|
81
82
|
envConfig: this.envConfig,
|
package/dist/src/sdk.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IntentHash, IntentPrimitive, MultiPayload } from "./intents/shared-types.cjs";
|
|
2
2
|
import { IIntentSigner } from "./intents/interfaces/intent-signer.cjs";
|
|
3
|
-
import { BatchWithdrawalResult, Bridge, CreateWithdrawalCompletionPromisesParams, FeeEstimation, IIntentsSDK, IntentPublishResult, IntentSettlementStatus, NearTxInfo, ParsedAssetInfo, PartialRPCEndpointMap, ProcessWithdrawalArgs, QuoteOptions, SignAndSendArgs, SignAndSendWithdrawalArgs, TxInfo, TxNoInfo, WithdrawalParams, WithdrawalResult } from "./shared-types.cjs";
|
|
3
|
+
import { BatchWithdrawalResult, Bridge, BridgeConfigs, CreateWithdrawalCompletionPromisesParams, FeeEstimation, IIntentsSDK, IntentPublishResult, IntentSettlementStatus, NearTxInfo, ParsedAssetInfo, PartialRPCEndpointMap, ProcessWithdrawalArgs, QuoteOptions, SignAndSendArgs, SignAndSendWithdrawalArgs, TxInfo, TxNoInfo, WithdrawalParams, WithdrawalResult } from "./shared-types.cjs";
|
|
4
4
|
import { IIntentRelayer } from "./intents/interfaces/intent-relayer.cjs";
|
|
5
5
|
import { ISaltManager } from "./intents/interfaces/salt-manager.cjs";
|
|
6
6
|
import { IntentPayloadBuilder } from "./intents/intent-payload-builder.cjs";
|
|
@@ -45,6 +45,7 @@ interface IntentsSDKConfig {
|
|
|
45
45
|
*/
|
|
46
46
|
routeMigratedPoaTokensThroughOmniBridge?: boolean;
|
|
47
47
|
};
|
|
48
|
+
bridgeConfigs?: BridgeConfigs;
|
|
48
49
|
}
|
|
49
50
|
declare class IntentsSDK implements IIntentsSDK {
|
|
50
51
|
protected envConfig: EnvConfig;
|
package/dist/src/sdk.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IntentHash, IntentPrimitive, MultiPayload } from "./intents/shared-types.js";
|
|
2
2
|
import { IIntentSigner } from "./intents/interfaces/intent-signer.js";
|
|
3
|
-
import { BatchWithdrawalResult, Bridge, CreateWithdrawalCompletionPromisesParams, FeeEstimation, IIntentsSDK, IntentPublishResult, IntentSettlementStatus, NearTxInfo, ParsedAssetInfo, PartialRPCEndpointMap, ProcessWithdrawalArgs, QuoteOptions, SignAndSendArgs, SignAndSendWithdrawalArgs, TxInfo, TxNoInfo, WithdrawalParams, WithdrawalResult } from "./shared-types.js";
|
|
3
|
+
import { BatchWithdrawalResult, Bridge, BridgeConfigs, CreateWithdrawalCompletionPromisesParams, FeeEstimation, IIntentsSDK, IntentPublishResult, IntentSettlementStatus, NearTxInfo, ParsedAssetInfo, PartialRPCEndpointMap, ProcessWithdrawalArgs, QuoteOptions, SignAndSendArgs, SignAndSendWithdrawalArgs, TxInfo, TxNoInfo, WithdrawalParams, WithdrawalResult } from "./shared-types.js";
|
|
4
4
|
import { IIntentRelayer } from "./intents/interfaces/intent-relayer.js";
|
|
5
5
|
import { ISaltManager } from "./intents/interfaces/salt-manager.js";
|
|
6
6
|
import { IntentPayloadBuilder } from "./intents/intent-payload-builder.js";
|
|
@@ -45,6 +45,7 @@ interface IntentsSDKConfig {
|
|
|
45
45
|
*/
|
|
46
46
|
routeMigratedPoaTokensThroughOmniBridge?: boolean;
|
|
47
47
|
};
|
|
48
|
+
bridgeConfigs?: BridgeConfigs;
|
|
48
49
|
}
|
|
49
50
|
declare class IntentsSDK implements IIntentsSDK {
|
|
50
51
|
protected envConfig: EnvConfig;
|
package/dist/src/sdk.js
CHANGED
|
@@ -73,7 +73,8 @@ var IntentsSDK = class {
|
|
|
73
73
|
envConfig: this.envConfig,
|
|
74
74
|
nearProvider,
|
|
75
75
|
solverRelayApiKey: this.solverRelayApiKey,
|
|
76
|
-
routeMigratedPoaTokensThroughOmniBridge: args.features?.routeMigratedPoaTokensThroughOmniBridge
|
|
76
|
+
routeMigratedPoaTokensThroughOmniBridge: args.features?.routeMigratedPoaTokensThroughOmniBridge,
|
|
77
|
+
bridgeConfig: args.bridgeConfigs?.[RouteEnum.OmniBridge]
|
|
77
78
|
}),
|
|
78
79
|
new DirectBridge({
|
|
79
80
|
envConfig: this.envConfig,
|
|
@@ -262,6 +262,16 @@ interface RouteFeeStructures {
|
|
|
262
262
|
/** Internal transfers have no fees */
|
|
263
263
|
[RouteEnum.InternalTransfer]: null;
|
|
264
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* Per-bridge configuration, keyed by route. Each entry is optional and tunes
|
|
267
|
+
* the behaviour of a single bridge; omitting one falls back to that bridge's defaults.
|
|
268
|
+
*/
|
|
269
|
+
interface BridgeConfigs {
|
|
270
|
+
[RouteEnum.OmniBridge]?: {
|
|
271
|
+
/** Asset IDs of subsidized tokens whose withdrawal relayer fee is prefunded. */
|
|
272
|
+
prefundedNativeFeeTokens?: string[];
|
|
273
|
+
};
|
|
274
|
+
}
|
|
265
275
|
/**
|
|
266
276
|
* Represents the different categories of fees that may apply across various withdrawal operations.
|
|
267
277
|
* Each route type has an optional fee structure. Uses a mapped type to ensure all RouteEnum values are covered.
|
|
@@ -386,4 +396,4 @@ type PartialRPCEndpointMap = { [K in keyof RPCEndpointMap]?: K extends typeof Ch
|
|
|
386
396
|
horizon?: RpcEndpoint[];
|
|
387
397
|
} : RpcEndpoint[] };
|
|
388
398
|
//#endregion
|
|
389
|
-
export { BatchWithdrawalResult, Bridge, CreateWithdrawalCompletionPromisesParams, FeeEstimation, HotBridgeRouteConfig, IIntentsSDK, IntentPublishResult, IntentSettlementStatus, InternalTransferRouteConfig, NearTxInfo, NearWithdrawalRouteConfig, OmniBridgeRouteConfig, ParsedAssetInfo, PartialRPCEndpointMap, PoaBridgeRouteConfig, ProcessWithdrawalArgs, QuoteOptions, RouteConfig, SignAndSendArgs, SignAndSendWithdrawalArgs, SignedIntentsComposition, TxInfo, TxNoInfo, VirtualChainRouteConfig, WithdrawalIdentifier, WithdrawalParams, WithdrawalResult };
|
|
399
|
+
export { BatchWithdrawalResult, Bridge, BridgeConfigs, CreateWithdrawalCompletionPromisesParams, FeeEstimation, HotBridgeRouteConfig, IIntentsSDK, IntentPublishResult, IntentSettlementStatus, InternalTransferRouteConfig, NearTxInfo, NearWithdrawalRouteConfig, OmniBridgeRouteConfig, ParsedAssetInfo, PartialRPCEndpointMap, PoaBridgeRouteConfig, ProcessWithdrawalArgs, QuoteOptions, RouteConfig, SignAndSendArgs, SignAndSendWithdrawalArgs, SignedIntentsComposition, TxInfo, TxNoInfo, VirtualChainRouteConfig, WithdrawalIdentifier, WithdrawalParams, WithdrawalResult };
|
|
@@ -262,6 +262,16 @@ interface RouteFeeStructures {
|
|
|
262
262
|
/** Internal transfers have no fees */
|
|
263
263
|
[RouteEnum.InternalTransfer]: null;
|
|
264
264
|
}
|
|
265
|
+
/**
|
|
266
|
+
* Per-bridge configuration, keyed by route. Each entry is optional and tunes
|
|
267
|
+
* the behaviour of a single bridge; omitting one falls back to that bridge's defaults.
|
|
268
|
+
*/
|
|
269
|
+
interface BridgeConfigs {
|
|
270
|
+
[RouteEnum.OmniBridge]?: {
|
|
271
|
+
/** Asset IDs of subsidized tokens whose withdrawal relayer fee is prefunded. */
|
|
272
|
+
prefundedNativeFeeTokens?: string[];
|
|
273
|
+
};
|
|
274
|
+
}
|
|
265
275
|
/**
|
|
266
276
|
* Represents the different categories of fees that may apply across various withdrawal operations.
|
|
267
277
|
* Each route type has an optional fee structure. Uses a mapped type to ensure all RouteEnum values are covered.
|
|
@@ -386,4 +396,4 @@ type PartialRPCEndpointMap = { [K in keyof RPCEndpointMap]?: K extends typeof Ch
|
|
|
386
396
|
horizon?: RpcEndpoint[];
|
|
387
397
|
} : RpcEndpoint[] };
|
|
388
398
|
//#endregion
|
|
389
|
-
export { BatchWithdrawalResult, Bridge, CreateWithdrawalCompletionPromisesParams, FeeEstimation, HotBridgeRouteConfig, IIntentsSDK, IntentPublishResult, IntentSettlementStatus, InternalTransferRouteConfig, NearTxInfo, NearWithdrawalRouteConfig, OmniBridgeRouteConfig, ParsedAssetInfo, PartialRPCEndpointMap, PoaBridgeRouteConfig, ProcessWithdrawalArgs, QuoteOptions, RouteConfig, SignAndSendArgs, SignAndSendWithdrawalArgs, SignedIntentsComposition, TxInfo, TxNoInfo, VirtualChainRouteConfig, WithdrawalIdentifier, WithdrawalParams, WithdrawalResult };
|
|
399
|
+
export { BatchWithdrawalResult, Bridge, BridgeConfigs, CreateWithdrawalCompletionPromisesParams, FeeEstimation, HotBridgeRouteConfig, IIntentsSDK, IntentPublishResult, IntentSettlementStatus, InternalTransferRouteConfig, NearTxInfo, NearWithdrawalRouteConfig, OmniBridgeRouteConfig, ParsedAssetInfo, PartialRPCEndpointMap, PoaBridgeRouteConfig, ProcessWithdrawalArgs, QuoteOptions, RouteConfig, SignAndSendArgs, SignAndSendWithdrawalArgs, SignedIntentsComposition, TxInfo, TxNoInfo, VirtualChainRouteConfig, WithdrawalIdentifier, WithdrawalParams, WithdrawalResult };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defuse-protocol/intents-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.73.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"valibot": "^1.0.0",
|
|
51
51
|
"viem": "^2.0.0",
|
|
52
52
|
"@defuse-protocol/contract-types": "0.6.4",
|
|
53
|
-
"@defuse-protocol/internal-utils": "0.35.
|
|
53
|
+
"@defuse-protocol/internal-utils": "0.35.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@ton/core": "^0.60.0",
|