@sodax/sdk 1.2.4-beta → 1.2.5-beta
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.cjs +14 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -5
- package/dist/index.d.ts +7 -5
- package/dist/index.mjs +14 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconAddress, IInjectiveWalletProvider, InjectiveExecuteResponse, SolanaChainConfig, SolanaBase58PublicKey, SolanaRpcResponseAndContext, SolanaTokenAmount, SolanaRawTransactionInstruction, WalletAddressProvider, SolanaSerializedTransaction, ISolanaWalletProvider, StellarSpokeChainConfig, StellarRpcConfig, IStellarWalletProvider, SuiSpokeChainConfig, SuiPaginatedCoins, SuiExecutionResult, ISuiWalletProvider, Address, Erc20Token,
|
|
1
|
+
import { IconAddress, IInjectiveWalletProvider, InjectiveExecuteResponse, SolanaChainConfig, SolanaBase58PublicKey, SolanaRpcResponseAndContext, SolanaTokenAmount, SolanaRawTransactionInstruction, WalletAddressProvider, SolanaSerializedTransaction, ISolanaWalletProvider, StellarSpokeChainConfig, StellarRpcConfig, IStellarWalletProvider, SuiSpokeChainConfig, SuiPaginatedCoins, SuiExecutionResult, ISuiWalletProvider, Address, Erc20Token, SpokeChainId, HttpUrl, Token, GetMoneyMarketTokensApiResponse, SolverConfig, HubAsset, OriginalAssetAddress, XToken, Hex as Hex$1, defaultSharedConfig, IconSpokeChainConfig, IIconWalletProvider, EvmHubChainConfig, EvmSpokeChainConfig, IEvmWalletProvider, SpokeChainConfig, SonicSpokeChainConfig, EvmChainId, InjectiveSpokeChainConfig, JsonObject, InjectiveRawTransaction, AssetInfo, TokenInfo, HubAddress, ChainId, EvmRawTransaction, EvmRawTransactionReceipt, ChainType, Hash as Hash$1, IntentRelayChainId, StellarRawTransaction, MoneyMarketConfig, spokeChainConfig, ICON_MAINNET_CHAIN_ID, BaseSpokeChainConfig, IConfigApi, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, GetSwapTokensByChainIdApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetHubAssetsApiResponse, GetHubAssetsByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, HubAssetInfo, HubChainId, IconEoaAddress, HubChainConfig, BridgeLimit } from '@sodax/types';
|
|
2
2
|
export * from '@sodax/types';
|
|
3
3
|
import * as viem from 'viem';
|
|
4
4
|
import { Hex, Address as Address$1, PublicClient, HttpTransport, WalletClient, CustomTransport, Chain, Account as Account$1, Hash, GetLogsReturnType, TransactionReceipt } from 'viem';
|
|
@@ -6345,10 +6345,11 @@ declare class MoneyMarketDataService {
|
|
|
6345
6345
|
getReservesData(): Promise<readonly [readonly AggregatedReserveData[], BaseCurrencyInfo]>;
|
|
6346
6346
|
/**
|
|
6347
6347
|
* Get the user reserves data
|
|
6348
|
-
* @param
|
|
6348
|
+
* @param spokeChainId - The spoke chain ID
|
|
6349
|
+
* @param userAddress - The user's wallet address on the spoke chain
|
|
6349
6350
|
* @returns {Promise<readonly [readonly UserReserveData[], number]>} - The user reserves data
|
|
6350
6351
|
*/
|
|
6351
|
-
getUserReservesData(
|
|
6352
|
+
getUserReservesData(spokeChainId: SpokeChainId, userAddress: string): Promise<readonly [readonly UserReserveData[], number]>;
|
|
6352
6353
|
/**
|
|
6353
6354
|
* Get the list of all eModes in the pool
|
|
6354
6355
|
* @returns {Promise<readonly EModeData[]>} - Array of eMode data
|
|
@@ -6366,10 +6367,11 @@ declare class MoneyMarketDataService {
|
|
|
6366
6367
|
getReservesHumanized(): Promise<ReservesDataHumanized>;
|
|
6367
6368
|
/**
|
|
6368
6369
|
* Get the user reserves humanized
|
|
6369
|
-
* @param
|
|
6370
|
+
* @param spokeChainId - The spoke chain ID
|
|
6371
|
+
* @param userAddress - The user's wallet address on the spoke chain
|
|
6370
6372
|
* @returns {Promise<{userReserves: UserReserveDataHumanized[], userEmodeCategoryId: number}>} - The user reserves humanized
|
|
6371
6373
|
*/
|
|
6372
|
-
getUserReservesHumanized(
|
|
6374
|
+
getUserReservesHumanized(spokeChainId: SpokeChainId, userAddress: string): Promise<{
|
|
6373
6375
|
userReserves: UserReserveDataHumanized[];
|
|
6374
6376
|
userEmodeCategoryId: number;
|
|
6375
6377
|
}>;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IconAddress, IInjectiveWalletProvider, InjectiveExecuteResponse, SolanaChainConfig, SolanaBase58PublicKey, SolanaRpcResponseAndContext, SolanaTokenAmount, SolanaRawTransactionInstruction, WalletAddressProvider, SolanaSerializedTransaction, ISolanaWalletProvider, StellarSpokeChainConfig, StellarRpcConfig, IStellarWalletProvider, SuiSpokeChainConfig, SuiPaginatedCoins, SuiExecutionResult, ISuiWalletProvider, Address, Erc20Token,
|
|
1
|
+
import { IconAddress, IInjectiveWalletProvider, InjectiveExecuteResponse, SolanaChainConfig, SolanaBase58PublicKey, SolanaRpcResponseAndContext, SolanaTokenAmount, SolanaRawTransactionInstruction, WalletAddressProvider, SolanaSerializedTransaction, ISolanaWalletProvider, StellarSpokeChainConfig, StellarRpcConfig, IStellarWalletProvider, SuiSpokeChainConfig, SuiPaginatedCoins, SuiExecutionResult, ISuiWalletProvider, Address, Erc20Token, SpokeChainId, HttpUrl, Token, GetMoneyMarketTokensApiResponse, SolverConfig, HubAsset, OriginalAssetAddress, XToken, Hex as Hex$1, defaultSharedConfig, IconSpokeChainConfig, IIconWalletProvider, EvmHubChainConfig, EvmSpokeChainConfig, IEvmWalletProvider, SpokeChainConfig, SonicSpokeChainConfig, EvmChainId, InjectiveSpokeChainConfig, JsonObject, InjectiveRawTransaction, AssetInfo, TokenInfo, HubAddress, ChainId, EvmRawTransaction, EvmRawTransactionReceipt, ChainType, Hash as Hash$1, IntentRelayChainId, StellarRawTransaction, MoneyMarketConfig, spokeChainConfig, ICON_MAINNET_CHAIN_ID, BaseSpokeChainConfig, IConfigApi, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, GetSwapTokensByChainIdApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetHubAssetsApiResponse, GetHubAssetsByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, HubAssetInfo, HubChainId, IconEoaAddress, HubChainConfig, BridgeLimit } from '@sodax/types';
|
|
2
2
|
export * from '@sodax/types';
|
|
3
3
|
import * as viem from 'viem';
|
|
4
4
|
import { Hex, Address as Address$1, PublicClient, HttpTransport, WalletClient, CustomTransport, Chain, Account as Account$1, Hash, GetLogsReturnType, TransactionReceipt } from 'viem';
|
|
@@ -6345,10 +6345,11 @@ declare class MoneyMarketDataService {
|
|
|
6345
6345
|
getReservesData(): Promise<readonly [readonly AggregatedReserveData[], BaseCurrencyInfo]>;
|
|
6346
6346
|
/**
|
|
6347
6347
|
* Get the user reserves data
|
|
6348
|
-
* @param
|
|
6348
|
+
* @param spokeChainId - The spoke chain ID
|
|
6349
|
+
* @param userAddress - The user's wallet address on the spoke chain
|
|
6349
6350
|
* @returns {Promise<readonly [readonly UserReserveData[], number]>} - The user reserves data
|
|
6350
6351
|
*/
|
|
6351
|
-
getUserReservesData(
|
|
6352
|
+
getUserReservesData(spokeChainId: SpokeChainId, userAddress: string): Promise<readonly [readonly UserReserveData[], number]>;
|
|
6352
6353
|
/**
|
|
6353
6354
|
* Get the list of all eModes in the pool
|
|
6354
6355
|
* @returns {Promise<readonly EModeData[]>} - Array of eMode data
|
|
@@ -6366,10 +6367,11 @@ declare class MoneyMarketDataService {
|
|
|
6366
6367
|
getReservesHumanized(): Promise<ReservesDataHumanized>;
|
|
6367
6368
|
/**
|
|
6368
6369
|
* Get the user reserves humanized
|
|
6369
|
-
* @param
|
|
6370
|
+
* @param spokeChainId - The spoke chain ID
|
|
6371
|
+
* @param userAddress - The user's wallet address on the spoke chain
|
|
6370
6372
|
* @returns {Promise<{userReserves: UserReserveDataHumanized[], userEmodeCategoryId: number}>} - The user reserves humanized
|
|
6371
6373
|
*/
|
|
6372
|
-
getUserReservesHumanized(
|
|
6374
|
+
getUserReservesHumanized(spokeChainId: SpokeChainId, userAddress: string): Promise<{
|
|
6373
6375
|
userReserves: UserReserveDataHumanized[];
|
|
6374
6376
|
userEmodeCategoryId: number;
|
|
6375
6377
|
}>;
|
package/dist/index.mjs
CHANGED
|
@@ -10415,13 +10415,12 @@ var MoneyMarketDataService = class {
|
|
|
10415
10415
|
}
|
|
10416
10416
|
/**
|
|
10417
10417
|
* Get the user reserves data
|
|
10418
|
-
* @param
|
|
10418
|
+
* @param spokeChainId - The spoke chain ID
|
|
10419
|
+
* @param userAddress - The user's wallet address on the spoke chain
|
|
10419
10420
|
* @returns {Promise<readonly [readonly UserReserveData[], number]>} - The user reserves data
|
|
10420
10421
|
*/
|
|
10421
|
-
async getUserReservesData(
|
|
10422
|
-
const
|
|
10423
|
-
const spokeChainId = spokeProvider.chainConfig.chain.id;
|
|
10424
|
-
const hubWalletAddress = await HubService.getUserHubWalletAddress(walletAddress, spokeChainId, this.hubProvider);
|
|
10422
|
+
async getUserReservesData(spokeChainId, userAddress) {
|
|
10423
|
+
const hubWalletAddress = await HubService.getUserHubWalletAddress(userAddress, spokeChainId, this.hubProvider);
|
|
10425
10424
|
return this.uiPoolDataProviderService.getUserReservesData(hubWalletAddress);
|
|
10426
10425
|
}
|
|
10427
10426
|
/**
|
|
@@ -10447,13 +10446,12 @@ var MoneyMarketDataService = class {
|
|
|
10447
10446
|
}
|
|
10448
10447
|
/**
|
|
10449
10448
|
* Get the user reserves humanized
|
|
10450
|
-
* @param
|
|
10449
|
+
* @param spokeChainId - The spoke chain ID
|
|
10450
|
+
* @param userAddress - The user's wallet address on the spoke chain
|
|
10451
10451
|
* @returns {Promise<{userReserves: UserReserveDataHumanized[], userEmodeCategoryId: number}>} - The user reserves humanized
|
|
10452
10452
|
*/
|
|
10453
|
-
async getUserReservesHumanized(
|
|
10454
|
-
const
|
|
10455
|
-
const spokeChainId = spokeProvider.chainConfig.chain.id;
|
|
10456
|
-
const hubWalletAddress = await HubService.getUserHubWalletAddress(walletAddress, spokeChainId, this.hubProvider);
|
|
10453
|
+
async getUserReservesHumanized(spokeChainId, userAddress) {
|
|
10454
|
+
const hubWalletAddress = await HubService.getUserHubWalletAddress(userAddress, spokeChainId, this.hubProvider);
|
|
10457
10455
|
return this.uiPoolDataProviderService.getUserReservesHumanized(hubWalletAddress);
|
|
10458
10456
|
}
|
|
10459
10457
|
/**
|
|
@@ -15493,6 +15491,11 @@ var PartnerFeeClaimService = class {
|
|
|
15493
15491
|
invariant6(isSonicSpokeProviderType(spokeProvider), "PartnerFeeClaimService only supports Sonic spoke provider");
|
|
15494
15492
|
invariant6(this.config.protocolIntentsContract, "protocolIntentsContract is not configured in solver config");
|
|
15495
15493
|
const walletAddress = await spokeProvider.walletProvider.getWalletAddress();
|
|
15494
|
+
const outputToken = params.dstChain !== this.hubProvider.chainConfig.chain.id ? this.hubProvider.configService.getHubAssetInfo(params.dstChain, params.outputToken)?.asset : params.outputToken;
|
|
15495
|
+
invariant6(
|
|
15496
|
+
outputToken,
|
|
15497
|
+
`hub asset not found for spoke chain token (params.outputToken): ${params.outputToken} with chain id: ${params.dstChain}`
|
|
15498
|
+
);
|
|
15496
15499
|
const rawTx = {
|
|
15497
15500
|
from: walletAddress,
|
|
15498
15501
|
to: this.config.protocolIntentsContract,
|
|
@@ -15501,7 +15504,7 @@ var PartnerFeeClaimService = class {
|
|
|
15501
15504
|
abi: ProtocolIntentsAbi,
|
|
15502
15505
|
functionName: "setAutoSwapPreferences",
|
|
15503
15506
|
args: [
|
|
15504
|
-
|
|
15507
|
+
outputToken,
|
|
15505
15508
|
BigInt(getIntentRelayChainId(params.dstChain)),
|
|
15506
15509
|
encodeAddress(params.dstChain, params.dstAddress)
|
|
15507
15510
|
]
|