@sodax/sdk 2.0.0-rc.13 → 2.0.0-rc.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { getAbiItem, parseAbi, isAddress, toHex, hexToBytes, encodeAbiParameters
2
2
  import { bcs } from '@mysten/sui/bcs';
3
3
  import { PublicKey, Connection, VersionedTransaction, SystemProgram, ComputeBudgetProgram, TransactionMessage, TransactionInstruction } from '@solana/web3.js';
4
4
  import { rpc, Address, xdr, Account, Horizon, Contract, TransactionBuilder, nativeToScVal, TimeoutInfinite, scValToBigInt, Operation, Asset, FeeBumpTransaction } from '@stellar/stellar-sdk';
5
- import { serializeCV, Cl, deserializeCV, cvToString, createNetwork, fetchFeeEstimateTransaction, fetchCallReadOnlyFunction, parseContractId, PostConditionMode, noneCV, someCV, uintCV, validateStacksAddress, makeUnsignedContractCall, serializePayloadBytes } from '@sodax/libs/stacks/core';
5
+ import { serializeCV, Cl, deserializeCV, cvToString, createNetwork, fetchFeeEstimateTransaction, fetchCallReadOnlyFunction, parseContractId, PostConditionMode, noneCV, someCV, uintCV, getAddressFromPublicKey, makeUnsignedContractCall, serializePayloadBytes } from '@sodax/libs/stacks/core';
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 { initEccLib, networks, Transaction, Psbt, payments, opcodes, script } from 'bitcoinjs-lib';
@@ -14,7 +14,8 @@ import { TOKEN_PROGRAM_ID, TOKEN_2022_PROGRAM_ID, getAssociatedTokenAddress } fr
14
14
  import { AnchorProvider, Program } from '@coral-xyz/anchor';
15
15
  import BN from 'bn.js';
16
16
  import * as IconSdkRaw from 'icon-sdk-js';
17
- import { ChainGrpcWasmApi, TxGrpcApi, CosmosTxV1Beta1TxPb, toBase64, fromBase64, MsgExecuteContract, createTransactionForAddressAndMsg } from '@injectivelabs/sdk-ts';
17
+ import { ChainGrpcWasmApi, TxGrpcApi, toBase64, fromBase64, MsgExecuteContract, ChainRestAuthApi, BaseAccount, createTransaction } from '@injectivelabs/sdk-ts';
18
+ import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.js';
18
19
  import { getNetworkEndpoints, Network } from '@injectivelabs/networks';
19
20
  import BigNumber5, { BigNumber } from 'bignumber.js';
20
21
  import { Token, Price } from '@pancakeswap/swap-sdk-core';
@@ -303,7 +304,8 @@ var HubVaultSymbols = [
303
304
  "sodaNEAR",
304
305
  "sodaKAIA",
305
306
  "sodaSTX",
306
- "sodaUSDS"
307
+ "sodaUSDS",
308
+ "sodaJITOSOL"
307
309
  ];
308
310
  var SodaTokens = {
309
311
  sodaBNB: {
@@ -530,9 +532,18 @@ var SodaTokens = {
530
532
  chainKey: ChainKeys.SONIC_MAINNET,
531
533
  hubAsset: "0x243b0c26c8b38793908d7C64e8510f21B19B4613",
532
534
  vault: "0x243b0c26c8b38793908d7C64e8510f21B19B4613"
535
+ },
536
+ sodaJITOSOL: {
537
+ symbol: "sodaJITOSOL",
538
+ name: "Soda JITOSOL",
539
+ decimals: 18,
540
+ address: "0xe1bad4400d947Bc4fa66f9c0A143D800002083a0",
541
+ chainKey: ChainKeys.SONIC_MAINNET,
542
+ hubAsset: "0xe1bad4400d947Bc4fa66f9c0A143D800002083a0",
543
+ vault: "0xe1bad4400d947Bc4fa66f9c0A143D800002083a0"
533
544
  }
534
545
  };
535
- var LsodaSymbols = ["lsodaWEETH", "lsodaWSTETH"];
546
+ var LsodaSymbols = ["lsodaWEETH", "lsodaWSTETH", "lsodaJITOSOL"];
536
547
  var LsodaTokens = {
537
548
  lsodaWEETH: {
538
549
  symbol: "lsodaWEETH",
@@ -551,6 +562,15 @@ var LsodaTokens = {
551
562
  chainKey: ChainKeys.SONIC_MAINNET,
552
563
  hubAsset: "0x136E5D1CEC5db1829E24941Eddd9C8640E02Ce7a",
553
564
  vault: "0x136E5D1CEC5db1829E24941Eddd9C8640E02Ce7a"
565
+ },
566
+ lsodaJITOSOL: {
567
+ symbol: "lsodaJITOSOL",
568
+ name: "Leveraged Soda JITOSOL",
569
+ decimals: 18,
570
+ address: "0xD7Ae4853E0f93682F5DaA14734F5D18cBa09Bd78",
571
+ chainKey: ChainKeys.SONIC_MAINNET,
572
+ hubAsset: "0xD7Ae4853E0f93682F5DaA14734F5D18cBa09Bd78",
573
+ vault: "0xD7Ae4853E0f93682F5DaA14734F5D18cBa09Bd78"
554
574
  }
555
575
  };
556
576
  var sonicSupportedTokens = {
@@ -828,7 +848,7 @@ var solanaSupportedTokens = {
828
848
  address: "J1toso1uCk3RLmjorhTtrVwY9HJ7X8V9yYac6Y7kGCPn",
829
849
  chainKey: ChainKeys.SOLANA_MAINNET,
830
850
  hubAsset: "0x942f89a324d2652e447b9fcf08effc9f9776a680",
831
- vault: "0x942f89a324d2652e447b9fcf08effc9f9776a680"
851
+ vault: SodaTokens.sodaJITOSOL.address
832
852
  },
833
853
  mSOL: {
834
854
  symbol: "mSOL",
@@ -1261,6 +1281,15 @@ var baseSupportedTokens = {
1261
1281
  chainKey: ChainKeys.BASE_MAINNET,
1262
1282
  hubAsset: "0xaa81bb5ba3c972ab53605d3ba7e443a3de6d1cb9",
1263
1283
  vault: "0xaa81bb5ba3c972ab53605d3ba7e443a3de6d1cb9"
1284
+ },
1285
+ AERO: {
1286
+ symbol: "AERO",
1287
+ name: "Aerodrome Finance",
1288
+ decimals: 18,
1289
+ address: "0x940181a94A35A4569e4529A3CDfB74e38FD98631",
1290
+ chainKey: ChainKeys.BASE_MAINNET,
1291
+ hubAsset: "0x348e086ab6f424dfc575a325c28624ed23973173",
1292
+ vault: "0x348e086ab6f424dfc575a325c28624ed23973173"
1264
1293
  }
1265
1294
  };
1266
1295
  var optimismSupportedTokens = {
@@ -1943,6 +1972,33 @@ var stellarSupportedTokens = {
1943
1972
  chainKey: ChainKeys.STELLAR_MAINNET,
1944
1973
  hubAsset: "0xD749B5FfFED7cEDaa3239abDd16D677179C29AEc",
1945
1974
  vault: SodaTokens.sodaSODA.address
1975
+ },
1976
+ sodaETH: {
1977
+ symbol: "sodaETH",
1978
+ name: "Soda ETH",
1979
+ decimals: 7,
1980
+ address: "CDK5EWVTZLGSLI6D5OSES7XUKWZUKBXDRNOWUVDNPP5RJRP5EYWCW7SL",
1981
+ chainKey: ChainKeys.STELLAR_MAINNET,
1982
+ hubAsset: "0x4985a4b72ac723723e9ae82382d12d77e9a715de",
1983
+ vault: SodaTokens.sodaETH.address
1984
+ },
1985
+ sodaBTC: {
1986
+ symbol: "sodaBTC",
1987
+ name: "Soda BTC",
1988
+ decimals: 7,
1989
+ address: "CD6XWBW74YVFDQQYUM2GALCULMA5MAWGP6NTCWF3ZYXP4Z7MEVY4JKBX",
1990
+ chainKey: ChainKeys.STELLAR_MAINNET,
1991
+ hubAsset: "0xddee01f63c18843e2bac30cb702864d7632c83a2",
1992
+ vault: SodaTokens.sodaBTC.address
1993
+ },
1994
+ sodaBNB: {
1995
+ symbol: "sodaBNB",
1996
+ name: "Soda BNB",
1997
+ decimals: 7,
1998
+ address: "CCXTXZAFLVNTMORVWYB6BGL7YEW3U3ONDAL2FGBRGDUQH7AGANVQPRS6",
1999
+ chainKey: ChainKeys.STELLAR_MAINNET,
2000
+ hubAsset: "0xa10be5f5c2dea7d272555dc73ea2a7317c3c5b63",
2001
+ vault: SodaTokens.sodaBNB.address
1946
2002
  }
1947
2003
  };
1948
2004
  var suiSupportedTokens = {
@@ -3082,6 +3138,21 @@ var spokeChainConfig = {
3082
3138
  assetCode: "SODA",
3083
3139
  contractId: "CAH5LKJC2ZB4RVUVEVL2QWJWNJLHQE2UF767ILLQ5EQ4O3OURR2XIUGM",
3084
3140
  assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
3141
+ },
3142
+ {
3143
+ assetCode: "sodaETH",
3144
+ contractId: "CDK5EWVTZLGSLI6D5OSES7XUKWZUKBXDRNOWUVDNPP5RJRP5EYWCW7SL",
3145
+ assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
3146
+ },
3147
+ {
3148
+ assetCode: "sodaBTC",
3149
+ contractId: "CD6XWBW74YVFDQQYUM2GALCULMA5MAWGP6NTCWF3ZYXP4Z7MEVY4JKBX",
3150
+ assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
3151
+ },
3152
+ {
3153
+ assetCode: "sodaBNB",
3154
+ contractId: "CCXTXZAFLVNTMORVWYB6BGL7YEW3U3ONDAL2FGBRGDUQH7AGANVQPRS6",
3155
+ assetIssuer: "GDYUTHY75A7WUZJQDPOP66FB32BOYGZRXHWTWO4Q6LQTANT5X3V5HNFA"
3085
3156
  }
3086
3157
  ],
3087
3158
  supportedTokens: stellarSupportedTokens,
@@ -3357,7 +3428,8 @@ var moneyMarketSupportedTokens = {
3357
3428
  spokeChainConfig[ChainKeys.SOLANA_MAINNET].supportedTokens.bnUSD,
3358
3429
  spokeChainConfig[ChainKeys.SOLANA_MAINNET].supportedTokens.USDC,
3359
3430
  spokeChainConfig[ChainKeys.SOLANA_MAINNET].supportedTokens.SODA,
3360
- spokeChainConfig[ChainKeys.SOLANA_MAINNET].supportedTokens.USDT
3431
+ spokeChainConfig[ChainKeys.SOLANA_MAINNET].supportedTokens.USDT,
3432
+ spokeChainConfig[ChainKeys.SOLANA_MAINNET].supportedTokens.JitoSOL
3361
3433
  ],
3362
3434
  [ChainKeys.ICON_MAINNET]: [
3363
3435
  // spokeChainConfig[ChainKeys.ICON].supportedTokens.ICX,
@@ -3368,7 +3440,10 @@ var moneyMarketSupportedTokens = {
3368
3440
  spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.XLM,
3369
3441
  spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.bnUSD,
3370
3442
  spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.SODA,
3371
- spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.USDC
3443
+ spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.USDC,
3444
+ spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.sodaETH,
3445
+ spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.sodaBTC,
3446
+ spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.sodaBNB
3372
3447
  ],
3373
3448
  [ChainKeys.SUI_MAINNET]: [
3374
3449
  spokeChainConfig[ChainKeys.SUI_MAINNET].supportedTokens.SUI,
@@ -3619,7 +3694,8 @@ var swapSupportedTokens = {
3619
3694
  spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.USDT,
3620
3695
  spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.wS,
3621
3696
  spokeChainConfig[ChainKeys.SONIC_MAINNET].supportedTokens.SODA,
3622
- ...Object.values(SodaTokens),
3697
+ // sodaUSDS is staging-only — see stagingSwapSupportedTokens
3698
+ ...Object.values(SodaTokens).filter((t) => t !== SodaTokens.sodaUSDS),
3623
3699
  ...Object.values(LsodaTokens)
3624
3700
  ],
3625
3701
  [ChainKeys.AVALANCHE_MAINNET]: [
@@ -3639,36 +3715,35 @@ var swapSupportedTokens = {
3639
3715
  spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.tBTC,
3640
3716
  spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.USDC,
3641
3717
  spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.USDT,
3642
- spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.SODA,
3643
3718
  spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.ARB,
3644
3719
  spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.AAVE,
3645
3720
  spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.LINK,
3646
3721
  spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.UNI,
3647
3722
  spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.CRV,
3648
3723
  spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.PENDLE,
3649
- spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.rETH
3724
+ spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.rETH,
3725
+ spokeChainConfig[ChainKeys.ARBITRUM_MAINNET].supportedTokens.SODA
3650
3726
  ],
3651
3727
  [ChainKeys.BASE_MAINNET]: [
3652
3728
  spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.ETH,
3653
- spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.bnUSD,
3654
3729
  spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.weETH,
3655
3730
  spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.USDC,
3656
3731
  spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.wstETH,
3657
3732
  spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.cbBTC,
3658
- spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.SODA,
3659
3733
  spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.VIRTUAL,
3660
- spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.cbETH
3734
+ spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.cbETH,
3735
+ spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.SODA
3661
3736
  ],
3662
3737
  [ChainKeys.OPTIMISM_MAINNET]: [
3663
3738
  spokeChainConfig[ChainKeys.OPTIMISM_MAINNET].supportedTokens.ETH,
3664
- spokeChainConfig[ChainKeys.OPTIMISM_MAINNET].supportedTokens.bnUSD,
3665
3739
  spokeChainConfig[ChainKeys.OPTIMISM_MAINNET].supportedTokens.USDC,
3666
3740
  spokeChainConfig[ChainKeys.OPTIMISM_MAINNET].supportedTokens.wstETH,
3667
3741
  // spokeChainConfig[OPTIMISM_MAINNET_CHAIN_ID].supportedTokens.weETH, // NOTE: Not Implemented
3668
3742
  spokeChainConfig[ChainKeys.OPTIMISM_MAINNET].supportedTokens.USDT,
3669
3743
  spokeChainConfig[ChainKeys.OPTIMISM_MAINNET].supportedTokens.SODA,
3670
3744
  spokeChainConfig[ChainKeys.OPTIMISM_MAINNET].supportedTokens.OP,
3671
- spokeChainConfig[ChainKeys.OPTIMISM_MAINNET].supportedTokens.WBTC
3745
+ spokeChainConfig[ChainKeys.OPTIMISM_MAINNET].supportedTokens.WBTC,
3746
+ spokeChainConfig[ChainKeys.OPTIMISM_MAINNET].supportedTokens.bnUSD
3672
3747
  ],
3673
3748
  [ChainKeys.POLYGON_MAINNET]: [
3674
3749
  spokeChainConfig[ChainKeys.POLYGON_MAINNET].supportedTokens.POL,
@@ -3724,7 +3799,6 @@ var swapSupportedTokens = {
3724
3799
  spokeChainConfig[ChainKeys.LIGHTLINK_MAINNET].supportedTokens["SUI.LL"],
3725
3800
  spokeChainConfig[ChainKeys.LIGHTLINK_MAINNET].supportedTokens["S.LL"],
3726
3801
  spokeChainConfig[ChainKeys.LIGHTLINK_MAINNET].supportedTokens["POL.LL"],
3727
- spokeChainConfig[ChainKeys.LIGHTLINK_MAINNET].supportedTokens["HYPE.LL"],
3728
3802
  spokeChainConfig[ChainKeys.LIGHTLINK_MAINNET].supportedTokens.LL
3729
3803
  ],
3730
3804
  [ChainKeys.SOLANA_MAINNET]: [
@@ -3763,7 +3837,10 @@ var swapSupportedTokens = {
3763
3837
  spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.bnUSD,
3764
3838
  // NOTE: Not Implemented
3765
3839
  spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.USDC,
3766
- spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.SODA
3840
+ spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.SODA,
3841
+ spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.sodaETH,
3842
+ spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.sodaBTC,
3843
+ spokeChainConfig[ChainKeys.STELLAR_MAINNET].supportedTokens.sodaBNB
3767
3844
  ],
3768
3845
  [ChainKeys.SUI_MAINNET]: [
3769
3846
  spokeChainConfig[ChainKeys.SUI_MAINNET].supportedTokens.SUI,
@@ -3781,12 +3858,8 @@ var swapSupportedTokens = {
3781
3858
  spokeChainConfig[ChainKeys.SUI_MAINNET].supportedTokens.WAL,
3782
3859
  spokeChainConfig[ChainKeys.SUI_MAINNET].supportedTokens.NAVX
3783
3860
  ],
3784
- [ChainKeys.INJECTIVE_MAINNET]: [
3785
- spokeChainConfig[ChainKeys.INJECTIVE_MAINNET].supportedTokens.INJ,
3786
- spokeChainConfig[ChainKeys.INJECTIVE_MAINNET].supportedTokens.bnUSD,
3787
- spokeChainConfig[ChainKeys.INJECTIVE_MAINNET].supportedTokens.USDC
3788
- // spokeChainConfig[ChainKeys.INJECTIVE_MAINNET].supportedTokens.SODA, // NOTE: not in solver wiki
3789
- ],
3861
+ // Injective is currently staging-only — see stagingSwapSupportedTokens
3862
+ [ChainKeys.INJECTIVE_MAINNET]: [],
3790
3863
  [ChainKeys.NEAR_MAINNET]: [
3791
3864
  spokeChainConfig[ChainKeys.NEAR_MAINNET].supportedTokens.NEAR,
3792
3865
  spokeChainConfig[ChainKeys.NEAR_MAINNET].supportedTokens.bnUSD,
@@ -3853,12 +3926,53 @@ var swapSupportedTokens = {
3853
3926
  spokeChainConfig[ChainKeys.STACKS_MAINNET].supportedTokens.USDC
3854
3927
  ]
3855
3928
  };
3929
+ var stagingSwapSupportedTokens = {
3930
+ [ChainKeys.SONIC_MAINNET]: [SodaTokens.sodaUSDS],
3931
+ [ChainKeys.AVALANCHE_MAINNET]: [],
3932
+ [ChainKeys.ARBITRUM_MAINNET]: [],
3933
+ [ChainKeys.BASE_MAINNET]: [
3934
+ spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.bnUSD,
3935
+ spokeChainConfig[ChainKeys.BASE_MAINNET].supportedTokens.AERO
3936
+ ],
3937
+ [ChainKeys.OPTIMISM_MAINNET]: [],
3938
+ [ChainKeys.POLYGON_MAINNET]: [
3939
+ spokeChainConfig[ChainKeys.POLYGON_MAINNET].supportedTokens.USDT,
3940
+ spokeChainConfig[ChainKeys.POLYGON_MAINNET].supportedTokens.wstETH
3941
+ ],
3942
+ [ChainKeys.BSC_MAINNET]: [],
3943
+ [ChainKeys.HYPEREVM_MAINNET]: [],
3944
+ [ChainKeys.LIGHTLINK_MAINNET]: [
3945
+ spokeChainConfig[ChainKeys.LIGHTLINK_MAINNET].supportedTokens["HYPE.LL"]
3946
+ ],
3947
+ [ChainKeys.SOLANA_MAINNET]: [],
3948
+ [ChainKeys.ICON_MAINNET]: [],
3949
+ [ChainKeys.STELLAR_MAINNET]: [],
3950
+ [ChainKeys.SUI_MAINNET]: [spokeChainConfig[ChainKeys.SUI_MAINNET].supportedTokens.USDT],
3951
+ [ChainKeys.INJECTIVE_MAINNET]: [
3952
+ spokeChainConfig[ChainKeys.INJECTIVE_MAINNET].supportedTokens.INJ,
3953
+ spokeChainConfig[ChainKeys.INJECTIVE_MAINNET].supportedTokens.bnUSD,
3954
+ spokeChainConfig[ChainKeys.INJECTIVE_MAINNET].supportedTokens.USDC
3955
+ // spokeChainConfig[ChainKeys.INJECTIVE_MAINNET].supportedTokens.SODA, // NOTE: not in solver wiki
3956
+ ],
3957
+ [ChainKeys.NEAR_MAINNET]: [],
3958
+ [ChainKeys.BITCOIN_MAINNET]: [],
3959
+ [ChainKeys.ETHEREUM_MAINNET]: [
3960
+ spokeChainConfig[ChainKeys.ETHEREUM_MAINNET].supportedTokens.wstETH,
3961
+ spokeChainConfig[ChainKeys.ETHEREUM_MAINNET].supportedTokens.weETH
3962
+ ],
3963
+ [ChainKeys.REDBELLY_MAINNET]: [],
3964
+ [ChainKeys.KAIA_MAINNET]: [],
3965
+ [ChainKeys.STACKS_MAINNET]: []
3966
+ };
3856
3967
  var swapsConfig = {
3857
- partnerFee: void 0,
3858
3968
  supportedTokens: swapSupportedTokens
3859
3969
  };
3860
3970
  var getSupportedSolverTokens = (chainId) => swapSupportedTokens[chainId];
3861
- var isSwapSupportedToken = (chainId, token) => swapSupportedTokens[chainId].some((t) => t.address.toLowerCase() === token.toLowerCase());
3971
+ var getStagingSolverTokens = (chainId) => [
3972
+ ...swapSupportedTokens[chainId],
3973
+ ...stagingSwapSupportedTokens[chainId]
3974
+ ];
3975
+ var isSwapSupportedToken = (chainId, token) => [...swapSupportedTokens[chainId], ...stagingSwapSupportedTokens[chainId]].some((t) => t.address.toLowerCase() === token.toLowerCase());
3862
3976
 
3863
3977
  // ../types/dist/leverageYield/leverageYield.js
3864
3978
  var leverageYieldVaults = [
@@ -3889,6 +4003,20 @@ var leverageYieldVaults = [
3889
4003
  fallbackAprPct: 2.4,
3890
4004
  label: "Lido (stETH)"
3891
4005
  }
4006
+ },
4007
+ {
4008
+ name: LsodaTokens.lsodaJITOSOL.symbol,
4009
+ vault: LsodaTokens.lsodaJITOSOL.vault,
4010
+ asset: SodaTokens.sodaJITOSOL.address,
4011
+ // sodaJITOSOL on Sonic
4012
+ borrowToken: SodaTokens.sodaSOL.address,
4013
+ // sodaSOL on Sonic
4014
+ lsdSource: {
4015
+ // DefiLlama pool for Jito's JitoSOL native staking on Solana (project: 'jito-liquid-staking').
4016
+ poolId: "0e7d0722-9054-4907-8593-567b353c0900",
4017
+ fallbackAprPct: 5.5,
4018
+ label: "Jito (JitoSOL)"
4019
+ }
3892
4020
  }
3893
4021
  ];
3894
4022
  var leverageYieldConfig = {
@@ -3896,11 +4024,8 @@ var leverageYieldConfig = {
3896
4024
  };
3897
4025
 
3898
4026
  // ../types/dist/sodax-config/sodax-config.js
3899
- var bridgeConfig = {
3900
- partnerFee: void 0
3901
- };
4027
+ var bridgeConfig = {};
3902
4028
  var sodaxConfig = {
3903
- fee: void 0,
3904
4029
  chains: spokeChainConfig,
3905
4030
  swaps: swapsConfig,
3906
4031
  moneyMarket: moneyMarketConfig,
@@ -4048,7 +4173,7 @@ function isValidWalletProviderForChainKey(chainKey, walletProvider) {
4048
4173
  }
4049
4174
 
4050
4175
  // ../types/dist/index.js
4051
- var CONFIG_VERSION = 211;
4176
+ var CONFIG_VERSION = 213;
4052
4177
  function isEvmSpokeChainConfig(value) {
4053
4178
  return typeof value === "object" && value !== null && value.chain.type === "EVM" && value.chain.key !== HUB_CHAIN_KEY;
4054
4179
  }
@@ -4435,7 +4560,10 @@ async function pollForExecutedPacket(payload) {
4435
4560
  }
4436
4561
  const txPackets = txPacketsResult.value;
4437
4562
  if (txPackets.success && txPackets.data.length > 0) {
4438
- const packet = txPackets.data.find((packet2) => packet2.src_tx_hash.toLowerCase() === payload.srcTxHash.toLowerCase());
4563
+ const candidates = txPackets.data.filter(
4564
+ (packet2) => packet2.src_tx_hash.toLowerCase() === payload.srcTxHash.toLowerCase()
4565
+ );
4566
+ const packet = payload.selectPacket ? payload.selectPacket(candidates) : candidates[0];
4439
4567
  if (packet?.status === "executed") {
4440
4568
  return { kind: "found", packet };
4441
4569
  }
@@ -13325,14 +13453,7 @@ function deepMerge(target, source) {
13325
13453
 
13326
13454
  // src/shared/config/mergeSodaxConfig.ts
13327
13455
  function mergeSodaxConfig(base2, override) {
13328
- const merged = deepMerge(base2, override);
13329
- if (override.fee !== void 0) {
13330
- merged.fee = override.fee;
13331
- }
13332
- if (override.bridge?.partnerFee !== void 0) {
13333
- merged.bridge.partnerFee = override.bridge.partnerFee;
13334
- }
13335
- return merged;
13456
+ return deepMerge(base2, override);
13336
13457
  }
13337
13458
 
13338
13459
  // src/shared/logger.ts
@@ -13372,6 +13493,12 @@ var ConfigService = class {
13372
13493
  * {@link initialize}'s dynamic-config swap never clobbers it. Read by services via `config.logger`.
13373
13494
  */
13374
13495
  logger;
13496
+ /**
13497
+ * Global partner fee. Resolved once at construction and kept independent of {@link sodax} so that
13498
+ * {@link initialize}'s dynamic-config swap never clobbers it. The backend never supplies it — it is
13499
+ * a client-side option set via `new Sodax({ fee })`. Per-feature overrides live on the feature config.
13500
+ */
13501
+ fee;
13375
13502
  initialized = false;
13376
13503
  // data structures for quick lookup
13377
13504
  supportedHubAssetsSet;
@@ -13383,11 +13510,12 @@ var ConfigService = class {
13383
13510
  stakedATokenAddressesSet;
13384
13511
  chainToSupportedTokenAddressMap;
13385
13512
  hubAssetToXTokenMap;
13386
- constructor({ api, config, userConfig, logger }) {
13513
+ constructor({ api, config, userConfig, logger, fee }) {
13387
13514
  this.api = api;
13388
13515
  this.sodax = config;
13389
13516
  this.userConfig = userConfig;
13390
13517
  this.logger = logger ?? resolveLogger(void 0);
13518
+ this.fee = fee;
13391
13519
  this.loadSodaxConfigDataStructures(config);
13392
13520
  }
13393
13521
  async initialize() {
@@ -13620,6 +13748,24 @@ var ConfigService = class {
13620
13748
  get moneyMarket() {
13621
13749
  return this.sodax.moneyMarket;
13622
13750
  }
13751
+ get leverageYield() {
13752
+ return this.sodax.leverageYield;
13753
+ }
13754
+ // Effective partner fee per feature: the feature-specific override if set, otherwise the global
13755
+ // `fee` client option ({@link fee}). The global fee is the default, overridable per-feature. `??`
13756
+ // (never a merge) keeps the chosen PartnerFee variant intact — no discriminated-union hybrid.
13757
+ get swapPartnerFee() {
13758
+ return this.swaps.partnerFee ?? this.fee;
13759
+ }
13760
+ get moneyMarketPartnerFee() {
13761
+ return this.moneyMarket.partnerFee ?? this.fee;
13762
+ }
13763
+ get bridgePartnerFee() {
13764
+ return this.bridge.partnerFee ?? this.fee;
13765
+ }
13766
+ get leverageYieldPartnerFee() {
13767
+ return this.leverageYield.partnerFee ?? this.fee;
13768
+ }
13623
13769
  get dex() {
13624
13770
  return this.sodax.dex;
13625
13771
  }
@@ -14431,12 +14577,23 @@ var StacksSpokeService = class {
14431
14577
  postConditionMode: PostConditionMode.Allow
14432
14578
  };
14433
14579
  if (params.raw === true) {
14434
- if (validateStacksAddress(params.srcAddress)) {
14435
- throw new Error('When using raw transactions, the public key must be provided as "from" parameter');
14580
+ if (!params.srcPublicKey) {
14581
+ throw new Error("Stacks raw transactions require srcPublicKey (the signer public key for srcAddress).");
14582
+ }
14583
+ let derivedAddress;
14584
+ try {
14585
+ derivedAddress = getAddressFromPublicKey(params.srcPublicKey, this.network);
14586
+ } catch (error) {
14587
+ throw new Error(`srcPublicKey is not a valid Stacks public key: ${error.message}`);
14588
+ }
14589
+ if (derivedAddress !== params.srcAddress) {
14590
+ throw new Error(
14591
+ `srcPublicKey does not match srcAddress: it derives ${derivedAddress}, but srcAddress is ${params.srcAddress}.`
14592
+ );
14436
14593
  }
14437
14594
  const tx = await makeUnsignedContractCall({
14438
14595
  ...reqData,
14439
- publicKey: params.srcAddress,
14596
+ publicKey: params.srcPublicKey,
14440
14597
  network: this.network,
14441
14598
  fee: 0,
14442
14599
  // placeholder — we'll estimate
@@ -14546,6 +14703,8 @@ var RadfiProvider = class {
14546
14703
  refreshToken = "";
14547
14704
  constructor(config) {
14548
14705
  this.config = config;
14706
+ this.accessToken = config.accessToken ?? "";
14707
+ this.refreshToken = config.refreshToken ?? "";
14549
14708
  if (config.apiUrl.endsWith("/")) {
14550
14709
  this.config.apiUrl = config.apiUrl.slice(0, -1);
14551
14710
  }
@@ -14586,13 +14745,11 @@ var RadfiProvider = class {
14586
14745
  try {
14587
14746
  const { accessToken, refreshToken } = await this.refreshAccessToken(this.refreshToken);
14588
14747
  this.setRadfiAccessToken(accessToken, refreshToken);
14589
- console.log("[ensureRadfiAccessToken] token refreshed successfully");
14590
14748
  return;
14591
14749
  } catch (error) {
14592
14750
  console.warn("[ensureRadfiAccessToken] refresh failed, falling back to full re-auth", error);
14593
14751
  }
14594
14752
  }
14595
- console.log("[ensureRadfiAccessToken] performing full re-authentication (BIP322 sign)");
14596
14753
  this.accessToken = "";
14597
14754
  this.refreshToken = "";
14598
14755
  await this.authenticateWithWallet(walletProvider);
@@ -14608,55 +14765,53 @@ var RadfiProvider = class {
14608
14765
  method: "POST",
14609
14766
  body: JSON.stringify(params)
14610
14767
  });
14768
+ const body = await this.parseJsonBody(res, "Bound Exchange authentication failed");
14611
14769
  if (!res.ok) {
14612
- const err = await res.json();
14613
- throw new RadfiApiError(res.status, err, "Bound Exchange authentication failed");
14770
+ throw new RadfiApiError(res.status, body, "Bound Exchange authentication failed");
14614
14771
  }
14615
- return res.json().then((r) => ({
14616
- accessToken: r.data?.accessToken ?? "",
14617
- refreshToken: r.data?.refreshToken ?? "",
14618
- tradingAddress: r.data?.tradingAddress ?? r.data?.wallet?.tradingAddress ?? ""
14619
- }));
14772
+ return {
14773
+ accessToken: body.data?.accessToken ?? "",
14774
+ refreshToken: body.data?.refreshToken ?? "",
14775
+ tradingAddress: body.data?.tradingAddress ?? body.data?.wallet?.tradingAddress ?? ""
14776
+ };
14620
14777
  }
14621
14778
  async refreshAccessToken(refreshToken) {
14622
14779
  const res = await this.request("/auth/refresh-token", {
14623
14780
  method: "POST",
14624
14781
  body: JSON.stringify({ refreshToken })
14625
14782
  });
14783
+ const body = await this.parseJsonBody(res, "Token refresh failed");
14626
14784
  if (!res.ok) {
14627
- const err = await res.json();
14628
- throw new RadfiApiError(res.status, err, "Token refresh failed");
14785
+ throw new RadfiApiError(res.status, body, "Token refresh failed");
14629
14786
  }
14630
- return res.json().then((r) => ({
14631
- accessToken: r.data?.accessToken ?? "",
14632
- refreshToken: r.data?.refreshToken ?? refreshToken
14633
- }));
14787
+ return {
14788
+ accessToken: body.data?.accessToken ?? "",
14789
+ refreshToken: body.data?.refreshToken ?? refreshToken
14790
+ };
14634
14791
  }
14635
14792
  async createTradingWallet(params, accessToken) {
14636
14793
  const res = await this.request("/wallets", {
14637
14794
  method: "POST",
14638
14795
  headers: {
14639
- Authorization: `Bearer ${accessToken || this.config.apiKey}`
14796
+ Authorization: `Bearer ${this.resolveAuth(accessToken)}`
14640
14797
  },
14641
14798
  body: JSON.stringify(params)
14642
14799
  });
14643
- if (!res.ok) {
14644
- const err = await res.json();
14645
- throw new RadfiApiError(res.status, err, "Failed to create trading wallet");
14800
+ const body = await this.parseJsonBody(res, "Failed to create trading wallet");
14801
+ if (!res.ok || !body.data) {
14802
+ throw new RadfiApiError(res.status, body, "Failed to create trading wallet");
14646
14803
  }
14647
- return res.json().then((r) => r.data);
14804
+ return body.data;
14648
14805
  }
14649
- async getTradingWallet(userAddress, accessToken) {
14806
+ async getTradingWallet(userAddress) {
14650
14807
  const res = await this.request(`/wallets/details/${userAddress}`, {
14651
- method: "GET",
14652
- headers: accessToken ? { Authorization: `Bearer ${accessToken}` } : {}
14808
+ method: "GET"
14653
14809
  });
14654
- if (!res.ok) {
14655
- throw new Error("Trading wallet not found");
14810
+ const body = await this.parseJsonBody(res, "Trading wallet not found");
14811
+ if (!res.ok || !body.data) {
14812
+ throw new RadfiApiError(res.status, body, "Trading wallet not found");
14656
14813
  }
14657
- const data = await res.json().then((r) => r.data);
14658
- if (!data) throw new Error("Trading wallet not found");
14659
- return data;
14814
+ return body.data;
14660
14815
  }
14661
14816
  async getBalance(address) {
14662
14817
  if (!this.config.umsUrl) {
@@ -14670,12 +14825,12 @@ var RadfiProvider = class {
14670
14825
  if (!res.ok) {
14671
14826
  throw new Error("Failed to fetch wallet balance");
14672
14827
  }
14673
- const { data } = await res.json();
14828
+ const { data } = await this.parseJsonBody(res, "Failed to fetch wallet balance");
14674
14829
  return {
14675
- btcSatoshi: BigInt(data.btcSatoshi ?? "0"),
14676
- pendingSatoshi: BigInt(data.pendingSatoshi ?? "0"),
14677
- externalPendingSatoshi: BigInt(data.externalPendingSatoshi ?? "0"),
14678
- totalUtxos: Number(data.totalUtxos ?? 0)
14830
+ btcSatoshi: BigInt(data?.btcSatoshi ?? "0"),
14831
+ pendingSatoshi: BigInt(data?.pendingSatoshi ?? "0"),
14832
+ externalPendingSatoshi: BigInt(data?.externalPendingSatoshi ?? "0"),
14833
+ totalUtxos: Number(data?.totalUtxos ?? 0)
14679
14834
  };
14680
14835
  }
14681
14836
  async checkIfTradingWalletExists(userAddress) {
@@ -14691,7 +14846,7 @@ var RadfiProvider = class {
14691
14846
  const res = await this.request("/sodax/transaction", {
14692
14847
  method: "POST",
14693
14848
  headers: {
14694
- Authorization: `Bearer ${accessToken || this.config.apiKey}`
14849
+ Authorization: `Bearer ${this.resolveAuth(accessToken)}`
14695
14850
  },
14696
14851
  body: JSON.stringify({
14697
14852
  type: "sodax-withdraw",
@@ -14702,8 +14857,8 @@ var RadfiProvider = class {
14702
14857
  }
14703
14858
  })
14704
14859
  });
14705
- const body = await res.json();
14706
- if (!res.ok || !body?.data) {
14860
+ const body = await this.parseJsonBody(res, "Bound Exchange transaction request failed");
14861
+ if (!res.ok || !body.data) {
14707
14862
  throw new RadfiApiError(res.status, body, "Bound Exchange transaction request failed");
14708
14863
  }
14709
14864
  return body.data;
@@ -14720,18 +14875,18 @@ var RadfiProvider = class {
14720
14875
  const res = await this.request("/sodax/transaction/sign", {
14721
14876
  method: "POST",
14722
14877
  headers: {
14723
- Authorization: `Bearer ${accessToken || this.config.apiKey}`
14878
+ Authorization: `Bearer ${this.resolveAuth(accessToken)}`
14724
14879
  },
14725
14880
  body: JSON.stringify({
14726
14881
  type: "sodax-withdraw",
14727
14882
  params
14728
14883
  })
14729
14884
  });
14730
- if (!res.ok) {
14731
- const err = await res.json();
14732
- throw new RadfiApiError(res.status, err, "Bound Exchange signature request failed");
14885
+ const body = await this.parseJsonBody(res, "Bound Exchange signature request failed");
14886
+ if (!res.ok || !body.data?.txId) {
14887
+ throw new RadfiApiError(res.status, body, "Bound Exchange signature request failed");
14733
14888
  }
14734
- return res.json().then((r) => r.data.txId);
14889
+ return body.data.txId;
14735
14890
  }
14736
14891
  /**
14737
14892
  * Fetch expired (or near-expiry) UTXOs for a trading wallet address from UMS API.
@@ -14750,7 +14905,8 @@ var RadfiProvider = class {
14750
14905
  if (!res.ok) {
14751
14906
  throw new Error("Failed to fetch expired UTXOs");
14752
14907
  }
14753
- return res.json();
14908
+ const body = await this.parseJsonBody(res, "Failed to fetch expired UTXOs");
14909
+ return { code: body.code ?? "", message: body.message ?? "", data: body.data ?? [] };
14754
14910
  }
14755
14911
  /**
14756
14912
  * Build a renew-utxo transaction via the Bound Exchange API.
@@ -14770,11 +14926,11 @@ var RadfiProvider = class {
14770
14926
  }
14771
14927
  })
14772
14928
  });
14773
- if (!res.ok) {
14774
- const err = await res.json();
14775
- throw new RadfiApiError(res.status, err, "Failed to build renew-utxo transaction");
14929
+ const body = await this.parseJsonBody(res, "Failed to build renew-utxo transaction");
14930
+ if (!res.ok || !body.data) {
14931
+ throw new RadfiApiError(res.status, body, "Failed to build renew-utxo transaction");
14776
14932
  }
14777
- return res.json().then((r) => r.data);
14933
+ return body.data;
14778
14934
  }
14779
14935
  /**
14780
14936
  * Sign and broadcast a renew-utxo transaction via the Bound Exchange API.
@@ -14791,11 +14947,14 @@ var RadfiProvider = class {
14791
14947
  params
14792
14948
  })
14793
14949
  });
14794
- if (!res.ok) {
14795
- const err = await res.json();
14796
- throw new RadfiApiError(res.status, err, "Failed to sign and broadcast renew-utxo transaction");
14950
+ const body = await this.parseJsonBody(
14951
+ res,
14952
+ "Failed to sign and broadcast renew-utxo transaction"
14953
+ );
14954
+ if (!res.ok || !body.data?.txId) {
14955
+ throw new RadfiApiError(res.status, body, "Failed to sign and broadcast renew-utxo transaction");
14797
14956
  }
14798
- return res.json().then((r) => r.data.txId);
14957
+ return body.data.txId;
14799
14958
  }
14800
14959
  /**
14801
14960
  * Withdraw BTC from trading wallet to user's personal wallet.
@@ -14812,11 +14971,11 @@ var RadfiProvider = class {
14812
14971
  params
14813
14972
  })
14814
14973
  });
14815
- if (!res.ok) {
14816
- const err = await res.json();
14817
- throw new RadfiApiError(res.status, err, "Failed to build withdraw transaction");
14974
+ const body = await this.parseJsonBody(res, "Failed to build withdraw transaction");
14975
+ if (!res.ok || !body.data) {
14976
+ throw new RadfiApiError(res.status, body, "Failed to build withdraw transaction");
14818
14977
  }
14819
- return res.json().then((r) => r.data);
14978
+ return body.data;
14820
14979
  }
14821
14980
  /**
14822
14981
  * Sign and broadcast a withdraw transaction via Bound Exchange.
@@ -14832,14 +14991,19 @@ var RadfiProvider = class {
14832
14991
  params
14833
14992
  })
14834
14993
  });
14994
+ const body = await this.parseJsonBody(
14995
+ res,
14996
+ "Failed to sign and broadcast withdraw transaction"
14997
+ );
14835
14998
  if (!res.ok) {
14836
- const err = await res.json();
14837
- throw new RadfiApiError(res.status, err, "Failed to sign and broadcast withdraw transaction");
14999
+ throw new RadfiApiError(res.status, body, "Failed to sign and broadcast withdraw transaction");
14838
15000
  }
14839
- return res.json().then((r) => {
14840
- const txId = r.data?.txId;
14841
- return typeof txId === "object" && txId?.data ? txId.data : txId;
14842
- });
15001
+ const raw = body.data?.txId;
15002
+ const txId = typeof raw === "object" ? raw?.data : raw;
15003
+ if (!txId) {
15004
+ throw new RadfiApiError(res.status, body, "Failed to sign and broadcast withdraw transaction");
15005
+ }
15006
+ return txId;
14843
15007
  }
14844
15008
  /**
14845
15009
  * Get max spendable amount for a withdraw transaction (amount after fee).
@@ -14855,11 +15019,56 @@ var RadfiProvider = class {
14855
15019
  params
14856
15020
  })
14857
15021
  });
14858
- if (!res.ok) {
14859
- const err = await res.json();
14860
- throw new RadfiApiError(res.status, err, "Failed to get max withdrawable amount");
15022
+ const body = await this.parseJsonBody(res, "Failed to get max withdrawable amount");
15023
+ if (!res.ok || !body.data) {
15024
+ throw new RadfiApiError(res.status, body, "Failed to get max withdrawable amount");
15025
+ }
15026
+ return body.data;
15027
+ }
15028
+ /**
15029
+ * Resolve the bearer credential for an authenticated Bound Exchange call, failing fast when none
15030
+ * is available. A server-side raw-build caller that never ran the interactive sign-in would
15031
+ * otherwise send `Authorization: Bearer ` (empty) and get an opaque 403 from Bound's gateway;
15032
+ * throwing here turns that into an actionable client-side error naming the fix. We deliberately do
15033
+ * NOT validate the token's contents (expiry / scope / signature) — only Bound can, and an invalid
15034
+ * token still surfaces as a legible 401/403 via `parseJsonBody`.
15035
+ */
15036
+ resolveAuth(accessToken) {
15037
+ const auth = accessToken || this.config.apiKey;
15038
+ if (!auth) {
15039
+ throw new RadfiApiError(
15040
+ 401,
15041
+ {
15042
+ message: "Bound Exchange access token (or apiKey) is required but none was set. Inject one via sodax.spoke.bitcoin.radfi.setRadfiAccessToken(token) or new Sodax({ ... }) with radfi.accessToken."
15043
+ },
15044
+ "Missing Bound Exchange credentials"
15045
+ );
15046
+ }
15047
+ return auth;
15048
+ }
15049
+ /**
15050
+ * Parse a Bound Exchange response body as JSON defensively.
15051
+ *
15052
+ * Bound (or an upstream gateway / WAF / CDN) can answer a request with an HTML error page
15053
+ * instead of JSON — e.g. an unauthenticated call, a blocked origin, a 404, or a 5xx. Calling
15054
+ * `res.json()` on that throws a cryptic `SyntaxError: Unexpected token '<'` that masks the real
15055
+ * HTTP status and bubbles up as an opaque failure (it surfaced as a `createIntent` /
15056
+ * `INTENT_CREATION_FAILED` "is not valid JSON" error on the Bitcoin raw-tx path). Reading the
15057
+ * body as text first and parsing it ourselves lets us raise a `RadfiApiError` carrying the
15058
+ * actual status code and a body snippet instead.
15059
+ */
15060
+ async parseJsonBody(res, fallback) {
15061
+ const text = await res.text();
15062
+ try {
15063
+ return text.length ? JSON.parse(text) : {};
15064
+ } catch {
15065
+ const snippet = text.replace(/\s+/g, " ").trim().slice(0, 200);
15066
+ throw new RadfiApiError(
15067
+ res.status,
15068
+ { message: `Bound Exchange returned a non-JSON response (HTTP ${res.status})${snippet ? `: ${snippet}` : ""}` },
15069
+ fallback
15070
+ );
14861
15071
  }
14862
- return res.json().then((r) => r.data);
14863
15072
  }
14864
15073
  async request(endpoint, options) {
14865
15074
  return fetch(`${this.config.apiUrl}${endpoint}`, {
@@ -17392,8 +17601,8 @@ function chain(...args) {
17392
17601
  const id = (a) => a;
17393
17602
  const wrap = (a, b) => (c) => a(b(c));
17394
17603
  const encode3 = args.map((x) => x.encode).reduceRight(wrap, id);
17395
- const decode = args.map((x) => x.decode).reduce(wrap, id);
17396
- return { encode: encode3, decode };
17604
+ const decode2 = args.map((x) => x.decode).reduce(wrap, id);
17605
+ return { encode: encode3, decode: decode2 };
17397
17606
  }
17398
17607
  // @__NO_SIDE_EFFECTS__
17399
17608
  function alphabet(letters) {
@@ -23494,6 +23703,8 @@ var IconSpokeService = class {
23494
23703
  };
23495
23704
  }
23496
23705
  };
23706
+ var GAS_BUFFER_MULTIPLIER = 1.2;
23707
+ var GAS_PRICE_REGEX = /^(\d+)(.*)$/;
23497
23708
  var InjectiveSpokeService = class {
23498
23709
  config;
23499
23710
  chainGrpcWasmApi;
@@ -23501,6 +23712,7 @@ var InjectiveSpokeService = class {
23501
23712
  endpoints;
23502
23713
  pollingIntervalMs;
23503
23714
  maxTimeoutMs;
23715
+ gasPrice;
23504
23716
  constructor(config) {
23505
23717
  this.config = config;
23506
23718
  this.endpoints = getNetworkEndpoints(Network.Mainnet);
@@ -23508,6 +23720,16 @@ var InjectiveSpokeService = class {
23508
23720
  this.txClient = new TxGrpcApi(this.endpoints.grpc);
23509
23721
  this.pollingIntervalMs = this.config.sodaxConfig.chains[ChainKeys.INJECTIVE_MAINNET].pollingConfig.pollingIntervalMs;
23510
23722
  this.maxTimeoutMs = this.config.sodaxConfig.chains[ChainKeys.INJECTIVE_MAINNET].pollingConfig.maxTimeoutMs;
23723
+ this.gasPrice = this.config.getChainConfig(ChainKeys.INJECTIVE_MAINNET).gasPrice;
23724
+ }
23725
+ /** Parse a chain-config gas price like `"500000000inj"` into its numeric price and denom. */
23726
+ parseGasPrice(gasPrice) {
23727
+ const match = GAS_PRICE_REGEX.exec(gasPrice);
23728
+ const price = match?.[1];
23729
+ if (price === void 0) {
23730
+ throw new Error(`Invalid Injective gasPrice config: ${gasPrice}`);
23731
+ }
23732
+ return { price: BigInt(price), denom: match?.[2] || "inj" };
23511
23733
  }
23512
23734
  /**
23513
23735
  * Estimate the gas for a transaction.
@@ -23516,7 +23738,7 @@ var InjectiveSpokeService = class {
23516
23738
  * @returns {Promise<InjectiveGasEstimate>} The estimated gas for the transaction.
23517
23739
  */
23518
23740
  async estimateGas({ tx }) {
23519
- const txRaw = CosmosTxV1Beta1TxPb.TxRaw.fromPartial({
23741
+ const txRaw = TxRaw.fromPartial({
23520
23742
  bodyBytes: tx.signedDoc.bodyBytes,
23521
23743
  authInfoBytes: tx.signedDoc.authInfoBytes,
23522
23744
  signatures: []
@@ -23555,7 +23777,9 @@ var InjectiveSpokeService = class {
23555
23777
  chainConfig.networkId,
23556
23778
  from,
23557
23779
  chainConfig.addresses.assetManager,
23558
- msg
23780
+ msg,
23781
+ void 0,
23782
+ funds
23559
23783
  );
23560
23784
  }
23561
23785
  const res = await params.walletProvider.execute(from, chainConfig.addresses.assetManager, msg, funds);
@@ -23576,27 +23800,50 @@ var InjectiveSpokeService = class {
23576
23800
  );
23577
23801
  return BigInt(fromBase64(response.data));
23578
23802
  }
23579
- async getRawTransaction(chainId, senderAddress, contractAddress, msg, memo) {
23803
+ async getRawTransaction(chainId, senderAddress, contractAddress, msg, memo, funds = []) {
23580
23804
  const msgExec = MsgExecuteContract.fromJSON({
23581
23805
  contractAddress,
23582
23806
  sender: senderAddress,
23583
23807
  msg,
23584
- funds: []
23808
+ funds
23585
23809
  });
23586
- const { txRaw } = await createTransactionForAddressAndMsg({
23810
+ const accountResponse = await new ChainRestAuthApi(this.endpoints.rest).fetchCosmosAccount(senderAddress);
23811
+ const baseAccount = BaseAccount.fromRestCosmosApi(accountResponse);
23812
+ const pubKey = baseAccount.pubKey.key;
23813
+ if (!pubKey) {
23814
+ throw new Error(`The pubKey for ${senderAddress} is missing \u2014 the account has not signed a transaction yet.`);
23815
+ }
23816
+ const txArgs = {
23587
23817
  message: msgExec,
23588
23818
  memo: memo || "",
23589
- address: senderAddress,
23590
- endpoint: this.endpoints.grpc,
23819
+ pubKey,
23820
+ sequence: baseAccount.sequence,
23821
+ accountNumber: baseAccount.accountNumber,
23591
23822
  chainId
23592
- });
23823
+ };
23824
+ const draft = createTransaction(txArgs);
23825
+ const { gasInfo } = await this.txClient.simulate(
23826
+ TxRaw.fromPartial({
23827
+ bodyBytes: draft.txRaw.bodyBytes,
23828
+ authInfoBytes: draft.txRaw.authInfoBytes,
23829
+ signatures: []
23830
+ // not required for simulation
23831
+ })
23832
+ );
23833
+ const gas = Math.ceil(gasInfo.gasUsed * GAS_BUFFER_MULTIPLIER);
23834
+ const { price, denom } = this.parseGasPrice(this.gasPrice);
23835
+ const fee = {
23836
+ amount: [{ denom, amount: (BigInt(gas) * price).toString() }],
23837
+ gas: gas.toString()
23838
+ };
23839
+ const { txRaw, signDoc } = createTransaction({ ...txArgs, fee });
23593
23840
  const rawTx = {
23594
23841
  from: senderAddress,
23595
23842
  to: contractAddress,
23596
23843
  signedDoc: {
23597
23844
  bodyBytes: txRaw.bodyBytes,
23598
23845
  chainId,
23599
- accountNumber: BigInt(0),
23846
+ accountNumber: BigInt(signDoc.accountNumber),
23600
23847
  authInfoBytes: txRaw.authInfoBytes
23601
23848
  }
23602
23849
  };
@@ -25735,6 +25982,24 @@ var SolverApiService = class {
25735
25982
  }
25736
25983
  }
25737
25984
  };
25985
+ function decodePacketIntentTarget(payload) {
25986
+ try {
25987
+ const hex = payload.startsWith("0x") ? payload.slice(2) : payload;
25988
+ const decoded = rlp.decode(Buffer.from(hex, "hex"));
25989
+ const field1 = decoded?.[1];
25990
+ if (!field1 || field1.length === 0) return void 0;
25991
+ return `0x${Buffer.from(field1).toString("hex")}`.toLowerCase();
25992
+ } catch {
25993
+ return void 0;
25994
+ }
25995
+ }
25996
+ function selectSolvedIntentPacket(packets, intentsContract) {
25997
+ if (packets.length <= 1) return packets[0];
25998
+ const target = intentsContract.toLowerCase();
25999
+ const matched = packets.find((packet) => decodePacketIntentTarget(packet.payload) === target);
26000
+ if (matched) return matched;
26001
+ return packets.reduce((highest, packet) => packet.conn_sn > highest.conn_sn ? packet : highest);
26002
+ }
25738
26003
 
25739
26004
  // src/swap/errors.ts
25740
26005
  var swapInvariant = createInvariant("swap");
@@ -25770,7 +26035,7 @@ var SwapService = class {
25770
26035
  relayerApiEndpoint;
25771
26036
  constructor({ config, hubProvider, spoke }) {
25772
26037
  this.solver = config.solver;
25773
- this.partnerFee = config.swaps.partnerFee;
26038
+ this.partnerFee = config.swapPartnerFee;
25774
26039
  this.relayerApiEndpoint = config.relay.relayerApiEndpoint;
25775
26040
  this.config = config;
25776
26041
  this.hubProvider = hubProvider;
@@ -25788,10 +26053,13 @@ var SwapService = class {
25788
26053
  /**
25789
26054
  * Requests a price quote from the solver API for a given token pair and amount.
25790
26055
  *
25791
- * Adjusts `payload.amount` by the configured partner fee before forwarding to the solver,
25792
- * so the returned `quoted_amount` reflects the net output the user actually receives.
26056
+ * Adjusts `payload.amount` by the partner fee before forwarding to the solver, so the returned
26057
+ * `quoted_amount` reflects the net output the user actually receives. Pass `partnerFee` to match
26058
+ * a per-action override supplied to `createIntent` (`extras.partnerFee`); omit it to use the
26059
+ * configured swap fee.
25793
26060
  *
25794
- * @param payload - Source/destination tokens, chain IDs, input amount, and quote type.
26061
+ * @param payload - The solver quote request, optionally carrying a per-call `partnerFee` override
26062
+ * (defaults to the configured swap partner fee). `partnerFee` is stripped before forwarding.
25795
26063
  * @returns A `Result` containing `{ quoted_amount: bigint }` on success, or a
25796
26064
  * `SolverErrorResponse` (with a `SolverIntentErrorCode`) on failure.
25797
26065
  *
@@ -25807,11 +26075,12 @@ var SwapService = class {
25807
26075
  * if (response.ok) console.log('Quoted amount:', response.value.quoted_amount);
25808
26076
  */
25809
26077
  async getQuote(payload) {
25810
- payload = {
25811
- ...payload,
25812
- amount: adjustAmountByFee(payload.amount, this.partnerFee, payload.quote_type)
26078
+ const { partnerFee = this.partnerFee, ...request } = payload;
26079
+ const adjustedPayload = {
26080
+ ...request,
26081
+ amount: adjustAmountByFee(request.amount, partnerFee, request.quote_type)
25813
26082
  };
25814
- return SolverApiService.getQuote(payload, this.solver, this.config);
26083
+ return SolverApiService.getQuote(adjustedPayload, this.solver, this.config);
25815
26084
  }
25816
26085
  /**
25817
26086
  * Calculates the partner fee that will be deducted from the given input amount.
@@ -26161,7 +26430,8 @@ var SwapService = class {
26161
26430
  * - `UNKNOWN` — defensive fallback.
26162
26431
  */
26163
26432
  async createIntent(_params) {
26164
- const { params, skipSimulation } = _params;
26433
+ const { params, skipSimulation, extras } = _params;
26434
+ const partnerFee = extras?.partnerFee ?? this.partnerFee;
26165
26435
  const baseCtx = { srcChainKey: params.srcChainKey, dstChainKey: params.dstChainKey };
26166
26436
  try {
26167
26437
  swapInvariant(
@@ -26196,16 +26466,27 @@ var SwapService = class {
26196
26466
  { ...baseCtx, field: "minOutputAmount" }
26197
26467
  );
26198
26468
  }
26199
- const personalAddress = params.srcAddress;
26200
- let walletAddress = personalAddress;
26201
- if (isBitcoinChainKeyType(params.srcChainKey) && _params.raw === false) {
26469
+ if (isStacksChainKeyType(params.srcChainKey) && _params.raw === true) {
26202
26470
  swapInvariant(
26203
- isBitcoinWalletProviderType(_params.walletProvider),
26204
- `Invalid wallet provider for chain key: ${params.srcChainKey}`,
26205
- baseCtx
26471
+ extras?.srcPublicKey !== void 0,
26472
+ "srcPublicKey is required for Stacks createIntent (raw) \u2014 the source tx is built unsigned and needs the signer public key",
26473
+ { ...baseCtx, field: "srcPublicKey" }
26206
26474
  );
26475
+ }
26476
+ const personalAddress = params.srcAddress;
26477
+ let walletAddress = personalAddress;
26478
+ if (isBitcoinChainKeyType(params.srcChainKey)) {
26479
+ if (_params.raw === false) {
26480
+ swapInvariant(
26481
+ isBitcoinWalletProviderType(_params.walletProvider),
26482
+ `Invalid wallet provider for chain key: ${params.srcChainKey}`,
26483
+ baseCtx
26484
+ );
26485
+ if (this.spoke.bitcoin.walletMode === "TRADING") {
26486
+ await this.spoke.bitcoin.radfi.ensureRadfiAccessToken(_params.walletProvider);
26487
+ }
26488
+ }
26207
26489
  walletAddress = await this.spoke.bitcoin.getEffectiveWalletAddress(personalAddress);
26208
- await this.spoke.bitcoin.radfi.ensureRadfiAccessToken(_params.walletProvider);
26209
26490
  }
26210
26491
  const creatorHubWalletAddress = await this.hubProvider.getUserHubWalletAddress(walletAddress, params.srcChainKey);
26211
26492
  if (isHubChainKeyType(params.srcChainKey) && isSonicChainKeyType(params.srcChainKey)) {
@@ -26213,7 +26494,7 @@ var SwapService = class {
26213
26494
  createIntentParams: params,
26214
26495
  creatorHubWalletAddress,
26215
26496
  solverConfig: this.solver,
26216
- fee: this.config.swaps.partnerFee,
26497
+ fee: partnerFee,
26217
26498
  hubProvider: this.hubProvider
26218
26499
  };
26219
26500
  const [txResult2, intent2, feeAmount2, data2] = await SonicSpokeService.createSwapIntent(
@@ -26239,11 +26520,14 @@ var SwapService = class {
26239
26520
  },
26240
26521
  creatorHubWalletAddress,
26241
26522
  this.config,
26242
- this.config.swaps.partnerFee
26523
+ partnerFee
26243
26524
  );
26244
26525
  const coreDepositParams = {
26245
26526
  srcChainKey: params.srcChainKey,
26246
26527
  srcAddress: walletAddress,
26528
+ srcPublicKey: extras?.srcPublicKey,
26529
+ // Bitcoin Bound token; BitcoinSpokeService.deposit falls back to the RadfiProvider instance token when undefined.
26530
+ accessToken: extras?.bound?.accessToken,
26247
26531
  to: creatorHubWalletAddress,
26248
26532
  token: params.inputToken,
26249
26533
  amount: params.inputAmount,
@@ -26562,6 +26846,11 @@ var SwapService = class {
26562
26846
  * Use this after `getStatus` returns `SolverIntentStatusCode.SOLVED (3)` to obtain the
26563
26847
  * destination-chain transaction hash from `packet.dst_tx_hash`.
26564
26848
  *
26849
+ * A single solver fill tx emits multiple relay packets sharing the same `src_tx_hash`. The
26850
+ * user-facing `IntentFilled` delivery is the packet whose payload targets the hub intents
26851
+ * contract; `selectSolvedIntentPacket` disambiguates so the returned `dst_tx_hash` is the
26852
+ * destination delivery tx rather than an internal hop.
26853
+ *
26565
26854
  * @param chainId - The destination spoke chain key (where output tokens are delivered).
26566
26855
  * @param fillTxHash - The solver's fill transaction hash, obtained from `getStatus.fill_tx_hash`.
26567
26856
  * @param timeout - Poll timeout in milliseconds. Defaults to `DEFAULT_RELAY_TX_TIMEOUT` (120 s).
@@ -26577,7 +26866,8 @@ var SwapService = class {
26577
26866
  intentRelayChainId: getIntentRelayChainId(chainId).toString(),
26578
26867
  srcTxHash: fillTxHash,
26579
26868
  timeout,
26580
- apiUrl: this.relayerApiEndpoint
26869
+ apiUrl: this.relayerApiEndpoint,
26870
+ selectPacket: (packets) => selectSolvedIntentPacket(packets, this.solver.intentsContract)
26581
26871
  });
26582
26872
  }
26583
26873
  /**
@@ -29102,10 +29392,10 @@ var BridgeService = class {
29102
29392
  * @returns Fee amount to be deducted, in the same units as `inputAmount`.
29103
29393
  */
29104
29394
  getFee(inputAmount) {
29105
- if (!this.config.bridge.partnerFee) {
29395
+ if (!this.config.bridgePartnerFee) {
29106
29396
  return 0n;
29107
29397
  }
29108
- return calculateFeeAmount(inputAmount, this.config.bridge.partnerFee);
29398
+ return calculateFeeAmount(inputAmount, this.config.bridgePartnerFee);
29109
29399
  }
29110
29400
  /**
29111
29401
  * Checks whether the caller has sufficient token allowance to execute the bridge.
@@ -29382,7 +29672,7 @@ var BridgeService = class {
29382
29672
  }
29383
29673
  const hubWallet = await this.hubProvider.getUserHubWalletAddress(walletAddress, params.srcChainKey);
29384
29674
  const effectiveSkipSimulation = skipSimulation || isBitcoinChainKeyType(params.srcChainKey) && this.spoke.bitcoin.walletMode === "USER";
29385
- const data = this.buildBridgeData(params, srcToken, dstToken, this.config.bridge.partnerFee);
29675
+ const data = this.buildBridgeData(params, srcToken, dstToken, this.config.bridgePartnerFee);
29386
29676
  const coreParams = {
29387
29677
  srcChainKey: params.srcChainKey,
29388
29678
  srcAddress: walletAddress,
@@ -35261,7 +35551,7 @@ var MoneyMarketService = class _MoneyMarketService {
35261
35551
  this.config = config;
35262
35552
  this.hubProvider = hubProvider;
35263
35553
  this.spoke = spoke;
35264
- this.partnerFee = config.moneyMarket.partnerFee;
35554
+ this.partnerFee = config.moneyMarketPartnerFee;
35265
35555
  this.relayerApiEndpoint = config.relay.relayerApiEndpoint;
35266
35556
  this.data = new MoneyMarketDataService({ hubProvider, config });
35267
35557
  }
@@ -37403,7 +37693,7 @@ var LeverageYieldService = class {
37403
37693
  * `UNKNOWN` (defensive fallback).
37404
37694
  */
37405
37695
  async createVaultIntent(_params) {
37406
- const { params, skipSimulation, hubWalletSwap, partnerFee = this.config.swaps.partnerFee } = _params;
37696
+ const { params, skipSimulation, hubWalletSwap, partnerFee = this.config.swapPartnerFee } = _params;
37407
37697
  const baseCtx = { srcChainKey: params.srcChainKey, dstChainKey: params.dstChainKey };
37408
37698
  try {
37409
37699
  leverageYieldInvariant(
@@ -38035,11 +38325,18 @@ var Sodax = class {
38035
38325
  // hub provider for the hub chain (e.g. Sonic mainnet)
38036
38326
  spoke;
38037
38327
  // spoke service enabling spoke chain operations
38038
- constructor(config) {
38039
- const logger = resolveLogger(config?.logger);
38040
- this.instanceConfig = config ? mergeSodaxConfig(sodaxConfig, config) : sodaxConfig;
38328
+ constructor(options) {
38329
+ const logger = resolveLogger(options?.logger);
38330
+ const fee = options?.fee;
38331
+ this.instanceConfig = options ? mergeSodaxConfig(sodaxConfig, options) : sodaxConfig;
38041
38332
  this.backendApi = new BackendApiService(this.instanceConfig.api, logger);
38042
- this.config = new ConfigService({ api: this.backendApi, config: this.instanceConfig, userConfig: config, logger });
38333
+ this.config = new ConfigService({
38334
+ api: this.backendApi,
38335
+ config: this.instanceConfig,
38336
+ userConfig: options,
38337
+ logger,
38338
+ fee
38339
+ });
38043
38340
  this.hubProvider = new EvmHubProvider({ config: this.config });
38044
38341
  this.spoke = new SpokeService({ config: this.config, hubProvider: this.hubProvider });
38045
38342
  this.swaps = new SwapService({
@@ -38119,4 +38416,4 @@ var isPartnerError = isCodeMember(PARTNER_CODES);
38119
38416
  (*! scure-base - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
38120
38417
  */
38121
38418
 
38122
- 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, LeverageYieldService, LockupMultiplier, LockupPeriod, LsodaSymbols, LsodaTokens, MAX_UINT256, MigrationService, MintPositionEventAbi, MoneyMarketDataService, MoneyMarketService, NEAR_CHAIN_KEYS, NEAR_CHAIN_KEYS_SET, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, 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, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, concentratedLiquidityConfig, connectionAbi, consoleLogger, 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, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, 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, leverageYieldConfig, leverageYieldInvariant, leverageYieldVaults, lightlinkSupportedTokens, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, moneyMarketConfig, moneyMarketReserveAssets, moneyMarketSupportedTokens, nativeToUSD, nearSupportedTokens, newbnUSDSpokeChainIds, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, optimismSupportedTokens, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, polygonSupportedTokens, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, redbellySupportedTokens, relayConfig, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, 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, usesBip322MessageSigning, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
38419
+ 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, LeverageYieldService, LockupMultiplier, LockupPeriod, LsodaSymbols, LsodaTokens, MAX_UINT256, MigrationService, MintPositionEventAbi, MoneyMarketDataService, MoneyMarketService, NEAR_CHAIN_KEYS, NEAR_CHAIN_KEYS_SET, NEAR_DEFAULT_GAS, NEAR_STORAGE_DEPOSIT, 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, calcOpReturnOutputVbytes, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, clPoolAbi, clPoolManagerAbi, clPositionManagerAbi, clQuoterAbi, clRouterAbi, clTickLensAbi, concentratedLiquidityConfig, connectionAbi, consoleLogger, 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, getStagingSolverTokens, 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, isLeverageYieldAllowanceCheckError, isLeverageYieldApproveError, isLeverageYieldCreateIntentError, isLeverageYieldError, isLeverageYieldLookupError, isLeverageYieldPostExecutionError, isLeverageYieldSwapError, 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, leverageYieldConfig, leverageYieldInvariant, leverageYieldVaults, lightlinkSupportedTokens, lookupFailed, mapRelayFailure, mergeSodaxConfig, messageOf, migrationInvariant, mintPositionParamsAbi, mmInvariant, modifyLiquidityParamsAbi, moneyMarketConfig, moneyMarketReserveAssets, moneyMarketSupportedTokens, nativeToUSD, nearSupportedTokens, newbnUSDSpokeChainIds, normalize, normalizeBN, normalizePsbtToBase64, normalizeSignatureToBase64, normalizedToUsd, optimismSupportedTokens, pancakeSwapInfinityDefaultHookAbi, pancakeSwapInfinityPoolManagerAbi, pancakeSwapInfinityPositionManagerAbi, parseToStroops, parseTokenArrayFromJson, partnerInvariant, permit2Abi, polygonSupportedTokens, poolAbi, poolKeyAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, recoveryInvariant, redbellySupportedTokens, relayConfig, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, resolveLogger, retry, reverseEncodeAddress, serializeAddressData, silentLogger, sleep, sodaxConfig, sodaxInvariant, solanaSupportedTokens, solverConfig, sonicSupportedTokens, sonicWalletFactoryAbi, spokeAssetManagerAbi, spokeChainConfig, spokeChainKeysSet, stacksSupportedTokens, stagingSwapSupportedTokens, stakedSodaAbi, stakingInvariant, stakingRouterAbi, stataTokenFactoryAbi, stellarSupportedTokens, submitTransaction, suiSupportedTokens, supportedSpokeChains, supportedTokensByChain, swapExactInSingleParamsAbi, swapInvariant, swapSupportedTokens, swapsConfig, uiPoolDataAbi, universalRouterAbi, unknownFailed, usesBip322MessageSigning, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, verifyFailed, wadToRay, waitForStacksTransaction, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };