@scallop-io/sui-scallop-sdk 1.5.3 → 2.0.0-alpha.2

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.
Files changed (60) hide show
  1. package/dist/index.d.mts +451 -602
  2. package/dist/index.d.ts +451 -602
  3. package/dist/index.js +29 -60
  4. package/dist/index.mjs +6 -6
  5. package/package.json +1 -1
  6. package/src/builders/loyaltyProgramBuilder.ts +5 -3
  7. package/src/builders/oracle.ts +10 -24
  8. package/src/builders/referralBuilder.ts +5 -9
  9. package/src/builders/sCoinBuilder.ts +9 -8
  10. package/src/builders/spoolBuilder.ts +4 -6
  11. package/src/constants/common.ts +114 -126
  12. package/src/constants/index.ts +0 -5
  13. package/src/constants/pyth.ts +25 -34
  14. package/src/constants/queryKeys.ts +2 -0
  15. package/src/models/index.ts +1 -0
  16. package/src/models/scallop.ts +23 -19
  17. package/src/models/scallopAddress.ts +7 -4
  18. package/src/models/scallopBuilder.ts +36 -41
  19. package/src/models/scallopCache.ts +1 -1
  20. package/src/models/scallopClient.ts +93 -94
  21. package/src/models/scallopConstants.ts +342 -0
  22. package/src/models/scallopIndexer.ts +11 -24
  23. package/src/models/scallopQuery.ts +70 -77
  24. package/src/models/scallopUtils.ts +122 -249
  25. package/src/queries/borrowIncentiveQuery.ts +21 -56
  26. package/src/queries/borrowLimitQuery.ts +3 -6
  27. package/src/queries/coreQuery.ts +94 -112
  28. package/src/queries/flashloanFeeQuery.ts +86 -0
  29. package/src/queries/isolatedAssetQuery.ts +12 -11
  30. package/src/queries/poolAddressesQuery.ts +187 -112
  31. package/src/queries/portfolioQuery.ts +65 -67
  32. package/src/queries/priceQuery.ts +16 -22
  33. package/src/queries/sCoinQuery.ts +15 -16
  34. package/src/queries/spoolQuery.ts +49 -59
  35. package/src/queries/supplyLimitQuery.ts +2 -6
  36. package/src/queries/xOracleQuery.ts +4 -15
  37. package/src/types/address.ts +12 -18
  38. package/src/types/builder/borrowIncentive.ts +2 -3
  39. package/src/types/builder/core.ts +20 -27
  40. package/src/types/builder/index.ts +1 -2
  41. package/src/types/builder/referral.ts +4 -8
  42. package/src/types/builder/sCoin.ts +4 -8
  43. package/src/types/builder/spool.ts +7 -10
  44. package/src/types/constant/common.ts +43 -49
  45. package/src/types/constant/enum.ts +15 -27
  46. package/src/types/constant/xOracle.ts +3 -5
  47. package/src/types/model.ts +49 -28
  48. package/src/types/query/borrowIncentive.ts +7 -24
  49. package/src/types/query/core.ts +8 -18
  50. package/src/types/query/portfolio.ts +8 -17
  51. package/src/types/query/spool.ts +5 -11
  52. package/src/types/utils.ts +1 -21
  53. package/src/utils/core.ts +1 -1
  54. package/src/utils/query.ts +13 -20
  55. package/src/utils/util.ts +6 -84
  56. package/src/constants/coinGecko.ts +0 -34
  57. package/src/constants/enum.ts +0 -268
  58. package/src/constants/flashloan.ts +0 -18
  59. package/src/constants/poolAddress.ts +0 -898
  60. package/src/models/scallopPrice.ts +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "1.5.3",
3
+ "version": "2.0.0-alpha.2",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -1,6 +1,5 @@
1
1
  import { Transaction } from '@mysten/sui/transactions';
2
2
  import { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
3
- import { coinIds } from 'src/constants';
4
3
  import { ScallopBuilder } from 'src/models';
5
4
  import {
6
5
  GenerateLoyaltyProgramNormalMethod,
@@ -44,13 +43,16 @@ const generateLoyaltyProgramQuickMethod: GenerateLoyaltyProgramQuickMethod = ({
44
43
  if (!veScaKey) throw new Error(`No veScaKey found for user ${sender}`);
45
44
 
46
45
  // claim the pending reward
47
- const rewardCoin = await txBlock.claimLoyaltyRevenue(veScaKey);
46
+ const rewardCoin = txBlock.claimLoyaltyRevenue(veScaKey);
48
47
 
49
48
  // get existing sca coin to merge with
49
+ const scaCoinType = builder.constants.coinTypes.sca;
50
+ if (!scaCoinType) throw new Error('Coin type sca not found');
51
+
50
52
  await builder.utils.mergeSimilarCoins(
51
53
  txBlock,
52
54
  rewardCoin,
53
- coinIds.sca,
55
+ scaCoinType,
54
56
  requireSender(txBlock)
55
57
  );
56
58
  txBlock.transferObjects([rewardCoin], sender);
@@ -3,17 +3,10 @@ import {
3
3
  SuiPythClient,
4
4
  SuiPriceServiceConnection,
5
5
  } from '@pythnetwork/pyth-sui-js';
6
- import { SUPPORT_COLLATERALS, SUPPORT_POOLS } from '../constants';
7
6
  import type { TransactionArgument } from '@mysten/sui/transactions';
8
7
  import type { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
9
8
  import type { ScallopBuilder } from '../models';
10
- import type {
11
- SupportAssetCoins,
12
- SupportOracleType,
13
- xOracleRules,
14
- xOracleRuleType,
15
- } from '../types';
16
- import { PYTH_ENDPOINTS } from 'src/constants/pyth';
9
+ import type { xOracleRules, xOracleRuleType } from '../types';
17
10
  import { xOracleList as X_ORACLE_LIST } from 'src/constants';
18
11
 
19
12
  /**
@@ -27,9 +20,7 @@ import { xOracleList as X_ORACLE_LIST } from 'src/constants';
27
20
  export const updateOracles = async (
28
21
  builder: ScallopBuilder,
29
22
  txBlock: SuiKitTxBlock,
30
- assetCoinNames: SupportAssetCoins[] = [
31
- ...new Set([...SUPPORT_POOLS, ...SUPPORT_COLLATERALS]),
32
- ],
23
+ assetCoinNames: string[] = [...builder.constants.whitelist.lending],
33
24
  options: {
34
25
  usePythPullModel: boolean;
35
26
  useOnChainXOracleList: boolean;
@@ -45,7 +36,7 @@ export const updateOracles = async (
45
36
  : X_ORACLE_LIST;
46
37
 
47
38
  // const rules: SupportOracleType[] = builder.isTestnet ? ['pyth'] : ['pyth'];
48
- const flattenedRules: SupportOracleType[] = [
39
+ const flattenedRules = [
49
40
  ...new Set(
50
41
  Object.values(xOracleList).flatMap(({ primary, secondary }) => [
51
42
  ...primary,
@@ -65,9 +56,9 @@ export const updateOracles = async (
65
56
  );
66
57
 
67
58
  // iterate through the endpoints
68
- const endpoints =
69
- builder.params.pythEndpoints ??
70
- PYTH_ENDPOINTS[builder.isTestnet ? 'testnet' : 'mainnet'];
59
+ const endpoints = builder.params.pythEndpoints ?? [
60
+ ...builder.constants.whitelist.pythEndpoints,
61
+ ];
71
62
  for (const endpoint of endpoints) {
72
63
  try {
73
64
  const pythConnection = new SuiPriceServiceConnection(endpoint);
@@ -91,12 +82,7 @@ export const updateOracles = async (
91
82
  // Remove duplicate coin names.
92
83
  const updateAssetCoinNames = [...new Set(assetCoinNames)];
93
84
  for (const assetCoinName of updateAssetCoinNames) {
94
- await updateOracle(
95
- builder,
96
- txBlock,
97
- assetCoinName,
98
- xOracleList[assetCoinName]
99
- );
85
+ updateOracle(builder, txBlock, assetCoinName, xOracleList[assetCoinName]);
100
86
  }
101
87
  };
102
88
 
@@ -107,10 +93,10 @@ export const updateOracles = async (
107
93
  * @param txBlock - TxBlock created by SuiKit.
108
94
  * @param assetCoinName - Specific support asset coin name.
109
95
  */
110
- const updateOracle = async (
96
+ const updateOracle = (
111
97
  builder: ScallopBuilder,
112
98
  txBlock: SuiKitTxBlock,
113
- assetCoinName: SupportAssetCoins,
99
+ assetCoinName: string,
114
100
  rules: xOracleRules
115
101
  ) => {
116
102
  const coinType = builder.utils.parseCoinType(assetCoinName);
@@ -177,7 +163,7 @@ const updatePrice = (
177
163
  xOracleId,
178
164
  coinType
179
165
  );
180
- Object.entries(rules).forEach(([type, rule]: [any, SupportOracleType[]]) => {
166
+ Object.entries(rules).forEach(([type, rule]: [any, string[]]) => {
181
167
  if (rule.includes('pyth')) {
182
168
  updatePythPrice(
183
169
  type,
@@ -1,5 +1,5 @@
1
1
  import { ScallopBuilder } from 'src/models';
2
- import { ScallopTxBlock, SupportCoins, SupportPoolCoins } from 'src/types';
2
+ import { ScallopTxBlock } from 'src/types';
3
3
  import {
4
4
  SUI_CLOCK_OBJECT_ID,
5
5
  SuiTxBlock as SuiKitTxBlock,
@@ -13,7 +13,6 @@ import {
13
13
  ReferralTxBlock,
14
14
  SuiTxBlockWithReferralNormalMethods,
15
15
  } from 'src/types/builder/referral';
16
- import { SUPPORT_POOLS } from 'src/constants';
17
16
  import { requireSender } from 'src/utils';
18
17
 
19
18
  const generateReferralNormalMethod: GenerateReferralNormalMethod = ({
@@ -52,7 +51,7 @@ const generateReferralNormalMethod: GenerateReferralNormalMethod = ({
52
51
  []
53
52
  );
54
53
  },
55
- claimReferralTicket: (poolCoinName: SupportCoins) => {
54
+ claimReferralTicket: (poolCoinName: string) => {
56
55
  const coinType = builder.utils.parseCoinType(poolCoinName);
57
56
  return builder.moveCall(
58
57
  txBlock,
@@ -68,7 +67,7 @@ const generateReferralNormalMethod: GenerateReferralNormalMethod = ({
68
67
  [coinType]
69
68
  );
70
69
  },
71
- burnReferralTicket: (ticket: SuiObjectArg, poolCoinName: SupportCoins) => {
70
+ burnReferralTicket: (ticket: SuiObjectArg, poolCoinName: string) => {
72
71
  const coinType = builder.utils.parseCoinType(poolCoinName);
73
72
  builder.moveCall(
74
73
  txBlock,
@@ -82,10 +81,7 @@ const generateReferralNormalMethod: GenerateReferralNormalMethod = ({
82
81
  [coinType]
83
82
  );
84
83
  },
85
- claimReferralRevenue: (
86
- veScaKey: SuiObjectArg,
87
- poolCoinName: SupportCoins
88
- ) => {
84
+ claimReferralRevenue: (veScaKey: SuiObjectArg, poolCoinName: string) => {
89
85
  const coinType = builder.utils.parseCoinType(poolCoinName);
90
86
  return builder.moveCall(
91
87
  txBlock,
@@ -109,7 +105,7 @@ const generateReferralQuickMethod: GenerateReferralQuickMethod = ({
109
105
  return {
110
106
  claimReferralRevenueQuick: async (
111
107
  veScaKey: SuiObjectArg,
112
- coinNames: SupportPoolCoins[] = [...SUPPORT_POOLS]
108
+ coinNames: string[] = [...builder.constants.whitelist.lending]
113
109
  ) => {
114
110
  const sender = requireSender(txBlock);
115
111
  const objToTransfer: SuiObjectArg[] = [];
@@ -21,25 +21,26 @@ const generateSCoinNormalMethod: GenerateSCoinNormalMethod = ({
21
21
 
22
22
  return {
23
23
  mintSCoin: (marketCoinName, marketCoin) => {
24
+ const sCoinType = builder.utils.parseSCoinType(marketCoinName);
25
+ if (!sCoinType)
26
+ throw new Error(`Invalid marketCoinName name: ${marketCoinName}`);
27
+
24
28
  return builder.moveCall(
25
29
  txBlock,
26
30
  `${sCoinPkgIds.pkgId}::s_coin_converter::mint_s_coin`,
27
31
  [builder.utils.getSCoinTreasury(marketCoinName), marketCoin],
28
- [
29
- builder.utils.parseSCoinType(marketCoinName),
30
- builder.utils.parseUnderlyingSCoinType(marketCoinName),
31
- ]
32
+ [sCoinType, builder.utils.parseUnderlyingSCoinType(marketCoinName)]
32
33
  );
33
34
  },
34
35
  burnSCoin: (sCoinName, sCoin) => {
36
+ const sCoinType = builder.utils.parseSCoinType(sCoinName);
37
+ if (!sCoinType) throw new Error(`Invalid sCoin name: ${sCoinName}`);
38
+
35
39
  return builder.moveCall(
36
40
  txBlock,
37
41
  `${sCoinPkgIds.pkgId}::s_coin_converter::burn_s_coin`,
38
42
  [builder.utils.getSCoinTreasury(sCoinName), sCoin],
39
- [
40
- builder.utils.parseSCoinType(sCoinName),
41
- builder.utils.parseUnderlyingSCoinType(sCoinName),
42
- ]
43
+ [sCoinType, builder.utils.parseUnderlyingSCoinType(sCoinName)]
43
44
  );
44
45
  },
45
46
  };
@@ -1,7 +1,6 @@
1
1
  import { Transaction } from '@mysten/sui/transactions';
2
2
  import { SUI_CLOCK_OBJECT_ID } from '@mysten/sui/utils';
3
3
  import { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
4
- import { spoolRewardCoins } from '../constants/enum';
5
4
  import { getStakeAccounts } from '../queries/spoolQuery';
6
5
  import { requireSender } from '../utils';
7
6
  import type { SuiAddressArg } from '@scallop-io/sui-kit';
@@ -13,7 +12,6 @@ import type {
13
12
  GenerateSpoolQuickMethod,
14
13
  SuiTxBlockWithSpoolNormalMethods,
15
14
  SpoolTxBlock,
16
- SupportStakeMarketCoins,
17
15
  ScallopTxBlock,
18
16
  SuiTxBlockWithSCoin,
19
17
  } from '../types';
@@ -35,7 +33,7 @@ const requireStakeAccountIds = async (
35
33
  ...params: [
36
34
  builder: ScallopBuilder,
37
35
  txBlock: SuiKitTxBlock,
38
- stakeMarketCoinName: SupportStakeMarketCoins,
36
+ stakeMarketCoinName: string,
39
37
  stakeAccountId?: SuiAddressArg,
40
38
  ]
41
39
  ) => {
@@ -66,7 +64,7 @@ const requireStakeAccounts = async (
66
64
  ...params: [
67
65
  builder: ScallopBuilder,
68
66
  txBlock: SuiKitTxBlock,
69
- stakeMarketCoinName: SupportStakeMarketCoins,
67
+ stakeMarketCoinName: string,
70
68
  stakeAccountId?: SuiAddressArg,
71
69
  ]
72
70
  ) => {
@@ -90,7 +88,7 @@ const stakeHelper = async (
90
88
  builder: ScallopBuilder,
91
89
  txBlock: SuiTxBlockWithSpoolNormalMethods,
92
90
  stakeAccount: SuiAddressArg,
93
- coinName: SupportStakeMarketCoins,
91
+ coinName: string,
94
92
  amount: number,
95
93
  sender: string,
96
94
  isSCoin: boolean = false
@@ -181,7 +179,7 @@ const generateSpoolNormalMethod: GenerateSpoolNormalMethod = ({
181
179
  ) as string;
182
180
  const marketCoinType =
183
181
  builder.utils.parseMarketCoinType(stakeMarketCoinName);
184
- const rewardCoinName = spoolRewardCoins[stakeMarketCoinName];
182
+ const rewardCoinName = builder.utils.getSpoolRewardCoinName();
185
183
  const rewardCoinType = builder.utils.parseCoinType(rewardCoinName);
186
184
  return builder.moveCall(
187
185
  txBlock,
@@ -4,24 +4,12 @@ export const SDK_API_BASE_URL = 'https://sdk.api.scallop.io' as const;
4
4
  export const IS_VE_SCA_TEST: boolean = false;
5
5
  export const USE_TEST_ADDRESS: boolean = false;
6
6
 
7
- export const ADDRESS_ID =
8
- IS_VE_SCA_TEST || USE_TEST_ADDRESS
9
- ? ('65fb07c39c845425d71d7b18' as const)
10
- : ('67c44a103fe1b8c454eb9699' as const);
7
+ // export const ADDRESS_ID =
8
+ // IS_VE_SCA_TEST || USE_TEST_ADDRESS
9
+ // ? ('65fb07c39c845425d71d7b18' as const)
10
+ // : ('67c44a103fe1b8c454eb9699' as const);
11
11
  // : ('66f8e7ed9bb9e07fdfb86bbb' as const);
12
12
 
13
- export const PROTOCOL_OBJECT_ID = IS_VE_SCA_TEST
14
- ? ('0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778' as const)
15
- : ('0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf' as const);
16
- // export const PROTOCOL_OBJECT_ID =
17
- // '0x87ddec2984645dbbe2403a509cc6edf393a43acdba9b77d45da2bcbefcf733c1' as const;
18
-
19
- export const BORROW_FEE_PROTOCOL_ID = IS_VE_SCA_TEST
20
- ? ('0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778' as const) // test environment
21
- : ('0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da' as const);
22
- // export const BORROW_FEE_PROTOCOL_ID =
23
- // '0x87ddec2984645dbbe2403a509cc6edf393a43acdba9b77d45da2bcbefcf733c1' as const;
24
-
25
13
  export const SCA_COIN_TYPE = IS_VE_SCA_TEST
26
14
  ? (`0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA` as const)
27
15
  : ('0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA' as const);
@@ -29,121 +17,121 @@ export const SCA_COIN_TYPE = IS_VE_SCA_TEST
29
17
  export const OLD_BORROW_INCENTIVE_PROTOCOL_ID =
30
18
  '0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410' as const;
31
19
 
32
- export const SUPPORT_POOLS = [
33
- 'usdc', // native USDC
34
- 'sbeth', // sui bridge ETH
35
- 'sbusdt', // sui bridge USDT
36
- 'sbwbtc', // sui bridge WBTC
37
- 'weth',
38
- 'wbtc',
39
- 'wusdc',
40
- 'wusdt',
41
- 'sui',
42
- 'wapt',
43
- 'wsol',
44
- 'cetus',
45
- 'afsui',
46
- 'hasui',
47
- 'vsui',
48
- 'sca',
49
- 'fud',
50
- 'deep',
51
- 'fdusd',
52
- 'blub',
53
- 'musd',
54
- 'ns',
55
- 'usdy',
56
- ] as const;
20
+ // export const SUPPORT_POOLS = [
21
+ // 'usdc', // native USDC
22
+ // 'sbeth', // sui bridge ETH
23
+ // 'sbusdt', // sui bridge USDT
24
+ // 'sbwbtc', // sui bridge WBTC
25
+ // 'weth',
26
+ // 'wbtc',
27
+ // 'wusdc',
28
+ // 'wusdt',
29
+ // 'sui',
30
+ // 'wapt',
31
+ // 'wsol',
32
+ // 'cetus',
33
+ // 'afsui',
34
+ // 'hasui',
35
+ // 'vsui',
36
+ // 'sca',
37
+ // 'fud',
38
+ // 'deep',
39
+ // 'fdusd',
40
+ // 'blub',
41
+ // 'musd',
42
+ // 'ns',
43
+ // 'usdy',
44
+ // ] as const;
57
45
 
58
- export const SUPPORT_COLLATERALS = [
59
- 'usdc', // native USDC
60
- 'sbeth', // sui bridge ETH
61
- 'sbusdt', // sui bridge USDT
62
- 'sbwbtc', // sui bridge WBTC
63
- 'weth',
64
- 'wbtc',
65
- 'wusdc',
66
- 'wusdt',
67
- 'sui',
68
- 'wapt',
69
- 'wsol',
70
- 'cetus',
71
- 'afsui',
72
- 'hasui',
73
- 'vsui',
74
- 'sca',
75
- 'fdusd',
76
- 'usdy',
77
- ] as const;
46
+ // export const SUPPORT_COLLATERALS = [
47
+ // 'usdc', // native USDC
48
+ // 'sbeth', // sui bridge ETH
49
+ // 'sbusdt', // sui bridge USDT
50
+ // 'sbwbtc', // sui bridge WBTC
51
+ // 'weth',
52
+ // 'wbtc',
53
+ // 'wusdc',
54
+ // 'wusdt',
55
+ // 'sui',
56
+ // 'wapt',
57
+ // 'wsol',
58
+ // 'cetus',
59
+ // 'afsui',
60
+ // 'hasui',
61
+ // 'vsui',
62
+ // 'sca',
63
+ // 'fdusd',
64
+ // 'usdy',
65
+ // ] as const;
78
66
 
79
- export const SUPPORT_SPOOLS = [
80
- 'susdc',
81
- 'sweth',
82
- 'ssui',
83
- 'swusdc',
84
- 'swusdt',
85
- 'scetus',
86
- 'safsui',
87
- 'shasui',
88
- 'svsui',
89
- ] as const;
67
+ // export const SUPPORT_SPOOLS = [
68
+ // 'susdc',
69
+ // 'sweth',
70
+ // 'ssui',
71
+ // 'swusdc',
72
+ // 'swusdt',
73
+ // 'scetus',
74
+ // 'safsui',
75
+ // 'shasui',
76
+ // 'svsui',
77
+ // ] as const;
90
78
 
91
- export const SUPPORT_SCOIN = [
92
- 'susdc',
93
- 'ssbeth',
94
- 'ssbusdt',
95
- 'ssbwbtc',
96
- 'ssui',
97
- 'swusdc',
98
- 'swusdt',
99
- 'safsui',
100
- 'shasui',
101
- 'svsui',
102
- 'sweth',
103
- 'ssca',
104
- 'scetus',
105
- 'swsol',
106
- 'swbtc',
107
- 'sdeep',
108
- 'sfud',
109
- 'sfdusd',
110
- 'sblub',
111
- 'smusd',
112
- 'sns',
113
- 'susdy',
114
- ] as const;
79
+ // export const SUPPORT_SCOIN = [
80
+ // 'susdc',
81
+ // 'ssbeth',
82
+ // 'ssbusdt',
83
+ // 'ssbwbtc',
84
+ // 'ssui',
85
+ // 'swusdc',
86
+ // 'swusdt',
87
+ // 'safsui',
88
+ // 'shasui',
89
+ // 'svsui',
90
+ // 'sweth',
91
+ // 'ssca',
92
+ // 'scetus',
93
+ // 'swsol',
94
+ // 'swbtc',
95
+ // 'sdeep',
96
+ // 'sfud',
97
+ // 'sfdusd',
98
+ // 'sblub',
99
+ // 'smusd',
100
+ // 'sns',
101
+ // 'susdy',
102
+ // ] as const;
115
103
 
116
- export const SUPPORT_SUI_BRIDGE = ['sbeth', 'sbusdt', 'sbwbtc'] as const;
117
- export const SUPPORT_WORMHOLE = [
118
- 'wusdc',
119
- 'wusdt',
120
- 'weth',
121
- 'wbtc',
122
- 'wapt',
123
- 'wsol',
124
- ] as const;
104
+ // export const SUPPORT_SUI_BRIDGE = ['sbeth', 'sbusdt', 'sbwbtc'] as const;
105
+ // export const SUPPORT_WORMHOLE = [
106
+ // 'wusdc',
107
+ // 'wusdt',
108
+ // 'weth',
109
+ // 'wbtc',
110
+ // 'wapt',
111
+ // 'wsol',
112
+ // ] as const;
125
113
 
126
- export const SUPPORT_SPOOLS_REWARDS = ['sui'] as const;
114
+ // export const SUPPORT_SPOOLS_REWARDS = ['sui'] as const;
127
115
 
128
- export const SUPPORT_BORROW_INCENTIVE_POOLS = [...SUPPORT_POOLS] as const;
116
+ // export const SUPPORT_BORROW_INCENTIVE_POOLS = [...SUPPORT_POOLS] as const;
129
117
 
130
- export const SUPPORT_BORROW_INCENTIVE_REWARDS = [
131
- ...SUPPORT_POOLS,
132
- ...SUPPORT_SCOIN,
133
- ] as const;
134
- export const SUPPORT_ORACLES = ['supra', 'switchboard', 'pyth'] as const;
118
+ // export const SUPPORT_BORROW_INCENTIVE_REWARDS = [
119
+ // ...SUPPORT_POOLS,
120
+ // ...SUPPORT_SCOIN,
121
+ // ] as const;
122
+ // export const SUPPORT_ORACLES = ['supra', 'switchboard', 'pyth'] as const;
135
123
 
136
- export const SUPPORT_PACKAGES = [
137
- 'coinDecimalsRegistry',
138
- 'math',
139
- 'whitelist',
140
- 'x',
141
- 'protocol',
142
- 'protocolWhitelist',
143
- 'query',
144
- 'supra',
145
- 'pyth',
146
- 'switchboard',
147
- 'xOracle',
148
- 'testCoin',
149
- ] as const;
124
+ // export const SUPPORT_PACKAGES = [
125
+ // 'coinDecimalsRegistry',
126
+ // 'math',
127
+ // 'whitelist',
128
+ // 'x',
129
+ // 'protocol',
130
+ // 'protocolWhitelist',
131
+ // 'query',
132
+ // 'supra',
133
+ // 'pyth',
134
+ // 'switchboard',
135
+ // 'xOracle',
136
+ // 'testCoin',
137
+ // ] as const;
@@ -1,10 +1,5 @@
1
1
  export * from './cache';
2
- export * from './coinGecko';
3
2
  export * from './common';
4
- export * from './enum';
5
- export * from './flashloan';
6
- export * from './poolAddress';
7
- export * from './pyth';
8
3
  export * from './queryKeys';
9
4
  export * from './rpc';
10
5
  export * from './testAddress';
@@ -1,34 +1,25 @@
1
- import { SupportPoolCoins } from 'src/types';
2
-
3
- export const PYTH_ENDPOINTS: {
4
- [k in 'mainnet' | 'testnet']: string[];
5
- } = {
6
- testnet: ['https://hermes-beta.pyth.network'],
7
- mainnet: ['https://hermes.pyth.network', 'https://scallop.rpc.p2p.world'],
8
- };
9
-
10
- export const PYTH_FEED_IDS: Record<SupportPoolCoins, string> = {
11
- usdc: 'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
12
- sbeth: 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
13
- sbusdt: '2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b',
14
- sbwbtc: 'e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
15
- weth: 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
16
- wbtc: 'e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
17
- wusdc: 'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
18
- wusdt: '2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b',
19
- sui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
20
- wapt: '03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5',
21
- wsol: 'ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
22
- cetus: 'e5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef',
23
- afsui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
24
- hasui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
25
- vsui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
26
- sca: '7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc',
27
- fdusd: 'ccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979',
28
- deep: '29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',
29
- fud: '6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75',
30
- blub: '5fc11ffe4975b624be495be038da30e30bee2004d8ae6282b5364577ef4ca92c',
31
- musd: '2ee09cdb656959379b9262f89de5ff3d4dfed0dd34c072b3e22518496a65249c',
32
- ns: 'bb5ff26e47a3a6cc7ec2fce1db996c2a145300edc5acaabe43bf9ff7c5dd5d32',
33
- usdy: 'e3d1723999820435ebab53003a542ff26847720692af92523eea613a9a28d500',
34
- };
1
+ // export const PYTH_FEED_IDS: Record<string, string> = {
2
+ // usdc: 'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
3
+ // sbeth: 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
4
+ // sbusdt: '2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b',
5
+ // sbwbtc: 'e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
6
+ // weth: 'ff61491a931112ddf1bd8147cd1b641375f79f5825126d665480874634fd0ace',
7
+ // wbtc: 'e62df6c8b4a85fe1a67db44dc12de5db330f7ac66b72dc658afedf0f4a415b43',
8
+ // wusdc: 'eaa020c61cc479712813461ce153894a96a6c00b21ed0cfc2798d1f9a9e9c94a',
9
+ // wusdt: '2b89b9dc8fdf9f34709a5b106b472f0f39bb6ca9ce04b0fd7f2e971688e2e53b',
10
+ // sui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
11
+ // wapt: '03ae4db29ed4ae33d323568895aa00337e658e348b37509f5372ae51f0af00d5',
12
+ // wsol: 'ef0d8b6fda2ceba41da15d4095d1da392a0d2f8ed0c6c7bc0f4cfac8c280b56d',
13
+ // cetus: 'e5b274b2611143df055d6e7cd8d93fe1961716bcd4dca1cad87a83bc1e78c1ef',
14
+ // afsui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
15
+ // hasui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
16
+ // vsui: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
17
+ // sca: '7e17f0ac105abe9214deb9944c30264f5986bf292869c6bd8e8da3ccd92d79bc',
18
+ // fdusd: 'ccdc1a08923e2e4f4b1e6ea89de6acbc5fe1948e9706f5604b8cb50bc1ed3979',
19
+ // deep: '29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',
20
+ // fud: '6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75',
21
+ // blub: '5fc11ffe4975b624be495be038da30e30bee2004d8ae6282b5364577ef4ca92c',
22
+ // musd: '2ee09cdb656959379b9262f89de5ff3d4dfed0dd34c072b3e22518496a65249c',
23
+ // ns: 'bb5ff26e47a3a6cc7ec2fce1db996c2a145300edc5acaabe43bf9ff7c5dd5d32',
24
+ // usdy: 'e3d1723999820435ebab53003a542ff26847720692af92523eea613a9a28d500',
25
+ // };
@@ -14,6 +14,8 @@ export const queryKeys = {
14
14
  'getAddresses',
15
15
  { addressId },
16
16
  ],
17
+ getWhiteList: () => ['api', 'getWhiteList'],
18
+ getPoolAddresses: () => ['api', 'getPoolAddresses'],
17
19
  getMarket: () => ['api', 'getMarket'],
18
20
  getSpools: () => ['api', 'getSpools'],
19
21
  getBorrowIncentivePool: () => ['api', 'getBorrowIncentivePools'],
@@ -6,3 +6,4 @@ export * from './scallopQuery';
6
6
  export * from './scallopUtils';
7
7
  export * from './scallopIndexer';
8
8
  export * from './scallopCache';
9
+ export * from './scallopConstants';