@defuse-protocol/intents-sdk 0.79.0 → 0.80.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/README.md CHANGED
@@ -279,6 +279,9 @@ The SDK automatically detects and supports multiple route types based on asset i
279
279
  - **Supported Assets**: Fungible tokens (NEP-141) supported by omni bridge relayer.
280
280
  - **Use Case**: multi-chain transfers for supported list of chains
281
281
  - **Route Type**: `omni_bridge`
282
+ - **Note**: Some tokens originally issued via the PoA Bridge (`.omft.near`) have since migrated to the Omni Bridge.
283
+ The SDK tracks these in `POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE` and automatically routes them through Omni Bridge
284
+ instead of PoA Bridge.
282
285
 
283
286
  ##### Internal Transfer Route
284
287
 
@@ -363,51 +366,6 @@ const sdk = new IntentsSDK({
363
366
  });
364
367
  ```
365
368
 
366
- ### Feature Flags
367
-
368
- Configure optional SDK features through the `features` configuration:
369
-
370
- #### Migrated PoA Token Routing
371
-
372
- Will route migrated PoA tokens (ending with `*.omft.near`) through Omni Bridge instead of the legacy PoA Bridge, unless explicitly set to route them through PoA bridge with routeConfig. Enable this when working with POA tokens that have been migrated to the Omni infrastructure:
373
-
374
- ```typescript
375
- const sdk = new IntentsSDK({
376
- referral: 'your-referral-code',
377
- features: {
378
- routeMigratedPoaTokensThroughOmniBridge: true
379
- }
380
- });
381
-
382
- // With this flag enabled, tokens like 'nep141:sol-c58e6539c2f2e097c251f8edf11f9c03e581f8d4.omft.near' will route through Omni Bridge
383
- const result = await sdk.processWithdrawal({
384
- withdrawalParams: {
385
- assetId: 'nep141:sol-c58e6539c2f2e097c251f8edf11f9c03e581f8d4.omft.near', // Migrated PoA token
386
- amount: 1000000n,
387
- destinationAddress: '39hqXivfCPUSqmXAaX3eo4JcA5bGFXhhs26dmg585DGb',
388
- feeInclusive: false
389
- }
390
- });
391
- ```
392
-
393
- **When to enable:**
394
- - Working with PoA tokens that have been migrated to Omni Bridge
395
- - Explicitly want to route `*.omft.near` tokens through the Omni Bridge
396
- - Default behavior (when disabled) routes these tokens through the PoA Bridge
397
-
398
- **Allowlisted Tokens:**
399
-
400
- Not all PoA tokens can be routed through Omni Bridge. The SDK exports `POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE` constant containing the tokens that support this routing:
401
-
402
- ```typescript
403
- import { POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE } from '@defuse-protocol/intents-sdk';
404
-
405
- console.log(POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE);
406
- // { 'sol-...omft.near': ChainKind.Sol, ... }
407
- ```
408
-
409
- The keys are token contract IDs and values are their `ChainKind`. Only tokens in this map will be routed through Omni Bridge when the feature flag is enabled. Other `*.omft.near` tokens will continue using the PoA Bridge.
410
-
411
369
  ### Other Intent Signers
412
370
 
413
371
  The SDK supports multiple intent signing methods using factory functions:
package/dist/index.cjs CHANGED
@@ -7,7 +7,7 @@ const require_bridge_name_enum = require('./src/constants/bridge-name-enum.cjs')
7
7
  const require_error = require('./src/bridges/direct-bridge/error.cjs');
8
8
  const require_error$1 = require('./src/bridges/hot-bridge/error.cjs');
9
9
  const require_error$2 = require('./src/bridges/omni-bridge/error.cjs');
10
- const require_poa_tokens_routable_through_omni_bridge = require('./src/constants/poa-tokens-routable-through-omni-bridge.cjs');
10
+ const require_poa_tokens_migrated_to_omni_bridge = require('./src/constants/poa-tokens-migrated-to-omni-bridge.cjs');
11
11
  const require_errors$1 = require('./src/bridges/poa-bridge/errors.cjs');
12
12
  const require_intent_hash = require('./src/intents/intent-hash.cjs');
13
13
  const require_expirable_nonce = require('./src/intents/expirable-nonce.cjs');
@@ -56,7 +56,7 @@ exports.IntentsSDK = require_sdk.IntentsSDK;
56
56
  exports.InvalidFeeValueError = require_error$2.InvalidFeeValueError;
57
57
  exports.MinWithdrawalAmountError = require_errors.MinWithdrawalAmountError;
58
58
  exports.OmniWithdrawalApiFeeRequestTimeoutError = require_error$2.OmniWithdrawalApiFeeRequestTimeoutError;
59
- exports.POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE = require_poa_tokens_routable_through_omni_bridge.POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE;
59
+ exports.POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE = require_poa_tokens_migrated_to_omni_bridge.POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE;
60
60
  Object.defineProperty(exports, 'PoaWithdrawalInvariantError', {
61
61
  enumerable: true,
62
62
  get: function () {
package/dist/index.d.cts CHANGED
@@ -12,7 +12,7 @@ import { Nep413RawPayload } from "./src/intents/intent-signer-impl/intent-signer
12
12
  import { Erc191RawPayload } from "./src/intents/intent-signer-impl/intent-signer-viem.cjs";
13
13
  import { createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem } from "./src/intents/intent-signer-impl/factories.cjs";
14
14
  import { createDefaultRoute, createHotBridgeRoute, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute } from "./src/lib/route-config-factory.cjs";
15
- import { POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE } from "./src/constants/poa-tokens-routable-through-omni-bridge.cjs";
15
+ import { POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE } from "./src/constants/poa-tokens-migrated-to-omni-bridge.cjs";
16
16
  import { WithdrawalFailedError, WithdrawalFailedErrorType, WithdrawalWatchError, WithdrawalWatchErrorType } from "./src/core/withdrawal-watcher.cjs";
17
17
  import { DestinationAddressMatchesTokenAddressError, DestinationAddressMatchesTokenAddressErrorType, FeeExceedsAmountError, FeeExceedsAmountErrorType, MinWithdrawalAmountError, MinWithdrawalAmountErrorType, TrustlineNotFoundError, TrustlineNotFoundErrorType, UnsupportedAssetIdError, UnsupportedAssetIdErrorType, UnsupportedDestinationMemoError, UnsupportedDestinationMemoErrorType } from "./src/classes/errors.cjs";
18
18
  import { DestinationExplicitNearAccountDoesntExistError, DestinationExplicitNearAccountDoesntExistErrorType } from "./src/bridges/direct-bridge/error.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, DestinationAddressMatchesTokenAddressError, type DestinationAddressMatchesTokenAddressErrorType, 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 };
25
+ export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationAddressMatchesTokenAddressError, type DestinationAddressMatchesTokenAddressErrorType, 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_MIGRATED_TO_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
@@ -12,7 +12,7 @@ import { Nep413RawPayload } from "./src/intents/intent-signer-impl/intent-signer
12
12
  import { Erc191RawPayload } from "./src/intents/intent-signer-impl/intent-signer-viem.js";
13
13
  import { createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem } from "./src/intents/intent-signer-impl/factories.js";
14
14
  import { createDefaultRoute, createHotBridgeRoute, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute } from "./src/lib/route-config-factory.js";
15
- import { POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE } from "./src/constants/poa-tokens-routable-through-omni-bridge.js";
15
+ import { POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE } from "./src/constants/poa-tokens-migrated-to-omni-bridge.js";
16
16
  import { WithdrawalFailedError, WithdrawalFailedErrorType, WithdrawalWatchError, WithdrawalWatchErrorType } from "./src/core/withdrawal-watcher.js";
17
17
  import { DestinationAddressMatchesTokenAddressError, DestinationAddressMatchesTokenAddressErrorType, FeeExceedsAmountError, FeeExceedsAmountErrorType, MinWithdrawalAmountError, MinWithdrawalAmountErrorType, TrustlineNotFoundError, TrustlineNotFoundErrorType, UnsupportedAssetIdError, UnsupportedAssetIdErrorType, UnsupportedDestinationMemoError, UnsupportedDestinationMemoErrorType } from "./src/classes/errors.js";
18
18
  import { DestinationExplicitNearAccountDoesntExistError, DestinationExplicitNearAccountDoesntExistErrorType } from "./src/bridges/direct-bridge/error.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, DestinationAddressMatchesTokenAddressError, type DestinationAddressMatchesTokenAddressErrorType, 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 };
25
+ export { AssertionError, type AssertionErrorType, BaseError, type BaseErrorType, type BatchWithdrawalResult, BridgeNameEnum, type BridgeNameEnumValues, type Chain, Chains, DestinationAddressMatchesTokenAddressError, type DestinationAddressMatchesTokenAddressErrorType, 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_MIGRATED_TO_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.js CHANGED
@@ -6,7 +6,7 @@ import { BridgeNameEnum } from "./src/constants/bridge-name-enum.js";
6
6
  import { DestinationExplicitNearAccountDoesntExistError } from "./src/bridges/direct-bridge/error.js";
7
7
  import { HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalNotFoundError } from "./src/bridges/hot-bridge/error.js";
8
8
  import { InsufficientUtxoForOmniBridgeWithdrawalError, IntentsNearOmniAvailableBalanceTooLowError, InvalidFeeValueError, OmniWithdrawalApiFeeRequestTimeoutError, TokenNotFoundInDestinationChainError } from "./src/bridges/omni-bridge/error.js";
9
- import { POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE } from "./src/constants/poa-tokens-routable-through-omni-bridge.js";
9
+ import { POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE } from "./src/constants/poa-tokens-migrated-to-omni-bridge.js";
10
10
  import { XrplDepositAuthEnabledError, XrplDestinationTagRequiredError } from "./src/bridges/poa-bridge/errors.js";
11
11
  import { computeIntentHash } from "./src/intents/intent-hash.js";
12
12
  import { VersionedNonceBuilder } from "./src/intents/expirable-nonce.js";
@@ -17,4 +17,4 @@ import { createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSi
17
17
  import { createDefaultRoute, createHotBridgeRoute, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute } from "./src/lib/route-config-factory.js";
18
18
  import { AssertionError, BaseError, HttpRequestError, IntentSettlementError, PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError, QuoteError, RelayPublishError, RelayPublishRejectedError, RelayPublishResultUnknownError, RpcRequestError, TimeoutError } from "@defuse-protocol/internal-utils";
19
19
 
20
- export { AssertionError, BaseError, BridgeNameEnum, Chains, DestinationAddressMatchesTokenAddressError, DestinationExplicitNearAccountDoesntExistError, FeeExceedsAmountError, HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalNotFoundError, HttpRequestError, InsufficientUtxoForOmniBridgeWithdrawalError, IntentPayloadBuilder, IntentSettlementError, IntentsNearOmniAvailableBalanceTooLowError, IntentsSDK, InvalidFeeValueError, MinWithdrawalAmountError, OmniWithdrawalApiFeeRequestTimeoutError, POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE, PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError, QuoteError, RelayPublishError, RelayPublishRejectedError, RelayPublishResultUnknownError, RouteEnum, RpcRequestError, TimeoutError, TokenNotFoundInDestinationChainError, TrustlineNotFoundError, UnsupportedAssetIdError, UnsupportedDestinationMemoError, VersionedNonceBuilder, WithdrawalFailedError, WithdrawalWatchError, XrplDepositAuthEnabledError, XrplDestinationTagRequiredError, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute, validateAddress as validateAddressFormat };
20
+ export { AssertionError, BaseError, BridgeNameEnum, Chains, DestinationAddressMatchesTokenAddressError, DestinationExplicitNearAccountDoesntExistError, FeeExceedsAmountError, HotWithdrawalApiFeeRequestTimeoutError, HotWithdrawalNotFoundError, HttpRequestError, InsufficientUtxoForOmniBridgeWithdrawalError, IntentPayloadBuilder, IntentSettlementError, IntentsNearOmniAvailableBalanceTooLowError, IntentsSDK, InvalidFeeValueError, MinWithdrawalAmountError, OmniWithdrawalApiFeeRequestTimeoutError, POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE, PoaWithdrawalInvariantError, PoaWithdrawalNotFoundError, PoaWithdrawalPendingError, QuoteError, RelayPublishError, RelayPublishRejectedError, RelayPublishResultUnknownError, RouteEnum, RpcRequestError, TimeoutError, TokenNotFoundInDestinationChainError, TrustlineNotFoundError, UnsupportedAssetIdError, UnsupportedDestinationMemoError, VersionedNonceBuilder, WithdrawalFailedError, WithdrawalWatchError, XrplDepositAuthEnabledError, XrplDestinationTagRequiredError, computeIntentHash, createDefaultRoute, createHotBridgeRoute, createIntentSignerNEP413, createIntentSignerNearKeyPair, createIntentSignerViem, createInternalTransferRoute, createNearWithdrawalRoute, createOmniBridgeRoute, createPoaBridgeRoute, createVirtualChainRoute, validateAddress as validateAddressFormat };
@@ -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_omni_bridge_constants = require('./omni-bridge-constants.cjs');
4
- const require_poa_tokens_routable_through_omni_bridge = require('../../constants/poa-tokens-routable-through-omni-bridge.cjs');
4
+ const require_poa_tokens_migrated_to_omni_bridge = require('../../constants/poa-tokens-migrated-to-omni-bridge.cjs');
5
5
  let _defuse_protocol_internal_utils = require("@defuse-protocol/internal-utils");
6
6
  let valibot = require("valibot");
7
7
  valibot = require_rolldown_runtime.__toESM(valibot);
@@ -82,7 +82,7 @@ function isUtxoChain(network) {
82
82
  return UTXO_CHAINS.includes(network);
83
83
  }
84
84
  function poaContractIdToChainKind(contractId) {
85
- return require_poa_tokens_routable_through_omni_bridge.POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE[contractId] ?? null;
85
+ return require_poa_tokens_migrated_to_omni_bridge.POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE[contractId] ?? null;
86
86
  }
87
87
  function validateOmniToken(nearAddress) {
88
88
  if (nearAddress.endsWith(".testnet")) return false;
@@ -1,6 +1,6 @@
1
1
  import { Chains } from "../../lib/caip2.js";
2
2
  import { MIN_GAS_AMOUNT, OMNI_BRIDGE_CONTRACT } from "./omni-bridge-constants.js";
3
- import { POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE } from "../../constants/poa-tokens-routable-through-omni-bridge.js";
3
+ import { POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE } from "../../constants/poa-tokens-migrated-to-omni-bridge.js";
4
4
  import { assert, utils } from "@defuse-protocol/internal-utils";
5
5
  import * as v from "valibot";
6
6
  import { ChainKind, getChain, isBridgeToken, omniAddress } from "@omni-bridge/core";
@@ -80,7 +80,7 @@ function isUtxoChain(network) {
80
80
  return UTXO_CHAINS.includes(network);
81
81
  }
82
82
  function poaContractIdToChainKind(contractId) {
83
- return POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE[contractId] ?? null;
83
+ return POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE[contractId] ?? null;
84
84
  }
85
85
  function validateOmniToken(nearAddress) {
86
86
  if (nearAddress.endsWith(".testnet")) return false;
@@ -9,7 +9,7 @@ const require_bridge_name_enum = require('../../constants/bridge-name-enum.cjs')
9
9
  const require_compareAddresses = require('../../lib/compareAddresses.cjs');
10
10
  const require_error = require('./error.cjs');
11
11
  const require_omni_bridge_constants = require('./omni-bridge-constants.cjs');
12
- const require_poa_tokens_routable_through_omni_bridge = require('../../constants/poa-tokens-routable-through-omni-bridge.cjs');
12
+ const require_poa_tokens_migrated_to_omni_bridge = require('../../constants/poa-tokens-migrated-to-omni-bridge.cjs');
13
13
  const require_omni_bridge_utils = require('./omni-bridge-utils.cjs');
14
14
  let _defuse_protocol_internal_utils = require("@defuse-protocol/internal-utils");
15
15
  let lru_cache = require("lru-cache");
@@ -19,7 +19,7 @@ let _omni_bridge_core = require("@omni-bridge/core");
19
19
 
20
20
  //#region src/bridges/omni-bridge/omni-bridge.ts
21
21
  var OmniBridge = class {
22
- constructor({ envConfig, nearProvider, solverRelayApiKey, routeMigratedPoaTokensThroughOmniBridge, bridgeConfig }) {
22
+ constructor({ envConfig, nearProvider, solverRelayApiKey, bridgeConfig }) {
23
23
  this.route = require_route_enum.RouteEnum.OmniBridge;
24
24
  this.intentsStorageBalanceCache = new _isaacs_ttlcache.default({
25
25
  max: 1,
@@ -35,7 +35,6 @@ var OmniBridge = class {
35
35
  this.nearProvider = nearProvider;
36
36
  this.omniBridgeAPI = new _omni_bridge_core.BridgeAPI("mainnet");
37
37
  this.solverRelayApiKey = solverRelayApiKey;
38
- this.routeMigratedPoaTokensThroughOmniBridge = routeMigratedPoaTokensThroughOmniBridge ?? false;
39
38
  this.bridgeConfig = { prefundedNativeFeeTokens: bridgeConfig?.prefundedNativeFeeTokens ?? [] };
40
39
  }
41
40
  is(routeConfig) {
@@ -49,7 +48,7 @@ var OmniBridge = class {
49
48
  const nonValidStandard = parsed.standard !== "nep141";
50
49
  if (nonValidStandard && (omniBridgeSetWithNoChain || targetChainSpecified)) throw new require_errors.UnsupportedAssetIdError(params.assetId, `Only NEP-141 tokens are supported by Omni Bridge.`);
51
50
  if (nonValidStandard) return false;
52
- const poaTokenRoutedThroughOmniBridge = this.isPoaTokenRoutedThroughOmniBridge(parsed.contractId);
51
+ const poaTokenRoutedThroughOmniBridge = this.isPoaTokenMigratedToOmniBridge(parsed.contractId);
53
52
  const nonValidToken = !poaTokenRoutedThroughOmniBridge && require_omni_bridge_utils.validateOmniToken(parsed.contractId) === false;
54
53
  if (nonValidToken && omniBridgeSetWithNoChain) throw new require_errors.UnsupportedAssetIdError(params.assetId, `Non valid omni contract id ${parsed.contractId}`);
55
54
  if (!targetChainSpecified && nonValidToken) return false;
@@ -74,7 +73,7 @@ var OmniBridge = class {
74
73
  parseAssetId(assetId) {
75
74
  const parsed = require_parse_defuse_asset_id.parseDefuseAssetId(assetId);
76
75
  if (parsed.standard !== "nep141") return null;
77
- const omniChainKind = this.isPoaTokenRoutedThroughOmniBridge(parsed.contractId) ? require_omni_bridge_utils.poaContractIdToChainKind(parsed.contractId) : (0, _omni_bridge_core.parseOriginChain)(parsed.contractId);
76
+ const omniChainKind = this.isPoaTokenMigratedToOmniBridge(parsed.contractId) ? require_omni_bridge_utils.poaContractIdToChainKind(parsed.contractId) : (0, _omni_bridge_core.parseOriginChain)(parsed.contractId);
78
77
  if (omniChainKind === null) return null;
79
78
  const blockchain = require_omni_bridge_utils.chainKindToCaip2(omniChainKind);
80
79
  if (blockchain === null) return null;
@@ -93,7 +92,7 @@ var OmniBridge = class {
93
92
  omniChainKind = require_omni_bridge_utils.caip2ToChainKind(routeConfig.chain);
94
93
  blockchain = routeConfig.chain;
95
94
  } else {
96
- omniChainKind = this.isPoaTokenRoutedThroughOmniBridge(parsed.contractId) ? require_omni_bridge_utils.poaContractIdToChainKind(parsed.contractId) : (0, _omni_bridge_core.parseOriginChain)(parsed.contractId);
95
+ omniChainKind = this.isPoaTokenMigratedToOmniBridge(parsed.contractId) ? require_omni_bridge_utils.poaContractIdToChainKind(parsed.contractId) : (0, _omni_bridge_core.parseOriginChain)(parsed.contractId);
97
96
  if (omniChainKind === null) return null;
98
97
  blockchain = require_omni_bridge_utils.chainKindToCaip2(omniChainKind);
99
98
  }
@@ -331,11 +330,10 @@ var OmniBridge = class {
331
330
  return intentsStorageBalance;
332
331
  }
333
332
  /**
334
- * Checks if passed token contract id is an allowlisted PoA token that should be routed via OmniBridge.
335
- * Always return false when feature flag routeMigratedPoaTokensThroughOmniBridge = false.
333
+ * Checks if passed token contract id is a Omni migrated PoA token.
336
334
  */
337
- isPoaTokenRoutedThroughOmniBridge(nearAddress) {
338
- return this.routeMigratedPoaTokensThroughOmniBridge ? require_poa_tokens_routable_through_omni_bridge.POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE[nearAddress] !== void 0 : false;
335
+ isPoaTokenMigratedToOmniBridge(nearAddress) {
336
+ return require_poa_tokens_migrated_to_omni_bridge.POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE[nearAddress] !== void 0;
339
337
  }
340
338
  };
341
339
 
@@ -8,7 +8,7 @@ import { BridgeNameEnum } from "../../constants/bridge-name-enum.js";
8
8
  import { compareAddresses } from "../../lib/compareAddresses.js";
9
9
  import { InsufficientUtxoForOmniBridgeWithdrawalError, IntentsNearOmniAvailableBalanceTooLowError, InvalidFeeValueError, OmniWithdrawalApiFeeRequestTimeoutError, TokenNotFoundInDestinationChainError } from "./error.js";
10
10
  import { FEE_SUBSIDIZED_TOKENS, INTENTS_STORAGE_BALANCE_CACHE_KEY, MIN_AMOUNT_SOL_OMNI_WITHDRAWAL, MIN_STORAGE_BALANCE_FOR_INTENTS_NEAR, NEAR_NATIVE_ASSET_ID, OMNI_BRIDGE_CONTRACT, SOL_OMNI_CONTRACT_ID } from "./omni-bridge-constants.js";
11
- import { POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE } from "../../constants/poa-tokens-routable-through-omni-bridge.js";
11
+ import { POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE } from "../../constants/poa-tokens-migrated-to-omni-bridge.js";
12
12
  import { caip2ToChainKind, chainKindToCaip2, createWithdrawIntentsPrimitive, getAccountOmniStorageBalance, getBridgedToken, getTokenDecimals, isUtxoChain, poaContractIdToChainKind, validateOmniToken } from "./omni-bridge-utils.js";
13
13
  import { assert, getNearNep141MinStorageBalance, getNearNep141StorageBalance, withTimeout } from "@defuse-protocol/internal-utils";
14
14
  import { LRUCache } from "lru-cache";
@@ -17,7 +17,7 @@ import { BridgeAPI, ChainKind, getAddress, getChain, getMinimumTransferableAmoun
17
17
 
18
18
  //#region src/bridges/omni-bridge/omni-bridge.ts
19
19
  var OmniBridge = class {
20
- constructor({ envConfig, nearProvider, solverRelayApiKey, routeMigratedPoaTokensThroughOmniBridge, bridgeConfig }) {
20
+ constructor({ envConfig, nearProvider, solverRelayApiKey, bridgeConfig }) {
21
21
  this.route = RouteEnum.OmniBridge;
22
22
  this.intentsStorageBalanceCache = new TTLCache({
23
23
  max: 1,
@@ -33,7 +33,6 @@ var OmniBridge = class {
33
33
  this.nearProvider = nearProvider;
34
34
  this.omniBridgeAPI = new BridgeAPI("mainnet");
35
35
  this.solverRelayApiKey = solverRelayApiKey;
36
- this.routeMigratedPoaTokensThroughOmniBridge = routeMigratedPoaTokensThroughOmniBridge ?? false;
37
36
  this.bridgeConfig = { prefundedNativeFeeTokens: bridgeConfig?.prefundedNativeFeeTokens ?? [] };
38
37
  }
39
38
  is(routeConfig) {
@@ -47,7 +46,7 @@ var OmniBridge = class {
47
46
  const nonValidStandard = parsed.standard !== "nep141";
48
47
  if (nonValidStandard && (omniBridgeSetWithNoChain || targetChainSpecified)) throw new UnsupportedAssetIdError(params.assetId, `Only NEP-141 tokens are supported by Omni Bridge.`);
49
48
  if (nonValidStandard) return false;
50
- const poaTokenRoutedThroughOmniBridge = this.isPoaTokenRoutedThroughOmniBridge(parsed.contractId);
49
+ const poaTokenRoutedThroughOmniBridge = this.isPoaTokenMigratedToOmniBridge(parsed.contractId);
51
50
  const nonValidToken = !poaTokenRoutedThroughOmniBridge && validateOmniToken(parsed.contractId) === false;
52
51
  if (nonValidToken && omniBridgeSetWithNoChain) throw new UnsupportedAssetIdError(params.assetId, `Non valid omni contract id ${parsed.contractId}`);
53
52
  if (!targetChainSpecified && nonValidToken) return false;
@@ -72,7 +71,7 @@ var OmniBridge = class {
72
71
  parseAssetId(assetId) {
73
72
  const parsed = parseDefuseAssetId(assetId);
74
73
  if (parsed.standard !== "nep141") return null;
75
- const omniChainKind = this.isPoaTokenRoutedThroughOmniBridge(parsed.contractId) ? poaContractIdToChainKind(parsed.contractId) : parseOriginChain(parsed.contractId);
74
+ const omniChainKind = this.isPoaTokenMigratedToOmniBridge(parsed.contractId) ? poaContractIdToChainKind(parsed.contractId) : parseOriginChain(parsed.contractId);
76
75
  if (omniChainKind === null) return null;
77
76
  const blockchain = chainKindToCaip2(omniChainKind);
78
77
  if (blockchain === null) return null;
@@ -91,7 +90,7 @@ var OmniBridge = class {
91
90
  omniChainKind = caip2ToChainKind(routeConfig.chain);
92
91
  blockchain = routeConfig.chain;
93
92
  } else {
94
- omniChainKind = this.isPoaTokenRoutedThroughOmniBridge(parsed.contractId) ? poaContractIdToChainKind(parsed.contractId) : parseOriginChain(parsed.contractId);
93
+ omniChainKind = this.isPoaTokenMigratedToOmniBridge(parsed.contractId) ? poaContractIdToChainKind(parsed.contractId) : parseOriginChain(parsed.contractId);
95
94
  if (omniChainKind === null) return null;
96
95
  blockchain = chainKindToCaip2(omniChainKind);
97
96
  }
@@ -329,11 +328,10 @@ var OmniBridge = class {
329
328
  return intentsStorageBalance;
330
329
  }
331
330
  /**
332
- * Checks if passed token contract id is an allowlisted PoA token that should be routed via OmniBridge.
333
- * Always return false when feature flag routeMigratedPoaTokensThroughOmniBridge = false.
331
+ * Checks if passed token contract id is a Omni migrated PoA token.
334
332
  */
335
- isPoaTokenRoutedThroughOmniBridge(nearAddress) {
336
- return this.routeMigratedPoaTokensThroughOmniBridge ? POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE[nearAddress] !== void 0 : false;
333
+ isPoaTokenMigratedToOmniBridge(nearAddress) {
334
+ return POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE[nearAddress] !== void 0;
337
335
  }
338
336
  };
339
337
 
@@ -29,7 +29,6 @@ const caip2Mapping = {
29
29
  [require_caip2.Chains.Arbitrum]: "eth:42161",
30
30
  [require_caip2.Chains.Bitcoin]: "btc:mainnet",
31
31
  [require_caip2.Chains.BitcoinCash]: "bch:mainnet",
32
- [require_caip2.Chains.Solana]: "sol:mainnet",
33
32
  [require_caip2.Chains.Dogecoin]: "doge:mainnet",
34
33
  [require_caip2.Chains.XRPL]: "xrp:mainnet",
35
34
  [require_caip2.Chains.Zcash]: "zec:mainnet",
@@ -37,11 +36,9 @@ const caip2Mapping = {
37
36
  [require_caip2.Chains.Berachain]: "eth:80094",
38
37
  [require_caip2.Chains.Tron]: "tron:mainnet",
39
38
  [require_caip2.Chains.Sui]: "sui:mainnet",
40
- [require_caip2.Chains.Aptos]: "aptos:mainnet",
41
39
  [require_caip2.Chains.Movement]: "movement:mainnet",
42
40
  [require_caip2.Chains.Cardano]: "cardano:mainnet",
43
41
  [require_caip2.Chains.Litecoin]: "ltc:mainnet",
44
- [require_caip2.Chains.Starknet]: "starknet:mainnet",
45
42
  [require_caip2.Chains.Aleo]: "aleo:mainnet",
46
43
  [require_caip2.Chains.Dash]: "dash:mainnet",
47
44
  [require_caip2.Chains.Plasma]: "eth:9745"
@@ -56,7 +53,6 @@ const tokenPrefixMapping = {
56
53
  arb: require_caip2.Chains.Arbitrum,
57
54
  btc: require_caip2.Chains.Bitcoin,
58
55
  bch: require_caip2.Chains.BitcoinCash,
59
- sol: require_caip2.Chains.Solana,
60
56
  doge: require_caip2.Chains.Dogecoin,
61
57
  xrp: require_caip2.Chains.XRPL,
62
58
  zec: require_caip2.Chains.Zcash,
@@ -64,11 +60,9 @@ const tokenPrefixMapping = {
64
60
  bera: require_caip2.Chains.Berachain,
65
61
  tron: require_caip2.Chains.Tron,
66
62
  sui: require_caip2.Chains.Sui,
67
- aptos: require_caip2.Chains.Aptos,
68
63
  movement: require_caip2.Chains.Movement,
69
64
  cardano: require_caip2.Chains.Cardano,
70
65
  ltc: require_caip2.Chains.Litecoin,
71
- starknet: require_caip2.Chains.Starknet,
72
66
  aleo: require_caip2.Chains.Aleo,
73
67
  dash: require_caip2.Chains.Dash,
74
68
  plasma: require_caip2.Chains.Plasma
@@ -28,7 +28,6 @@ const caip2Mapping = {
28
28
  [Chains.Arbitrum]: "eth:42161",
29
29
  [Chains.Bitcoin]: "btc:mainnet",
30
30
  [Chains.BitcoinCash]: "bch:mainnet",
31
- [Chains.Solana]: "sol:mainnet",
32
31
  [Chains.Dogecoin]: "doge:mainnet",
33
32
  [Chains.XRPL]: "xrp:mainnet",
34
33
  [Chains.Zcash]: "zec:mainnet",
@@ -36,11 +35,9 @@ const caip2Mapping = {
36
35
  [Chains.Berachain]: "eth:80094",
37
36
  [Chains.Tron]: "tron:mainnet",
38
37
  [Chains.Sui]: "sui:mainnet",
39
- [Chains.Aptos]: "aptos:mainnet",
40
38
  [Chains.Movement]: "movement:mainnet",
41
39
  [Chains.Cardano]: "cardano:mainnet",
42
40
  [Chains.Litecoin]: "ltc:mainnet",
43
- [Chains.Starknet]: "starknet:mainnet",
44
41
  [Chains.Aleo]: "aleo:mainnet",
45
42
  [Chains.Dash]: "dash:mainnet",
46
43
  [Chains.Plasma]: "eth:9745"
@@ -55,7 +52,6 @@ const tokenPrefixMapping = {
55
52
  arb: Chains.Arbitrum,
56
53
  btc: Chains.Bitcoin,
57
54
  bch: Chains.BitcoinCash,
58
- sol: Chains.Solana,
59
55
  doge: Chains.Dogecoin,
60
56
  xrp: Chains.XRPL,
61
57
  zec: Chains.Zcash,
@@ -63,11 +59,9 @@ const tokenPrefixMapping = {
63
59
  bera: Chains.Berachain,
64
60
  tron: Chains.Tron,
65
61
  sui: Chains.Sui,
66
- aptos: Chains.Aptos,
67
62
  movement: Chains.Movement,
68
63
  cardano: Chains.Cardano,
69
64
  ltc: Chains.Litecoin,
70
- starknet: Chains.Starknet,
71
65
  aleo: Chains.Aleo,
72
66
  dash: Chains.Dash,
73
67
  plasma: Chains.Plasma
@@ -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_bridge_name_enum = require('../../constants/bridge-name-enum.cjs');
9
9
  const require_compareAddresses = require('../../lib/compareAddresses.cjs');
10
- const require_poa_tokens_routable_through_omni_bridge = require('../../constants/poa-tokens-routable-through-omni-bridge.cjs');
10
+ const require_poa_tokens_migrated_to_omni_bridge = require('../../constants/poa-tokens-migrated-to-omni-bridge.cjs');
11
11
  const require_errors$1 = require('./errors.cjs');
12
12
  const require_poa_bridge_utils = require('./poa-bridge-utils.cjs');
13
13
  let _defuse_protocol_internal_utils = require("@defuse-protocol/internal-utils");
@@ -16,12 +16,11 @@ _isaacs_ttlcache = require_rolldown_runtime.__toESM(_isaacs_ttlcache);
16
16
 
17
17
  //#region src/bridges/poa-bridge/poa-bridge.ts
18
18
  var PoaBridge = class {
19
- constructor({ envConfig, xrplRpcUrls, routeMigratedPoaTokensThroughOmniBridge }) {
19
+ constructor({ envConfig, xrplRpcUrls }) {
20
20
  this.route = require_route_enum.RouteEnum.PoaBridge;
21
21
  this.supportedTokensCache = new _isaacs_ttlcache.default({ ttl: 30 * 1e3 });
22
22
  this.envConfig = envConfig;
23
23
  this.xrplRpcUrls = xrplRpcUrls;
24
- this.routeMigratedPoaTokensThroughOmniBridge = routeMigratedPoaTokensThroughOmniBridge ?? false;
25
24
  }
26
25
  getPoaBridgeBaseURL() {
27
26
  if (!this.envConfig.poaBridgeBaseURL) throw new Error("POA Bridge is not available in this environment: poaBridgeBaseURL is not configured");
@@ -35,13 +34,14 @@ var PoaBridge = class {
35
34
  const assetInfo = this.parseAssetId(params.assetId);
36
35
  const isValid = assetInfo != null;
37
36
  if (!isValid && params.routeConfig != null) throw new require_errors.UnsupportedAssetIdError(params.assetId, "`assetId` does not match `routeConfig`.");
38
- if (this.routeMigratedPoaTokensThroughOmniBridge && assetInfo != null && require_poa_tokens_routable_through_omni_bridge.POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE[assetInfo.contractId] !== void 0 && params.routeConfig === void 0) return false;
37
+ if (assetInfo != null && require_poa_tokens_migrated_to_omni_bridge.POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE[assetInfo.contractId] !== void 0) return false;
39
38
  return isValid;
40
39
  }
41
40
  parseAssetId(assetId) {
42
41
  if (!this.envConfig.poaTokenFactoryContractID) return null;
43
42
  const parsed = require_parse_defuse_asset_id.parseDefuseAssetId(assetId);
44
43
  if (!parsed.contractId.endsWith(`.${this.envConfig.poaTokenFactoryContractID}`)) return null;
44
+ if (require_poa_tokens_migrated_to_omni_bridge.POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE[parsed.contractId] !== void 0) return null;
45
45
  let blockchain;
46
46
  try {
47
47
  blockchain = require_poa_bridge_utils.contractIdToCaip2(parsed.contractId);
@@ -6,7 +6,7 @@ import { parseDefuseAssetId } from "../../lib/parse-defuse-asset-id.js";
6
6
  import { validateAddress } from "../../lib/validateAddress.js";
7
7
  import { BridgeNameEnum } from "../../constants/bridge-name-enum.js";
8
8
  import { compareAddresses } from "../../lib/compareAddresses.js";
9
- import { POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE } from "../../constants/poa-tokens-routable-through-omni-bridge.js";
9
+ import { POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE } from "../../constants/poa-tokens-migrated-to-omni-bridge.js";
10
10
  import { XrplDepositAuthEnabledError, XrplDestinationTagRequiredError } from "./errors.js";
11
11
  import { contractIdToCaip2, createWithdrawIntentPrimitive, toPoaNetwork } from "./poa-bridge-utils.js";
12
12
  import { RpcRequestError, assert, poaBridge, utils, xrpl } from "@defuse-protocol/internal-utils";
@@ -14,12 +14,11 @@ import TTLCache from "@isaacs/ttlcache";
14
14
 
15
15
  //#region src/bridges/poa-bridge/poa-bridge.ts
16
16
  var PoaBridge = class {
17
- constructor({ envConfig, xrplRpcUrls, routeMigratedPoaTokensThroughOmniBridge }) {
17
+ constructor({ envConfig, xrplRpcUrls }) {
18
18
  this.route = RouteEnum.PoaBridge;
19
19
  this.supportedTokensCache = new TTLCache({ ttl: 30 * 1e3 });
20
20
  this.envConfig = envConfig;
21
21
  this.xrplRpcUrls = xrplRpcUrls;
22
- this.routeMigratedPoaTokensThroughOmniBridge = routeMigratedPoaTokensThroughOmniBridge ?? false;
23
22
  }
24
23
  getPoaBridgeBaseURL() {
25
24
  if (!this.envConfig.poaBridgeBaseURL) throw new Error("POA Bridge is not available in this environment: poaBridgeBaseURL is not configured");
@@ -33,13 +32,14 @@ var PoaBridge = class {
33
32
  const assetInfo = this.parseAssetId(params.assetId);
34
33
  const isValid = assetInfo != null;
35
34
  if (!isValid && params.routeConfig != null) throw new UnsupportedAssetIdError(params.assetId, "`assetId` does not match `routeConfig`.");
36
- if (this.routeMigratedPoaTokensThroughOmniBridge && assetInfo != null && POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE[assetInfo.contractId] !== void 0 && params.routeConfig === void 0) return false;
35
+ if (assetInfo != null && POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE[assetInfo.contractId] !== void 0) return false;
37
36
  return isValid;
38
37
  }
39
38
  parseAssetId(assetId) {
40
39
  if (!this.envConfig.poaTokenFactoryContractID) return null;
41
40
  const parsed = parseDefuseAssetId(assetId);
42
41
  if (!parsed.contractId.endsWith(`.${this.envConfig.poaTokenFactoryContractID}`)) return null;
42
+ if (POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE[parsed.contractId] !== void 0) return null;
43
43
  let blockchain;
44
44
  try {
45
45
  blockchain = contractIdToCaip2(parsed.contractId);
@@ -1,13 +1,11 @@
1
1
  const require_rolldown_runtime = require('../../_virtual/rolldown_runtime.cjs');
2
2
  let _omni_bridge_core = require("@omni-bridge/core");
3
3
 
4
- //#region src/constants/poa-tokens-routable-through-omni-bridge.ts
4
+ //#region src/constants/poa-tokens-migrated-to-omni-bridge.ts
5
5
  /**
6
- * These tokens can be routed through either PoA Bridge or Omni Bridge
7
- * depending on the SDK configuration. Use the `routeMigratedPoaTokensThroughOmniBridge`
8
- * feature flag to enable Omni Bridge routing for these tokens.
6
+ * These tokens originaly have been PoA Bridge tokens but have been migrated to Omni bridge.
9
7
  */
10
- const POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE = {
8
+ const POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE = {
11
9
  "sol-57d087fd8c460f612f8701f5499ad8b2eec5ab68.omft.near": _omni_bridge_core.ChainKind.Sol,
12
10
  "sol-c58e6539c2f2e097c251f8edf11f9c03e581f8d4.omft.near": _omni_bridge_core.ChainKind.Sol,
13
11
  "sol-b9c68f94ec8fd160137af8cdfe5e61cd68e2afba.omft.near": _omni_bridge_core.ChainKind.Sol,
@@ -19,8 +17,12 @@ const POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE = {
19
17
  "sol-1f00bb36e75cfc8e1274c1507cc3054f5b3f3ce1.omft.near": _omni_bridge_core.ChainKind.Sol,
20
18
  "sol-c634d063ceff771aff0c972ec396fd915a6bbd0e.omft.near": _omni_bridge_core.ChainKind.Sol,
21
19
  "sol-d600e625449a4d9380eaf5e3265e54c90d34e260.omft.near": _omni_bridge_core.ChainKind.Sol,
22
- "sol.omft.near": _omni_bridge_core.ChainKind.Sol
20
+ "sol.omft.near": _omni_bridge_core.ChainKind.Sol,
21
+ "aptos.omft.near": _omni_bridge_core.ChainKind.Aptos,
22
+ "aptos-34ee497f210c5a511e8d5b53bc56d75b63612bb5.omft.near": _omni_bridge_core.ChainKind.Aptos,
23
+ "aptos-88cb7619440a914fe6400149a12b443c3ac21d59.omft.near": _omni_bridge_core.ChainKind.Aptos,
24
+ "starknet.omft.near": _omni_bridge_core.ChainKind.Strk
23
25
  };
24
26
 
25
27
  //#endregion
26
- exports.POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE = POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE;
28
+ exports.POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE = POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE;
@@ -0,0 +1,10 @@
1
+ import { ChainKind } from "@omni-bridge/core";
2
+
3
+ //#region src/constants/poa-tokens-migrated-to-omni-bridge.d.ts
4
+
5
+ /**
6
+ * These tokens originaly have been PoA Bridge tokens but have been migrated to Omni bridge.
7
+ */
8
+ declare const POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE: Record<string, ChainKind>;
9
+ //#endregion
10
+ export { POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE };
@@ -0,0 +1,10 @@
1
+ import { ChainKind } from "@omni-bridge/core";
2
+
3
+ //#region src/constants/poa-tokens-migrated-to-omni-bridge.d.ts
4
+
5
+ /**
6
+ * These tokens originaly have been PoA Bridge tokens but have been migrated to Omni bridge.
7
+ */
8
+ declare const POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE: Record<string, ChainKind>;
9
+ //#endregion
10
+ export { POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE };
@@ -1,12 +1,10 @@
1
1
  import { ChainKind } from "@omni-bridge/core";
2
2
 
3
- //#region src/constants/poa-tokens-routable-through-omni-bridge.ts
3
+ //#region src/constants/poa-tokens-migrated-to-omni-bridge.ts
4
4
  /**
5
- * These tokens can be routed through either PoA Bridge or Omni Bridge
6
- * depending on the SDK configuration. Use the `routeMigratedPoaTokensThroughOmniBridge`
7
- * feature flag to enable Omni Bridge routing for these tokens.
5
+ * These tokens originaly have been PoA Bridge tokens but have been migrated to Omni bridge.
8
6
  */
9
- const POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE = {
7
+ const POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE = {
10
8
  "sol-57d087fd8c460f612f8701f5499ad8b2eec5ab68.omft.near": ChainKind.Sol,
11
9
  "sol-c58e6539c2f2e097c251f8edf11f9c03e581f8d4.omft.near": ChainKind.Sol,
12
10
  "sol-b9c68f94ec8fd160137af8cdfe5e61cd68e2afba.omft.near": ChainKind.Sol,
@@ -18,8 +16,12 @@ const POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE = {
18
16
  "sol-1f00bb36e75cfc8e1274c1507cc3054f5b3f3ce1.omft.near": ChainKind.Sol,
19
17
  "sol-c634d063ceff771aff0c972ec396fd915a6bbd0e.omft.near": ChainKind.Sol,
20
18
  "sol-d600e625449a4d9380eaf5e3265e54c90d34e260.omft.near": ChainKind.Sol,
21
- "sol.omft.near": ChainKind.Sol
19
+ "sol.omft.near": ChainKind.Sol,
20
+ "aptos.omft.near": ChainKind.Aptos,
21
+ "aptos-34ee497f210c5a511e8d5b53bc56d75b63612bb5.omft.near": ChainKind.Aptos,
22
+ "aptos-88cb7619440a914fe6400149a12b443c3ac21d59.omft.near": ChainKind.Aptos,
23
+ "starknet.omft.near": ChainKind.Strk
22
24
  };
23
25
 
24
26
  //#endregion
25
- export { POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE };
27
+ export { POA_TOKENS_MIGRATED_TO_OMNI_BRIDGE };
package/dist/src/sdk.cjs CHANGED
@@ -53,8 +53,7 @@ var IntentsSDK = class {
53
53
  }),
54
54
  new require_poa_bridge.PoaBridge({
55
55
  envConfig: this.envConfig,
56
- xrplRpcUrls,
57
- routeMigratedPoaTokensThroughOmniBridge: args.features?.routeMigratedPoaTokensThroughOmniBridge
56
+ xrplRpcUrls
58
57
  }),
59
58
  new require_hot_bridge.HotBridge({
60
59
  envConfig: this.envConfig,
@@ -75,7 +74,6 @@ var IntentsSDK = class {
75
74
  envConfig: this.envConfig,
76
75
  nearProvider,
77
76
  solverRelayApiKey: this.solverRelayApiKey,
78
- routeMigratedPoaTokensThroughOmniBridge: args.features?.routeMigratedPoaTokensThroughOmniBridge,
79
77
  bridgeConfig: args.bridgeConfigs?.[require_route_enum.RouteEnum.OmniBridge]
80
78
  }),
81
79
  new require_direct_bridge.DirectBridge({
@@ -38,13 +38,6 @@ interface IntentsSDKConfig {
38
38
  referral: string;
39
39
  solverRelayApiKey?: string;
40
40
  hotBridgeApiKey?: string;
41
- features?: {
42
- /**
43
- * Route migrated POA tokens (*.omft.near) through Omni Bridge.
44
- * Enable this to use Omni Bridge for POA tokens that have been migrated to the Omni infrastructure.
45
- */
46
- routeMigratedPoaTokensThroughOmniBridge?: boolean;
47
- };
48
41
  bridgeConfigs?: BridgeConfigs;
49
42
  }
50
43
  declare class IntentsSDK implements IIntentsSDK {
package/dist/src/sdk.d.ts CHANGED
@@ -38,13 +38,6 @@ interface IntentsSDKConfig {
38
38
  referral: string;
39
39
  solverRelayApiKey?: string;
40
40
  hotBridgeApiKey?: string;
41
- features?: {
42
- /**
43
- * Route migrated POA tokens (*.omft.near) through Omni Bridge.
44
- * Enable this to use Omni Bridge for POA tokens that have been migrated to the Omni infrastructure.
45
- */
46
- routeMigratedPoaTokensThroughOmniBridge?: boolean;
47
- };
48
41
  bridgeConfigs?: BridgeConfigs;
49
42
  }
50
43
  declare class IntentsSDK implements IIntentsSDK {
package/dist/src/sdk.js CHANGED
@@ -51,8 +51,7 @@ var IntentsSDK = class {
51
51
  }),
52
52
  new PoaBridge({
53
53
  envConfig: this.envConfig,
54
- xrplRpcUrls,
55
- routeMigratedPoaTokensThroughOmniBridge: args.features?.routeMigratedPoaTokensThroughOmniBridge
54
+ xrplRpcUrls
56
55
  }),
57
56
  new HotBridge$1({
58
57
  envConfig: this.envConfig,
@@ -73,7 +72,6 @@ var IntentsSDK = class {
73
72
  envConfig: this.envConfig,
74
73
  nearProvider,
75
74
  solverRelayApiKey: this.solverRelayApiKey,
76
- routeMigratedPoaTokensThroughOmniBridge: args.features?.routeMigratedPoaTokensThroughOmniBridge,
77
75
  bridgeConfig: args.bridgeConfigs?.[RouteEnum.OmniBridge]
78
76
  }),
79
77
  new DirectBridge({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defuse-protocol/intents-sdk",
3
- "version": "0.79.0",
3
+ "version": "0.80.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "repository": {
@@ -38,8 +38,8 @@
38
38
  "@hot-labs/omni-sdk": "2.25.5",
39
39
  "@isaacs/ttlcache": "^1.0.0",
40
40
  "@lifeomic/attempt": "^3.0.0",
41
- "@omni-bridge/core": "0.17.0",
42
- "@omni-bridge/near": "0.17.0",
41
+ "@omni-bridge/core": "0.18.0",
42
+ "@omni-bridge/near": "0.18.0",
43
43
  "@noble/hashes": "^1.7.1",
44
44
  "@scure/base": "^1.0.0",
45
45
  "borsher": "^4.0.0",
@@ -1,12 +0,0 @@
1
- import { ChainKind } from "@omni-bridge/core";
2
-
3
- //#region src/constants/poa-tokens-routable-through-omni-bridge.d.ts
4
-
5
- /**
6
- * These tokens can be routed through either PoA Bridge or Omni Bridge
7
- * depending on the SDK configuration. Use the `routeMigratedPoaTokensThroughOmniBridge`
8
- * feature flag to enable Omni Bridge routing for these tokens.
9
- */
10
- declare const POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE: Record<string, ChainKind>;
11
- //#endregion
12
- export { POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE };
@@ -1,12 +0,0 @@
1
- import { ChainKind } from "@omni-bridge/core";
2
-
3
- //#region src/constants/poa-tokens-routable-through-omni-bridge.d.ts
4
-
5
- /**
6
- * These tokens can be routed through either PoA Bridge or Omni Bridge
7
- * depending on the SDK configuration. Use the `routeMigratedPoaTokensThroughOmniBridge`
8
- * feature flag to enable Omni Bridge routing for these tokens.
9
- */
10
- declare const POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE: Record<string, ChainKind>;
11
- //#endregion
12
- export { POA_TOKENS_ROUTABLE_THROUGH_OMNI_BRIDGE };