@sodax/sdk 1.0.0-rc.2 → 1.0.0-rc.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -366
- package/dist/index.cjs +508 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +21 -13
- package/dist/index.d.ts +21 -13
- package/dist/index.mjs +510 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IIconWalletProvider, IconSpokeChainConfig, HttpUrl, IconAddress, IInjectiveWalletProvider, InjectiveExecuteResponse, StellarSpokeChainConfig, IStellarWalletProvider, StellarRpcConfig, ISuiWalletProvider, SuiSpokeChainConfig, Address, SpokeChainId, Token, GetMoneyMarketTokensApiResponse, ISolanaWalletProvider, SolanaChainConfig, IEvmWalletProvider, SpokeChainConfig, EvmSpokeChainConfig, SonicSpokeChainConfig, EvmHubChainConfig, EvmChainId, InjectiveSpokeChainConfig, AssetInfo, Hex as Hex$1, TokenInfo, HubAddress, EvmRawTransaction, InjectiveRawTransaction, SolanaBase58PublicKey, SolverConfig, Hash as Hash$1, IntentRelayChainId, StellarRawTransaction, MoneyMarketConfig, spokeChainConfig, ICON_MAINNET_CHAIN_ID, IConfigApi, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, GetSwapTokensByChainIdApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetHubAssetsApiResponse, GetHubVaultsApiResponse, GetHubAssetsByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, OriginalAssetAddress, HubAssetInfo, HubChainId, XToken, EvmRawTransactionReceipt, HubChainConfig, IconEoaAddress } from '@sodax/types';
|
|
1
|
+
import { IIconWalletProvider, IconSpokeChainConfig, HttpUrl, IconAddress, IInjectiveWalletProvider, InjectiveExecuteResponse, StellarSpokeChainConfig, IStellarWalletProvider, StellarRpcConfig, ISuiWalletProvider, SuiSpokeChainConfig, Address, Erc20Token, SpokeChainId, Token, GetMoneyMarketTokensApiResponse, ISolanaWalletProvider, SolanaChainConfig, IEvmWalletProvider, SpokeChainConfig, EvmSpokeChainConfig, SonicSpokeChainConfig, EvmHubChainConfig, EvmChainId, InjectiveSpokeChainConfig, AssetInfo, Hex as Hex$1, TokenInfo, HubAddress, EvmRawTransaction, InjectiveRawTransaction, SolanaBase58PublicKey, SolverConfig, Hash as Hash$1, IntentRelayChainId, StellarRawTransaction, MoneyMarketConfig, spokeChainConfig, ICON_MAINNET_CHAIN_ID, IConfigApi, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, GetSwapTokensByChainIdApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetHubAssetsApiResponse, GetHubVaultsApiResponse, GetHubAssetsByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, OriginalAssetAddress, HubAssetInfo, HubChainId, XToken, EvmRawTransactionReceipt, HubChainConfig, IconEoaAddress } from '@sodax/types';
|
|
2
2
|
export * from '@sodax/types';
|
|
3
3
|
import * as viem from 'viem';
|
|
4
4
|
import { Hex, PublicClient, HttpTransport, Address as Address$1, WalletClient, CustomTransport, Chain, Account as Account$1, Hash, GetLogsReturnType, TransactionReceipt } from 'viem';
|
|
@@ -6132,11 +6132,15 @@ declare class UiPoolDataProviderService implements UiPoolDataProviderInterface {
|
|
|
6132
6132
|
getEModes(): Promise<readonly EModeData[]>;
|
|
6133
6133
|
/**
|
|
6134
6134
|
* Get the list of all reserves in the pool
|
|
6135
|
-
* @param
|
|
6136
|
-
* @param poolAddressesProvider - The address of the Pool Addresses Provider
|
|
6135
|
+
* @param unfiltered - If true, returns all reserves in the pool (including bnUSD (debt) reserve); if false (default), filters out bnUSD.
|
|
6137
6136
|
* @returns {Promise<readonly Address[]>} - Array of reserve addresses
|
|
6138
6137
|
*/
|
|
6139
|
-
getReservesList(): Promise<readonly Address[]>;
|
|
6138
|
+
getReservesList(unfiltered?: boolean): Promise<readonly Address[]>;
|
|
6139
|
+
/**
|
|
6140
|
+
* @description Get the bnUSD facilitator bucket
|
|
6141
|
+
* @returns {Promise<readonly [bigint, bigint]>} - The bnUSD [cap, current borrowed]
|
|
6142
|
+
*/
|
|
6143
|
+
getBnusdFacilitatorBucket(): Promise<readonly [bigint, bigint]>;
|
|
6140
6144
|
/**
|
|
6141
6145
|
* Get detailed data for all reserves in the pool
|
|
6142
6146
|
* @returns {Promise<readonly [readonly AggregatedReserveData[], BaseCurrencyInfo]>} - Tuple containing array of reserve data and base currency info
|
|
@@ -6185,6 +6189,7 @@ declare class MoneyMarketDataService {
|
|
|
6185
6189
|
readonly lendingPoolService: LendingPoolService;
|
|
6186
6190
|
readonly hubProvider: EvmHubProvider;
|
|
6187
6191
|
constructor(hubProvider: EvmHubProvider);
|
|
6192
|
+
getATokenData(aToken: Address): Promise<Erc20Token>;
|
|
6188
6193
|
/**
|
|
6189
6194
|
* LendingPool
|
|
6190
6195
|
*/
|
|
@@ -6205,9 +6210,10 @@ declare class MoneyMarketDataService {
|
|
|
6205
6210
|
*/
|
|
6206
6211
|
/**
|
|
6207
6212
|
* Get the reserves list
|
|
6213
|
+
* @param unfiltered - If true, return the list of all reserves in the pool (including bnUSD (debt) reserve)
|
|
6208
6214
|
* @returns {Promise<readonly Address[]>} - List of reserve asset addresses
|
|
6209
6215
|
*/
|
|
6210
|
-
getReservesList(): Promise<readonly Address[]>;
|
|
6216
|
+
getReservesList(unfiltered?: boolean): Promise<readonly Address[]>;
|
|
6211
6217
|
/**
|
|
6212
6218
|
* Get the reserves data
|
|
6213
6219
|
* @returns {Promise<readonly [readonly AggregatedReserveData[], BaseCurrencyInfo]>} - The reserves data
|
|
@@ -7777,7 +7783,7 @@ declare class SwapService {
|
|
|
7777
7783
|
* "token_dst_blockchain_id":"0xa4b1.arbitrum",
|
|
7778
7784
|
* "amount":1000000000000000n,
|
|
7779
7785
|
* "quote_type": "exact_input"
|
|
7780
|
-
* } satisfies SolverIntentQuoteRequest
|
|
7786
|
+
* } satisfies SolverIntentQuoteRequest & OptionalFee
|
|
7781
7787
|
*
|
|
7782
7788
|
* const response = await swapService.getQuote(payload);
|
|
7783
7789
|
*
|
|
@@ -8538,6 +8544,7 @@ declare function relayTxAndWaitPacket<S extends SpokeProvider>(spokeTxHash: stri
|
|
|
8538
8544
|
|
|
8539
8545
|
declare class Erc20Service {
|
|
8540
8546
|
private constructor();
|
|
8547
|
+
static getErc20Token(token: Address$1, publicClient: PublicClient): Promise<Erc20Token>;
|
|
8541
8548
|
/**
|
|
8542
8549
|
* Check if spender has enough ERC20 allowance for given amount
|
|
8543
8550
|
* @param token - ERC20 token address
|
|
@@ -8706,6 +8713,7 @@ type SolverIntentQuoteRequest = {
|
|
|
8706
8713
|
token_dst_blockchain_id: SpokeChainId;
|
|
8707
8714
|
amount: bigint;
|
|
8708
8715
|
quote_type: QuoteType;
|
|
8716
|
+
fee?: PartnerFee;
|
|
8709
8717
|
};
|
|
8710
8718
|
type SolverIntentQuoteResponseRaw = {
|
|
8711
8719
|
quoted_amount: string;
|
|
@@ -9301,7 +9309,7 @@ declare const hyper: {
|
|
|
9301
9309
|
};
|
|
9302
9310
|
declare function getEvmViemChain(id: EvmChainId): Chain;
|
|
9303
9311
|
declare const bnUSDLegacySpokeChainIds: readonly ["0x1.icon", "sui", "stellar"];
|
|
9304
|
-
declare const newbnUSDSpokeChainIds: ("0xa86a.avax" | "0xa4b1.arbitrum" | "0x2105.base" | "0x38.bsc" | "sonic" | "0xa.optimism" | "0x89.polygon" | "
|
|
9312
|
+
declare const newbnUSDSpokeChainIds: ("0xa86a.avax" | "0xa4b1.arbitrum" | "0x2105.base" | "0x38.bsc" | "sonic" | "0xa.optimism" | "0x89.polygon" | "hyper" | "lightlink" | "ethereum" | "sui" | "stellar" | "injective-1" | "solana")[];
|
|
9305
9313
|
declare const bnUSDLegacyTokens: readonly [{
|
|
9306
9314
|
readonly symbol: "bnUSD (legacy)";
|
|
9307
9315
|
readonly name: "bnUSD";
|
|
@@ -9375,12 +9383,6 @@ declare const bnUSDNewTokens: ({
|
|
|
9375
9383
|
readonly decimals: 18;
|
|
9376
9384
|
readonly address: "0x39E77f86C1B1f3fbAb362A82b49D2E86C09659B4";
|
|
9377
9385
|
readonly xChainId: "0x89.polygon";
|
|
9378
|
-
} | {
|
|
9379
|
-
readonly symbol: "bnUSD";
|
|
9380
|
-
readonly name: "bnUSD";
|
|
9381
|
-
readonly decimals: 18;
|
|
9382
|
-
readonly address: "0x043fb7e23350Dd5b77dE5E228B528763DEcb9131";
|
|
9383
|
-
readonly xChainId: "nibiru";
|
|
9384
9386
|
} | {
|
|
9385
9387
|
readonly symbol: "bnUSD";
|
|
9386
9388
|
readonly name: "bnUSD";
|
|
@@ -9393,6 +9395,12 @@ declare const bnUSDNewTokens: ({
|
|
|
9393
9395
|
readonly decimals: 18;
|
|
9394
9396
|
readonly address: "0x36134A03dcD03Bbe858B8F7ED28a71AAC608F9E7";
|
|
9395
9397
|
readonly xChainId: "lightlink";
|
|
9398
|
+
} | {
|
|
9399
|
+
readonly symbol: "bnUSD";
|
|
9400
|
+
readonly name: "bnUSD";
|
|
9401
|
+
readonly decimals: 18;
|
|
9402
|
+
readonly address: "0x1f22279C89B213944b7Ea41daCB0a868DdCDFd13";
|
|
9403
|
+
readonly xChainId: "ethereum";
|
|
9396
9404
|
} | {
|
|
9397
9405
|
readonly symbol: "bnUSD";
|
|
9398
9406
|
readonly name: "bnUSD";
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IIconWalletProvider, IconSpokeChainConfig, HttpUrl, IconAddress, IInjectiveWalletProvider, InjectiveExecuteResponse, StellarSpokeChainConfig, IStellarWalletProvider, StellarRpcConfig, ISuiWalletProvider, SuiSpokeChainConfig, Address, SpokeChainId, Token, GetMoneyMarketTokensApiResponse, ISolanaWalletProvider, SolanaChainConfig, IEvmWalletProvider, SpokeChainConfig, EvmSpokeChainConfig, SonicSpokeChainConfig, EvmHubChainConfig, EvmChainId, InjectiveSpokeChainConfig, AssetInfo, Hex as Hex$1, TokenInfo, HubAddress, EvmRawTransaction, InjectiveRawTransaction, SolanaBase58PublicKey, SolverConfig, Hash as Hash$1, IntentRelayChainId, StellarRawTransaction, MoneyMarketConfig, spokeChainConfig, ICON_MAINNET_CHAIN_ID, IConfigApi, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, GetSwapTokensByChainIdApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetHubAssetsApiResponse, GetHubVaultsApiResponse, GetHubAssetsByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, OriginalAssetAddress, HubAssetInfo, HubChainId, XToken, EvmRawTransactionReceipt, HubChainConfig, IconEoaAddress } from '@sodax/types';
|
|
1
|
+
import { IIconWalletProvider, IconSpokeChainConfig, HttpUrl, IconAddress, IInjectiveWalletProvider, InjectiveExecuteResponse, StellarSpokeChainConfig, IStellarWalletProvider, StellarRpcConfig, ISuiWalletProvider, SuiSpokeChainConfig, Address, Erc20Token, SpokeChainId, Token, GetMoneyMarketTokensApiResponse, ISolanaWalletProvider, SolanaChainConfig, IEvmWalletProvider, SpokeChainConfig, EvmSpokeChainConfig, SonicSpokeChainConfig, EvmHubChainConfig, EvmChainId, InjectiveSpokeChainConfig, AssetInfo, Hex as Hex$1, TokenInfo, HubAddress, EvmRawTransaction, InjectiveRawTransaction, SolanaBase58PublicKey, SolverConfig, Hash as Hash$1, IntentRelayChainId, StellarRawTransaction, MoneyMarketConfig, spokeChainConfig, ICON_MAINNET_CHAIN_ID, IConfigApi, GetAllConfigApiResponse, GetChainsApiResponse, GetSwapTokensApiResponse, GetSwapTokensByChainIdApiResponse, GetMoneyMarketReserveAssetsApiResponse, GetMoneyMarketTokensByChainIdApiResponse, GetHubAssetsApiResponse, GetHubVaultsApiResponse, GetHubAssetsByChainIdApiResponse, GetRelayChainIdMapApiResponse, GetSpokeChainConfigApiResponse, OriginalAssetAddress, HubAssetInfo, HubChainId, XToken, EvmRawTransactionReceipt, HubChainConfig, IconEoaAddress } from '@sodax/types';
|
|
2
2
|
export * from '@sodax/types';
|
|
3
3
|
import * as viem from 'viem';
|
|
4
4
|
import { Hex, PublicClient, HttpTransport, Address as Address$1, WalletClient, CustomTransport, Chain, Account as Account$1, Hash, GetLogsReturnType, TransactionReceipt } from 'viem';
|
|
@@ -6132,11 +6132,15 @@ declare class UiPoolDataProviderService implements UiPoolDataProviderInterface {
|
|
|
6132
6132
|
getEModes(): Promise<readonly EModeData[]>;
|
|
6133
6133
|
/**
|
|
6134
6134
|
* Get the list of all reserves in the pool
|
|
6135
|
-
* @param
|
|
6136
|
-
* @param poolAddressesProvider - The address of the Pool Addresses Provider
|
|
6135
|
+
* @param unfiltered - If true, returns all reserves in the pool (including bnUSD (debt) reserve); if false (default), filters out bnUSD.
|
|
6137
6136
|
* @returns {Promise<readonly Address[]>} - Array of reserve addresses
|
|
6138
6137
|
*/
|
|
6139
|
-
getReservesList(): Promise<readonly Address[]>;
|
|
6138
|
+
getReservesList(unfiltered?: boolean): Promise<readonly Address[]>;
|
|
6139
|
+
/**
|
|
6140
|
+
* @description Get the bnUSD facilitator bucket
|
|
6141
|
+
* @returns {Promise<readonly [bigint, bigint]>} - The bnUSD [cap, current borrowed]
|
|
6142
|
+
*/
|
|
6143
|
+
getBnusdFacilitatorBucket(): Promise<readonly [bigint, bigint]>;
|
|
6140
6144
|
/**
|
|
6141
6145
|
* Get detailed data for all reserves in the pool
|
|
6142
6146
|
* @returns {Promise<readonly [readonly AggregatedReserveData[], BaseCurrencyInfo]>} - Tuple containing array of reserve data and base currency info
|
|
@@ -6185,6 +6189,7 @@ declare class MoneyMarketDataService {
|
|
|
6185
6189
|
readonly lendingPoolService: LendingPoolService;
|
|
6186
6190
|
readonly hubProvider: EvmHubProvider;
|
|
6187
6191
|
constructor(hubProvider: EvmHubProvider);
|
|
6192
|
+
getATokenData(aToken: Address): Promise<Erc20Token>;
|
|
6188
6193
|
/**
|
|
6189
6194
|
* LendingPool
|
|
6190
6195
|
*/
|
|
@@ -6205,9 +6210,10 @@ declare class MoneyMarketDataService {
|
|
|
6205
6210
|
*/
|
|
6206
6211
|
/**
|
|
6207
6212
|
* Get the reserves list
|
|
6213
|
+
* @param unfiltered - If true, return the list of all reserves in the pool (including bnUSD (debt) reserve)
|
|
6208
6214
|
* @returns {Promise<readonly Address[]>} - List of reserve asset addresses
|
|
6209
6215
|
*/
|
|
6210
|
-
getReservesList(): Promise<readonly Address[]>;
|
|
6216
|
+
getReservesList(unfiltered?: boolean): Promise<readonly Address[]>;
|
|
6211
6217
|
/**
|
|
6212
6218
|
* Get the reserves data
|
|
6213
6219
|
* @returns {Promise<readonly [readonly AggregatedReserveData[], BaseCurrencyInfo]>} - The reserves data
|
|
@@ -7777,7 +7783,7 @@ declare class SwapService {
|
|
|
7777
7783
|
* "token_dst_blockchain_id":"0xa4b1.arbitrum",
|
|
7778
7784
|
* "amount":1000000000000000n,
|
|
7779
7785
|
* "quote_type": "exact_input"
|
|
7780
|
-
* } satisfies SolverIntentQuoteRequest
|
|
7786
|
+
* } satisfies SolverIntentQuoteRequest & OptionalFee
|
|
7781
7787
|
*
|
|
7782
7788
|
* const response = await swapService.getQuote(payload);
|
|
7783
7789
|
*
|
|
@@ -8538,6 +8544,7 @@ declare function relayTxAndWaitPacket<S extends SpokeProvider>(spokeTxHash: stri
|
|
|
8538
8544
|
|
|
8539
8545
|
declare class Erc20Service {
|
|
8540
8546
|
private constructor();
|
|
8547
|
+
static getErc20Token(token: Address$1, publicClient: PublicClient): Promise<Erc20Token>;
|
|
8541
8548
|
/**
|
|
8542
8549
|
* Check if spender has enough ERC20 allowance for given amount
|
|
8543
8550
|
* @param token - ERC20 token address
|
|
@@ -8706,6 +8713,7 @@ type SolverIntentQuoteRequest = {
|
|
|
8706
8713
|
token_dst_blockchain_id: SpokeChainId;
|
|
8707
8714
|
amount: bigint;
|
|
8708
8715
|
quote_type: QuoteType;
|
|
8716
|
+
fee?: PartnerFee;
|
|
8709
8717
|
};
|
|
8710
8718
|
type SolverIntentQuoteResponseRaw = {
|
|
8711
8719
|
quoted_amount: string;
|
|
@@ -9301,7 +9309,7 @@ declare const hyper: {
|
|
|
9301
9309
|
};
|
|
9302
9310
|
declare function getEvmViemChain(id: EvmChainId): Chain;
|
|
9303
9311
|
declare const bnUSDLegacySpokeChainIds: readonly ["0x1.icon", "sui", "stellar"];
|
|
9304
|
-
declare const newbnUSDSpokeChainIds: ("0xa86a.avax" | "0xa4b1.arbitrum" | "0x2105.base" | "0x38.bsc" | "sonic" | "0xa.optimism" | "0x89.polygon" | "
|
|
9312
|
+
declare const newbnUSDSpokeChainIds: ("0xa86a.avax" | "0xa4b1.arbitrum" | "0x2105.base" | "0x38.bsc" | "sonic" | "0xa.optimism" | "0x89.polygon" | "hyper" | "lightlink" | "ethereum" | "sui" | "stellar" | "injective-1" | "solana")[];
|
|
9305
9313
|
declare const bnUSDLegacyTokens: readonly [{
|
|
9306
9314
|
readonly symbol: "bnUSD (legacy)";
|
|
9307
9315
|
readonly name: "bnUSD";
|
|
@@ -9375,12 +9383,6 @@ declare const bnUSDNewTokens: ({
|
|
|
9375
9383
|
readonly decimals: 18;
|
|
9376
9384
|
readonly address: "0x39E77f86C1B1f3fbAb362A82b49D2E86C09659B4";
|
|
9377
9385
|
readonly xChainId: "0x89.polygon";
|
|
9378
|
-
} | {
|
|
9379
|
-
readonly symbol: "bnUSD";
|
|
9380
|
-
readonly name: "bnUSD";
|
|
9381
|
-
readonly decimals: 18;
|
|
9382
|
-
readonly address: "0x043fb7e23350Dd5b77dE5E228B528763DEcb9131";
|
|
9383
|
-
readonly xChainId: "nibiru";
|
|
9384
9386
|
} | {
|
|
9385
9387
|
readonly symbol: "bnUSD";
|
|
9386
9388
|
readonly name: "bnUSD";
|
|
@@ -9393,6 +9395,12 @@ declare const bnUSDNewTokens: ({
|
|
|
9393
9395
|
readonly decimals: 18;
|
|
9394
9396
|
readonly address: "0x36134A03dcD03Bbe858B8F7ED28a71AAC608F9E7";
|
|
9395
9397
|
readonly xChainId: "lightlink";
|
|
9398
|
+
} | {
|
|
9399
|
+
readonly symbol: "bnUSD";
|
|
9400
|
+
readonly name: "bnUSD";
|
|
9401
|
+
readonly decimals: 18;
|
|
9402
|
+
readonly address: "0x1f22279C89B213944b7Ea41daCB0a868DdCDFd13";
|
|
9403
|
+
readonly xChainId: "ethereum";
|
|
9396
9404
|
} | {
|
|
9397
9405
|
readonly symbol: "bnUSD";
|
|
9398
9406
|
readonly name: "bnUSD";
|