@sodax/sdk 0.0.1-rc.34 → 0.0.1-rc.36

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
@@ -1,6 +1,6 @@
1
- import { getAbiItem, encodeAbiParameters, parseAbiParameters, fromHex, createPublicClient, http, toHex, erc20Abi as erc20Abi$1, encodeFunctionData, decodeAbiParameters, encodePacked, parseEventLogs, keccak256, isAddress } from 'viem';
1
+ import { getAbiItem, defineChain, encodeAbiParameters, parseAbiParameters, fromHex, createPublicClient, http, toHex, erc20Abi as erc20Abi$1, encodeFunctionData, decodeAbiParameters, encodePacked, parseEventLogs, keccak256, isAddress } from 'viem';
2
2
  import { nibiru, polygon, bsc, optimism, base, arbitrum, avalanche, sonic } from 'viem/chains';
3
- import { SONIC_MAINNET_CHAIN_ID, SPOKE_CHAIN_IDS, ICON_MAINNET_CHAIN_ID, SUI_MAINNET_CHAIN_ID, STELLAR_MAINNET_CHAIN_ID, INJECTIVE_MAINNET_CHAIN_ID, POLYGON_MAINNET_CHAIN_ID, BSC_MAINNET_CHAIN_ID, OPTIMISM_MAINNET_CHAIN_ID, BASE_MAINNET_CHAIN_ID, ARBITRUM_MAINNET_CHAIN_ID, NIBIRU_MAINNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, SOLANA_MAINNET_CHAIN_ID } from '@sodax/types';
3
+ import { SONIC_MAINNET_CHAIN_ID, SPOKE_CHAIN_IDS, ICON_MAINNET_CHAIN_ID, SUI_MAINNET_CHAIN_ID, STELLAR_MAINNET_CHAIN_ID, INJECTIVE_MAINNET_CHAIN_ID, HYPEREVM_MAINNET_CHAIN_ID, POLYGON_MAINNET_CHAIN_ID, BSC_MAINNET_CHAIN_ID, OPTIMISM_MAINNET_CHAIN_ID, BASE_MAINNET_CHAIN_ID, ARBITRUM_MAINNET_CHAIN_ID, NIBIRU_MAINNET_CHAIN_ID, AVALANCHE_MAINNET_CHAIN_ID, SOLANA_MAINNET_CHAIN_ID } from '@sodax/types';
4
4
  export * from '@sodax/types';
5
5
  import { ChainGrpcWasmApi, TxGrpcApi, toBase64, fromBase64 } from '@injectivelabs/sdk-ts';
6
6
  import { getNetworkEndpoints, Network } from '@injectivelabs/networks';
@@ -6133,7 +6133,8 @@ var INTENT_RELAY_CHAIN_IDS = {
6133
6133
  OPTIMISM: 24n,
6134
6134
  POLYGON: 5n,
6135
6135
  ARBITRUM: 23n,
6136
- NIBIRU: 7235938n
6136
+ NIBIRU: 7235938n,
6137
+ HYPER: 26745n
6137
6138
  };
6138
6139
  var EVM_CHAIN_IDS = [
6139
6140
  AVALANCHE_MAINNET_CHAIN_ID,
@@ -6143,7 +6144,8 @@ var EVM_CHAIN_IDS = [
6143
6144
  SONIC_MAINNET_CHAIN_ID,
6144
6145
  OPTIMISM_MAINNET_CHAIN_ID,
6145
6146
  POLYGON_MAINNET_CHAIN_ID,
6146
- NIBIRU_MAINNET_CHAIN_ID
6147
+ NIBIRU_MAINNET_CHAIN_ID,
6148
+ HYPEREVM_MAINNET_CHAIN_ID
6147
6149
  ];
6148
6150
  var EVM_SPOKE_CHAIN_IDS = [
6149
6151
  AVALANCHE_MAINNET_CHAIN_ID,
@@ -6153,7 +6155,8 @@ var EVM_SPOKE_CHAIN_IDS = [
6153
6155
  OPTIMISM_MAINNET_CHAIN_ID,
6154
6156
  POLYGON_MAINNET_CHAIN_ID,
6155
6157
  NIBIRU_MAINNET_CHAIN_ID,
6156
- SONIC_MAINNET_CHAIN_ID
6158
+ SONIC_MAINNET_CHAIN_ID,
6159
+ HYPEREVM_MAINNET_CHAIN_ID
6157
6160
  ];
6158
6161
  var ChainIdToIntentRelayChainId = {
6159
6162
  [AVALANCHE_MAINNET_CHAIN_ID]: INTENT_RELAY_CHAIN_IDS.AVAX,
@@ -6168,9 +6171,34 @@ var ChainIdToIntentRelayChainId = {
6168
6171
  [SUI_MAINNET_CHAIN_ID]: INTENT_RELAY_CHAIN_IDS.SUI,
6169
6172
  [STELLAR_MAINNET_CHAIN_ID]: INTENT_RELAY_CHAIN_IDS.STELLAR,
6170
6173
  [ICON_MAINNET_CHAIN_ID]: INTENT_RELAY_CHAIN_IDS.ICON,
6171
- [NIBIRU_MAINNET_CHAIN_ID]: INTENT_RELAY_CHAIN_IDS.NIBIRU
6174
+ [NIBIRU_MAINNET_CHAIN_ID]: INTENT_RELAY_CHAIN_IDS.NIBIRU,
6175
+ [HYPEREVM_MAINNET_CHAIN_ID]: INTENT_RELAY_CHAIN_IDS.HYPER
6172
6176
  };
6173
6177
  var getIntentRelayChainId = (chainId) => ChainIdToIntentRelayChainId[chainId];
6178
+ var hyper = /* @__PURE__ */ defineChain({
6179
+ id: 999,
6180
+ name: "HyperEVM",
6181
+ nativeCurrency: {
6182
+ decimals: 18,
6183
+ name: "HYPE",
6184
+ symbol: "HYPE"
6185
+ },
6186
+ rpcUrls: {
6187
+ default: { http: ["https://rpc.hyperliquid.xyz/evm"] }
6188
+ },
6189
+ blockExplorers: {
6190
+ default: {
6191
+ name: "HyperEVMScan",
6192
+ url: "https://hyperevmscan.io/"
6193
+ }
6194
+ },
6195
+ contracts: {
6196
+ multicall3: {
6197
+ address: "0xcA11bde05977b3631167028862bE2a173976CA11",
6198
+ blockCreated: 13051
6199
+ }
6200
+ }
6201
+ });
6174
6202
  function getEvmViemChain(id) {
6175
6203
  switch (id) {
6176
6204
  case SONIC_MAINNET_CHAIN_ID:
@@ -6189,6 +6217,8 @@ function getEvmViemChain(id) {
6189
6217
  return polygon;
6190
6218
  case NIBIRU_MAINNET_CHAIN_ID:
6191
6219
  return nibiru;
6220
+ case HYPEREVM_MAINNET_CHAIN_ID:
6221
+ return hyper;
6192
6222
  default:
6193
6223
  throw new Error(`Unsupported EVM chain ID: ${id}`);
6194
6224
  }
@@ -6209,7 +6239,8 @@ var HubVaultSymbols = [
6209
6239
  "sodaPOL",
6210
6240
  "sodaNIBI",
6211
6241
  "sodaS",
6212
- "IbnUSD"
6242
+ "IbnUSD",
6243
+ "sodaHYPE"
6213
6244
  ];
6214
6245
  var SodaTokens = {
6215
6246
  sodaBNB: {
@@ -6323,6 +6354,13 @@ var SodaTokens = {
6323
6354
  decimals: 18,
6324
6355
  address: "0x21685E341DE7844135329914Be6Bd8D16982d834",
6325
6356
  xChainId: SONIC_MAINNET_CHAIN_ID
6357
+ },
6358
+ sodaHYPE: {
6359
+ symbol: "sodaHYPE",
6360
+ name: "Soda HYPE",
6361
+ decimals: 18,
6362
+ address: "0x6E81124fC5d2Bf666B16a0A5d90066eBf35c7411",
6363
+ xChainId: SONIC_MAINNET_CHAIN_ID
6326
6364
  }
6327
6365
  };
6328
6366
  var SodaTokensAsHubAssets = Object.values(SodaTokens).reduce(
@@ -6860,6 +6898,42 @@ var spokeChainConfig = {
6860
6898
  }
6861
6899
  }
6862
6900
  },
6901
+ [HYPEREVM_MAINNET_CHAIN_ID]: {
6902
+ chain: {
6903
+ name: "HyperEVM",
6904
+ id: HYPEREVM_MAINNET_CHAIN_ID,
6905
+ type: "EVM"
6906
+ },
6907
+ addresses: {
6908
+ assetManager: "0xAfd6A6e4287A511D3BAAd013093815268846FBb7",
6909
+ connection: "0xA143488cDc5B74B366231E6A4d5a55A2D9Dc8484"
6910
+ },
6911
+ nativeToken: "0x0000000000000000000000000000000000000000",
6912
+ bnUSD: "0x506Ba7C8d91dAdf7a91eE677a205D9687b751579",
6913
+ supportedTokens: {
6914
+ HYPE: {
6915
+ symbol: "HYPE",
6916
+ name: "HYPE",
6917
+ decimals: 18,
6918
+ address: "0x0000000000000000000000000000000000000000",
6919
+ xChainId: HYPEREVM_MAINNET_CHAIN_ID
6920
+ },
6921
+ bnUSD: {
6922
+ symbol: "bnUSD",
6923
+ name: "bnUSD",
6924
+ decimals: 18,
6925
+ address: "0x506Ba7C8d91dAdf7a91eE677a205D9687b751579",
6926
+ xChainId: HYPEREVM_MAINNET_CHAIN_ID
6927
+ },
6928
+ SODA: {
6929
+ symbol: "SODA",
6930
+ name: "SODAX",
6931
+ decimals: 18,
6932
+ address: "0xA28C70F92a1B2513edCdDD29c2E5195a4B785aB2",
6933
+ xChainId: HYPEREVM_MAINNET_CHAIN_ID
6934
+ }
6935
+ }
6936
+ },
6863
6937
  [INJECTIVE_MAINNET_CHAIN_ID]: {
6864
6938
  addresses: {
6865
6939
  assetManager: "inj1dg6tm62uup53wn2kn97caeqfwt0sukx3qjk8rw",
@@ -7173,7 +7247,8 @@ var hubVaults = {
7173
7247
  "0x11b93c162aabffd026539bb3b9f9ec22c8b7ef8a",
7174
7248
  "0x69425ffb14704124a58d6f69d510f74a59d9a5bc",
7175
7249
  "0x9d4b663eb075d2a1c7b8eaefb9eccc0510388b51",
7176
- "0xD1d14BF3324C901855A1f7d0d5CA4c8458D2a780"
7250
+ "0xD1d14BF3324C901855A1f7d0d5CA4c8458D2a780",
7251
+ "0x19feaf3043dfa69b365d05495630e840a2b9a9dc"
7177
7252
  ]
7178
7253
  },
7179
7254
  [SodaTokens.sodaSODA.symbol]: {
@@ -7195,7 +7270,8 @@ var hubVaults = {
7195
7270
  "0x07Db7b1a96ebE474B20F52fF487cEE415adee79e",
7196
7271
  "0x20Ce75CdcEe44B1308365447b91B9c26e2b71Ffd",
7197
7272
  "0x5Db9CEc919f40C50809D9490DC3BbA4F05b0a1D7",
7198
- "0x655730024B673B3378CD6031B1Cd01eaE9afb138"
7273
+ "0x655730024B673B3378CD6031B1Cd01eaE9afb138",
7274
+ "0x4cf5ce9594aeddc5d3efe9d4cdf0b944b4e73a53"
7199
7275
  ]
7200
7276
  },
7201
7277
  [SodaTokens.sodaAVAX.symbol]: {
@@ -7314,6 +7390,10 @@ var hubVaults = {
7314
7390
  "0x9d58508ad10d34048a11640735ca5075bba07b35",
7315
7391
  "0xC1df02fb7b1b06bE886592C89F6955387998B2f7"
7316
7392
  ]
7393
+ },
7394
+ [SodaTokens.sodaHYPE.symbol]: {
7395
+ address: "0x6e81124fc5d2bf666b16a0a5d90066ebf35c7411",
7396
+ reserves: ["0x7288622bc2d39553f34d5b81c88c3f979d91dbc7"]
7317
7397
  }
7318
7398
  };
7319
7399
  var hubVaultTokensMap = new Map(
@@ -7726,6 +7806,29 @@ var hubAssets = {
7726
7806
  vault: hubVaults.sodaSODA.address
7727
7807
  }
7728
7808
  },
7809
+ [HYPEREVM_MAINNET_CHAIN_ID]: {
7810
+ [spokeChainConfig[HYPEREVM_MAINNET_CHAIN_ID].nativeToken]: {
7811
+ asset: "0x7288622bc2D39553f34D5b81c88c3F979d91dbc7",
7812
+ decimal: 18,
7813
+ symbol: "HYPE",
7814
+ name: "HYPE",
7815
+ vault: hubVaults.sodaHYPE.address
7816
+ },
7817
+ [spokeChainConfig[HYPEREVM_MAINNET_CHAIN_ID].bnUSD]: {
7818
+ asset: "0x19feaf3043dfa69b365d05495630e840a2b9a9dc",
7819
+ decimal: 18,
7820
+ symbol: "bnUSD",
7821
+ name: "bnUSD",
7822
+ vault: hubVaults.bnUSD.address
7823
+ },
7824
+ [spokeChainConfig[HYPEREVM_MAINNET_CHAIN_ID].supportedTokens.SODA.address]: {
7825
+ asset: "0x4cf5ce9594aeddc5d3efe9d4cdf0b944b4e73a53",
7826
+ decimal: 18,
7827
+ symbol: "SODA",
7828
+ name: "SODAX",
7829
+ vault: hubVaults.sodaSODA.address
7830
+ }
7831
+ },
7729
7832
  [INJECTIVE_MAINNET_CHAIN_ID]: {
7730
7833
  [spokeChainConfig[INJECTIVE_MAINNET_CHAIN_ID].supportedTokens.INJ.address]: {
7731
7834
  asset: "0xd375590b4955f6ea5623f799153f9b787a3bd319",
@@ -8002,6 +8105,7 @@ var solverSupportedTokens = {
8002
8105
  spokeChainConfig[BSC_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
8003
8106
  spokeChainConfig[BSC_MAINNET_CHAIN_ID].supportedTokens.USDC
8004
8107
  ],
8108
+ [HYPEREVM_MAINNET_CHAIN_ID]: [],
8005
8109
  [SOLANA_MAINNET_CHAIN_ID]: [
8006
8110
  spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.SOL,
8007
8111
  spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
@@ -8061,7 +8165,8 @@ var moneyMarketSupportedTokens = {
8061
8165
  spokeChainConfig[AVALANCHE_MAINNET_CHAIN_ID].supportedTokens.AVAX,
8062
8166
  spokeChainConfig[AVALANCHE_MAINNET_CHAIN_ID].supportedTokens.USDT,
8063
8167
  spokeChainConfig[AVALANCHE_MAINNET_CHAIN_ID].supportedTokens.USDC,
8064
- spokeChainConfig[AVALANCHE_MAINNET_CHAIN_ID].supportedTokens.bnUSD
8168
+ spokeChainConfig[AVALANCHE_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
8169
+ spokeChainConfig[AVALANCHE_MAINNET_CHAIN_ID].supportedTokens.SODA
8065
8170
  ],
8066
8171
  [ARBITRUM_MAINNET_CHAIN_ID]: [
8067
8172
  spokeChainConfig[ARBITRUM_MAINNET_CHAIN_ID].supportedTokens.ETH,
@@ -8071,7 +8176,8 @@ var moneyMarketSupportedTokens = {
8071
8176
  // spokeChainConfig[ARBITRUM_MAINNET_CHAIN_ID].supportedTokens.wstETH,
8072
8177
  spokeChainConfig[ARBITRUM_MAINNET_CHAIN_ID].supportedTokens.tBTC,
8073
8178
  spokeChainConfig[ARBITRUM_MAINNET_CHAIN_ID].supportedTokens.USDT,
8074
- spokeChainConfig[ARBITRUM_MAINNET_CHAIN_ID].supportedTokens.USDC
8179
+ spokeChainConfig[ARBITRUM_MAINNET_CHAIN_ID].supportedTokens.USDC,
8180
+ spokeChainConfig[ARBITRUM_MAINNET_CHAIN_ID].supportedTokens.SODA
8075
8181
  ],
8076
8182
  [BASE_MAINNET_CHAIN_ID]: [
8077
8183
  spokeChainConfig[BASE_MAINNET_CHAIN_ID].supportedTokens.ETH,
@@ -8079,7 +8185,8 @@ var moneyMarketSupportedTokens = {
8079
8185
  // spokeChainConfig[BASE_MAINNET_CHAIN_ID].supportedTokens.weETH,
8080
8186
  spokeChainConfig[BASE_MAINNET_CHAIN_ID].supportedTokens.USDC,
8081
8187
  // spokeChainConfig[BASE_MAINNET_CHAIN_ID].supportedTokens.wstETH,
8082
- spokeChainConfig[BASE_MAINNET_CHAIN_ID].supportedTokens.cbBTC
8188
+ spokeChainConfig[BASE_MAINNET_CHAIN_ID].supportedTokens.cbBTC,
8189
+ spokeChainConfig[BASE_MAINNET_CHAIN_ID].supportedTokens.SODA
8083
8190
  ],
8084
8191
  [OPTIMISM_MAINNET_CHAIN_ID]: [
8085
8192
  spokeChainConfig[OPTIMISM_MAINNET_CHAIN_ID].supportedTokens.ETH,
@@ -8087,23 +8194,32 @@ var moneyMarketSupportedTokens = {
8087
8194
  spokeChainConfig[OPTIMISM_MAINNET_CHAIN_ID].supportedTokens.USDC,
8088
8195
  // spokeChainConfig[OPTIMISM_MAINNET_CHAIN_ID].supportedTokens.wstETH,
8089
8196
  // spokeChainConfig[OPTIMISM_MAINNET_CHAIN_ID].supportedTokens.weETH,
8090
- spokeChainConfig[OPTIMISM_MAINNET_CHAIN_ID].supportedTokens.USDT
8197
+ spokeChainConfig[OPTIMISM_MAINNET_CHAIN_ID].supportedTokens.USDT,
8198
+ spokeChainConfig[OPTIMISM_MAINNET_CHAIN_ID].supportedTokens.SODA
8091
8199
  ],
8092
8200
  [POLYGON_MAINNET_CHAIN_ID]: [
8093
8201
  spokeChainConfig[POLYGON_MAINNET_CHAIN_ID].supportedTokens.POL,
8094
8202
  spokeChainConfig[POLYGON_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
8095
- spokeChainConfig[POLYGON_MAINNET_CHAIN_ID].supportedTokens.USDC
8203
+ spokeChainConfig[POLYGON_MAINNET_CHAIN_ID].supportedTokens.USDC,
8204
+ spokeChainConfig[POLYGON_MAINNET_CHAIN_ID].supportedTokens.SODA
8096
8205
  ],
8097
8206
  [BSC_MAINNET_CHAIN_ID]: [
8098
8207
  spokeChainConfig[BSC_MAINNET_CHAIN_ID].supportedTokens.BNB,
8099
8208
  spokeChainConfig[BSC_MAINNET_CHAIN_ID].supportedTokens.ETHB,
8100
8209
  spokeChainConfig[BSC_MAINNET_CHAIN_ID].supportedTokens.BTCB,
8101
- spokeChainConfig[BSC_MAINNET_CHAIN_ID].supportedTokens.bnUSD
8210
+ spokeChainConfig[BSC_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
8211
+ spokeChainConfig[BSC_MAINNET_CHAIN_ID].supportedTokens.SODA
8212
+ ],
8213
+ [HYPEREVM_MAINNET_CHAIN_ID]: [
8214
+ spokeChainConfig[HYPEREVM_MAINNET_CHAIN_ID].supportedTokens.HYPE,
8215
+ spokeChainConfig[HYPEREVM_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
8216
+ spokeChainConfig[HYPEREVM_MAINNET_CHAIN_ID].supportedTokens.SODA
8102
8217
  ],
8103
8218
  [SOLANA_MAINNET_CHAIN_ID]: [
8104
8219
  spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.SOL,
8105
8220
  spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
8106
- spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.USDC
8221
+ spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.USDC,
8222
+ spokeChainConfig[SOLANA_MAINNET_CHAIN_ID].supportedTokens.SODA
8107
8223
  ],
8108
8224
  [ICON_MAINNET_CHAIN_ID]: [
8109
8225
  // spokeChainConfig[ICON_MAINNET_CHAIN_ID].supportedTokens.ICX,
@@ -8112,17 +8228,20 @@ var moneyMarketSupportedTokens = {
8112
8228
  ],
8113
8229
  [STELLAR_MAINNET_CHAIN_ID]: [
8114
8230
  spokeChainConfig[STELLAR_MAINNET_CHAIN_ID].supportedTokens.XLM,
8115
- spokeChainConfig[STELLAR_MAINNET_CHAIN_ID].supportedTokens.bnUSD
8231
+ spokeChainConfig[STELLAR_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
8232
+ spokeChainConfig[STELLAR_MAINNET_CHAIN_ID].supportedTokens.SODA
8116
8233
  ],
8117
8234
  [SUI_MAINNET_CHAIN_ID]: [
8118
8235
  spokeChainConfig[SUI_MAINNET_CHAIN_ID].supportedTokens.SUI,
8119
8236
  spokeChainConfig[SUI_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
8120
- spokeChainConfig[SUI_MAINNET_CHAIN_ID].supportedTokens.USDC
8237
+ spokeChainConfig[SUI_MAINNET_CHAIN_ID].supportedTokens.USDC,
8238
+ spokeChainConfig[SUI_MAINNET_CHAIN_ID].supportedTokens.SODA
8121
8239
  ],
8122
8240
  [INJECTIVE_MAINNET_CHAIN_ID]: [
8123
8241
  spokeChainConfig[INJECTIVE_MAINNET_CHAIN_ID].supportedTokens.INJ,
8124
8242
  spokeChainConfig[INJECTIVE_MAINNET_CHAIN_ID].supportedTokens.bnUSD,
8125
- spokeChainConfig[INJECTIVE_MAINNET_CHAIN_ID].supportedTokens.USDC
8243
+ spokeChainConfig[INJECTIVE_MAINNET_CHAIN_ID].supportedTokens.USDC,
8244
+ spokeChainConfig[INJECTIVE_MAINNET_CHAIN_ID].supportedTokens.SODA
8126
8245
  ],
8127
8246
  [NIBIRU_MAINNET_CHAIN_ID]: [],
8128
8247
  [SONIC_MAINNET_CHAIN_ID]: [
@@ -8130,7 +8249,8 @@ var moneyMarketSupportedTokens = {
8130
8249
  spokeChainConfig[SONIC_MAINNET_CHAIN_ID].supportedTokens.WETH,
8131
8250
  spokeChainConfig[SONIC_MAINNET_CHAIN_ID].supportedTokens.USDC,
8132
8251
  spokeChainConfig[SONIC_MAINNET_CHAIN_ID].supportedTokens.USDT,
8133
- spokeChainConfig[SONIC_MAINNET_CHAIN_ID].supportedTokens.wS
8252
+ spokeChainConfig[SONIC_MAINNET_CHAIN_ID].supportedTokens.wS,
8253
+ spokeChainConfig[SONIC_MAINNET_CHAIN_ID].supportedTokens.SODA
8134
8254
  ]
8135
8255
  };
8136
8256
  var isMoneyMarketSupportedToken = (chainId, token) => moneyMarketSupportedTokens[chainId].some((t) => t.address.toLowerCase() === token.toLowerCase());
@@ -9350,7 +9470,7 @@ var SuiSpokeService = class _SuiSpokeService {
9350
9470
  };
9351
9471
 
9352
9472
  // src/entities/sui/SuiSpokeProvider.ts
9353
- var SuiSpokeProvider = class _SuiSpokeProvider {
9473
+ var SuiSpokeProvider = class {
9354
9474
  walletProvider;
9355
9475
  chainConfig;
9356
9476
  publicClient;
@@ -9381,7 +9501,7 @@ var SuiSpokeProvider = class _SuiSpokeProvider {
9381
9501
  async transfer(token, amount, to, data, raw) {
9382
9502
  const isNative2 = token.toLowerCase() === this.chainConfig.nativeToken.toLowerCase();
9383
9503
  const tx = new Transaction();
9384
- const walletAddress = await this.walletProvider.getWalletAddressBytes();
9504
+ const walletAddress = await this.walletProvider.getWalletAddress();
9385
9505
  const coin = isNative2 ? await this.getNativeCoin(tx, amount) : await this.getCoin(tx, token, amount, walletAddress);
9386
9506
  const connection = this.splitAddress(this.chainConfig.addresses.connection);
9387
9507
  const assetManager = this.splitAddress(await this.getAssetManagerAddress());
@@ -9495,10 +9615,6 @@ var SuiSpokeProvider = class _SuiSpokeProvider {
9495
9615
  async getWalletAddress() {
9496
9616
  return this.walletProvider.getWalletAddress();
9497
9617
  }
9498
- async getWalletAddressBytes() {
9499
- const address = await this.getWalletAddress();
9500
- return _SuiSpokeProvider.getAddressBCSBytes(address);
9501
- }
9502
9618
  static getAddressBCSBytes(suiaddress) {
9503
9619
  return toHex(bcs.Address.serialize(suiaddress).toBytes());
9504
9620
  }
@@ -10081,13 +10197,13 @@ var IconSpokeService = class _IconSpokeService {
10081
10197
  dstAddress,
10082
10198
  payload
10083
10199
  };
10084
- const walletAddressBytes = await spokeProvider.walletProvider.getWalletAddressBytes();
10085
- const transaction = new CallTransactionBuilder().from(walletAddressBytes).to(spokeProvider.chainConfig.addresses.connection).stepLimit(Converter.toBigNumber("2000000")).nid(spokeProvider.chainConfig.nid).version("0x3").timestamp((/* @__PURE__ */ new Date()).getTime() * 1e3).method("sendMessage").params(params).build();
10200
+ const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
10201
+ const transaction = new CallTransactionBuilder().from(walletAddress).to(spokeProvider.chainConfig.addresses.connection).stepLimit(Converter.toBigNumber("2000000")).nid(spokeProvider.chainConfig.nid).version("0x3").timestamp((/* @__PURE__ */ new Date()).getTime() * 1e3).method("sendMessage").params(params).build();
10086
10202
  if (raw) {
10087
10203
  return Converter.toRawTransaction(transaction);
10088
10204
  }
10089
10205
  return spokeProvider.walletProvider.sendTransaction({
10090
- from: walletAddressBytes,
10206
+ from: walletAddress,
10091
10207
  to: spokeProvider.chainConfig.addresses.connection,
10092
10208
  nid: spokeProvider.chainConfig.nid,
10093
10209
  value: "0x0",
@@ -10415,7 +10531,7 @@ var StellarSpokeService = class _StellarSpokeService {
10415
10531
  static async deposit(params, spokeProvider, hubProvider, raw) {
10416
10532
  const userWallet = params.to ?? await EvmWalletAbstraction.getUserHubWalletAddress(
10417
10533
  spokeProvider.chainConfig.chain.id,
10418
- params.from,
10534
+ encodeAddress(spokeProvider.chainConfig.chain.id, params.from),
10419
10535
  hubProvider
10420
10536
  );
10421
10537
  return _StellarSpokeService.transfer(
@@ -10448,7 +10564,7 @@ var StellarSpokeService = class _StellarSpokeService {
10448
10564
  static async getSimulateDepositParams(params, spokeProvider, hubProvider) {
10449
10565
  const to = params.to ?? await EvmWalletAbstraction.getUserHubWalletAddress(
10450
10566
  spokeProvider.chainConfig.chain.id,
10451
- params.from,
10567
+ encodeAddress(spokeProvider.chainConfig.chain.id, params.from),
10452
10568
  hubProvider
10453
10569
  );
10454
10570
  return {
@@ -11198,6 +11314,7 @@ var SpokeService = class _SpokeService {
11198
11314
  );
11199
11315
  }
11200
11316
  if (spokeProvider instanceof SuiSpokeProvider) {
11317
+ await _SpokeService.verifyDepositSimulation(params, spokeProvider, hubProvider, skipSimulation);
11201
11318
  return SuiSpokeService.deposit(
11202
11319
  params,
11203
11320
  spokeProvider,
@@ -11330,7 +11447,10 @@ var SpokeService = class _SpokeService {
11330
11447
  {
11331
11448
  target: from,
11332
11449
  srcChainId: getIntentRelayChainId(spokeProvider.chainConfig.chain.id),
11333
- srcAddress: await spokeProvider.walletProvider.getWalletAddressBytes(),
11450
+ srcAddress: encodeAddress(
11451
+ spokeProvider.chainConfig.chain.id,
11452
+ await spokeProvider.walletProvider.getWalletAddress()
11453
+ ),
11334
11454
  payload
11335
11455
  },
11336
11456
  hubProvider
@@ -11383,7 +11503,10 @@ var SpokeService = class _SpokeService {
11383
11503
  {
11384
11504
  target: from,
11385
11505
  srcChainId: getIntentRelayChainId(spokeProvider.chainConfig.chain.id),
11386
- srcAddress: await spokeProvider.walletProvider.getWalletAddressBytes(),
11506
+ srcAddress: encodeAddress(
11507
+ spokeProvider.chainConfig.chain.id,
11508
+ await spokeProvider.walletProvider.getWalletAddress()
11509
+ ),
11387
11510
  payload
11388
11511
  },
11389
11512
  hubProvider
@@ -13403,16 +13526,17 @@ var MigrationService = class {
13403
13526
  */
13404
13527
  async migratebnUSD(params, spokeProvider, timeout = DEFAULT_RELAY_TX_TIMEOUT, unchecked = false) {
13405
13528
  try {
13406
- const txResult = await this.createMigratebnUSDIntent(params, spokeProvider, unchecked);
13407
- if (!txResult.ok) {
13529
+ const intentResult = await this.createMigratebnUSDIntent(params, spokeProvider, unchecked);
13530
+ if (!intentResult.ok) {
13408
13531
  return {
13409
13532
  ok: false,
13410
- error: txResult.error
13533
+ error: intentResult.error
13411
13534
  };
13412
13535
  }
13536
+ const [spokeTxHash, extraData] = intentResult.value;
13413
13537
  const packetResult = await relayTxAndWaitPacket(
13414
- txResult.value,
13415
- void 0,
13538
+ spokeTxHash,
13539
+ spokeProvider instanceof SolanaSpokeProvider ? extraData : void 0,
13416
13540
  spokeProvider,
13417
13541
  this.config.relayerApiEndpoint,
13418
13542
  timeout
@@ -13420,7 +13544,7 @@ var MigrationService = class {
13420
13544
  if (!packetResult.ok) {
13421
13545
  return packetResult;
13422
13546
  }
13423
- return { ok: true, value: [txResult.value, packetResult.value.dst_tx_hash] };
13547
+ return { ok: true, value: [spokeTxHash, packetResult.value.dst_tx_hash] };
13424
13548
  } catch (error) {
13425
13549
  return {
13426
13550
  ok: false,
@@ -13782,9 +13906,12 @@ var MigrationService = class {
13782
13906
  } else {
13783
13907
  throw new Error("srcbnUSD or dstbnUSD must be a legacy bnUSD token");
13784
13908
  }
13909
+ const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
13910
+ const creatorHubWalletAddress = await deriveUserWalletAddress(spokeProvider, this.hubProvider, walletAddress);
13785
13911
  const txResult = await SpokeService.deposit(
13786
13912
  {
13787
- from: await spokeProvider.walletProvider.getWalletAddress(),
13913
+ from: walletAddress,
13914
+ to: creatorHubWalletAddress,
13788
13915
  token: params.srcbnUSD,
13789
13916
  amount: params.amount,
13790
13917
  data: migrationData
@@ -13795,7 +13922,13 @@ var MigrationService = class {
13795
13922
  );
13796
13923
  return {
13797
13924
  ok: true,
13798
- value: txResult
13925
+ value: [
13926
+ txResult,
13927
+ {
13928
+ address: creatorHubWalletAddress,
13929
+ payload: migrationData
13930
+ }
13931
+ ]
13799
13932
  };
13800
13933
  } catch (error) {
13801
13934
  return {
@@ -17778,6 +17911,6 @@ var SolverIntentErrorCode = /* @__PURE__ */ ((SolverIntentErrorCode2) => {
17778
17911
  return SolverIntentErrorCode2;
17779
17912
  })(SolverIntentErrorCode || {});
17780
17913
 
17781
- export { BackendApiService, BalnSwapService, BigIntToHex, BigNumberZeroDecimal, BnUSDMigrationService, BridgeService, ChainIdToIntentRelayChainId, 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, EVM_CHAIN_IDS, EVM_SPOKE_CHAIN_IDS, Erc20Service, EvmAssetManagerService, EvmHubProvider, EvmSolverService, EvmSpokeProvider, EvmSpokeService, EvmVaultTokenService, EvmWalletAbstraction, FEE_PERCENTAGE_SCALE, HALF_RAY, HALF_WAD, HubVaultSymbols, ICON_TX_RESULT_WAIT_MAX_RETRY, INTENT_RELAY_CHAIN_IDS, IconSpokeProvider, IcxMigrationService, InjectiveSpokeProvider, IntentCreatedEventAbi, IntentDataType, IntentsAbi, LTV_PRECISION, LendingPoolService, LockupMultiplier, LockupPeriod, MAX_UINT256, MigrationService, MoneyMarketDataService, MoneyMarketService, RAY, RAY_DECIMALS, SECONDS_PER_YEAR, STELLAR_DEFAULT_TX_TIMEOUT_SECONDS, STELLAR_PRIORITY_FEE, SodaTokens, SodaTokensAsHubAssets, SodaVaultTokensSet, Sodax, SolanaSpokeProvider, SolverIntentErrorCode, SolverIntentStatusCode, SolverService, SonicSpokeProvider, SonicSpokeService, SpokeService, StellarSpokeProvider, SuiSpokeProvider, SuiSpokeService, SupportedMigrationTokens, USD_DECIMALS, UiPoolDataProviderService, VAULT_TOKEN_DECIMALS, WAD, WAD_RAY_RATIO, WEI_DECIMALS, WalletAbstractionService, adjustAmountByFee, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bnUSDLegacySpokeChainIds, bnUSDLegacyTokens, bnUSDNewTokens, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, chainIdToHubAssetsMap, connectionAbi, deriveUserWalletAddress, encodeAddress, encodeContractCalls, erc20Abi, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, getAllLegacybnUSDTokens, getAndFormatReserveEModes, getCompoundedBalance, getEvmViemChain, getHubAssetInfo, getHubChainConfig, getHubVaultTokenByAddress, getIconAddressBytes, getIntentRelayChainId, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getMoneyMarketConfig, getOriginalAssetAddress, getOriginalAssetInfoFromVault, getOriginalTokenFromOriginalAssetAddress, getPacket, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getSolverConfig, getSpokeChainIdFromIntentRelayChainId, getSupportedMoneyMarketTokens, getSupportedSolverTokens, getTransactionPackets, hexToBigInt, hubAssetToOriginalAssetMap, hubAssets, hubVaultTokensMap, hubVaults, hubVaultsAddressSet, intentRelayChainIdToSpokeChainIdMap, isBalnMigrateParams, isConfiguredMoneyMarketConfig, isConfiguredSolverConfig, isEvmHubChainConfig, isEvmInitializedConfig, isEvmSpokeChainConfig, isEvmSpokeProvider, isEvmUninitializedBrowserConfig, isEvmUninitializedConfig, isEvmUninitializedPrivateKeyConfig, isIconAddress, isIconSpokeProvider, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveSpokeProvider, isIntentCreationFailedError, isIntentCreationUnknownError, isIntentPostExecutionFailedError, isIntentRelayChainId, isIntentSubmitTxFailedError, isJsonRpcPayloadResponse, isLegacybnUSDChainId, isLegacybnUSDToken, isMoneyMarketBorrowUnknownError, isMoneyMarketCreateBorrowIntentFailedError, isMoneyMarketCreateRepayIntentFailedError, isMoneyMarketCreateSupplyIntentFailedError, isMoneyMarketCreateWithdrawIntentFailedError, isMoneyMarketRelayTimeoutError, isMoneyMarketRepayUnknownError, isMoneyMarketReserveAsset, isMoneyMarketReserveHubAsset, isMoneyMarketSubmitTxFailedError, isMoneyMarketSupplyUnknownError, isMoneyMarketSupportedToken, isMoneyMarketWithdrawUnknownError, isNativeToken, isNewbnUSDChainId, isNewbnUSDToken, isPartnerFeeAmount, isPartnerFeePercentage, isResponseAddressType, isResponseSigningType, isSodaVaultToken, isSolanaSpokeProvider, isSolverSupportedToken, isSonicSpokeProvider, isStellarSpokeProvider, isSuiSpokeProvider, isUnifiedBnUSDMigrateParams, isValidChainHubAsset, isValidHubAsset, isValidIntentRelayChainId, isValidOriginalAssetAddress, isValidSpokeChainId, isValidVault, isWaitUntilIntentExecutedFailed, moneyMarketReserveAssets, moneyMarketReserveHubAssetsSet, moneyMarketSupportedTokens, nativeToUSD, newbnUSDSpokeChainIds, normalize, normalizeBN, normalizedToUsd, originalAssetTohubAssetMap, poolAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, sonicWalletFactoryAbi, spokeAssetManagerAbi, spokeChainConfig, spokeChainIdsSet, submitTransaction, supportedHubAssets, supportedHubChains, supportedSodaAssets, supportedSpokeChains, supportedTokensPerChain, uiPoolDataAbi, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, wadToRay, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
17914
+ export { BackendApiService, BalnSwapService, BigIntToHex, BigNumberZeroDecimal, BnUSDMigrationService, BridgeService, ChainIdToIntentRelayChainId, 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, EVM_CHAIN_IDS, EVM_SPOKE_CHAIN_IDS, Erc20Service, EvmAssetManagerService, EvmHubProvider, EvmSolverService, EvmSpokeProvider, EvmSpokeService, EvmVaultTokenService, EvmWalletAbstraction, FEE_PERCENTAGE_SCALE, HALF_RAY, HALF_WAD, HubVaultSymbols, ICON_TX_RESULT_WAIT_MAX_RETRY, INTENT_RELAY_CHAIN_IDS, IconSpokeProvider, IcxMigrationService, InjectiveSpokeProvider, IntentCreatedEventAbi, IntentDataType, IntentsAbi, LTV_PRECISION, LendingPoolService, LockupMultiplier, LockupPeriod, MAX_UINT256, MigrationService, MoneyMarketDataService, MoneyMarketService, RAY, RAY_DECIMALS, SECONDS_PER_YEAR, STELLAR_DEFAULT_TX_TIMEOUT_SECONDS, STELLAR_PRIORITY_FEE, SodaTokens, SodaTokensAsHubAssets, SodaVaultTokensSet, Sodax, SolanaSpokeProvider, SolverIntentErrorCode, SolverIntentStatusCode, SolverService, SonicSpokeProvider, SonicSpokeService, SpokeService, StellarSpokeProvider, SuiSpokeProvider, SuiSpokeService, SupportedMigrationTokens, USD_DECIMALS, UiPoolDataProviderService, VAULT_TOKEN_DECIMALS, WAD, WAD_RAY_RATIO, WEI_DECIMALS, WalletAbstractionService, adjustAmountByFee, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bnUSDLegacySpokeChainIds, bnUSDLegacyTokens, bnUSDNewTokens, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, chainIdToHubAssetsMap, connectionAbi, deriveUserWalletAddress, encodeAddress, encodeContractCalls, erc20Abi, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, getAllLegacybnUSDTokens, getAndFormatReserveEModes, getCompoundedBalance, getEvmViemChain, getHubAssetInfo, getHubChainConfig, getHubVaultTokenByAddress, getIconAddressBytes, getIntentRelayChainId, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getMoneyMarketConfig, getOriginalAssetAddress, getOriginalAssetInfoFromVault, getOriginalTokenFromOriginalAssetAddress, getPacket, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getSolverConfig, getSpokeChainIdFromIntentRelayChainId, getSupportedMoneyMarketTokens, getSupportedSolverTokens, getTransactionPackets, hexToBigInt, hubAssetToOriginalAssetMap, hubAssets, hubVaultTokensMap, hubVaults, hubVaultsAddressSet, hyper, intentRelayChainIdToSpokeChainIdMap, isBalnMigrateParams, isConfiguredMoneyMarketConfig, isConfiguredSolverConfig, isEvmHubChainConfig, isEvmInitializedConfig, isEvmSpokeChainConfig, isEvmSpokeProvider, isEvmUninitializedBrowserConfig, isEvmUninitializedConfig, isEvmUninitializedPrivateKeyConfig, isIconAddress, isIconSpokeProvider, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveSpokeProvider, isIntentCreationFailedError, isIntentCreationUnknownError, isIntentPostExecutionFailedError, isIntentRelayChainId, isIntentSubmitTxFailedError, isJsonRpcPayloadResponse, isLegacybnUSDChainId, isLegacybnUSDToken, isMoneyMarketBorrowUnknownError, isMoneyMarketCreateBorrowIntentFailedError, isMoneyMarketCreateRepayIntentFailedError, isMoneyMarketCreateSupplyIntentFailedError, isMoneyMarketCreateWithdrawIntentFailedError, isMoneyMarketRelayTimeoutError, isMoneyMarketRepayUnknownError, isMoneyMarketReserveAsset, isMoneyMarketReserveHubAsset, isMoneyMarketSubmitTxFailedError, isMoneyMarketSupplyUnknownError, isMoneyMarketSupportedToken, isMoneyMarketWithdrawUnknownError, isNativeToken, isNewbnUSDChainId, isNewbnUSDToken, isPartnerFeeAmount, isPartnerFeePercentage, isResponseAddressType, isResponseSigningType, isSodaVaultToken, isSolanaSpokeProvider, isSolverSupportedToken, isSonicSpokeProvider, isStellarSpokeProvider, isSuiSpokeProvider, isUnifiedBnUSDMigrateParams, isValidChainHubAsset, isValidHubAsset, isValidIntentRelayChainId, isValidOriginalAssetAddress, isValidSpokeChainId, isValidVault, isWaitUntilIntentExecutedFailed, moneyMarketReserveAssets, moneyMarketReserveHubAssetsSet, moneyMarketSupportedTokens, nativeToUSD, newbnUSDSpokeChainIds, normalize, normalizeBN, normalizedToUsd, originalAssetTohubAssetMap, poolAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, sonicWalletFactoryAbi, spokeAssetManagerAbi, spokeChainConfig, spokeChainIdsSet, submitTransaction, supportedHubAssets, supportedHubChains, supportedSodaAssets, supportedSpokeChains, supportedTokensPerChain, uiPoolDataAbi, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, wadToRay, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
17782
17915
  //# sourceMappingURL=index.mjs.map
17783
17916
  //# sourceMappingURL=index.mjs.map