@sodax/sdk 2.0.0-rc.2 → 2.0.0-rc.4

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.
Files changed (57) hide show
  1. package/README.md +8 -60
  2. package/dist/index.cjs +28 -39
  3. package/dist/index.d.cts +21 -108
  4. package/dist/index.d.ts +21 -108
  5. package/dist/index.mjs +34 -43
  6. package/package.json +22 -21
  7. package/ai-exported/AGENTS.md +0 -99
  8. package/ai-exported/integration/README.md +0 -41
  9. package/ai-exported/integration/ai-rules.md +0 -75
  10. package/ai-exported/integration/architecture.md +0 -519
  11. package/ai-exported/integration/chain-specifics.md +0 -189
  12. package/ai-exported/integration/features/README.md +0 -19
  13. package/ai-exported/integration/features/auxiliary-services.md +0 -189
  14. package/ai-exported/integration/features/bridge.md +0 -136
  15. package/ai-exported/integration/features/dex.md +0 -182
  16. package/ai-exported/integration/features/icx-bnusd-baln.md +0 -181
  17. package/ai-exported/integration/features/money-market.md +0 -198
  18. package/ai-exported/integration/features/staking.md +0 -166
  19. package/ai-exported/integration/features/swap.md +0 -207
  20. package/ai-exported/integration/quickstart.md +0 -213
  21. package/ai-exported/integration/recipes/README.md +0 -21
  22. package/ai-exported/integration/recipes/backend-server-init.md +0 -69
  23. package/ai-exported/integration/recipes/chain-key-narrowing.md +0 -65
  24. package/ai-exported/integration/recipes/gas-estimation.md +0 -33
  25. package/ai-exported/integration/recipes/initialize-sodax.md +0 -53
  26. package/ai-exported/integration/recipes/raw-tx-flow.md +0 -71
  27. package/ai-exported/integration/recipes/result-and-errors.md +0 -104
  28. package/ai-exported/integration/recipes/signed-tx-flow.md +0 -46
  29. package/ai-exported/integration/recipes/testing.md +0 -101
  30. package/ai-exported/integration/reference/README.md +0 -18
  31. package/ai-exported/integration/reference/chain-keys.md +0 -67
  32. package/ai-exported/integration/reference/error-codes.md +0 -165
  33. package/ai-exported/integration/reference/glossary.md +0 -32
  34. package/ai-exported/integration/reference/public-api.md +0 -138
  35. package/ai-exported/integration/reference/wallet-providers.md +0 -62
  36. package/ai-exported/migration/README.md +0 -58
  37. package/ai-exported/migration/ai-rules.md +0 -80
  38. package/ai-exported/migration/breaking-changes/architecture.md +0 -342
  39. package/ai-exported/migration/breaking-changes/result-and-errors.md +0 -363
  40. package/ai-exported/migration/breaking-changes/type-system.md +0 -321
  41. package/ai-exported/migration/checklist.md +0 -61
  42. package/ai-exported/migration/features/README.md +0 -35
  43. package/ai-exported/migration/features/auxiliary-services.md +0 -156
  44. package/ai-exported/migration/features/bridge.md +0 -125
  45. package/ai-exported/migration/features/dex.md +0 -143
  46. package/ai-exported/migration/features/icx-bnusd-baln.md +0 -151
  47. package/ai-exported/migration/features/money-market.md +0 -214
  48. package/ai-exported/migration/features/staking.md +0 -138
  49. package/ai-exported/migration/features/swap.md +0 -198
  50. package/ai-exported/migration/recipes.md +0 -288
  51. package/ai-exported/migration/reference/README.md +0 -18
  52. package/ai-exported/migration/reference/deleted-exports.md +0 -126
  53. package/ai-exported/migration/reference/error-code-crosswalk.md +0 -104
  54. package/ai-exported/migration/reference/return-shapes.md +0 -49
  55. package/ai-exported/migration/reference/sodax-config.md +0 -52
  56. package/dist/index.cjs.map +0 -1
  57. package/dist/index.mjs.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,19 +1,20 @@
1
- import { IConfigApi, ApiConfig, Result, SubmitSwapTxRequest, SubmitSwapTxResponse, GetSubmitSwapTxStatusParams, SubmitSwapTxStatusResponse, Address, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, SpokeChainKey, GetSwapTokensByChainIdApiResponse, GetMoneyMarketTokensApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, SodaxConfig, XToken, OriginalAssetAddress, IntentRelayChainId, HubChainKey, HubConfig, PoolKey, SpokeChainConfig, RelayConfig, SolverConfig, SwapsConfig, BridgeConfig, MoneyMarketConfig, DexConfig, GetSpokeChainConfigType, EvmContractCall, Hex, IEvmWalletProvider, EvmRawTransactionReceipt, PartnerFee, QuoteType, EvmChainKey, DeepPartial, WalletProviderSlot, TxReturnType, ChainType, GetChainType, SolanaRawTransactionReceipt, StellarSorobanTransactionReceipt, IconTransactionResult, SuiRawTransactionReceipt, InjectiveRawTransactionReceipt, NearRawTransactionReceipt, StacksRawTransactionReceipt, BitcoinRawTransactionReceipt, GetAddressType, HubAddress, GetTokenAddressType, EvmSpokeOnlyChainKey, StellarChainKey, SonicChainKey, AssetInfo, TokenInfo, VaultReserves, StacksChainKey, FeeEstimateTransaction, StacksTransactionParams, RadfiConfig, IBitcoinWalletProvider, RadfiDepositTxResponse, BtcAddressType, BitcoinChainKey, HttpUrl, NearChainKey, FillData, NearRawTransaction, SuiPaginatedCoins, SuiChainKey, SuiExecutionResult, SuiGasEstimate, IStellarWalletProvider, StellarGasEstimate, SolanaChainKey, SolanaGasEstimate, SolanaBase58PublicKey, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaRpcResponseAndContext, SolanaTokenAmount, IconChainKey, IconGasEstimate, IconAddress, InjectiveChainKey, InjectiveGasEstimate, JsonObject, InjectiveRawTransaction, IInjectiveWalletProvider, InjectiveExecuteResponse, GetEstimateGasReturnType, EvmSpokeChainConfig, PartnerFeeAmount, PartnerFeePercentage, IWalletProvider, GetWalletProviderType, SolverIntentQuoteRequest, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentStatusRequest, SolverIntentStatusResponse, SolverExecutionRequest, SolverExecutionResponse, SpokeExecActionParams, FeeAmount, Hash as Hash$1, IcxTokenType, IconEoaAddress, IconContractAddress, BridgeLimit, UserUnstakeInfo, ConcentratedLiquidityConfig } from '@sodax/types';
1
+ import { IConfigApi, ApiConfig, Result, SubmitSwapTxRequest, SubmitSwapTxResponse, GetSubmitSwapTxStatusParams, SubmitSwapTxStatusResponse, Address, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, SpokeChainKey, GetSwapTokensByChainIdApiResponse, GetMoneyMarketTokensApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, SodaxConfig, XToken, OriginalAssetAddress, IntentRelayChainId, HubChainKey, HubConfig, PoolKey, SpokeChainConfig, RelayConfig, SolverConfig, SwapsConfig, BridgeConfig, MoneyMarketConfig, DexConfig, GetSpokeChainConfigType, EvmContractCall, Hex, IEvmWalletProvider, EvmRawTransactionReceipt, PartnerFee, QuoteType, EvmChainKey, DeepPartial, WalletProviderSlot, TxReturnType, ChainType, GetChainType, SolanaRawTransactionReceipt, StellarSorobanTransactionReceipt, IconTransactionResult, SuiRawTransactionReceipt, InjectiveRawTransactionReceipt, NearRawTransactionReceipt, StacksRawTransactionReceipt, BitcoinRawTransactionReceipt, GetAddressType, HubAddress, GetTokenAddressType, EvmSpokeOnlyChainKey, StellarChainKey, SonicChainKey, AssetInfo, TokenInfo, VaultReserves, StacksChainKey, FeeEstimateTransaction, StacksTransactionParams, RadfiConfig, IBitcoinWalletProvider, RadfiDepositTxResponse, BtcAddressType, BitcoinChainKey, HttpUrl, NearChainKey, FillData, NearRawTransaction, SuiPaginatedCoins, SuiChainKey, SuiExecutionResult, SuiGasEstimate, IStellarWalletProvider, StellarGasEstimate, SolanaChainKey, SolanaGasEstimate, SolanaBase58PublicKey, SolanaRawTransactionInstruction, SolanaSerializedTransaction, SolanaRpcResponseAndContext, SolanaTokenAmount, IconChainKey, IconGasEstimate, InjectiveChainKey, InjectiveGasEstimate, JsonObject, InjectiveRawTransaction, IInjectiveWalletProvider, InjectiveExecuteResponse, GetEstimateGasReturnType, IconAddress, EvmSpokeChainConfig, PartnerFeeAmount, PartnerFeePercentage, IWalletProvider, GetWalletProviderType, SolverIntentQuoteRequest, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentStatusRequest, SolverIntentStatusResponse, SolverExecutionRequest, SolverExecutionResponse, SpokeExecActionParams, FeeAmount, Hash as Hash$1, IcxTokenType, IconEoaAddress, IconContractAddress, BridgeLimit, UserUnstakeInfo, ConcentratedLiquidityConfig } from '@sodax/types';
2
2
  export * from '@sodax/types';
3
3
  import * as viem from 'viem';
4
4
  import { Hex as Hex$1, Chain, Address as Address$1, PublicClient, HttpTransport, Hash, GetLogsReturnType } from 'viem';
5
5
  import { ClarityValue } from '@stacks/transactions';
6
6
  import { StacksNetwork } from '@stacks/network';
7
- import * as bitcoin from 'bitcoinjs-lib';
7
+ import { networks, Psbt } from 'bitcoinjs-lib';
8
8
  import { JsonRpcProvider } from 'near-api-js';
9
9
  import { Transaction, TransactionResult } from '@mysten/sui/transactions';
10
10
  import { SuiClient } from '@mysten/sui/client';
11
- import { rpc, Transaction as Transaction$1, Memo, MemoType, Operation, FeeBumpTransaction, Horizon, Account, xdr, Address as Address$2 } from '@stellar/stellar-sdk';
11
+ import { rpc, Transaction as Transaction$1, Memo, MemoType, Operation, FeeBumpTransaction, Horizon, Account, xdr } from '@stellar/stellar-sdk';
12
12
  import { Connection as Connection$1, TransactionInstruction, PublicKey } from '@solana/web3.js';
13
13
  import { IconService } from 'icon-sdk-js';
14
14
  import { ChainGrpcWasmApi, TxGrpcApi } from '@injectivelabs/sdk-ts';
15
15
  import { NetworkEndpoints } from '@injectivelabs/networks';
16
- import * as anchor from '@coral-xyz/anchor';
16
+ import * as _coral_xyz_anchor from '@coral-xyz/anchor';
17
+ import { AnchorProvider, Program } from '@coral-xyz/anchor';
17
18
  import { Price, Token } from '@pancakeswap/swap-sdk-core';
18
19
  import BigNumber$1 from 'bignumber.js';
19
20
 
@@ -8227,22 +8228,6 @@ type IntentState = {
8227
8228
  pendingPayment: boolean;
8228
8229
  };
8229
8230
 
8230
- type SonicSpokeDepositParams<Raw extends boolean> = {
8231
- srcAddress: Address$1;
8232
- srcChainKey: SonicChainKey;
8233
- to: HubAddress;
8234
- token: Address$1;
8235
- amount: bigint;
8236
- data: Hex;
8237
- } & WalletProviderSlot<SonicChainKey, Raw>;
8238
- type SonicDepositParams = {
8239
- srcAddress: Address$1;
8240
- srcChainKey: SonicChainKey;
8241
- to: HubAddress;
8242
- token: Address$1;
8243
- amount: bigint;
8244
- data: Hex;
8245
- };
8246
8231
  type WithdrawInfo = {
8247
8232
  aTokenAddress: Address$1;
8248
8233
  aTokenAmount: bigint;
@@ -8267,12 +8252,6 @@ type CreateSonicSwapIntentParams<Raw extends boolean> = {
8267
8252
  chainConfig: HubConfig;
8268
8253
  };
8269
8254
  } & WalletProviderSlot<SonicChainKey, Raw>;
8270
- type ApproveSonicWithdrawParams<Raw extends boolean> = {
8271
- srcAddress: Address$1;
8272
- srcChainKey: SonicChainKey;
8273
- from: Address$1;
8274
- withdrawInfo: WithdrawInfo;
8275
- } & WalletProviderSlot<SonicChainKey, Raw>;
8276
8255
  declare class SonicSpokeService {
8277
8256
  private readonly config;
8278
8257
  readonly publicClient: PublicClient<HttpTransport>;
@@ -8316,7 +8295,7 @@ declare class SonicSpokeService {
8316
8295
  getUserRouter(params: GetUserRouterParams): Promise<HubAddress>;
8317
8296
  /**
8318
8297
  * Deposit tokens to the spoke chain using the Sonic wallet abstraction.
8319
- * @param {SonicSpokeDepositParams<Raw>} params - The parameters for the deposit
8298
+ * @param {DepositParams<SonicChainKey, Raw>} params - The parameters for the deposit
8320
8299
  * @returns {Promise<TxReturnType<SonicChainKey, Raw>>} A promise that resolves to the transaction hash
8321
8300
  */
8322
8301
  deposit<Raw extends boolean>(params: DepositParams<SonicChainKey, Raw>): Promise<TxReturnType<SonicChainKey, Raw>>;
@@ -8835,23 +8814,6 @@ declare function encodeBtcPayloadToBytes(payload: BtcPayload): string;
8835
8814
  */
8836
8815
  declare function normalizePsbtToBase64(signedPsbt: string): string;
8837
8816
 
8838
- type BitcoinSpokeDepositParams = {
8839
- srcChainKey: BitcoinChainKey;
8840
- srcAddress: GetAddressType<BitcoinChainKey>;
8841
- to: HubAddress;
8842
- token: string;
8843
- amount: bigint;
8844
- data: Hex;
8845
- accessToken?: string;
8846
- };
8847
- type BitcoinTransferToHubParams = {
8848
- srcChainKey: BitcoinChainKey;
8849
- srcAddress: GetAddressType<BitcoinChainKey>;
8850
- token: string;
8851
- amount: bigint;
8852
- data?: Hex;
8853
- accessToken?: string;
8854
- };
8855
8817
  type BitcoinUTXO = {
8856
8818
  txid: string;
8857
8819
  vout: number;
@@ -8881,7 +8843,7 @@ declare class BitcoinSpokeService {
8881
8843
  private readonly pollingIntervalMs;
8882
8844
  private readonly maxTimeoutMs;
8883
8845
  constructor(config: ConfigService);
8884
- getBtcNetwork(chainId: BitcoinChainKey): bitcoin.networks.Network;
8846
+ getBtcNetwork(chainId: BitcoinChainKey): networks.Network;
8885
8847
  getBalance(tokenAddress: string, walletAddress: string): Promise<bigint>;
8886
8848
  fetchScriptPubKey(utxo: BitcoinUTXO): Promise<string>;
8887
8849
  /**
@@ -8944,7 +8906,7 @@ declare class BitcoinSpokeService {
8944
8906
  buildBitcoinTransaction(utxos: BitcoinUTXO[], outputs: Array<{
8945
8907
  address: string;
8946
8908
  value: number;
8947
- }>, changeAddress: string, chainId: BitcoinChainKey, walletProvider: IBitcoinWalletProvider, feeRate?: number): Promise<bitcoin.Psbt>;
8909
+ }>, changeAddress: string, chainId: BitcoinChainKey, walletProvider: IBitcoinWalletProvider, feeRate?: number): Promise<Psbt>;
8948
8910
  /**
8949
8911
  * Deposit operation - transfer BTC to the asset manager
8950
8912
  */
@@ -8954,7 +8916,7 @@ declare class BitcoinSpokeService {
8954
8916
  /**
8955
8917
  * Build deposit PSBT with embedded cross-chain data
8956
8918
  */
8957
- buildDepositPsbt(walletAddress: string, walletProvider: IBitcoinWalletProvider, srcChainKey: BitcoinChainKey, token: string, amount: bigint, data: string, utxos: BitcoinUTXO[]): Promise<bitcoin.Psbt>;
8919
+ buildDepositPsbt(walletAddress: string, walletProvider: IBitcoinWalletProvider, srcChainKey: BitcoinChainKey, token: string, amount: bigint, data: string, utxos: BitcoinUTXO[]): Promise<Psbt>;
8958
8920
  /**
8959
8921
  * Fetch UTXOs for an address
8960
8922
  */
@@ -8969,7 +8931,7 @@ declare class BitcoinSpokeService {
8969
8931
  /**
8970
8932
  * Sign and broadcast a Bitcoin transaction
8971
8933
  */
8972
- signAndBroadcastTransaction(psbt: bitcoin.Psbt | string, walletProvider: IBitcoinWalletProvider): Promise<string>;
8934
+ signAndBroadcastTransaction(psbt: Psbt | string, walletProvider: IBitcoinWalletProvider): Promise<string>;
8973
8935
  /**
8974
8936
  * Broadcast a signed transaction
8975
8937
  */
@@ -9128,7 +9090,6 @@ declare class SuiSpokeService {
9128
9090
  stateId: string;
9129
9091
  };
9130
9092
  getNativeCoin(tx: Transaction, amount: bigint): Promise<SuiNativeCoinResult>;
9131
- static getAddressBCSBytes(suiaddress: string): Hex;
9132
9093
  encodeSimulationParams(token: string, assetManager: string): {
9133
9094
  encodedToken: Hex;
9134
9095
  encodedSrcAddress: Hex;
@@ -9151,20 +9112,19 @@ declare class SuiSpokeService {
9151
9112
  estimateGas({ tx }: EstimateGasParams<SuiChainKey>): Promise<SuiGasEstimate>;
9152
9113
  /**
9153
9114
  * Get the balance of the token in the spoke chain.
9154
- * @param {Address} token - The address of the token to get the balance of.
9155
- * @param {SuiSpokeProvider} spokeProvider - The spoke provider.
9115
+ * @param {GetDepositParams<SuiChainKey>} params - The src chain key, src address, and token address.
9156
9116
  * @returns {Promise<bigint>} The balance of the token.
9157
9117
  */
9158
9118
  getDeposit(params: GetDepositParams<SuiChainKey>): Promise<bigint>;
9159
9119
  /**
9160
9120
  * Fetch the asset manager config from the spoke chain.
9161
- * @param {SuiBaseSpokeProvider} suiSpokeProvider - The spoke provider.
9121
+ * @param {SuiChainKey} chainId - The Sui chain key.
9162
9122
  * @returns {Promise<string>} The asset manager config.
9163
9123
  */
9164
9124
  fetchAssetManagerAddress(chainId: SuiChainKey): Promise<string>;
9165
9125
  /**
9166
9126
  * Fetch the latest asset manager package id from the spoke chain.
9167
- * @param {SuiBaseSpokeProvider} suiSpokeProvider - The spoke provider.
9127
+ * @param {SuiChainKey} chainId - The Sui chain key.
9168
9128
  * @returns {Promise<string>} The latest asset manager package id.
9169
9129
  */
9170
9130
  fetchLatestAssetManagerPackageId(chainId: SuiChainKey): Promise<string>;
@@ -9196,19 +9156,6 @@ declare class CustomStellarAccount {
9196
9156
  decrementSequenceNumber(): void;
9197
9157
  resetSequenceNumber(): void;
9198
9158
  }
9199
- type StellarSpokeDepositParams = {
9200
- from: Hex$1;
9201
- to?: HubAddress;
9202
- token: string;
9203
- amount: bigint;
9204
- data: Hex$1;
9205
- };
9206
- type StellarTransferToHubParams = {
9207
- token: string;
9208
- recipient: Address$2;
9209
- amount: bigint;
9210
- data: Hex$1;
9211
- };
9212
9159
  type RequestTrustlineParams<S extends StellarChainKey, Raw extends boolean> = {
9213
9160
  srcAddress: string;
9214
9161
  srcChainKey: S;
@@ -9277,19 +9224,6 @@ declare class StellarSpokeService {
9277
9224
  waitForTransactionReceipt(params: WaitForTxReceiptParams<StellarChainKey>): Promise<Result<WaitForTxReceiptReturnType<StellarChainKey>>>;
9278
9225
  }
9279
9226
 
9280
- type SolanaSpokeDepositParams = {
9281
- from: SolanaBase58PublicKey;
9282
- to?: HubAddress;
9283
- token: SolanaBase58PublicKey;
9284
- amount: bigint;
9285
- data: Hex$1;
9286
- };
9287
- type SolanaTransferToHubParams = {
9288
- token: PublicKey;
9289
- recipient: string;
9290
- amount: string;
9291
- data: Hex$1;
9292
- };
9293
9227
  declare class SolanaSpokeService {
9294
9228
  private readonly config;
9295
9229
  private readonly rpcUrl;
@@ -9329,27 +9263,6 @@ declare class SolanaSpokeService {
9329
9263
  static buildTransactionInstruction(rawInstructions: SolanaRawTransactionInstruction[]): TransactionInstruction[];
9330
9264
  }
9331
9265
 
9332
- type IconSpokeDepositParams = {
9333
- from: IconAddress;
9334
- srcChainKey: IconChainKey;
9335
- to?: HubAddress;
9336
- token: string;
9337
- amount: bigint;
9338
- data: Hex;
9339
- };
9340
- type IconTransferToHubParams = {
9341
- token: string;
9342
- recipient: Address;
9343
- amount: bigint;
9344
- data: Hex;
9345
- };
9346
- type IconCallParams<Raw extends boolean> = {
9347
- srcChainKey: IconChainKey;
9348
- srcAddress: GetAddressType<IconChainKey>;
9349
- dstChainKey: HubChainKey;
9350
- dstAddress: HubAddress;
9351
- payload: Hex;
9352
- } & WalletProviderSlot<IconChainKey, Raw>;
9353
9266
  declare class IconSpokeService {
9354
9267
  private readonly config;
9355
9268
  readonly iconService: IconService;
@@ -9360,7 +9273,7 @@ declare class IconSpokeService {
9360
9273
  estimateGas({ tx }: EstimateGasParams<IconChainKey>): Promise<IconGasEstimate>;
9361
9274
  /**
9362
9275
  * Deposit tokens to the spoke chain.
9363
- * @param {IconSpokeDepositParams} params - The parameters for the deposit
9276
+ * @param {DepositParams<IconChainKey, R>} params - The parameters for the deposit
9364
9277
  * @param {IconSpokeProviderType} spokeProvider - The provider for the spoke chain
9365
9278
  * @param {EvmHubProvider} hubProvider - The provider for the hub chain
9366
9279
  * @param {boolean} raw - The return type raw or just transaction hash
@@ -11545,11 +11458,11 @@ type Connection = {
11545
11458
  ];
11546
11459
  };
11547
11460
 
11548
- declare function getProvider(base58PublicKey: string, rpcUrl: string): Promise<anchor.AnchorProvider>;
11549
- declare function getAssetManagerIdl(assetManager: string, provider: anchor.AnchorProvider): Promise<anchor.Idl>;
11550
- declare function getConnectionIdl(connection: string, provider: anchor.AnchorProvider): Promise<anchor.Idl>;
11551
- declare function getAssetManagerProgram(base58PublicKey: string, rpcUrl: string, assetManager: string): Promise<anchor.Program<AssetManager>>;
11552
- declare function getConnectionProgram(base58PublicKey: string, rpcUrl: string, connection: string): Promise<anchor.Program<Connection>>;
11461
+ declare function getProvider(base58PublicKey: string, rpcUrl: string): Promise<AnchorProvider>;
11462
+ declare function getAssetManagerIdl(assetManager: string, provider: AnchorProvider): Promise<_coral_xyz_anchor.Idl>;
11463
+ declare function getConnectionIdl(connection: string, provider: AnchorProvider): Promise<_coral_xyz_anchor.Idl>;
11464
+ declare function getAssetManagerProgram(base58PublicKey: string, rpcUrl: string, assetManager: string): Promise<Program<AssetManager>>;
11465
+ declare function getConnectionProgram(base58PublicKey: string, rpcUrl: string, connection: string): Promise<Program<Connection>>;
11553
11466
  declare function getSolanaAddressBytes(address: PublicKey): Hex$1;
11554
11467
  declare function hexToSolanaAddress(hex: Hex$1): PublicKey;
11555
11468
  declare function isSolanaNativeToken(address: PublicKey): boolean;
@@ -12930,7 +12843,7 @@ declare class BridgeService {
12930
12843
  * checking theoretical bridgeability without requiring both chains to be in the active config.
12931
12844
  * @returns `true` if the tokens share the same hub vault; `false` otherwise.
12932
12845
  */
12933
- isBridgeable({ from, to, unchecked, }: {
12846
+ isBridgeable({ from, to, unchecked }: {
12934
12847
  from: XToken;
12935
12848
  to: XToken;
12936
12849
  unchecked?: boolean;
@@ -16476,4 +16389,4 @@ type DexErrorCode = LookupErrorCode;
16476
16389
  type DexError = SodaxError<DexErrorCode>;
16477
16390
  declare const isDexError: (e: unknown) => e is SodaxError<LookupErrorCode>;
16478
16391
 
16479
- export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type ApiResponse, type ApproveErrorCode, type ApproveSonicWithdrawParams, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, type BitcoinSpokeDepositParams, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinTransferToHubParams, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApproveParams, type Erc20IsAllowanceParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, HttpRelayError, type HubAssetBalance, type HubProvider, type IconCallParams, type IconJsonRpcVersion, type IconSpokeDepositParams, IconSpokeService, type IconTransferToHubParams, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NearSpokeService, type OnDemandBtcPayload, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxFeature, type SodaxPhase, type SolanaSpokeDepositParams, SolanaSpokeService, type SolanaTransferToHubParams, SolverApiService, type SonicDepositParams, type SonicSpokeDepositParams, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, type StellarSpokeDepositParams, StellarSpokeService, type StellarTransferToHubParams, type SubmitTxParams, type SubmitTxResponse, type SuiNativeCoinResult, SuiSpokeService, type SuiTxObject, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapResponse, SwapService, type SwapServiceConstructorParams, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, connectionAbi, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSubmitSwapTxResponse, isSubmitSwapTxStatusResponse, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, lookupFailed, mapRelayFailure, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, normalize, normalizeBN, normalizePsbtToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, reverseEncodeAddress, serializeAddressData, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
16392
+ export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, type AggregatedReserveData, type AllowanceCheckErrorCode, type AllowanceInfo, type AllowanceResponse, type AllowanceTransferDetails, type ApiResponse, type ApproveErrorCode, type ApyRange, type AssetDepositAction, type AssetEntry, AssetService, type AssetServiceConstructorParams, type AssetWithdrawAction, type AutoSwapPreferences, BackendApiService, type BalnLockParams, type BalnMigrateAction, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, BitcoinSpokeService, type BitcoinTransactionResult, type BitcoinUTXO, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeAction, type BridgeAllowanceCheckError, type BridgeAllowanceCheckErrorCode, type BridgeApproveError, type BridgeApproveErrorCode, type BridgeCreateIntentError, type BridgeCreateIntentErrorCode, type BridgeError, type BridgeErrorCode, type BridgeLookupError, type BridgeLookupErrorCode, type BridgeOrchestrationError, type BridgeOrchestrationErrorCode, type BridgeParams, BridgeService, type BridgeServiceConstructorParams, type BtcPayload, CREATE_INTENT_CODES, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CallResponse, type CancelIntentActionParams, type CancelIntentParams, type CancelUnstakeAction, type CancelUnstakeParams, type ClClaimRewardsParams, type ClDecreaseLiquidityParams, type ClGetPoolDataParams, type ClIncreaseLiquidityParams, type ClLiquidityClaimRewardsAction, type ClLiquidityDecreaseLiquidityAction, type ClLiquidityIncreaseLiquidityAction, type ClLiquidityWithdrawAction, type ClMintPositionEventLog, type ClPositionInfo, ClService, type ClServiceConstructorParams, type ClSupplyAction, type ClSupplyParams, type ClWithdrawParams, type ClaimAction, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, type ConcentratedLiquidityParams, type ConcentratedLiquidityTokenInfo, ConfigService, type ConfigServiceConstructorParams, type ConnMsg, type CreateAssetDepositParams, type CreateAssetWithdrawParams, type CreateBridgeIntentParams, type CreateIntentErrorCode, type CreateIntentParams, type CreateIntentResult, type CreateLimitOrderParams, type CreateSonicSwapIntentParams, type CreateViemPublicClientParams, CustomSorobanServer, CustomStellarAccount, type DepositParams, type DepositSimulationParams, type DestinationParamsType, type DetailedLock, type DexError, type DexErrorCode, DexService, type DexServiceConstructorParams, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, type EnrichedToken, type Erc20ApproveParams, type Erc20IsAllowanceParams, Erc20Service, type Erc20Token, Erc4626Service, type EstimateGasParams, EvmAssetManagerService, type EvmDepositToDataParams, EvmHubProvider, type EvmHubProviderConstructorParams, EvmSolverService, EvmSpokeService, EvmVaultTokenService, type EvmWithdrawAssetDataParams, type ExecuteMsg, type FeatureInvariant, type FeeData, type FeeTokenApproveAction, type FeeTokenApproveParams, type FetchHubAssetBalancesParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, GAS_ESTIMATION_CODES, type GasEstimationErrorCode, type GetDepositParams, type GetIntentSubmitTxExtraDataParams, type GetPacketParams, type GetPacketResponse, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeServiceType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, type GetTxReceiptType, type GetUserRouterParams, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, HttpRelayError, type HubAssetBalance, type HubProvider, type IconJsonRpcVersion, IconSpokeService, type IcxCreateRevertMigrationParams, type IcxMigrateAction, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRevertMigrationAction, type IcxRevertMigrationParams, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, type InjectiveBalance, InjectiveSpokeService, type InstantUnstakeAction, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapResult, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentData, IntentDataType, type IntentDeliveryInfo, IntentFilledEventAbi, type IntentFilledEventLog, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentTxResult, IntentsAbi, type JsonRpcPayloadResponse, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, type LendingPoolServiceConstructorParams, type LimitOrderActionParams, LockupMultiplier, LockupPeriod, type LookupErrorCode, type MapRelayFailureCtx, type MigrateOrchestrationError, type MigrateOrchestrationErrorCode, type MigrationAction, type MigrationAllowanceCheckError, type MigrationAllowanceCheckErrorCode, type MigrationApproveError, type MigrationApproveErrorCode, type MigrationCreateIntentError, type MigrationCreateIntentErrorCode, type MigrationDirection, type MigrationError, type MigrationErrorCode, type MigrationLookupError, type MigrationLookupErrorCode, type MigrationOp, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConstructorParams, type MigrationTokens, MintPositionEventAbi, type MintPositionEventLog, type MoneyMarketAction, type MoneyMarketAllowanceCheckError, type MoneyMarketAllowanceCheckErrorCode, type MoneyMarketAllowanceParams, type MoneyMarketApproveActionParams, type MoneyMarketApproveError, type MoneyMarketApproveErrorCode, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowActionParams, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketCreateIntentError, type MoneyMarketCreateIntentErrorCode, MoneyMarketDataService, type MoneyMarketDataServiceConstructorParams, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketGasEstimationError, type MoneyMarketGasEstimationErrorCode, type MoneyMarketOrchestrationError, type MoneyMarketOrchestrationErrorCode, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayActionParams, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConstructorParams, type MoneyMarketSupplyActionParams, type MoneyMarketSupplyParams, type MoneyMarketWithdrawActionParams, type MoneyMarketWithdrawParams, NEAR_DEFAULT_GAS, NearSpokeService, type OnDemandBtcPayload, type OptionalRaw, type OptionalSkipSimulation, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerAction, type PartnerError, type PartnerErrorCode, type PartnerFeeClaimAssetBalance, PartnerFeeClaimService, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapAction, type PartnerFeeClaimSwapParams, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, Permit2Service, type PermitBatch, type PermitDetails, type PermitSingle, type PoolBaseCurrencyHumanized, type PoolData, type PoolRewardConfig, type PoolSpokeAssets, type PostExecutionError, type PostExecutionErrorCode, ProtocolIntentsAbi, type QueryMsg, type QueryResponse, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RadfiApiError, type RadfiAuthResult, type RadfiBuildTxResponse, type RadfiErrorBody, type RadfiMaxSpentResponse, RadfiProvider, type RadfiTradingWallet, type RadfiUtxo, type RadfiUtxoListResponse, type RadfiWalletBalance, type RateLimitConfig, type RawDestinationParams, type RecoveryAction, type RecoveryError, type RecoveryErrorCode, RecoveryService, type RecoveryServiceConstructorParams, type RelayAction, type RelayAndWaitParams, type RelayCode, type RelayErrorCode, type RelayExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayWrappedErrorCode, type RequestConfig, type RequestOverrideConfig, type RequestTrustlineParams, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResponseAddressType, type ResponseSigningType, type RevertMigrationOrchestrationError, type RevertMigrationOrchestrationErrorCode, type RewardInfoHumanized, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, type SendMessageParams, type SetSwapPreferenceAction, type SetSwapPreferenceParams, Sodax, SodaxError, type SodaxErrorCode, type SodaxErrorContext, type SodaxErrorJSON, type SodaxFeature, type SodaxPhase, SolanaSpokeService, SolverApiService, SonicSpokeService, type SpokeApproveParams, type SpokeApproveParamsEvmSpoke, type SpokeApproveParamsHub, type SpokeApproveParamsStellar, type SpokeIsAllowanceValidParams, type SpokeIsAllowanceValidParamsEvmSpoke, type SpokeIsAllowanceValidParamsHub, type SpokeIsAllowanceValidParamsOther, type SpokeIsAllowanceValidParamsStellar, SpokeService, type SpokeServiceConstructorParams, type SpokeServiceType, StacksSpokeService, type StakeAction, type StakeOrchestrationError, type StakeOrchestrationErrorCode, type StakeParams, type StakingActionType, type StakingActionUnion, type StakingAllowanceCheckError, type StakingAllowanceCheckErrorCode, type StakingApproveError, type StakingApproveErrorCode, type StakingConfig, type StakingCreateIntentError, type StakingCreateIntentErrorCode, type StakingError, type StakingErrorCode, type StakingInfo, type StakingInfoFetchError, type StakingInfoFetchErrorCode, StakingLogic, type StakingOrchestrationError, type StakingOrchestrationErrorCode, type StakingParamsUnion, StakingService, type StakingServiceConstructorParams, type State, StellarSpokeService, type SubmitTxParams, type SubmitTxResponse, SuiSpokeService, SupportedMigrationTokens, type SwapAction, type SwapActionParams, type SwapCreateIntentError, type SwapCreateIntentErrorCode, type SwapError, type SwapErrorCode, type SwapResponse, SwapService, type SwapServiceConstructorParams, type TokenSpenderPair, type TokenWithConversion, type TxHashPair, type TxStatus, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UiPoolDataProviderServiceConstructorParams, type UnifiedBnUSDMigrateAction, type UnifiedBnUSDMigrateParams, type UnstakeAction, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type VerifySimulationParams, type VerifyTxHashParams, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitForTxReceiptParams, type WaitForTxReceiptReturnType, type WaitUntilIntentExecutedPayload, type WalletMode, type WalletSimulationParams, type WithdrawHubAssetAction, type WithdrawHubAssetParams, type WithdrawInfo, adjustAmountByFee, allowanceCheckFailed, approveFailed, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bridgeInvariant, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, connectionAbi, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, dexInvariant, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getCompoundedBalance, getConnectionIdl, getConnectionProgram, getEvmViemChain, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, intentCreationFailed, isBalnMigrateParams, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexError, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKeyType, isIconAddress, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNearChainKeyType, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKeyType, isStellarWalletProviderType, isSubmitSwapTxResponse, isSubmitSwapTxStatusResponse, isSuiChainKeyType, isSwapCreateIntentError, isSwapError, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, lookupFailed, mapRelayFailure, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, nativeToUSD, normalize, normalizeBN, normalizePsbtToBase64, normalizedToUsd, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, reverseEncodeAddress, serializeAddressData, sleep, sodaxInvariant, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, submitTransaction, swapExactInSingleParamsAbi, swapInvariant, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
package/dist/index.mjs CHANGED
@@ -6,13 +6,13 @@ import { serializeCV, Cl, deserializeCV, cvToString, fetchFeeEstimateTransaction
6
6
  import { kaia, redbellyMainnet, mainnet, lightlinkPhoenix, polygon, bsc, optimism, base, arbitrum, avalanche, sonic } from 'viem/chains';
7
7
  import * as rlp from 'rlp';
8
8
  import { createNetwork } from '@stacks/network';
9
- import * as bitcoin from 'bitcoinjs-lib';
9
+ import { initEccLib, networks, Transaction, Psbt, payments, opcodes, script } from 'bitcoinjs-lib';
10
10
  import * as ecc from '@bitcoinerlab/secp256k1';
11
11
  import { CLPositionManagerAbi, encodeCLPositionManagerMintCalldata, encodeCLPositionManagerIncreaseLiquidityCalldata, encodeCLPositionManagerDecreaseLiquidityCalldata, getPoolId, CLPoolManagerAbi, decodePoolKey } from '@pancakeswap/infinity-sdk';
12
- import { Transaction } from '@mysten/sui/transactions';
12
+ import { Transaction as Transaction$1 } from '@mysten/sui/transactions';
13
13
  import { SuiClient } from '@mysten/sui/client';
14
14
  import { TOKEN_PROGRAM_ID, getAssociatedTokenAddress } from '@solana/spl-token';
15
- import * as anchor from '@coral-xyz/anchor';
15
+ import { AnchorProvider, Program } from '@coral-xyz/anchor';
16
16
  import BN from 'bn.js';
17
17
  import * as IconSdkRaw from 'icon-sdk-js';
18
18
  import { ChainGrpcWasmApi, TxGrpcApi, CosmosTxV1Beta1TxPb, toBase64, fromBase64, MsgExecuteContract, createTransactionForAddressAndMsg } from '@injectivelabs/sdk-ts';
@@ -488,7 +488,7 @@ var SodaTokens = {
488
488
  sodaNEAR: {
489
489
  symbol: "sodaNEAR",
490
490
  name: "SODA NEAR",
491
- decimals: 24,
491
+ decimals: 18,
492
492
  address: "0xf4ba497c9b805e4bd88a8a9e6a7b8f74984c3e39",
493
493
  chainKey: ChainKeys.SONIC_MAINNET,
494
494
  hubAsset: "0xf4ba497c9b805e4bd88a8a9e6a7b8f74984c3e39",
@@ -3203,7 +3203,8 @@ var moneyMarketSupportedTokens = {
3203
3203
  spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.HYPE,
3204
3204
  spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.bnUSD,
3205
3205
  spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.SODA,
3206
- spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.USDT0
3206
+ spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.USDT0,
3207
+ spokeChainConfig[ChainKeys.HYPEREVM_MAINNET].supportedTokens.USDC
3207
3208
  ],
3208
3209
  [ChainKeys.LIGHTLINK_MAINNET]: [
3209
3210
  spokeChainConfig[ChainKeys.LIGHTLINK_MAINNET].supportedTokens.ETH,
@@ -3487,7 +3488,6 @@ var swapSupportedTokens = {
3487
3488
  spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.USDT,
3488
3489
  spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.wS,
3489
3490
  spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.SODA,
3490
- spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.bnUSD,
3491
3491
  ...Object.values(SodaTokens)
3492
3492
  ],
3493
3493
  [ChainKeys.AVALANCHE_MAINNET]: [
@@ -3869,7 +3869,7 @@ function isValidWalletProviderForChainKey(chainKey, walletProvider) {
3869
3869
  }
3870
3870
 
3871
3871
  // ../types/dist/index.js
3872
- var CONFIG_VERSION = 200;
3872
+ var CONFIG_VERSION = 202;
3873
3873
  function isEvmSpokeChainConfig(value) {
3874
3874
  return typeof value === "object" && value !== null && value.chain.type === "EVM" && value.chain.key !== HUB_CHAIN_KEY;
3875
3875
  }
@@ -14670,7 +14670,7 @@ function normalizePsbtToBase64(signedPsbt) {
14670
14670
  }
14671
14671
 
14672
14672
  // src/shared/services/spoke/BitcoinSpokeService.ts
14673
- bitcoin.initEccLib(ecc);
14673
+ initEccLib(ecc);
14674
14674
  var BITCOIN_DEFAULT_FEE_RATE = 3;
14675
14675
  var DUST_THRESHOLD = 546;
14676
14676
  var BitcoinSpokeService = class {
@@ -14690,7 +14690,7 @@ var BitcoinSpokeService = class {
14690
14690
  this.maxTimeoutMs = chainConfig.pollingConfig.maxTimeoutMs;
14691
14691
  }
14692
14692
  getBtcNetwork(chainId) {
14693
- return this.config.getChainConfig(chainId).network === "MAINNET" ? bitcoin.networks.bitcoin : bitcoin.networks.testnet;
14693
+ return this.config.getChainConfig(chainId).network === "MAINNET" ? networks.bitcoin : networks.testnet;
14694
14694
  }
14695
14695
  async getBalance(tokenAddress, walletAddress) {
14696
14696
  if (!tokenAddress || tokenAddress === "0x" || tokenAddress === "BTC") {
@@ -14702,7 +14702,7 @@ var BitcoinSpokeService = class {
14702
14702
  }
14703
14703
  async fetchScriptPubKey(utxo) {
14704
14704
  const txHex = await this.fetchRawTransaction(utxo.txid);
14705
- const tx = bitcoin.Transaction.fromHex(txHex);
14705
+ const tx = Transaction.fromHex(txHex);
14706
14706
  const out = tx.outs[utxo.vout];
14707
14707
  if (!out) {
14708
14708
  throw new Error(`UTXO not found: ${utxo.txid}:${utxo.vout}`);
@@ -14804,7 +14804,7 @@ var BitcoinSpokeService = class {
14804
14804
  * Build a priority Bitcoin transaction with proper fee calculation
14805
14805
  */
14806
14806
  async buildBitcoinTransaction(utxos, outputs, changeAddress, chainId, walletProvider, feeRate) {
14807
- const psbt = new bitcoin.Psbt({ network: this.getBtcNetwork(chainId) });
14807
+ const psbt = new Psbt({ network: this.getBtcNetwork(chainId) });
14808
14808
  const effectiveFeeRate = feeRate ?? await this.getFeeRateEstimate();
14809
14809
  const walletAddress = await walletProvider.getWalletAddress();
14810
14810
  const addressType = detectBitcoinAddressType(walletAddress);
@@ -14835,7 +14835,7 @@ var BitcoinSpokeService = class {
14835
14835
  throw new Error("Missing public key for P2SH-P2WPKH input");
14836
14836
  }
14837
14837
  const pubKeyHex = await walletProvider.getPublicKey();
14838
- const redeemScript = bitcoin.payments.p2wpkh({
14838
+ const redeemScript = payments.p2wpkh({
14839
14839
  pubkey: Buffer.from(pubKeyHex, "hex"),
14840
14840
  network: this.getBtcNetwork(chainId)
14841
14841
  }).output;
@@ -14992,14 +14992,14 @@ var BitcoinSpokeService = class {
14992
14992
  const psbt = await this.buildBitcoinTransaction(utxos, outputs, walletAddress, srcChainKey, walletProvider);
14993
14993
  const OP_RADFI_SODAX_DATA = 49;
14994
14994
  const payload = Buffer.concat([Buffer.from([OP_RADFI_SODAX_DATA]), Buffer.from(data.slice(2), "hex")]);
14995
- const OP_RETURN = bitcoin.opcodes.OP_RETURN;
14996
- const OP_12 = bitcoin.opcodes.OP_12;
14995
+ const OP_RETURN = opcodes.OP_RETURN;
14996
+ const OP_12 = opcodes.OP_12;
14997
14997
  if (OP_RETURN === void 0 || OP_12 === void 0) {
14998
14998
  throw new Error("bitcoinjs-lib opcodes OP_RETURN or OP_12 are undefined");
14999
14999
  }
15000
- const script2 = bitcoin.script.compile([OP_RETURN, OP_12, payload]);
15000
+ const compiledScript = script.compile([OP_RETURN, OP_12, payload]);
15001
15001
  psbt.addOutput({
15002
- script: script2,
15002
+ script: compiledScript,
15003
15003
  value: 0
15004
15004
  });
15005
15005
  return psbt;
@@ -21601,7 +21601,7 @@ var SonicSpokeService = class {
21601
21601
  }
21602
21602
  /**
21603
21603
  * Deposit tokens to the spoke chain using the Sonic wallet abstraction.
21604
- * @param {SonicSpokeDepositParams<Raw>} params - The parameters for the deposit
21604
+ * @param {DepositParams<SonicChainKey, Raw>} params - The parameters for the deposit
21605
21605
  * @returns {Promise<TxReturnType<SonicChainKey, Raw>>} A promise that resolves to the transaction hash
21606
21606
  */
21607
21607
  async deposit(params) {
@@ -21830,9 +21830,6 @@ var SuiSpokeService = class {
21830
21830
  }
21831
21831
  return coin;
21832
21832
  }
21833
- static getAddressBCSBytes(suiaddress) {
21834
- return toHex(bcs.Address.serialize(suiaddress).toBytes());
21835
- }
21836
21833
  encodeSimulationParams(token, assetManager) {
21837
21834
  const encoder2 = new TextEncoder();
21838
21835
  return {
@@ -21870,7 +21867,7 @@ var SuiSpokeService = class {
21870
21867
  async deposit(params) {
21871
21868
  const { srcAddress: from, srcChainKey, token, to, amount, data = "0x" } = params;
21872
21869
  const isNative = isNativeToken(srcChainKey, token);
21873
- const tx = new Transaction();
21870
+ const tx = new Transaction$1();
21874
21871
  const coin = isNative ? await this.getNativeCoin(tx, amount) : await this.getCoin(tx, token, amount, from);
21875
21872
  const connection = this.splitAddress(this.config.getChainConfig(srcChainKey).addresses.connection);
21876
21873
  const assetManager = this.splitAddress(await this.getAssetManagerAddress(srcChainKey));
@@ -21904,7 +21901,7 @@ var SuiSpokeService = class {
21904
21901
  }
21905
21902
  async sendMessage(params) {
21906
21903
  const { srcAddress: from, srcChainKey, dstChainKey, dstAddress, payload } = params;
21907
- const txb = new Transaction();
21904
+ const txb = new Transaction$1();
21908
21905
  const connection = this.splitAddress(this.config.getChainConfig(srcChainKey).addresses.connection);
21909
21906
  const relayId = getIntentRelayChainId(dstChainKey);
21910
21907
  txb.moveCall({
@@ -21938,7 +21935,7 @@ var SuiSpokeService = class {
21938
21935
  * @returns {Promise<bigint>} The estimated computation cost.
21939
21936
  */
21940
21937
  async estimateGas({ tx }) {
21941
- const txb = Transaction.fromKind(tx.data);
21938
+ const txb = Transaction$1.fromKind(tx.data);
21942
21939
  const result = await this.publicClient.devInspectTransactionBlock({
21943
21940
  sender: tx.from,
21944
21941
  transactionBlock: txb
@@ -21947,13 +21944,12 @@ var SuiSpokeService = class {
21947
21944
  }
21948
21945
  /**
21949
21946
  * Get the balance of the token in the spoke chain.
21950
- * @param {Address} token - The address of the token to get the balance of.
21951
- * @param {SuiSpokeProvider} spokeProvider - The spoke provider.
21947
+ * @param {GetDepositParams<SuiChainKey>} params - The src chain key, src address, and token address.
21952
21948
  * @returns {Promise<bigint>} The balance of the token.
21953
21949
  */
21954
21950
  async getDeposit(params) {
21955
21951
  const assetmanager = this.splitAddress(await this.getAssetManagerAddress(params.srcChainKey));
21956
- const tx = new Transaction();
21952
+ const tx = new Transaction$1();
21957
21953
  const result = await this.viewContract(
21958
21954
  tx,
21959
21955
  assetmanager.packageId,
@@ -21972,7 +21968,7 @@ var SuiSpokeService = class {
21972
21968
  }
21973
21969
  /**
21974
21970
  * Fetch the asset manager config from the spoke chain.
21975
- * @param {SuiBaseSpokeProvider} suiSpokeProvider - The spoke provider.
21971
+ * @param {SuiChainKey} chainId - The Sui chain key.
21976
21972
  * @returns {Promise<string>} The asset manager config.
21977
21973
  */
21978
21974
  async fetchAssetManagerAddress(chainId) {
@@ -21981,7 +21977,7 @@ var SuiSpokeService = class {
21981
21977
  }
21982
21978
  /**
21983
21979
  * Fetch the latest asset manager package id from the spoke chain.
21984
- * @param {SuiBaseSpokeProvider} suiSpokeProvider - The spoke provider.
21980
+ * @param {SuiChainKey} chainId - The Sui chain key.
21985
21981
  * @returns {Promise<string>} The latest asset manager package id.
21986
21982
  */
21987
21983
  async fetchLatestAssetManagerPackageId(chainId) {
@@ -22595,11 +22591,11 @@ async function getProvider(base58PublicKey, rpcUrl) {
22595
22591
  signAllTransactions: () => Promise.reject()
22596
22592
  };
22597
22593
  const connection = new Connection(rpcUrl);
22598
- return new anchor.AnchorProvider(connection, wallet, { commitment: "confirmed" });
22594
+ return new AnchorProvider(connection, wallet, { commitment: "confirmed" });
22599
22595
  }
22600
22596
  async function getAssetManagerIdl(assetManager, provider) {
22601
22597
  try {
22602
- const idl = await anchor.Program.fetchIdl(new PublicKey(assetManager), provider);
22598
+ const idl = await Program.fetchIdl(new PublicKey(assetManager), provider);
22603
22599
  if (!idl) {
22604
22600
  throw new Error("asset manager idl not available");
22605
22601
  }
@@ -22611,7 +22607,7 @@ async function getAssetManagerIdl(assetManager, provider) {
22611
22607
  }
22612
22608
  async function getConnectionIdl(connection, provider) {
22613
22609
  try {
22614
- const idl = await anchor.Program.fetchIdl(new PublicKey(connection), provider);
22610
+ const idl = await Program.fetchIdl(new PublicKey(connection), provider);
22615
22611
  if (!idl) {
22616
22612
  throw new Error("asset manager idl not available");
22617
22613
  }
@@ -22624,12 +22620,12 @@ async function getConnectionIdl(connection, provider) {
22624
22620
  async function getAssetManagerProgram(base58PublicKey, rpcUrl, assetManager) {
22625
22621
  const provider = await getProvider(base58PublicKey, rpcUrl);
22626
22622
  const idl = await getAssetManagerIdl(assetManager, provider);
22627
- return new anchor.Program(idl, provider);
22623
+ return new Program(idl, provider);
22628
22624
  }
22629
22625
  async function getConnectionProgram(base58PublicKey, rpcUrl, connection) {
22630
22626
  const provider = await getProvider(base58PublicKey, rpcUrl);
22631
22627
  const idl = await getConnectionIdl(connection, provider);
22632
- return new anchor.Program(idl, provider);
22628
+ return new Program(idl, provider);
22633
22629
  }
22634
22630
  function getSolanaAddressBytes(address) {
22635
22631
  return `0x${Buffer.from(address.toBytes()).toString("hex")}`;
@@ -22941,7 +22937,7 @@ var IconSpokeService = class {
22941
22937
  }
22942
22938
  /**
22943
22939
  * Deposit tokens to the spoke chain.
22944
- * @param {IconSpokeDepositParams} params - The parameters for the deposit
22940
+ * @param {DepositParams<IconChainKey, R>} params - The parameters for the deposit
22945
22941
  * @param {IconSpokeProviderType} spokeProvider - The provider for the spoke chain
22946
22942
  * @param {EvmHubProvider} hubProvider - The provider for the hub chain
22947
22943
  * @param {boolean} raw - The return type raw or just transaction hash
@@ -28021,7 +28017,7 @@ var MigrationService = class {
28021
28017
  );
28022
28018
  const hubWalletAddress = await this.hubProvider.getUserHubWalletAddress(
28023
28019
  params.srcAddress,
28024
- ChainKeys.SONIC_MAINNET
28020
+ ChainKeys.ICON_MAINNET
28025
28021
  );
28026
28022
  const coreParams = {
28027
28023
  srcChainKey: ChainKeys.ICON_MAINNET,
@@ -29121,11 +29117,7 @@ var BridgeService = class {
29121
29117
  * checking theoretical bridgeability without requiring both chains to be in the active config.
29122
29118
  * @returns `true` if the tokens share the same hub vault; `false` otherwise.
29123
29119
  */
29124
- isBridgeable({
29125
- from,
29126
- to,
29127
- unchecked = false
29128
- }) {
29120
+ isBridgeable({ from, to, unchecked = false }) {
29129
29121
  try {
29130
29122
  if (!unchecked) {
29131
29123
  bridgeInvariant(this.config.isValidSpokeChainKey(from.chainKey), `Invalid spoke chain (${from.chainKey})`, {
@@ -34319,7 +34311,8 @@ var UiPoolDataProviderService = class {
34319
34311
  // The borrow index must also come from the bnUSD debt token.
34320
34312
  // User debt is stored scaled by bnUSD's index, so reading it back requires the same index.
34321
34313
  // Using the vault's index here would inflate the displayed debt amount.
34322
- variableBorrowIndex: bnUSDReserve.variableBorrowIndex
34314
+ variableBorrowIndex: bnUSDReserve.variableBorrowIndex,
34315
+ borrowingEnabled: bnUSDReserve.borrowingEnabled
34323
34316
  };
34324
34317
  return [
34325
34318
  [
@@ -36707,5 +36700,3 @@ var isPartnerError = isCodeMember(PARTNER_CODES);
36707
36700
  */
36708
36701
 
36709
36702
  export { ALLOWANCE_CHECK_CODES, APPROVE_CODES, AssetService, BITCOIN_CHAIN_KEYS, BITCOIN_CHAIN_KEYS_SET, BTC_WALLET_ADDRESS_TYPES, BackendApiService, BalnSwapService, BigIntToHex, BigNumberZeroDecimal, BitcoinSpokeService, BnUSDMigrationService, BridgeService, CHAIN_KEYS, CONFIG_VERSION, CREATE_INTENT_CODES, ChainKeys, ChainTypeArr, ClService, ConfigService, CustomSorobanServer, CustomStellarAccount, DEFAULT_BACKEND_API_ENDPOINT, DEFAULT_BACKEND_API_HEADERS, DEFAULT_BACKEND_API_TIMEOUT, DEFAULT_DEADLINE_OFFSET, DEFAULT_MAX_RETRY, DEFAULT_RELAYER_API_ENDPOINT, DEFAULT_RELAY_TX_TIMEOUT, DEFAULT_RETRY_DELAY_MS, DexService, EVM_CHAIN_ID_TO_KEY, EVM_CHAIN_KEYS, EVM_CHAIN_KEYS_SET, EVM_SPOKE_ONLY_CHAIN_KEYS, EVM_SPOKE_ONLY_CHAIN_KEYS_SET, Erc20Service, Erc4626Service, EvmAssetManagerService, EvmHubProvider, EvmSolverService, EvmSpokeService, EvmVaultTokenService, FEE_PERCENTAGE_SCALE, GAS_ESTIMATION_CODES, HALF_RAY, HALF_WAD, HUB_CHAIN_KEY, HttpRelayError, HubVaultSymbols, ICON_CHAIN_KEYS, ICON_CHAIN_KEYS_SET, ICON_TX_RESULT_WAIT_MAX_RETRY, INJECTIVE_CHAIN_KEYS, INJECTIVE_CHAIN_KEYS_SET, INTENT_CHAIN_IDS, IconSpokeService, IcxMigrationService, Injective20Token, InjectiveSpokeService, IntentCreatedEventAbi, IntentDataType, IntentFilledEventAbi, IntentRelayChainIdToChainKey, IntentsAbi, LOOKUP_CODES, LTV_PRECISION, LendingPoolService, LockupMultiplier, LockupPeriod, MAX_UINT256, MigrationService, MintPositionEventAbi, MoneyMarketDataService, MoneyMarketService, NEAR_CHAIN_KEYS, NEAR_CHAIN_KEYS_SET, NEAR_DEFAULT_GAS, NearSpokeService, PartnerFeeClaimService, PartnerService, Permit2Service, ProtocolIntentsAbi, RAY, RAY_DECIMALS, RELAY_ERROR_CODES, RadfiApiError, RadfiProvider, RecoveryService, RelayChainIdMap, SECONDS_PER_YEAR, SODAX_ERROR_CODES, SODAX_FEATURES, SOLANA_CHAIN_KEYS, SOLANA_CHAIN_KEYS_SET, SONIC_CHAIN_KEYS, SONIC_CHAIN_KEYS_SET, STACKS_CHAIN_KEYS, STACKS_CHAIN_KEYS_SET, STELLAR_CHAIN_KEYS, STELLAR_CHAIN_KEYS_SET, SUI_CHAIN_KEYS, SUI_CHAIN_KEYS_SET, SodaTokens, Sodax, SodaxError, SolanaSpokeService, SolverApiService, SolverIntentErrorCode, SolverIntentStatusCode, SonicSpokeService, SpokeService, StacksSpokeService, StakingLogic, StakingService, StatATokenAddresses, StellarSpokeService, SuiSpokeService, SupportedMigrationTokens, SwapService, USD_DECIMALS, UiPoolDataProviderService, VAULT_TOKEN_DECIMALS, WAD, WAD_RAY_RATIO, WEI_DECIMALS, adjustAmountByFee, allowanceCheckFailed, apiConfig, approveFailed, arbitrumSupportedTokens, assetManagerAbi, avalancheSupportedTokens, balnSwapAbi, baseChainInfo, baseSupportedTokens, binomialApproximatedRayPow, bitcoinSupportedTokens, bnUSDLegacySpokeChainIds, bnUSDLegacyTokens, bridgeConfig, bridgeInvariant, bscSupportedTokens, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, concentratedLiquidityConfig, connectionAbi, convertTransactionInstructionToRaw, createInvariant, deepMerge, defaultHookAbi, detectBitcoinAddressType, dexConfig, dexInvariant, dexPools, encodeAddress, encodeBtcPayloadToBytes, encodeContractCalls, erc20Abi, erc4626Abi, estimateBitcoinTxSize, ethereumSupportedTokens, executionFailed, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, gasEstimationFailed, getAllLegacybnUSDTokens, getAndFormatReserveEModes, getAssetManagerIdl, getAssetManagerProgram, getChainKeyFromRelayChainId, getChainType, getCompoundedBalance, getConcentratedLiquidityConfig, getConnectionIdl, getConnectionProgram, getEvmChainKeyByChainId, getEvmViemChain, getIconAddressBytes, getIntentRelayChainId, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getProvider, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getSolverConfig, getSupportedSolverTokens, getTransactionPackets, getbnUSDToken, hexToBigInt, hexToSolanaAddress, hubConfig, hyper, hyperevmSupportedTokens, iconSupportedTokens, injectiveSupportedTokens, intentCreationFailed, isBalnMigrateParams, isBitcoinChainKey, isBitcoinChainKeyType, isBitcoinWalletProviderType, isBridgeAllowanceCheckError, isBridgeApproveError, isBridgeCreateIntentError, isBridgeError, isBridgeLookupError, isBridgeOrchestrationError, isCodeMember, isDexError, isEvmChainKey, isEvmChainKeyType, isEvmSpokeChainConfig, isEvmSpokeOnlyChainKey, isEvmSpokeOnlyChainKeyType, isEvmWalletProviderType, isFeatureError, isHubChainKey, isHubChainKeyType, isIconAddress, isIconChainKey, isIconChainKeyType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveChainKey, isInjectiveChainKeyType, isJsonRpcPayloadResponse, isLegacybnUSDChainId, isLegacybnUSDToken, isMigrateOrchestrationError, isMigrationAllowanceCheckError, isMigrationApproveError, isMigrationCreateIntentError, isMigrationError, isMigrationLookupError, isMoneyMarketAllowanceCheckError, isMoneyMarketApproveError, isMoneyMarketCreateIntentError, isMoneyMarketError, isMoneyMarketGasEstimationError, isMoneyMarketOrchestrationError, isNativeToken, isNearChainKey, isNearChainKeyType, isNewbnUSDChainId, isNewbnUSDToken, isOptionalBitcoinWalletProviderType, isOptionalEvmWalletProviderType, isOptionalStellarWalletProviderType, isPartnerError, isPartnerFeeAmount, isPartnerFeePercentage, isPostExecutionError, isRawDestinationParams, isRecoveryError, isResponseAddressType, isResponseSigningType, isRevertMigrationOrchestrationError, isSodaxError, isSolanaChainKey, isSolanaChainKeyType, isSolanaNativeToken, isSonicChainKey, isSonicChainKeyType, isSpokeApproveParamsEvmSpoke, isSpokeApproveParamsHub, isSpokeApproveParamsStellar, isSpokeChainKey, isSpokeIsAllowanceValidParamsEvmSpoke, isSpokeIsAllowanceValidParamsHub, isSpokeIsAllowanceValidParamsStellar, isStacksChainKey, isStacksChainKeyType, isStakeOrchestrationError, isStakingAllowanceCheckError, isStakingApproveError, isStakingCreateIntentError, isStakingError, isStakingInfoFetchError, isStakingOrchestrationError, isStellarChainKey, isStellarChainKeyType, isStellarWalletProviderType, isSubmitSwapTxResponse, isSubmitSwapTxStatusResponse, isSuiChainKey, isSuiChainKeyType, isSupportedBitcoinAddressType, isSwapCreateIntentError, isSwapError, isSwapSupportedToken, isUndefinedOrValidWalletProviderForChainKey, isUnifiedBnUSDMigrateParams, isValidWalletProviderForChainKey, kaiaSupportedTokens, lightlinkSupportedTokens, lookupFailed, mapRelayFailure, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, moneyMarketConfig, moneyMarketReserveAssets, moneyMarketSupportedTokens, nativeToUSD, nearSupportedTokens, newbnUSDSpokeChainIds, normalize, normalizeBN, normalizePsbtToBase64, normalizedToUsd, optimismSupportedTokens, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, polygonSupportedTokens, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, redbellySupportedTokens, relayConfig, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, reverseEncodeAddress, serializeAddressData, sleep, sodaxConfig, sodaxInvariant, solanaSupportedTokens, solverConfig, sonicSupportedTokens, sonicWalletFactoryAbi, spokeAssetManagerAbi, spokeChainConfig, spokeChainKeysSet, stacksSupportedTokens, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, stellarSupportedTokens, submitTransaction, suiSupportedTokens, supportedSpokeChains, supportedTokensByChain, swapExactInSingleParamsAbi, swapInvariant, swapSupportedTokens, swapsConfig, uiPoolDataAbi, universalRouterAbi, unknownFailed, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
36710
- //# sourceMappingURL=index.mjs.map
36711
- //# sourceMappingURL=index.mjs.map