@sodax/sdk 1.2.3-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 +137 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +52 -7
- package/dist/index.d.ts +52 -7
- package/dist/index.mjs +137 -13
- 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
|
}>;
|
|
@@ -7864,6 +7866,7 @@ declare class EvmSpokeService {
|
|
|
7864
7866
|
* @returns {Promise<TxReturnType<EvmSpokeProviderType, R>>} A promise that resolves to the transaction hash.
|
|
7865
7867
|
*/
|
|
7866
7868
|
private static call;
|
|
7869
|
+
static waitForTransactionReceipt(params: VerifyTxHashRawEvmConfig): Promise<Result<EvmRawTransactionReceipt, Error>>;
|
|
7867
7870
|
}
|
|
7868
7871
|
|
|
7869
7872
|
/**
|
|
@@ -7944,6 +7947,12 @@ declare class SpokeService {
|
|
|
7944
7947
|
* @returns {Promise<Result<boolean>>} A promise that resolves to the result of the verification.
|
|
7945
7948
|
*/
|
|
7946
7949
|
static verifyTxHash(txHash: string, spokeProvider: SpokeProvider): Promise<Result<boolean>>;
|
|
7950
|
+
/**
|
|
7951
|
+
* Verifies the transaction hash for the spoke chain to exist on chain.
|
|
7952
|
+
* @param {VerifyTxHashRawConfig} params - The parameters for the verification.
|
|
7953
|
+
* @returns {Promise<Result<boolean>>} A promise that resolves to the result of the verification.
|
|
7954
|
+
*/
|
|
7955
|
+
static verifyTxHashRaw<T extends ChainType>(params: VerifyTxHashRawConfig<T>): Promise<Result<boolean>>;
|
|
7947
7956
|
}
|
|
7948
7957
|
|
|
7949
7958
|
type IconSpokeDepositParams = {
|
|
@@ -8145,7 +8154,9 @@ declare class SolanaSpokeService {
|
|
|
8145
8154
|
* @returns The transaction result.
|
|
8146
8155
|
*/
|
|
8147
8156
|
private static call;
|
|
8148
|
-
static
|
|
8157
|
+
static waitForConfirmationRaw(params: VerifyTxHashRawSolanaConfig): Promise<Result<boolean>>;
|
|
8158
|
+
static waitForConfirmation(spokeProvider: SolanaSpokeProvider, signature: string, commitment?: Finality, timeoutMs?: number, // total time to wait
|
|
8159
|
+
pollingTimeout?: number): Promise<Result<boolean>>;
|
|
8149
8160
|
}
|
|
8150
8161
|
|
|
8151
8162
|
declare const IntentCreatedEventAbi: {
|
|
@@ -9337,6 +9348,7 @@ declare class StellarSpokeService {
|
|
|
9337
9348
|
static callWallet<R extends boolean = false>(from: HubAddress, payload: Hex, spokeProvider: StellarSpokeProviderType, hubProvider: EvmHubProvider, raw?: R): Promise<TxReturnType<StellarSpokeProviderType, R>>;
|
|
9338
9349
|
private static transfer;
|
|
9339
9350
|
private static call;
|
|
9351
|
+
static waitForTransactionRaw(params: VerifyTxHashRawStellarConfig): Promise<Result<boolean, Error>>;
|
|
9340
9352
|
static waitForTransaction(spokeProvider: StellarSpokeProvider, txHash: string, pollingTimeout?: number, maxAttempts?: number): Promise<Result<boolean, Error>>;
|
|
9341
9353
|
}
|
|
9342
9354
|
|
|
@@ -9756,6 +9768,39 @@ type SonicAddressOrSpokeType = {
|
|
|
9756
9768
|
} | {
|
|
9757
9769
|
spokeProvider: SonicSpokeProviderType;
|
|
9758
9770
|
};
|
|
9771
|
+
type VerifyTxHashRawSolanaConfig = {
|
|
9772
|
+
chainType: 'SOLANA';
|
|
9773
|
+
rpcUrl: HttpUrl;
|
|
9774
|
+
signature: string;
|
|
9775
|
+
commitment?: Finality;
|
|
9776
|
+
timeoutMs?: number;
|
|
9777
|
+
pollingTimeout?: number;
|
|
9778
|
+
};
|
|
9779
|
+
type VerifyTxHashRawStellarConfig = {
|
|
9780
|
+
txHash: string;
|
|
9781
|
+
chainType: 'STELLAR';
|
|
9782
|
+
sorobanRpcConfig: {
|
|
9783
|
+
sorobanRpcUrl: HttpUrl;
|
|
9784
|
+
customHeaders: Record<string, string>;
|
|
9785
|
+
};
|
|
9786
|
+
pollingTimeout?: number;
|
|
9787
|
+
maxAttempts?: number;
|
|
9788
|
+
};
|
|
9789
|
+
type VerifyTxHashRawEvmConfig = {
|
|
9790
|
+
txHash: Hash;
|
|
9791
|
+
chainType: 'EVM';
|
|
9792
|
+
chainId: EvmChainId;
|
|
9793
|
+
rpcUrl: HttpUrl | undefined;
|
|
9794
|
+
confirmations?: number;
|
|
9795
|
+
pollingInterval?: number;
|
|
9796
|
+
retryCount?: number;
|
|
9797
|
+
retryDelay?: number;
|
|
9798
|
+
timeout?: number;
|
|
9799
|
+
};
|
|
9800
|
+
type VerifyTxHashRawConfigType = Prettify<(VerifyTxHashRawSolanaConfig | VerifyTxHashRawStellarConfig | VerifyTxHashRawEvmConfig) & {
|
|
9801
|
+
chainType: ChainType;
|
|
9802
|
+
}>;
|
|
9803
|
+
type VerifyTxHashRawConfig<T extends ChainType> = T extends 'SOLANA' ? VerifyTxHashRawSolanaConfig : T extends 'STELLAR' ? VerifyTxHashRawStellarConfig : T extends 'EVM' ? VerifyTxHashRawEvmConfig : VerifyTxHashRawConfigType;
|
|
9759
9804
|
|
|
9760
9805
|
/**
|
|
9761
9806
|
* BackendApiService - Proxy service for Sodax Backend API
|
|
@@ -11640,4 +11685,4 @@ declare class MigrationService {
|
|
|
11640
11685
|
createRevertSodaToIcxMigrationIntent<S extends SonicSpokeProviderType = SonicSpokeProviderType, R extends boolean = false>(params: Omit<IcxCreateRevertMigrationParams, 'wICX'>, spokeProvider: S, raw?: R): Promise<Result<TxReturnType<S, R>, MigrationError<'CREATE_REVERT_MIGRATION_INTENT_FAILED'>>>;
|
|
11641
11686
|
}
|
|
11642
11687
|
|
|
11643
|
-
export { type AggregatedReserveData, type AllowanceResponse, type ApiResponse, type AssetEntry, type AutoSwapPreferences, type BackendApiConfig, BackendApiService, type Balance, type BalnLockParams, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeError, type BridgeErrorCode, type BridgeExtraData, type BridgeOptionalExtraData, type BridgeParams, BridgeService, type BridgeServiceConfig, type BridgeServiceConstructorParams, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CancelUnstakeParams, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, ConfigService, type ConfigServiceConfig, type ConfigServiceConstructorParams, type ConnMsg, type CreateBridgeIntentParams, type CreateIntentAutoSwapError, type CreateIntentParams, type CreateLimitOrderParams, type CustomProvider, 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, type Default, type DepositSimulationParams, type DetailedLock, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, Erc20Service, EvmAssetManagerService, EvmBaseSpokeProvider, type EvmContractCall, type EvmDepositToDataParams, type EvmGasEstimate, EvmHubProvider, type EvmHubProviderConfig, type EvmHubProviderConstructorParams, type EvmInitializedConfig, EvmRawSpokeProvider, type EvmReturnType, EvmSolverService, type EvmSpokeDepositParams, EvmSpokeProvider, type EvmSpokeProviderType, EvmSpokeService, type EvmTransferParams, type EvmTransferToHubParams, type EvmTxReturnType, type EvmUninitializedBrowserConfig, type EvmUninitializedConfig, type EvmUninitializedPrivateKeyConfig, EvmVaultTokenService, EvmWalletAbstraction, type EvmWithdrawAssetDataParams, type ExecuteIntentAutoSwapError, type ExecuteMsg, FEE_PERCENTAGE_SCALE, type FeeAmount, type FeeData, type FeeTokenApproveParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, type GasEstimateType, type GetAddressType, type GetChainConfigType, type GetEstimateGasReturnType, type GetIntentSubmitTxExtraDataParams, type GetMigrationFailedPayload, type GetMoneyMarketError, type GetMoneyMarketParams, type GetPacketParams, type GetPacketResponse, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeDepositParamsType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HashTxReturnType, HubService, type HubTxHash, ICON_TX_RESULT_WAIT_MAX_RETRY, type IRawSpokeProvider, type ISpokeProvider, type IWalletProvider, IconBaseSpokeProvider, type IconContractAddress, type IconGasEstimate, type IconJsonRpcVersion, IconRawSpokeProvider, type IconRawTransaction, type IconReturnType, type IconSpokeDepositParams, IconSpokeProvider, type IconSpokeProviderType, IconSpokeService, type IconTransferToHubParams, type IcxCreateRevertMigrationParams, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRawTransaction, type IcxRevertMigrationParams, type IcxTokenType, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, InjectiveBaseSpokeProvider, type InjectiveGasEstimate, InjectiveRawSpokeProvider, type InjectiveReturnType, type InjectiveSpokeDepositParams, InjectiveSpokeProvider, type InjectiveSpokeProviderType, InjectiveSpokeService, type InjectiveTransferToHubParams, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapErrorData, type IntentAutoSwapResult, type IntentCancelFailedErrorData, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentCreationFailedErrorData, type IntentData, IntentDataType, type IntentDeliveryInfo, type IntentError, type IntentErrorCode, type IntentErrorData, IntentFilledEventAbi, type IntentFilledEventLog, type IntentPostExecutionFailedErrorData, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentSubmitTxFailedErrorData, type IntentWaitUntilIntentExecutedFailedErrorData, IntentsAbi, type JsonRpcPayloadResponse, LTV_PRECISION, type LegacybnUSDChainId, type LegacybnUSDToken, type LegacybnUSDTokenAddress, LendingPoolService, type LimitOrderParams, LockupMultiplier, LockupPeriod, MAX_UINT256, type MigrationAction, type MigrationError, type MigrationErrorCode, type MigrationErrorData, type MigrationFailedErrorData, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConfig, type MigrationServiceConstructorParams, type MigrationTokens, type MoneyMarketAction, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowFailedError, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketConfigParams, MoneyMarketDataService, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketExtraData, type MoneyMarketOptionalExtraData, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayFailedError, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConfig, type MoneyMarketServiceConstructorParams, type MoneyMarketSubmitTxFailedError, type MoneyMarketSupplyFailedError, type MoneyMarketSupplyParams, type MoneyMarketUnknownError, type MoneyMarketUnknownErrorCode, type MoneyMarketWithdrawFailedError, type MoneyMarketWithdrawParams, type NewbnUSDChainId, type Optional, type OptionalFee, type OptionalRaw, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerFee, type PartnerFeeAmount, type PartnerFeeClaimAssetBalance, PartnerFeeClaimService, type PartnerFeeClaimServiceConfig, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapParams, type PartnerFeeConfig, type PartnerFeePercentage, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, type PoolBaseCurrencyHumanized, type Prettify, type PromiseEvmTxReturnType, type PromiseIconTxReturnType, type PromiseInjectiveTxReturnType, type PromiseSolanaTxReturnType, type PromiseStellarTxReturnType, type PromiseSuiTxReturnType, type PromiseTxReturnType, ProtocolIntentsAbi, type QueryMsg, type QuoteType, RAY, RAY_DECIMALS, type RawSpokeProvider, type RawTxReturnType, type RelayAction, type RelayError, type RelayErrorCode, type RelayExtraData, type RelayOptionalExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayerApiConfig, type RequestConfig, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResponseAddressType, type ResponseSigningType, type Result, type RewardInfoHumanized, SECONDS_PER_YEAR, STELLAR_DEFAULT_TX_TIMEOUT_SECONDS, STELLAR_PRIORITY_FEE, type SetSwapPreferenceError, type SetSwapPreferenceParams, Sodax, type SodaxConfig, SolanaBaseSpokeProvider, type SolanaGasEstimate, SolanaRawSpokeProvider, type SolanaRawSpokeProviderConfig, type SolanaRawTransaction, type SolanaReturnType, type SolanaSpokeDepositParams, SolanaSpokeProvider, type SolanaSpokeProviderType, SolanaSpokeService, type SolanaTransferToHubParams, SolverApiService, type SolverConfigParams, type SolverErrorResponse, type SolverExecutionRequest, type SolverExecutionResponse, SolverIntentErrorCode, type SolverIntentQuoteRequest, type SolverIntentQuoteResponse, type SolverIntentQuoteResponseRaw, SolverIntentStatusCode, type SolverIntentStatusRequest, type SolverIntentStatusResponse, type SonicAddressOrSpokeType, SonicBaseSpokeProvider, SonicRawSpokeProvider, type SonicSpokeDepositParams, SonicSpokeProvider, type SonicSpokeProviderType, SonicSpokeService, type SpokeDepositParams, type SpokeProvider, type SpokeProviderType, SpokeService, type SpokeTokenSymbols, type SpokeTxHash, type StakeParams, type StakingAction, type StakingConfig, type StakingError, type StakingErrorCode, type StakingInfo, StakingLogic, type StakingParams, StakingService, type StakingServiceConstructorParams, type State, StellarBaseSpokeProvider, type StellarGasEstimate, StellarRawSpokeProvider, type StellarReturnType, type StellarSpokeDepositParams, StellarSpokeProvider, type StellarSpokeProviderType, StellarSpokeService, type StellarTransferToHubParams, type SubmitTxExtraData, type SubmitTxParams, type SubmitTxResponse, SuiBaseSpokeProvider, type SuiGasEstimate, SuiRawSpokeProvider, type SuiRawTransaction, type SuiReturnType, type SuiSpokeDepositParams, SuiSpokeProvider, type SuiSpokeProviderType, SuiSpokeService, type SuiTransferToHubParams, SupportedMigrationTokens, type SwapParams, SwapService, type SwapServiceConfig, type SwapServiceConstructorParams, type TxReturnType, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UnifiedBnUSDMigrateParams, type UnknownIntentAutoSwapError, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakeSodaRequest, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type UserUnstakeInfo, VAULT_TOKEN_DECIMALS, type VaultReserves, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitIntentAutoSwapError, type WaitUntilIntentExecutedPayload, WalletAbstractionService, type WalletSimulationParams, type WithdrawInfo, adjustAmountByFee, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bnUSDLegacySpokeChainIds, bnUSDLegacyTokens, bnUSDNewTokens, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, connectionAbi, convertTransactionInstructionToRaw, deriveUserWalletAddress, encodeAddress, encodeContractCalls, erc20Abi, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, getAllLegacybnUSDTokens, getAndFormatReserveEModes, getCompoundedBalance, getEvmViemChain, getHubChainConfig, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, isAddressString, isBalnMigrateParams, isConfiguredMoneyMarketConfig, isConfiguredSolverConfig, isCreateIntentAutoSwapError, isEvmHubChainConfig, isEvmInitializedConfig, isEvmRawSpokeProvider, isEvmSpokeChainConfig, isEvmSpokeProvider, isEvmSpokeProviderType, isEvmUninitializedBrowserConfig, isEvmUninitializedConfig, isEvmUninitializedPrivateKeyConfig, isHubSpokeProvider, isIconAddress, isIconRawSpokeProvider, isIconSpokeProvider, isIconSpokeProviderType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveRawSpokeProvider, isInjectiveSpokeProvider, isInjectiveSpokeProviderType, isIntentCreationFailedError, isIntentCreationUnknownError, isIntentPostExecutionFailedError, isIntentRelayChainId, isIntentSubmitTxFailedError, isJsonRpcPayloadResponse, isLegacybnUSDChainId, isLegacybnUSDToken, isMoneyMarketBorrowUnknownError, isMoneyMarketCreateBorrowIntentFailedError, isMoneyMarketCreateRepayIntentFailedError, isMoneyMarketCreateSupplyIntentFailedError, isMoneyMarketCreateWithdrawIntentFailedError, isMoneyMarketRelayTimeoutError, isMoneyMarketRepayUnknownError, isMoneyMarketSubmitTxFailedError, isMoneyMarketSupplyUnknownError, isMoneyMarketWithdrawUnknownError, isNewbnUSDChainId, isNewbnUSDToken, isPartnerFeeAmount, isPartnerFeePercentage, isRawSpokeProvider, isResponseAddressType, isResponseSigningType, isSetSwapPreferenceError, isSolanaNativeToken, isSolanaRawSpokeProvider, isSolanaSpokeProvider, isSolanaSpokeProviderType, isSolverErrorResponse, isSonicRawSpokeProvider, isSonicSpokeProvider, isSonicSpokeProviderType, isStellarRawSpokeProvider, isStellarSpokeProvider, isStellarSpokeProviderType, isSuiRawSpokeProvider, isSuiSpokeProvider, isSuiSpokeProviderType, isUnifiedBnUSDMigrateParams, isUnknownIntentAutoSwapError, isWaitIntentAutoSwapError, isWaitUntilIntentExecutedFailed, nativeToUSD, newbnUSDSpokeChainIds, normalize, normalizeBN, normalizedToUsd, parseToStroops, parseTokenArrayFromJson, poolAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, sleep, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingRouterAbi, submitTransaction, uiPoolDataAbi, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, wadToRay, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
|
11688
|
+
export { type AggregatedReserveData, type AllowanceResponse, type ApiResponse, type AssetEntry, type AutoSwapPreferences, type BackendApiConfig, BackendApiService, type Balance, type BalnLockParams, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeError, type BridgeErrorCode, type BridgeExtraData, type BridgeOptionalExtraData, type BridgeParams, BridgeService, type BridgeServiceConfig, type BridgeServiceConstructorParams, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CancelUnstakeParams, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, ConfigService, type ConfigServiceConfig, type ConfigServiceConstructorParams, type ConnMsg, type CreateBridgeIntentParams, type CreateIntentAutoSwapError, type CreateIntentParams, type CreateLimitOrderParams, type CustomProvider, 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, type Default, type DepositSimulationParams, type DetailedLock, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, Erc20Service, EvmAssetManagerService, EvmBaseSpokeProvider, type EvmContractCall, type EvmDepositToDataParams, type EvmGasEstimate, EvmHubProvider, type EvmHubProviderConfig, type EvmHubProviderConstructorParams, type EvmInitializedConfig, EvmRawSpokeProvider, type EvmReturnType, EvmSolverService, type EvmSpokeDepositParams, EvmSpokeProvider, type EvmSpokeProviderType, EvmSpokeService, type EvmTransferParams, type EvmTransferToHubParams, type EvmTxReturnType, type EvmUninitializedBrowserConfig, type EvmUninitializedConfig, type EvmUninitializedPrivateKeyConfig, EvmVaultTokenService, EvmWalletAbstraction, type EvmWithdrawAssetDataParams, type ExecuteIntentAutoSwapError, type ExecuteMsg, FEE_PERCENTAGE_SCALE, type FeeAmount, type FeeData, type FeeTokenApproveParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, type GasEstimateType, type GetAddressType, type GetChainConfigType, type GetEstimateGasReturnType, type GetIntentSubmitTxExtraDataParams, type GetMigrationFailedPayload, type GetMoneyMarketError, type GetMoneyMarketParams, type GetPacketParams, type GetPacketResponse, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeDepositParamsType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HashTxReturnType, HubService, type HubTxHash, ICON_TX_RESULT_WAIT_MAX_RETRY, type IRawSpokeProvider, type ISpokeProvider, type IWalletProvider, IconBaseSpokeProvider, type IconContractAddress, type IconGasEstimate, type IconJsonRpcVersion, IconRawSpokeProvider, type IconRawTransaction, type IconReturnType, type IconSpokeDepositParams, IconSpokeProvider, type IconSpokeProviderType, IconSpokeService, type IconTransferToHubParams, type IcxCreateRevertMigrationParams, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRawTransaction, type IcxRevertMigrationParams, type IcxTokenType, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, InjectiveBaseSpokeProvider, type InjectiveGasEstimate, InjectiveRawSpokeProvider, type InjectiveReturnType, type InjectiveSpokeDepositParams, InjectiveSpokeProvider, type InjectiveSpokeProviderType, InjectiveSpokeService, type InjectiveTransferToHubParams, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapErrorData, type IntentAutoSwapResult, type IntentCancelFailedErrorData, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentCreationFailedErrorData, type IntentData, IntentDataType, type IntentDeliveryInfo, type IntentError, type IntentErrorCode, type IntentErrorData, IntentFilledEventAbi, type IntentFilledEventLog, type IntentPostExecutionFailedErrorData, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentSubmitTxFailedErrorData, type IntentWaitUntilIntentExecutedFailedErrorData, IntentsAbi, type JsonRpcPayloadResponse, LTV_PRECISION, type LegacybnUSDChainId, type LegacybnUSDToken, type LegacybnUSDTokenAddress, LendingPoolService, type LimitOrderParams, LockupMultiplier, LockupPeriod, MAX_UINT256, type MigrationAction, type MigrationError, type MigrationErrorCode, type MigrationErrorData, type MigrationFailedErrorData, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConfig, type MigrationServiceConstructorParams, type MigrationTokens, type MoneyMarketAction, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowFailedError, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketConfigParams, MoneyMarketDataService, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketExtraData, type MoneyMarketOptionalExtraData, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayFailedError, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConfig, type MoneyMarketServiceConstructorParams, type MoneyMarketSubmitTxFailedError, type MoneyMarketSupplyFailedError, type MoneyMarketSupplyParams, type MoneyMarketUnknownError, type MoneyMarketUnknownErrorCode, type MoneyMarketWithdrawFailedError, type MoneyMarketWithdrawParams, type NewbnUSDChainId, type Optional, type OptionalFee, type OptionalRaw, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerFee, type PartnerFeeAmount, type PartnerFeeClaimAssetBalance, PartnerFeeClaimService, type PartnerFeeClaimServiceConfig, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapParams, type PartnerFeeConfig, type PartnerFeePercentage, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, type PoolBaseCurrencyHumanized, type Prettify, type PromiseEvmTxReturnType, type PromiseIconTxReturnType, type PromiseInjectiveTxReturnType, type PromiseSolanaTxReturnType, type PromiseStellarTxReturnType, type PromiseSuiTxReturnType, type PromiseTxReturnType, ProtocolIntentsAbi, type QueryMsg, type QuoteType, RAY, RAY_DECIMALS, type RawSpokeProvider, type RawTxReturnType, type RelayAction, type RelayError, type RelayErrorCode, type RelayExtraData, type RelayOptionalExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayerApiConfig, type RequestConfig, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResponseAddressType, type ResponseSigningType, type Result, type RewardInfoHumanized, SECONDS_PER_YEAR, STELLAR_DEFAULT_TX_TIMEOUT_SECONDS, STELLAR_PRIORITY_FEE, type SetSwapPreferenceError, type SetSwapPreferenceParams, Sodax, type SodaxConfig, SolanaBaseSpokeProvider, type SolanaGasEstimate, SolanaRawSpokeProvider, type SolanaRawSpokeProviderConfig, type SolanaRawTransaction, type SolanaReturnType, type SolanaSpokeDepositParams, SolanaSpokeProvider, type SolanaSpokeProviderType, SolanaSpokeService, type SolanaTransferToHubParams, SolverApiService, type SolverConfigParams, type SolverErrorResponse, type SolverExecutionRequest, type SolverExecutionResponse, SolverIntentErrorCode, type SolverIntentQuoteRequest, type SolverIntentQuoteResponse, type SolverIntentQuoteResponseRaw, SolverIntentStatusCode, type SolverIntentStatusRequest, type SolverIntentStatusResponse, type SonicAddressOrSpokeType, SonicBaseSpokeProvider, SonicRawSpokeProvider, type SonicSpokeDepositParams, SonicSpokeProvider, type SonicSpokeProviderType, SonicSpokeService, type SpokeDepositParams, type SpokeProvider, type SpokeProviderType, SpokeService, type SpokeTokenSymbols, type SpokeTxHash, type StakeParams, type StakingAction, type StakingConfig, type StakingError, type StakingErrorCode, type StakingInfo, StakingLogic, type StakingParams, StakingService, type StakingServiceConstructorParams, type State, StellarBaseSpokeProvider, type StellarGasEstimate, StellarRawSpokeProvider, type StellarReturnType, type StellarSpokeDepositParams, StellarSpokeProvider, type StellarSpokeProviderType, StellarSpokeService, type StellarTransferToHubParams, type SubmitTxExtraData, type SubmitTxParams, type SubmitTxResponse, SuiBaseSpokeProvider, type SuiGasEstimate, SuiRawSpokeProvider, type SuiRawTransaction, type SuiReturnType, type SuiSpokeDepositParams, SuiSpokeProvider, type SuiSpokeProviderType, SuiSpokeService, type SuiTransferToHubParams, SupportedMigrationTokens, type SwapParams, SwapService, type SwapServiceConfig, type SwapServiceConstructorParams, type TxReturnType, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UnifiedBnUSDMigrateParams, type UnknownIntentAutoSwapError, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakeSodaRequest, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type UserUnstakeInfo, VAULT_TOKEN_DECIMALS, type VaultReserves, type VerifyTxHashRawConfig, type VerifyTxHashRawConfigType, type VerifyTxHashRawEvmConfig, type VerifyTxHashRawSolanaConfig, type VerifyTxHashRawStellarConfig, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitIntentAutoSwapError, type WaitUntilIntentExecutedPayload, WalletAbstractionService, type WalletSimulationParams, type WithdrawInfo, adjustAmountByFee, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bnUSDLegacySpokeChainIds, bnUSDLegacyTokens, bnUSDNewTokens, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, connectionAbi, convertTransactionInstructionToRaw, deriveUserWalletAddress, encodeAddress, encodeContractCalls, erc20Abi, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, getAllLegacybnUSDTokens, getAndFormatReserveEModes, getCompoundedBalance, getEvmViemChain, getHubChainConfig, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, isAddressString, isBalnMigrateParams, isConfiguredMoneyMarketConfig, isConfiguredSolverConfig, isCreateIntentAutoSwapError, isEvmHubChainConfig, isEvmInitializedConfig, isEvmRawSpokeProvider, isEvmSpokeChainConfig, isEvmSpokeProvider, isEvmSpokeProviderType, isEvmUninitializedBrowserConfig, isEvmUninitializedConfig, isEvmUninitializedPrivateKeyConfig, isHubSpokeProvider, isIconAddress, isIconRawSpokeProvider, isIconSpokeProvider, isIconSpokeProviderType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveRawSpokeProvider, isInjectiveSpokeProvider, isInjectiveSpokeProviderType, isIntentCreationFailedError, isIntentCreationUnknownError, isIntentPostExecutionFailedError, isIntentRelayChainId, isIntentSubmitTxFailedError, isJsonRpcPayloadResponse, isLegacybnUSDChainId, isLegacybnUSDToken, isMoneyMarketBorrowUnknownError, isMoneyMarketCreateBorrowIntentFailedError, isMoneyMarketCreateRepayIntentFailedError, isMoneyMarketCreateSupplyIntentFailedError, isMoneyMarketCreateWithdrawIntentFailedError, isMoneyMarketRelayTimeoutError, isMoneyMarketRepayUnknownError, isMoneyMarketSubmitTxFailedError, isMoneyMarketSupplyUnknownError, isMoneyMarketWithdrawUnknownError, isNewbnUSDChainId, isNewbnUSDToken, isPartnerFeeAmount, isPartnerFeePercentage, isRawSpokeProvider, isResponseAddressType, isResponseSigningType, isSetSwapPreferenceError, isSolanaNativeToken, isSolanaRawSpokeProvider, isSolanaSpokeProvider, isSolanaSpokeProviderType, isSolverErrorResponse, isSonicRawSpokeProvider, isSonicSpokeProvider, isSonicSpokeProviderType, isStellarRawSpokeProvider, isStellarSpokeProvider, isStellarSpokeProviderType, isSuiRawSpokeProvider, isSuiSpokeProvider, isSuiSpokeProviderType, isUnifiedBnUSDMigrateParams, isUnknownIntentAutoSwapError, isWaitIntentAutoSwapError, isWaitUntilIntentExecutedFailed, nativeToUSD, newbnUSDSpokeChainIds, normalize, normalizeBN, normalizedToUsd, parseToStroops, parseTokenArrayFromJson, poolAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, sleep, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingRouterAbi, submitTransaction, uiPoolDataAbi, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, wadToRay, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
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
|
}>;
|
|
@@ -7864,6 +7866,7 @@ declare class EvmSpokeService {
|
|
|
7864
7866
|
* @returns {Promise<TxReturnType<EvmSpokeProviderType, R>>} A promise that resolves to the transaction hash.
|
|
7865
7867
|
*/
|
|
7866
7868
|
private static call;
|
|
7869
|
+
static waitForTransactionReceipt(params: VerifyTxHashRawEvmConfig): Promise<Result<EvmRawTransactionReceipt, Error>>;
|
|
7867
7870
|
}
|
|
7868
7871
|
|
|
7869
7872
|
/**
|
|
@@ -7944,6 +7947,12 @@ declare class SpokeService {
|
|
|
7944
7947
|
* @returns {Promise<Result<boolean>>} A promise that resolves to the result of the verification.
|
|
7945
7948
|
*/
|
|
7946
7949
|
static verifyTxHash(txHash: string, spokeProvider: SpokeProvider): Promise<Result<boolean>>;
|
|
7950
|
+
/**
|
|
7951
|
+
* Verifies the transaction hash for the spoke chain to exist on chain.
|
|
7952
|
+
* @param {VerifyTxHashRawConfig} params - The parameters for the verification.
|
|
7953
|
+
* @returns {Promise<Result<boolean>>} A promise that resolves to the result of the verification.
|
|
7954
|
+
*/
|
|
7955
|
+
static verifyTxHashRaw<T extends ChainType>(params: VerifyTxHashRawConfig<T>): Promise<Result<boolean>>;
|
|
7947
7956
|
}
|
|
7948
7957
|
|
|
7949
7958
|
type IconSpokeDepositParams = {
|
|
@@ -8145,7 +8154,9 @@ declare class SolanaSpokeService {
|
|
|
8145
8154
|
* @returns The transaction result.
|
|
8146
8155
|
*/
|
|
8147
8156
|
private static call;
|
|
8148
|
-
static
|
|
8157
|
+
static waitForConfirmationRaw(params: VerifyTxHashRawSolanaConfig): Promise<Result<boolean>>;
|
|
8158
|
+
static waitForConfirmation(spokeProvider: SolanaSpokeProvider, signature: string, commitment?: Finality, timeoutMs?: number, // total time to wait
|
|
8159
|
+
pollingTimeout?: number): Promise<Result<boolean>>;
|
|
8149
8160
|
}
|
|
8150
8161
|
|
|
8151
8162
|
declare const IntentCreatedEventAbi: {
|
|
@@ -9337,6 +9348,7 @@ declare class StellarSpokeService {
|
|
|
9337
9348
|
static callWallet<R extends boolean = false>(from: HubAddress, payload: Hex, spokeProvider: StellarSpokeProviderType, hubProvider: EvmHubProvider, raw?: R): Promise<TxReturnType<StellarSpokeProviderType, R>>;
|
|
9338
9349
|
private static transfer;
|
|
9339
9350
|
private static call;
|
|
9351
|
+
static waitForTransactionRaw(params: VerifyTxHashRawStellarConfig): Promise<Result<boolean, Error>>;
|
|
9340
9352
|
static waitForTransaction(spokeProvider: StellarSpokeProvider, txHash: string, pollingTimeout?: number, maxAttempts?: number): Promise<Result<boolean, Error>>;
|
|
9341
9353
|
}
|
|
9342
9354
|
|
|
@@ -9756,6 +9768,39 @@ type SonicAddressOrSpokeType = {
|
|
|
9756
9768
|
} | {
|
|
9757
9769
|
spokeProvider: SonicSpokeProviderType;
|
|
9758
9770
|
};
|
|
9771
|
+
type VerifyTxHashRawSolanaConfig = {
|
|
9772
|
+
chainType: 'SOLANA';
|
|
9773
|
+
rpcUrl: HttpUrl;
|
|
9774
|
+
signature: string;
|
|
9775
|
+
commitment?: Finality;
|
|
9776
|
+
timeoutMs?: number;
|
|
9777
|
+
pollingTimeout?: number;
|
|
9778
|
+
};
|
|
9779
|
+
type VerifyTxHashRawStellarConfig = {
|
|
9780
|
+
txHash: string;
|
|
9781
|
+
chainType: 'STELLAR';
|
|
9782
|
+
sorobanRpcConfig: {
|
|
9783
|
+
sorobanRpcUrl: HttpUrl;
|
|
9784
|
+
customHeaders: Record<string, string>;
|
|
9785
|
+
};
|
|
9786
|
+
pollingTimeout?: number;
|
|
9787
|
+
maxAttempts?: number;
|
|
9788
|
+
};
|
|
9789
|
+
type VerifyTxHashRawEvmConfig = {
|
|
9790
|
+
txHash: Hash;
|
|
9791
|
+
chainType: 'EVM';
|
|
9792
|
+
chainId: EvmChainId;
|
|
9793
|
+
rpcUrl: HttpUrl | undefined;
|
|
9794
|
+
confirmations?: number;
|
|
9795
|
+
pollingInterval?: number;
|
|
9796
|
+
retryCount?: number;
|
|
9797
|
+
retryDelay?: number;
|
|
9798
|
+
timeout?: number;
|
|
9799
|
+
};
|
|
9800
|
+
type VerifyTxHashRawConfigType = Prettify<(VerifyTxHashRawSolanaConfig | VerifyTxHashRawStellarConfig | VerifyTxHashRawEvmConfig) & {
|
|
9801
|
+
chainType: ChainType;
|
|
9802
|
+
}>;
|
|
9803
|
+
type VerifyTxHashRawConfig<T extends ChainType> = T extends 'SOLANA' ? VerifyTxHashRawSolanaConfig : T extends 'STELLAR' ? VerifyTxHashRawStellarConfig : T extends 'EVM' ? VerifyTxHashRawEvmConfig : VerifyTxHashRawConfigType;
|
|
9759
9804
|
|
|
9760
9805
|
/**
|
|
9761
9806
|
* BackendApiService - Proxy service for Sodax Backend API
|
|
@@ -11640,4 +11685,4 @@ declare class MigrationService {
|
|
|
11640
11685
|
createRevertSodaToIcxMigrationIntent<S extends SonicSpokeProviderType = SonicSpokeProviderType, R extends boolean = false>(params: Omit<IcxCreateRevertMigrationParams, 'wICX'>, spokeProvider: S, raw?: R): Promise<Result<TxReturnType<S, R>, MigrationError<'CREATE_REVERT_MIGRATION_INTENT_FAILED'>>>;
|
|
11641
11686
|
}
|
|
11642
11687
|
|
|
11643
|
-
export { type AggregatedReserveData, type AllowanceResponse, type ApiResponse, type AssetEntry, type AutoSwapPreferences, type BackendApiConfig, BackendApiService, type Balance, type BalnLockParams, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeError, type BridgeErrorCode, type BridgeExtraData, type BridgeOptionalExtraData, type BridgeParams, BridgeService, type BridgeServiceConfig, type BridgeServiceConstructorParams, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CancelUnstakeParams, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, ConfigService, type ConfigServiceConfig, type ConfigServiceConstructorParams, type ConnMsg, type CreateBridgeIntentParams, type CreateIntentAutoSwapError, type CreateIntentParams, type CreateLimitOrderParams, type CustomProvider, 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, type Default, type DepositSimulationParams, type DetailedLock, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, Erc20Service, EvmAssetManagerService, EvmBaseSpokeProvider, type EvmContractCall, type EvmDepositToDataParams, type EvmGasEstimate, EvmHubProvider, type EvmHubProviderConfig, type EvmHubProviderConstructorParams, type EvmInitializedConfig, EvmRawSpokeProvider, type EvmReturnType, EvmSolverService, type EvmSpokeDepositParams, EvmSpokeProvider, type EvmSpokeProviderType, EvmSpokeService, type EvmTransferParams, type EvmTransferToHubParams, type EvmTxReturnType, type EvmUninitializedBrowserConfig, type EvmUninitializedConfig, type EvmUninitializedPrivateKeyConfig, EvmVaultTokenService, EvmWalletAbstraction, type EvmWithdrawAssetDataParams, type ExecuteIntentAutoSwapError, type ExecuteMsg, FEE_PERCENTAGE_SCALE, type FeeAmount, type FeeData, type FeeTokenApproveParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, type GasEstimateType, type GetAddressType, type GetChainConfigType, type GetEstimateGasReturnType, type GetIntentSubmitTxExtraDataParams, type GetMigrationFailedPayload, type GetMoneyMarketError, type GetMoneyMarketParams, type GetPacketParams, type GetPacketResponse, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeDepositParamsType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HashTxReturnType, HubService, type HubTxHash, ICON_TX_RESULT_WAIT_MAX_RETRY, type IRawSpokeProvider, type ISpokeProvider, type IWalletProvider, IconBaseSpokeProvider, type IconContractAddress, type IconGasEstimate, type IconJsonRpcVersion, IconRawSpokeProvider, type IconRawTransaction, type IconReturnType, type IconSpokeDepositParams, IconSpokeProvider, type IconSpokeProviderType, IconSpokeService, type IconTransferToHubParams, type IcxCreateRevertMigrationParams, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRawTransaction, type IcxRevertMigrationParams, type IcxTokenType, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, InjectiveBaseSpokeProvider, type InjectiveGasEstimate, InjectiveRawSpokeProvider, type InjectiveReturnType, type InjectiveSpokeDepositParams, InjectiveSpokeProvider, type InjectiveSpokeProviderType, InjectiveSpokeService, type InjectiveTransferToHubParams, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapErrorData, type IntentAutoSwapResult, type IntentCancelFailedErrorData, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentCreationFailedErrorData, type IntentData, IntentDataType, type IntentDeliveryInfo, type IntentError, type IntentErrorCode, type IntentErrorData, IntentFilledEventAbi, type IntentFilledEventLog, type IntentPostExecutionFailedErrorData, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentSubmitTxFailedErrorData, type IntentWaitUntilIntentExecutedFailedErrorData, IntentsAbi, type JsonRpcPayloadResponse, LTV_PRECISION, type LegacybnUSDChainId, type LegacybnUSDToken, type LegacybnUSDTokenAddress, LendingPoolService, type LimitOrderParams, LockupMultiplier, LockupPeriod, MAX_UINT256, type MigrationAction, type MigrationError, type MigrationErrorCode, type MigrationErrorData, type MigrationFailedErrorData, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConfig, type MigrationServiceConstructorParams, type MigrationTokens, type MoneyMarketAction, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowFailedError, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketConfigParams, MoneyMarketDataService, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketExtraData, type MoneyMarketOptionalExtraData, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayFailedError, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConfig, type MoneyMarketServiceConstructorParams, type MoneyMarketSubmitTxFailedError, type MoneyMarketSupplyFailedError, type MoneyMarketSupplyParams, type MoneyMarketUnknownError, type MoneyMarketUnknownErrorCode, type MoneyMarketWithdrawFailedError, type MoneyMarketWithdrawParams, type NewbnUSDChainId, type Optional, type OptionalFee, type OptionalRaw, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerFee, type PartnerFeeAmount, type PartnerFeeClaimAssetBalance, PartnerFeeClaimService, type PartnerFeeClaimServiceConfig, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapParams, type PartnerFeeConfig, type PartnerFeePercentage, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, type PoolBaseCurrencyHumanized, type Prettify, type PromiseEvmTxReturnType, type PromiseIconTxReturnType, type PromiseInjectiveTxReturnType, type PromiseSolanaTxReturnType, type PromiseStellarTxReturnType, type PromiseSuiTxReturnType, type PromiseTxReturnType, ProtocolIntentsAbi, type QueryMsg, type QuoteType, RAY, RAY_DECIMALS, type RawSpokeProvider, type RawTxReturnType, type RelayAction, type RelayError, type RelayErrorCode, type RelayExtraData, type RelayOptionalExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayerApiConfig, type RequestConfig, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResponseAddressType, type ResponseSigningType, type Result, type RewardInfoHumanized, SECONDS_PER_YEAR, STELLAR_DEFAULT_TX_TIMEOUT_SECONDS, STELLAR_PRIORITY_FEE, type SetSwapPreferenceError, type SetSwapPreferenceParams, Sodax, type SodaxConfig, SolanaBaseSpokeProvider, type SolanaGasEstimate, SolanaRawSpokeProvider, type SolanaRawSpokeProviderConfig, type SolanaRawTransaction, type SolanaReturnType, type SolanaSpokeDepositParams, SolanaSpokeProvider, type SolanaSpokeProviderType, SolanaSpokeService, type SolanaTransferToHubParams, SolverApiService, type SolverConfigParams, type SolverErrorResponse, type SolverExecutionRequest, type SolverExecutionResponse, SolverIntentErrorCode, type SolverIntentQuoteRequest, type SolverIntentQuoteResponse, type SolverIntentQuoteResponseRaw, SolverIntentStatusCode, type SolverIntentStatusRequest, type SolverIntentStatusResponse, type SonicAddressOrSpokeType, SonicBaseSpokeProvider, SonicRawSpokeProvider, type SonicSpokeDepositParams, SonicSpokeProvider, type SonicSpokeProviderType, SonicSpokeService, type SpokeDepositParams, type SpokeProvider, type SpokeProviderType, SpokeService, type SpokeTokenSymbols, type SpokeTxHash, type StakeParams, type StakingAction, type StakingConfig, type StakingError, type StakingErrorCode, type StakingInfo, StakingLogic, type StakingParams, StakingService, type StakingServiceConstructorParams, type State, StellarBaseSpokeProvider, type StellarGasEstimate, StellarRawSpokeProvider, type StellarReturnType, type StellarSpokeDepositParams, StellarSpokeProvider, type StellarSpokeProviderType, StellarSpokeService, type StellarTransferToHubParams, type SubmitTxExtraData, type SubmitTxParams, type SubmitTxResponse, SuiBaseSpokeProvider, type SuiGasEstimate, SuiRawSpokeProvider, type SuiRawTransaction, type SuiReturnType, type SuiSpokeDepositParams, SuiSpokeProvider, type SuiSpokeProviderType, SuiSpokeService, type SuiTransferToHubParams, SupportedMigrationTokens, type SwapParams, SwapService, type SwapServiceConfig, type SwapServiceConstructorParams, type TxReturnType, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UnifiedBnUSDMigrateParams, type UnknownIntentAutoSwapError, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakeSodaRequest, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type UserUnstakeInfo, VAULT_TOKEN_DECIMALS, type VaultReserves, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitIntentAutoSwapError, type WaitUntilIntentExecutedPayload, WalletAbstractionService, type WalletSimulationParams, type WithdrawInfo, adjustAmountByFee, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bnUSDLegacySpokeChainIds, bnUSDLegacyTokens, bnUSDNewTokens, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, connectionAbi, convertTransactionInstructionToRaw, deriveUserWalletAddress, encodeAddress, encodeContractCalls, erc20Abi, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, getAllLegacybnUSDTokens, getAndFormatReserveEModes, getCompoundedBalance, getEvmViemChain, getHubChainConfig, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, isAddressString, isBalnMigrateParams, isConfiguredMoneyMarketConfig, isConfiguredSolverConfig, isCreateIntentAutoSwapError, isEvmHubChainConfig, isEvmInitializedConfig, isEvmRawSpokeProvider, isEvmSpokeChainConfig, isEvmSpokeProvider, isEvmSpokeProviderType, isEvmUninitializedBrowserConfig, isEvmUninitializedConfig, isEvmUninitializedPrivateKeyConfig, isHubSpokeProvider, isIconAddress, isIconRawSpokeProvider, isIconSpokeProvider, isIconSpokeProviderType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveRawSpokeProvider, isInjectiveSpokeProvider, isInjectiveSpokeProviderType, isIntentCreationFailedError, isIntentCreationUnknownError, isIntentPostExecutionFailedError, isIntentRelayChainId, isIntentSubmitTxFailedError, isJsonRpcPayloadResponse, isLegacybnUSDChainId, isLegacybnUSDToken, isMoneyMarketBorrowUnknownError, isMoneyMarketCreateBorrowIntentFailedError, isMoneyMarketCreateRepayIntentFailedError, isMoneyMarketCreateSupplyIntentFailedError, isMoneyMarketCreateWithdrawIntentFailedError, isMoneyMarketRelayTimeoutError, isMoneyMarketRepayUnknownError, isMoneyMarketSubmitTxFailedError, isMoneyMarketSupplyUnknownError, isMoneyMarketWithdrawUnknownError, isNewbnUSDChainId, isNewbnUSDToken, isPartnerFeeAmount, isPartnerFeePercentage, isRawSpokeProvider, isResponseAddressType, isResponseSigningType, isSetSwapPreferenceError, isSolanaNativeToken, isSolanaRawSpokeProvider, isSolanaSpokeProvider, isSolanaSpokeProviderType, isSolverErrorResponse, isSonicRawSpokeProvider, isSonicSpokeProvider, isSonicSpokeProviderType, isStellarRawSpokeProvider, isStellarSpokeProvider, isStellarSpokeProviderType, isSuiRawSpokeProvider, isSuiSpokeProvider, isSuiSpokeProviderType, isUnifiedBnUSDMigrateParams, isUnknownIntentAutoSwapError, isWaitIntentAutoSwapError, isWaitUntilIntentExecutedFailed, nativeToUSD, newbnUSDSpokeChainIds, normalize, normalizeBN, normalizedToUsd, parseToStroops, parseTokenArrayFromJson, poolAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, sleep, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingRouterAbi, submitTransaction, uiPoolDataAbi, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, wadToRay, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
|
11688
|
+
export { type AggregatedReserveData, type AllowanceResponse, type ApiResponse, type AssetEntry, type AutoSwapPreferences, type BackendApiConfig, BackendApiService, type Balance, type BalnLockParams, type BalnMigrateParams, type BalnSwapAbi, BalnSwapService, type BalnSwapServiceConstructorParams, type BaseCurrencyInfo, BigIntToHex, type BigNumberValue, BigNumberZeroDecimal, BnUSDMigrationService, type BnUSDMigrationServiceConstructorParams, type BnUSDRevertMigrationParams, type BorrowInfo, type BridgeError, type BridgeErrorCode, type BridgeExtraData, type BridgeOptionalExtraData, type BridgeParams, BridgeService, type BridgeServiceConfig, type BridgeServiceConstructorParams, type CalculateAllReserveIncentivesRequest, type CalculateAllUserIncentivesRequest, type CalculateCompoundedRateRequest, type CancelUnstakeParams, type ClaimParams, type CombinedReserveData, type ComputedUserReserve, ConfigService, type ConfigServiceConfig, type ConfigServiceConstructorParams, type ConnMsg, type CreateBridgeIntentParams, type CreateIntentAutoSwapError, type CreateIntentParams, type CreateLimitOrderParams, type CustomProvider, 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, type Default, type DepositSimulationParams, type DetailedLock, type EModeCategory, type EModeCategoryHumanized, type EModeData, type EModeDataString, type EmodeDataHumanized, Erc20Service, EvmAssetManagerService, EvmBaseSpokeProvider, type EvmContractCall, type EvmDepositToDataParams, type EvmGasEstimate, EvmHubProvider, type EvmHubProviderConfig, type EvmHubProviderConstructorParams, type EvmInitializedConfig, EvmRawSpokeProvider, type EvmReturnType, EvmSolverService, type EvmSpokeDepositParams, EvmSpokeProvider, type EvmSpokeProviderType, EvmSpokeService, type EvmTransferParams, type EvmTransferToHubParams, type EvmTxReturnType, type EvmUninitializedBrowserConfig, type EvmUninitializedConfig, type EvmUninitializedPrivateKeyConfig, EvmVaultTokenService, EvmWalletAbstraction, type EvmWithdrawAssetDataParams, type ExecuteIntentAutoSwapError, type ExecuteMsg, FEE_PERCENTAGE_SCALE, type FeeAmount, type FeeData, type FeeTokenApproveParams, type FormatReserveRequest, type FormatReserveResponse, type FormatReserveUSDRequest, type FormatReserveUSDResponse, type FormatReservesAndIncentivesUSDRequest, type FormatReservesUSDRequest, type FormatUserSummaryAndIncentivesRequest, type FormatUserSummaryAndIncentivesResponse, type FormatUserSummaryRequest, type FormatUserSummaryResponse, type FormattedReserveEMode, type GasEstimateType, type GetAddressType, type GetChainConfigType, type GetEstimateGasReturnType, type GetIntentSubmitTxExtraDataParams, type GetMigrationFailedPayload, type GetMoneyMarketError, type GetMoneyMarketParams, type GetPacketParams, type GetPacketResponse, type GetRelayRequestParamType, type GetRelayResponse, type GetSpokeDepositParamsType, type GetTransactionPacketsParams, type GetTransactionPacketsResponse, HALF_RAY, HALF_WAD, type HanaWalletRequestEvent, type HanaWalletResponseEvent, type HashTxReturnType, HubService, type HubTxHash, ICON_TX_RESULT_WAIT_MAX_RETRY, type IRawSpokeProvider, type ISpokeProvider, type IWalletProvider, IconBaseSpokeProvider, type IconContractAddress, type IconGasEstimate, type IconJsonRpcVersion, IconRawSpokeProvider, type IconRawTransaction, type IconReturnType, type IconSpokeDepositParams, IconSpokeProvider, type IconSpokeProviderType, IconSpokeService, type IconTransferToHubParams, type IcxCreateRevertMigrationParams, type IcxMigrateParams, IcxMigrationService, type IcxMigrationServiceConstructorParams, type IcxRawTransaction, type IcxRevertMigrationParams, type IcxTokenType, type IncentiveDataHumanized, type InjTokenInfo, Injective20Token, InjectiveBaseSpokeProvider, type InjectiveGasEstimate, InjectiveRawSpokeProvider, type InjectiveReturnType, type InjectiveSpokeDepositParams, InjectiveSpokeProvider, type InjectiveSpokeProviderType, InjectiveSpokeService, type InjectiveTransferToHubParams, type InstantUnstakeParams, type InstantiateMsg, type Intent, type IntentAutoSwapErrorData, type IntentAutoSwapResult, type IntentCancelFailedErrorData, IntentCreatedEventAbi, type IntentCreatedEventLog, type IntentCreationFailedErrorData, type IntentData, IntentDataType, type IntentDeliveryInfo, type IntentError, type IntentErrorCode, type IntentErrorData, IntentFilledEventAbi, type IntentFilledEventLog, type IntentPostExecutionFailedErrorData, type IntentRelayRequest, type IntentRelayRequestParams, type IntentResponse, type IntentState, type IntentSubmitTxFailedErrorData, type IntentWaitUntilIntentExecutedFailedErrorData, IntentsAbi, type JsonRpcPayloadResponse, LTV_PRECISION, type LegacybnUSDChainId, type LegacybnUSDToken, type LegacybnUSDTokenAddress, LendingPoolService, type LimitOrderParams, LockupMultiplier, LockupPeriod, MAX_UINT256, type MigrationAction, type MigrationError, type MigrationErrorCode, type MigrationErrorData, type MigrationFailedErrorData, type MigrationParams, type MigrationRevertParams, MigrationService, type MigrationServiceConfig, type MigrationServiceConstructorParams, type MigrationTokens, type MoneyMarketAction, type MoneyMarketAsset, type MoneyMarketAssetBorrowers, type MoneyMarketAssetSuppliers, type MoneyMarketBorrowFailedError, type MoneyMarketBorrowParams, type MoneyMarketBorrowers, type MoneyMarketConfigParams, MoneyMarketDataService, type MoneyMarketEncodeBorrowParams, type MoneyMarketEncodeRepayParams, type MoneyMarketEncodeRepayWithATokensParams, type MoneyMarketEncodeSupplyParams, type MoneyMarketEncodeWithdrawParams, type MoneyMarketError, type MoneyMarketErrorCode, type MoneyMarketExtraData, type MoneyMarketOptionalExtraData, type MoneyMarketParams, type MoneyMarketPosition, type MoneyMarketRepayFailedError, type MoneyMarketRepayParams, MoneyMarketService, type MoneyMarketServiceConfig, type MoneyMarketServiceConstructorParams, type MoneyMarketSubmitTxFailedError, type MoneyMarketSupplyFailedError, type MoneyMarketSupplyParams, type MoneyMarketUnknownError, type MoneyMarketUnknownErrorCode, type MoneyMarketWithdrawFailedError, type MoneyMarketWithdrawParams, type NewbnUSDChainId, type Optional, type OptionalFee, type OptionalRaw, type OptionalTimeout, type OrderbookResponse, type PacketData, type PartnerFee, type PartnerFeeAmount, type PartnerFeeClaimAssetBalance, PartnerFeeClaimService, type PartnerFeeClaimServiceConfig, type PartnerFeeClaimServiceConstructorParams, type PartnerFeeClaimSwapParams, type PartnerFeeConfig, type PartnerFeePercentage, PartnerService, type PartnerServiceConfig, type PartnerServiceConstructorParams, type PoolBaseCurrencyHumanized, type Prettify, type PromiseEvmTxReturnType, type PromiseIconTxReturnType, type PromiseInjectiveTxReturnType, type PromiseSolanaTxReturnType, type PromiseStellarTxReturnType, type PromiseSuiTxReturnType, type PromiseTxReturnType, ProtocolIntentsAbi, type QueryMsg, type QuoteType, RAY, RAY_DECIMALS, type RawSpokeProvider, type RawTxReturnType, type RelayAction, type RelayError, type RelayErrorCode, type RelayExtraData, type RelayOptionalExtraData, type RelayRequestDetail, type RelayRequestSigning, type RelayTxStatus, type RelayerApiConfig, type RequestConfig, type ReserveCalculationData, type ReserveData, type ReserveDataHumanized, type ReserveDataLegacy, type ReserveDataWithPrice, type ReserveEMode, type ReserveIncentiveDict, type ReservesDataHumanized, type ReservesIncentiveDataHumanized, type ResponseAddressType, type ResponseSigningType, type Result, type RewardInfoHumanized, SECONDS_PER_YEAR, STELLAR_DEFAULT_TX_TIMEOUT_SECONDS, STELLAR_PRIORITY_FEE, type SetSwapPreferenceError, type SetSwapPreferenceParams, Sodax, type SodaxConfig, SolanaBaseSpokeProvider, type SolanaGasEstimate, SolanaRawSpokeProvider, type SolanaRawSpokeProviderConfig, type SolanaRawTransaction, type SolanaReturnType, type SolanaSpokeDepositParams, SolanaSpokeProvider, type SolanaSpokeProviderType, SolanaSpokeService, type SolanaTransferToHubParams, SolverApiService, type SolverConfigParams, type SolverErrorResponse, type SolverExecutionRequest, type SolverExecutionResponse, SolverIntentErrorCode, type SolverIntentQuoteRequest, type SolverIntentQuoteResponse, type SolverIntentQuoteResponseRaw, SolverIntentStatusCode, type SolverIntentStatusRequest, type SolverIntentStatusResponse, type SonicAddressOrSpokeType, SonicBaseSpokeProvider, SonicRawSpokeProvider, type SonicSpokeDepositParams, SonicSpokeProvider, type SonicSpokeProviderType, SonicSpokeService, type SpokeDepositParams, type SpokeProvider, type SpokeProviderType, SpokeService, type SpokeTokenSymbols, type SpokeTxHash, type StakeParams, type StakingAction, type StakingConfig, type StakingError, type StakingErrorCode, type StakingInfo, StakingLogic, type StakingParams, StakingService, type StakingServiceConstructorParams, type State, StellarBaseSpokeProvider, type StellarGasEstimate, StellarRawSpokeProvider, type StellarReturnType, type StellarSpokeDepositParams, StellarSpokeProvider, type StellarSpokeProviderType, StellarSpokeService, type StellarTransferToHubParams, type SubmitTxExtraData, type SubmitTxParams, type SubmitTxResponse, SuiBaseSpokeProvider, type SuiGasEstimate, SuiRawSpokeProvider, type SuiRawTransaction, type SuiReturnType, type SuiSpokeDepositParams, SuiSpokeProvider, type SuiSpokeProviderType, SuiSpokeService, type SuiTransferToHubParams, SupportedMigrationTokens, type SwapParams, SwapService, type SwapServiceConfig, type SwapServiceConstructorParams, type TxReturnType, USD_DECIMALS, type UiPoolDataProviderInterface, UiPoolDataProviderService, type UnifiedBnUSDMigrateParams, type UnknownIntentAutoSwapError, type UnstakeParams, type UnstakeRequest, type UnstakeRequestWithPenalty, type UnstakeSodaRequest, type UnstakingInfo, type UserIncentiveData, type UserIncentiveDataHumanized, type UserIncentiveDict, type UserIntentsResponse, type UserReserveCalculationData, type UserReserveData, type UserReserveDataHumanized, type UserReserveDataString, type UserReservesIncentivesDataHumanized, type UserRewardInfoHumanized, type UserUnstakeInfo, VAULT_TOKEN_DECIMALS, type VaultReserves, type VerifyTxHashRawConfig, type VerifyTxHashRawConfigType, type VerifyTxHashRawEvmConfig, type VerifyTxHashRawSolanaConfig, type VerifyTxHashRawStellarConfig, WAD, WAD_RAY_RATIO, WEI_DECIMALS, type WaitIntentAutoSwapError, type WaitUntilIntentExecutedPayload, WalletAbstractionService, type WalletSimulationParams, type WithdrawInfo, adjustAmountByFee, assetManagerAbi, balnSwapAbi, binomialApproximatedRayPow, bnUSDLegacySpokeChainIds, bnUSDLegacyTokens, bnUSDNewTokens, calculateAllReserveIncentives, calculateAllUserIncentives, calculateAvailableBorrowsMarketReferenceCurrency, calculateCompoundedInterest, calculateCompoundedRate, calculateFeeAmount, calculateHealthFactorFromBalances, calculateHealthFactorFromBalancesBigUnits, calculateLinearInterest, calculatePercentageFeeAmount, connectionAbi, convertTransactionInstructionToRaw, deriveUserWalletAddress, encodeAddress, encodeContractCalls, erc20Abi, formatBasisPoints, formatEModeCategory, formatEModes, formatPercentage, formatReserve, formatReserveUSD, formatReserves, formatReservesAndIncentives, formatUserSummary, formatUserSummaryAndIncentives, getAllLegacybnUSDTokens, getAndFormatReserveEModes, getCompoundedBalance, getEvmViemChain, getHubChainConfig, getIconAddressBytes, getLinearBalance, getMarketReferenceCurrencyAndUsdBalance, getPacket, getRandomBytes, getReserveNormalizedIncome, getReservesEModes, getSolanaAddressBytes, getTransactionPackets, hexToBigInt, hexToSolanaAddress, hyper, isAddressString, isBalnMigrateParams, isConfiguredMoneyMarketConfig, isConfiguredSolverConfig, isCreateIntentAutoSwapError, isEvmHubChainConfig, isEvmInitializedConfig, isEvmRawSpokeProvider, isEvmSpokeChainConfig, isEvmSpokeProvider, isEvmSpokeProviderType, isEvmUninitializedBrowserConfig, isEvmUninitializedConfig, isEvmUninitializedPrivateKeyConfig, isHubSpokeProvider, isIconAddress, isIconRawSpokeProvider, isIconSpokeProvider, isIconSpokeProviderType, isIcxCreateRevertMigrationParams, isIcxMigrateParams, isInjectiveRawSpokeProvider, isInjectiveSpokeProvider, isInjectiveSpokeProviderType, isIntentCreationFailedError, isIntentCreationUnknownError, isIntentPostExecutionFailedError, isIntentRelayChainId, isIntentSubmitTxFailedError, isJsonRpcPayloadResponse, isLegacybnUSDChainId, isLegacybnUSDToken, isMoneyMarketBorrowUnknownError, isMoneyMarketCreateBorrowIntentFailedError, isMoneyMarketCreateRepayIntentFailedError, isMoneyMarketCreateSupplyIntentFailedError, isMoneyMarketCreateWithdrawIntentFailedError, isMoneyMarketRelayTimeoutError, isMoneyMarketRepayUnknownError, isMoneyMarketSubmitTxFailedError, isMoneyMarketSupplyUnknownError, isMoneyMarketWithdrawUnknownError, isNewbnUSDChainId, isNewbnUSDToken, isPartnerFeeAmount, isPartnerFeePercentage, isRawSpokeProvider, isResponseAddressType, isResponseSigningType, isSetSwapPreferenceError, isSolanaNativeToken, isSolanaRawSpokeProvider, isSolanaSpokeProvider, isSolanaSpokeProviderType, isSolverErrorResponse, isSonicRawSpokeProvider, isSonicSpokeProvider, isSonicSpokeProviderType, isStellarRawSpokeProvider, isStellarSpokeProvider, isStellarSpokeProviderType, isSuiRawSpokeProvider, isSuiSpokeProvider, isSuiSpokeProviderType, isUnifiedBnUSDMigrateParams, isUnknownIntentAutoSwapError, isWaitIntentAutoSwapError, isWaitUntilIntentExecutedFailed, nativeToUSD, newbnUSDSpokeChainIds, normalize, normalizeBN, normalizedToUsd, parseToStroops, parseTokenArrayFromJson, poolAbi, randomUint256, rayDiv, rayMul, rayPow, rayToWad, relayTxAndWaitPacket, requestAddress, requestJsonRpc, requestSigning, retry, sleep, sonicWalletFactoryAbi, spokeAssetManagerAbi, stakedSodaAbi, stakingRouterAbi, submitTransaction, uiPoolDataAbi, valueToBigNumber, valueToZDBigNumber, variableDebtTokenAbi, vaultTokenAbi, wadToRay, waitForTransactionReceipt, waitUntilIntentExecuted, walletFactoryAbi, wrappedSonicAbi };
|
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
|
/**
|
|
@@ -10739,6 +10737,33 @@ var StellarSpokeService = class _StellarSpokeService {
|
|
|
10739
10737
|
raw
|
|
10740
10738
|
);
|
|
10741
10739
|
}
|
|
10740
|
+
static async waitForTransactionRaw(params) {
|
|
10741
|
+
const defaultParams = {
|
|
10742
|
+
pollingTimeout: 750,
|
|
10743
|
+
maxAttempts: 40
|
|
10744
|
+
};
|
|
10745
|
+
const { pollingTimeout, maxAttempts, sorobanRpcConfig, txHash } = { ...defaultParams, ...params };
|
|
10746
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
10747
|
+
try {
|
|
10748
|
+
const sorobanServer = new CustomSorobanServer(sorobanRpcConfig.sorobanRpcUrl, sorobanRpcConfig.customHeaders);
|
|
10749
|
+
const tx = await sorobanServer.getTransaction(txHash);
|
|
10750
|
+
if (tx && tx.status === "SUCCESS") {
|
|
10751
|
+
return { ok: true, value: true };
|
|
10752
|
+
}
|
|
10753
|
+
if (tx && tx.status === "FAILED") {
|
|
10754
|
+
return { ok: false, error: new Error(`Transaction failed: ${JSON.stringify(tx)}`) };
|
|
10755
|
+
}
|
|
10756
|
+
if (tx && tx.status === "NOT_FOUND") {
|
|
10757
|
+
await sleep(pollingTimeout);
|
|
10758
|
+
continue;
|
|
10759
|
+
}
|
|
10760
|
+
await sleep(pollingTimeout);
|
|
10761
|
+
} catch (err) {
|
|
10762
|
+
await sleep(pollingTimeout);
|
|
10763
|
+
}
|
|
10764
|
+
}
|
|
10765
|
+
return { ok: false, error: new Error("Transaction was not confirmed within the max attempts") };
|
|
10766
|
+
}
|
|
10742
10767
|
static async waitForTransaction(spokeProvider, txHash, pollingTimeout = 750, maxAttempts = 40) {
|
|
10743
10768
|
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
10744
10769
|
try {
|
|
@@ -11548,6 +11573,42 @@ var EvmSpokeService = class _EvmSpokeService {
|
|
|
11548
11573
|
}
|
|
11549
11574
|
return spokeProvider.walletProvider.sendTransaction(rawTx);
|
|
11550
11575
|
}
|
|
11576
|
+
static async waitForTransactionReceipt(params) {
|
|
11577
|
+
try {
|
|
11578
|
+
const { txHash, chainId, rpcUrl, confirmations, pollingInterval, retryCount, retryDelay, timeout } = params;
|
|
11579
|
+
const evmChain = getEvmViemChain(chainId);
|
|
11580
|
+
const publicClient = createPublicClient({
|
|
11581
|
+
chain: evmChain,
|
|
11582
|
+
transport: http(rpcUrl ?? evmChain.rpcUrls.default.http[0])
|
|
11583
|
+
});
|
|
11584
|
+
const receipt = await publicClient.waitForTransactionReceipt({
|
|
11585
|
+
hash: txHash,
|
|
11586
|
+
confirmations,
|
|
11587
|
+
pollingInterval,
|
|
11588
|
+
retryCount,
|
|
11589
|
+
retryDelay,
|
|
11590
|
+
timeout
|
|
11591
|
+
});
|
|
11592
|
+
const response = {
|
|
11593
|
+
...receipt,
|
|
11594
|
+
transactionIndex: receipt.transactionIndex.toString(),
|
|
11595
|
+
blockNumber: receipt.blockNumber.toString(),
|
|
11596
|
+
cumulativeGasUsed: receipt.cumulativeGasUsed.toString(),
|
|
11597
|
+
gasUsed: receipt.gasUsed.toString(),
|
|
11598
|
+
contractAddress: receipt.contractAddress?.toString() ?? null,
|
|
11599
|
+
logs: receipt.logs.map((log) => ({
|
|
11600
|
+
...log,
|
|
11601
|
+
blockNumber: log.blockNumber.toString(),
|
|
11602
|
+
logIndex: log.logIndex.toString(),
|
|
11603
|
+
transactionIndex: log.transactionIndex.toString()
|
|
11604
|
+
})),
|
|
11605
|
+
effectiveGasPrice: receipt.effectiveGasPrice?.toString()
|
|
11606
|
+
};
|
|
11607
|
+
return { ok: true, value: response };
|
|
11608
|
+
} catch (error) {
|
|
11609
|
+
return { ok: false, error: new Error(`Failed to get transaction receipt: ${JSON.stringify(error)}`) };
|
|
11610
|
+
}
|
|
11611
|
+
}
|
|
11551
11612
|
};
|
|
11552
11613
|
|
|
11553
11614
|
// src/shared/utils/icon-utils.ts
|
|
@@ -12009,7 +12070,40 @@ var SolanaSpokeService = class _SolanaSpokeService {
|
|
|
12009
12070
|
}
|
|
12010
12071
|
return spokeProvider.walletProvider.sendTransaction(serializedTransaction);
|
|
12011
12072
|
}
|
|
12012
|
-
static async
|
|
12073
|
+
static async waitForConfirmationRaw(params) {
|
|
12074
|
+
try {
|
|
12075
|
+
const defaultParams = {
|
|
12076
|
+
commitment: "finalized",
|
|
12077
|
+
timeoutMs: 6e4,
|
|
12078
|
+
// total time to wait
|
|
12079
|
+
pollingTimeout: 750
|
|
12080
|
+
// 750ms retry interval
|
|
12081
|
+
};
|
|
12082
|
+
const { rpcUrl, signature, commitment, timeoutMs, pollingTimeout } = { ...defaultParams, ...params };
|
|
12083
|
+
const connection = new Connection(rpcUrl, commitment);
|
|
12084
|
+
const deadline = Date.now() + timeoutMs;
|
|
12085
|
+
while (Date.now() < deadline) {
|
|
12086
|
+
try {
|
|
12087
|
+
const tx = await connection.getTransaction(signature, { commitment, maxSupportedTransactionVersion: 0 });
|
|
12088
|
+
if (tx) {
|
|
12089
|
+
if (tx.meta?.err) {
|
|
12090
|
+
return { ok: false, error: new Error(JSON.stringify(tx.meta.err)) };
|
|
12091
|
+
}
|
|
12092
|
+
return { ok: true, value: true };
|
|
12093
|
+
}
|
|
12094
|
+
} catch {
|
|
12095
|
+
}
|
|
12096
|
+
await new Promise((r) => setTimeout(r, pollingTimeout));
|
|
12097
|
+
}
|
|
12098
|
+
return {
|
|
12099
|
+
ok: false,
|
|
12100
|
+
error: new Error(`Timed out after ${timeoutMs}ms waiting for ${commitment} confirmation for ${signature}`)
|
|
12101
|
+
};
|
|
12102
|
+
} catch (error) {
|
|
12103
|
+
return { ok: false, error: new Error(`Failed to get transaction confirmation: ${JSON.stringify(error)}`) };
|
|
12104
|
+
}
|
|
12105
|
+
}
|
|
12106
|
+
static async waitForConfirmation(spokeProvider, signature, commitment = "finalized", timeoutMs = 6e4, pollingTimeout = 750) {
|
|
12013
12107
|
try {
|
|
12014
12108
|
const connection = new Connection(spokeProvider.chainConfig.rpcUrl, commitment);
|
|
12015
12109
|
const deadline = Date.now() + timeoutMs;
|
|
@@ -12024,7 +12118,7 @@ var SolanaSpokeService = class _SolanaSpokeService {
|
|
|
12024
12118
|
}
|
|
12025
12119
|
} catch {
|
|
12026
12120
|
}
|
|
12027
|
-
await new Promise((r) => setTimeout(r,
|
|
12121
|
+
await new Promise((r) => setTimeout(r, pollingTimeout));
|
|
12028
12122
|
}
|
|
12029
12123
|
return {
|
|
12030
12124
|
ok: false,
|
|
@@ -12446,6 +12540,31 @@ var SpokeService = class _SpokeService {
|
|
|
12446
12540
|
value: true
|
|
12447
12541
|
};
|
|
12448
12542
|
}
|
|
12543
|
+
/**
|
|
12544
|
+
* Verifies the transaction hash for the spoke chain to exist on chain.
|
|
12545
|
+
* @param {VerifyTxHashRawConfig} params - The parameters for the verification.
|
|
12546
|
+
* @returns {Promise<Result<boolean>>} A promise that resolves to the result of the verification.
|
|
12547
|
+
*/
|
|
12548
|
+
static async verifyTxHashRaw(params) {
|
|
12549
|
+
switch (params.chainType) {
|
|
12550
|
+
case "SOLANA":
|
|
12551
|
+
return SolanaSpokeService.waitForConfirmationRaw(params);
|
|
12552
|
+
case "STELLAR":
|
|
12553
|
+
return StellarSpokeService.waitForTransactionRaw(params);
|
|
12554
|
+
case "EVM": {
|
|
12555
|
+
const result = await EvmSpokeService.waitForTransactionReceipt(params);
|
|
12556
|
+
if (!result.ok) {
|
|
12557
|
+
return result;
|
|
12558
|
+
}
|
|
12559
|
+
if (result.value.status && result.value.status !== "0x1") {
|
|
12560
|
+
return { ok: false, error: new Error("Transaction reverted") };
|
|
12561
|
+
}
|
|
12562
|
+
return { ok: true, value: true };
|
|
12563
|
+
}
|
|
12564
|
+
default:
|
|
12565
|
+
return { ok: true, value: true };
|
|
12566
|
+
}
|
|
12567
|
+
}
|
|
12449
12568
|
};
|
|
12450
12569
|
var IntentDataType = /* @__PURE__ */ ((IntentDataType2) => {
|
|
12451
12570
|
IntentDataType2[IntentDataType2["FEE"] = 1] = "FEE";
|
|
@@ -15372,6 +15491,11 @@ var PartnerFeeClaimService = class {
|
|
|
15372
15491
|
invariant6(isSonicSpokeProviderType(spokeProvider), "PartnerFeeClaimService only supports Sonic spoke provider");
|
|
15373
15492
|
invariant6(this.config.protocolIntentsContract, "protocolIntentsContract is not configured in solver config");
|
|
15374
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
|
+
);
|
|
15375
15499
|
const rawTx = {
|
|
15376
15500
|
from: walletAddress,
|
|
15377
15501
|
to: this.config.protocolIntentsContract,
|
|
@@ -15380,7 +15504,7 @@ var PartnerFeeClaimService = class {
|
|
|
15380
15504
|
abi: ProtocolIntentsAbi,
|
|
15381
15505
|
functionName: "setAutoSwapPreferences",
|
|
15382
15506
|
args: [
|
|
15383
|
-
|
|
15507
|
+
outputToken,
|
|
15384
15508
|
BigInt(getIntentRelayChainId(params.dstChain)),
|
|
15385
15509
|
encodeAddress(params.dstChain, params.dstAddress)
|
|
15386
15510
|
]
|