@scallop-io/sui-scallop-sdk 2.3.0-lst-x-oracle-alpha.8 → 2.3.0

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 (73) hide show
  1. package/dist/index.d.mts +1811 -1750
  2. package/dist/index.d.ts +1811 -1750
  3. package/dist/index.js +49 -2
  4. package/dist/index.mjs +15 -2
  5. package/package.json +8 -5
  6. package/src/builders/borrowIncentiveBuilder.ts +4 -4
  7. package/src/builders/coreBuilder.ts +86 -59
  8. package/src/builders/index.ts +2 -2
  9. package/src/builders/loyaltyProgramBuilder.ts +2 -2
  10. package/src/builders/oracles/index.ts +365 -114
  11. package/src/builders/oracles/pyth.ts +135 -0
  12. package/src/builders/referralBuilder.ts +4 -10
  13. package/src/builders/sCoinBuilder.ts +2 -6
  14. package/src/builders/spoolBuilder.ts +2 -2
  15. package/src/builders/vescaBuilder.ts +5 -5
  16. package/src/constants/common.ts +3 -0
  17. package/src/constants/index.ts +1 -1
  18. package/src/constants/queryKeys.ts +1 -1
  19. package/src/constants/testAddress.ts +95 -183
  20. package/src/constants/xoracle.ts +2 -8
  21. package/src/index.ts +1 -1
  22. package/src/models/index.ts +1 -2
  23. package/src/models/interface.ts +6 -6
  24. package/src/models/rateLimiter.ts +55 -0
  25. package/src/models/scallop.ts +1 -1
  26. package/src/models/scallopAddress.ts +5 -25
  27. package/src/models/scallopBuilder.ts +14 -11
  28. package/src/models/scallopClient.ts +31 -14
  29. package/src/models/scallopConstants.ts +3 -3
  30. package/src/models/scallopIndexer.ts +3 -4
  31. package/src/models/scallopQuery.ts +112 -56
  32. package/src/models/scallopQueryClient.ts +1 -1
  33. package/src/models/scallopSuiKit.ts +1 -1
  34. package/src/models/scallopUtils.ts +12 -7
  35. package/src/queries/borrowIncentiveQuery.ts +4 -3
  36. package/src/queries/coreQuery.ts +114 -186
  37. package/src/queries/index.ts +3 -4
  38. package/src/queries/loyaltyProgramQuery.ts +2 -2
  39. package/src/queries/ownerQuery.ts +32 -0
  40. package/src/queries/poolAddressesQuery.ts +1 -3
  41. package/src/queries/portfolioQuery.ts +68 -16
  42. package/src/queries/priceQuery.ts +2 -3
  43. package/src/queries/sCoinQuery.ts +2 -2
  44. package/src/queries/spoolQuery.ts +57 -74
  45. package/src/queries/vescaQuery.ts +3 -3
  46. package/src/queries/xOracleQuery.ts +4 -21
  47. package/src/types/address.ts +47 -85
  48. package/src/types/builder/core.ts +40 -15
  49. package/src/types/builder/index.ts +17 -1
  50. package/src/types/constant/enum.ts +64 -0
  51. package/src/types/constant/index.ts +1 -2
  52. package/src/types/constant/xOracle.ts +7 -10
  53. package/src/types/index.ts +1 -1
  54. package/src/types/query/core.ts +3 -0
  55. package/src/types/query/index.ts +1 -0
  56. package/src/types/query/sCoin.ts +1 -0
  57. package/src/{builders/utils.ts → utils/builder.ts} +1 -1
  58. package/src/utils/core.ts +18 -0
  59. package/src/utils/index.ts +5 -0
  60. package/src/utils/indexer.ts +47 -0
  61. package/src/{queries/utils.ts → utils/query.ts} +7 -25
  62. package/src/utils/util.ts +42 -0
  63. package/src/builders/oracles/error.ts +0 -29
  64. package/src/builders/oracles/oraclePackageRegistry.ts +0 -322
  65. package/src/builders/oracles/priceFeedUpdater.ts +0 -112
  66. package/src/builders/oracles/priceUpdateRequester.ts +0 -50
  67. package/src/builders/oracles/xOracleUpdateStrategy.ts +0 -178
  68. package/src/builders/oracles/xOracleUpdater.ts +0 -160
  69. package/src/constants/api.ts +0 -2
  70. package/src/models/utils.ts +0 -97
  71. package/src/types/builder/type.ts +0 -25
  72. package/src/types/constant/package.ts +0 -16
  73. /package/src/types/{util.ts → utils.ts} +0 -0
@@ -8,8 +8,8 @@ import {
8
8
  ScallopTxBlock,
9
9
  SuiTxBlockWithSCoinNormalMethods,
10
10
  sCoinPkgIds,
11
- } from 'src/types/builder';
12
- import { requireSender } from './utils';
11
+ } from 'src/types';
12
+ import { requireSender } from 'src/utils';
13
13
 
14
14
  const generateSCoinNormalMethod: GenerateSCoinNormalMethod = ({
15
15
  builder,
@@ -36,10 +36,6 @@ const generateSCoinNormalMethod: GenerateSCoinNormalMethod = ({
36
36
  const sCoinType = builder.utils.parseSCoinType(sCoinName);
37
37
  if (!sCoinType) throw new Error(`Invalid sCoin name: ${sCoinName}`);
38
38
 
39
- console.log({
40
- sCoinName,
41
- treasury: builder.utils.getSCoinTreasury(sCoinName),
42
- });
43
39
  return builder.moveCall(
44
40
  txBlock,
45
41
  `${sCoinPkgIds.pkgId}::s_coin_converter::burn_s_coin`,
@@ -2,7 +2,7 @@ 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
4
  import { getStakeAccounts } from '../queries/spoolQuery';
5
- import { requireSender } from './utils';
5
+ import { requireSender } from '../utils';
6
6
  import type { SuiAddressArg } from '@scallop-io/sui-kit';
7
7
  import type { TransactionResult } from '@mysten/sui/transactions';
8
8
  import type { ScallopBuilder } from 'src/models';
@@ -14,7 +14,7 @@ import type {
14
14
  SpoolTxBlock,
15
15
  ScallopTxBlock,
16
16
  SuiTxBlockWithSCoin,
17
- } from 'src/types/builder';
17
+ } from 'src/types';
18
18
 
19
19
  /**
20
20
  * Check and get stake account id from transaction block.
@@ -4,9 +4,9 @@ import {
4
4
  Transaction,
5
5
  SuiTxBlock as SuiKitTxBlock,
6
6
  } from '@scallop-io/sui-kit';
7
- import { SCA_COIN_TYPE } from 'src/constants/common';
7
+ import { SCA_COIN_TYPE } from 'src/constants';
8
8
  import { ScallopBuilder } from 'src/models';
9
- import { getVeSca, getVeScas } from 'src/queries/vescaQuery';
9
+ import { getVeSca, getVeScas } from 'src/queries';
10
10
  import {
11
11
  requireSender,
12
12
  checkLockSca,
@@ -14,21 +14,21 @@ import {
14
14
  checkExtendLockAmount,
15
15
  checkRenewExpiredVeSca,
16
16
  checkVesca,
17
- } from './utils';
17
+ } from 'src/utils';
18
18
  import type {
19
19
  TransactionObjectArgument,
20
20
  SuiObjectArg,
21
21
  } from '@scallop-io/sui-kit';
22
22
  import type {
23
+ AddressesInterface,
23
24
  GenerateVeScaNormalMethod,
24
25
  GenerateVeScaQuickMethod,
25
26
  QuickMethodReturnType,
26
27
  ScallopTxBlock,
27
28
  SuiTxBlockWithVeScaNormalMethods,
28
29
  VeScaTxBlock,
29
- } from 'src/types/builder';
30
+ } from 'src/types';
30
31
  import { SuiObjectData } from '@mysten/sui/client';
31
- import { AddressesInterface } from 'src/types/address';
32
32
 
33
33
  /**
34
34
  * Check and get veSCA data from transaction block.
@@ -1,3 +1,6 @@
1
+ export const API_BASE_URL = 'https://sui.apis.scallop.io' as const;
2
+ export const SDK_API_BASE_URL = 'https://sdk.api.scallop.io' as const;
3
+
1
4
  export const IS_VE_SCA_TEST: boolean = false;
2
5
  export const USE_TEST_ADDRESS: boolean = false;
3
6
 
@@ -1,8 +1,8 @@
1
- export * from './api';
2
1
  export * from './cache';
3
2
  export * from './common';
4
3
  export * from './queryKeys';
5
4
  export * from './rpc';
6
5
  export * from './testAddress';
7
6
  export * from './vesca';
7
+ export * from './testAddress';
8
8
  export * from './xoracle';
@@ -11,7 +11,7 @@ export const queryKeys = {
11
11
  getPoolAddresses: () => ['api', 'getPoolAddresses'],
12
12
  getMarket: () => ['api', 'getMarket'],
13
13
  getSpools: () => ['api', 'getSpools'],
14
- getBorrowIncentivePool: () => ['api', 'getBorrowIncentivePools'],
14
+ getBorrowIncentivePools: () => ['api', 'getBorrowIncentivePools'],
15
15
  getTotalValueLocked: () => ['api', 'getTotalValueLocked'],
16
16
  },
17
17
 
@@ -1,4 +1,4 @@
1
- import { AddressesInterface } from 'src/types/address';
1
+ import { AddressesInterface } from 'src/types';
2
2
 
3
3
  export const TEST_ADDRESSES: AddressesInterface = {
4
4
  core: {
@@ -48,7 +48,8 @@ export const TEST_ADDRESSES: AddressesInterface = {
48
48
  oracle: {
49
49
  supra: '',
50
50
  switchboard:
51
- '0xbca474133638352ba83ccf7b5c931d50f764b09550e16612c9f70f1e21f3f594',
51
+ // '0xbca474133638352ba83ccf7b5c931d50f764b09550e16612c9f70f1e21f3f594',
52
+ '0xaebdb50e0a95c5aa20c60bde5f574dac90aef83b508d64146cf29b5f63c35d4f ',
52
53
  pyth: {
53
54
  feed: '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
54
55
  feedObject:
@@ -56,31 +57,11 @@ export const TEST_ADDRESSES: AddressesInterface = {
56
57
  },
57
58
  },
58
59
  },
59
- afsui: {
60
- id: '0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc',
61
- metaData:
62
- '0x2f9217f533e51334873a39b8026a4aa6919497b47f49d0986a4f1aec66f8a34d',
63
- treasury: '',
64
- coinType:
65
- '0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI',
66
- symbol: 'afSUI',
67
- decimals: 9,
68
- oracle: {
69
- supra: '',
70
- switchboard: '',
71
- pyth: {
72
- feed: '17cd845b16e874485b2684f8b8d1517d744105dbb904eec30222717f4bc9ee0d',
73
- feedObject:
74
- '0xd779885c5246357e24cbde7348f2d81f756d9650975c02d81346b15d8b557ebf',
75
- },
76
- },
77
- },
78
60
  sca: {
79
61
  id: '0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6',
80
62
  metaData:
81
63
  '0x5d26a1e9a55c88147ac870bfa31b729d7f49f8804b8b3adfdf3582d301cca844',
82
- treasury:
83
- '0x54e81607d636c3520a697b803a99a167fce7ccdf1bad7d210e2941d264515351',
64
+ treasury: '',
84
65
  coinType:
85
66
  '0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA',
86
67
  symbol: 'SCA',
@@ -141,12 +122,16 @@ export const TEST_ADDRESSES: AddressesInterface = {
141
122
  '0x1edeae568fde99e090dbdec4bcdbd33a15f53a1ce1f87aeef1a560dedf4b4a90',
142
123
  primaryPriceUpdatePolicyObject:
143
124
  '0xbcd908d0ee6d63d726e61676f3feeec3d19817f4849bbecf372dd3399f247f6b',
125
+ // '0x56e48a141f20a3a6a6d3fc43e58b01fc63f756c08224870e7890c80ec9d2afee' // prod
144
126
  secondaryPriceUpdatePolicyObject:
145
127
  '0x624a6f120777bb30e718b86e836c205ef4229448052377dc3d78272a6662b2c0',
128
+ // '0xef4d9430ae42c1b24199ac55e87ddd7262622447ee3c7de8868efe839b3d8705' // prod
146
129
  primaryPriceUpdatePolicyVecsetId:
147
130
  '0xfb1330aa028ed6a159b742c71b5a79b3b6824cf71efa40ea82b52486ad209264',
131
+ // '0xc22c9d691ee4c780de09db91d8b487d863211ebf08720772144bcf716318826c', // prod
148
132
  secondaryPriceUpdatePolicyVecsetId:
149
133
  '0x4b827acc73f3f53f808dd73a7ee0a60ae61e84322176bece72b26467030b467c',
134
+ // '0x3b184ff859f5de30eeaf186898e5224925be6bb6d2baa74347ef471a8cd1c0d3' // prod
150
135
  supra: {
151
136
  registry: '',
152
137
  registryCap: '',
@@ -155,9 +140,10 @@ export const TEST_ADDRESSES: AddressesInterface = {
155
140
  switchboard: {
156
141
  registry:
157
142
  '0x9b1b415f384af6af0ff31c22decdc88b3b83d0188cf63ef9c58fd122bca77219',
158
- registryCap: '',
159
- registryTableId: '',
143
+ registryTableId:
144
+ '0x9f75c071b0db2e80da3f5c98686ffdedf3a633684290499501595277a5350b8c',
160
145
  state: '',
146
+ registryCap: '',
161
147
  },
162
148
  pyth: {
163
149
  registry:
@@ -170,16 +156,6 @@ export const TEST_ADDRESSES: AddressesInterface = {
170
156
  '0x5306f64e312b581766351c07af79c72fcb1cd25147157fdc2f8ad76de9a3fb6a',
171
157
  wormholeState:
172
158
  '0xaeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c',
173
- lst: {
174
- afsui: {
175
- safeId:
176
- '0xeb685899830dd5837b47007809c76d91a098d52aabbf61e8ac467c59e5cc4610',
177
- stakedSuiVaultId:
178
- '0x2f8f6d5da7f13ea37daa397724280483ed062769813b6f31e9788e59cc88994d',
179
- configId:
180
- '0x67103edaadcd38b76f5df76d99adcad989260a5f16bfd411a67efbf858b2f7a2',
181
- },
182
- },
183
159
  },
184
160
  },
185
161
  packages: {
@@ -218,26 +194,18 @@ export const TEST_ADDRESSES: AddressesInterface = {
218
194
  upgradeCap:
219
195
  '0x14220f035f4cfc2ce442c30703fb44d24f00846eb7077907a231a56051a1d9b2',
220
196
  },
221
- supra: {
222
- id: '',
223
- upgradeCap: '',
224
- },
197
+ supra: { id: '', object: '', upgradeCap: '' },
225
198
  pyth: {
226
199
  id: '0xe622909f9252d4ef1737c41ea430ef44203d8f5dc8e01e1b3950a31405bc54eb',
227
200
  object:
228
201
  '0xe622909f9252d4ef1737c41ea430ef44203d8f5dc8e01e1b3950a31405bc54eb',
229
202
  upgradeCap:
230
203
  '0xb1f167889643ff766df31745b6e93b92462d8165b0a4f1b095499e15180370f7',
231
- lst: {
232
- afsui: {
233
- id: '0xd45b20f4bbc7ab4b2b3874a4fa38aa440505d8010bba052df914892537e6b418',
234
- object:
235
- '0xd45b20f4bbc7ab4b2b3874a4fa38aa440505d8010bba052df914892537e6b418',
236
- },
237
- },
238
204
  },
239
205
  switchboard: {
240
206
  id: '0x248f5cb31c12eed6ab8fd4c6176466b982be42ce87e6bf8ff896fb8097a1660d',
207
+ object:
208
+ '0x248f5cb31c12eed6ab8fd4c6176466b982be42ce87e6bf8ff896fb8097a1660d',
241
209
  upgradeCap: '',
242
210
  },
243
211
  xOracle: {
@@ -249,81 +217,43 @@ export const TEST_ADDRESSES: AddressesInterface = {
249
217
  },
250
218
  testCoin: {
251
219
  id: '',
220
+ upgradeCap: '',
252
221
  },
253
222
  },
254
223
  },
255
224
  spool: {
256
- id: '0x472fc7d4c3534a8ec8c2f5d7a557a43050eab057aaab853e8910968ddc84fc9f',
225
+ id: '0x1742655fe5872dfa6456673f9e38612a4965e6979e6cd7696a7f1225f28bae21',
257
226
  adminCap:
258
227
  '0xdd8a047cbbf802bfcde5288b8ef1910965d789cc614da11d39af05fca0bd020a',
259
228
  object:
260
229
  '0xe87f1b2d498106a2c61421cec75b7b5c5e348512b0dc263949a0e7a3c256571a',
261
230
  pools: {
262
- sweth: {
263
- id: '0xeec40beccb07c575bebd842eeaabb835f77cd3dab73add433477e57f583a6787',
264
- rewardPoolId:
265
- '0x957de68a18d87817de8309b30c1ec269a4d87ae513abbeed86b5619cb9ce1077',
266
- },
267
231
  ssui: {
268
- id: '0x4f0ba970d3c11db05c8f40c64a15b6a33322db3702d634ced6536960ab6f3ee4',
232
+ id: '0xb9617f83c06ebdeac0a8834782b1015e1cc7ea23739e30c132c4bfb95c37a579',
269
233
  rewardPoolId:
270
- '0x162250ef72393a4ad3d46294c4e1bdfcb03f04c869d390e7efbfc995353a7ee9',
234
+ '0xc3206071a8d43212efb6e3b5504f2321f8df97ab122b466c0bc7cfdf398dc13a',
271
235
  },
272
236
  susdc: {
273
237
  id: '0x0b5f5f413bd3799e4052c37311966c77f3a4545eb125d2e93e67a68478021918',
274
238
  rewardPoolId:
275
239
  '0x85ed6ed72ea97c35dbf0cdc7ed6fbc48d8ec15de9b17c74bf4512df8a6d7f166',
276
240
  },
277
- swusdc: {
278
- id: '0x4ace6648ddc64e646ba47a957c562c32c9599b3bba8f5ac1aadb2ae23a2f8ca0',
279
- rewardPoolId:
280
- '0xf4268cc9b9413b9bfe09e8966b8de650494c9e5784bf0930759cfef4904daff8',
281
- },
282
- swusdt: {
283
- id: '0xcb328f7ffa7f9342ed85af3fdb2f22919e1a06dfb2f713c04c73543870d7548f',
284
- rewardPoolId:
285
- '0x2c9f934d67a5baa586ceec2cc24163a2f049a6af3d5ba36b84d8ac40f25c4080',
286
- },
287
- scetus: {
288
- id: '0xac1bb13bf4472a637c18c2415fb0e3c1227ea2bcf35242e50563c98215bd298e',
289
- rewardPoolId:
290
- '0x6835c1224126a45086fc6406adc249e3f30df18d779ca4f4e570e38716a17f3f',
291
- },
292
- safsui: {
293
- id: '0xeedf438abcaa6ce4d9625ffca110920592d5867e4c5637d84ad9f466c4feb800',
294
- rewardPoolId:
295
- '0x89255a2f86ed7fbfef35ab8b7be48cc7667015975be2685dd9a55a9a64baf76e',
296
- },
297
- shasui: {
298
- id: '0xa6148bc1b623e936d39a952ceb5bea79e8b37228a8f595067bf1852efd3c34aa',
299
- rewardPoolId:
300
- '0x6f3563644d3e2ef13176dbf9d865bd93479df60ccbe07b7e66db57f6309f5a66',
301
- },
302
- svsui: {
303
- id: '0x69ce8e537e750a95381e6040794afa5ab1758353a1a2e1de7760391b01f91670',
304
- rewardPoolId:
305
- '0xbca914adce058ad0902c7f3cfcd698392a475f00dcfdc3f76001d0370b98777a',
306
- },
307
241
  },
308
- // version: '',
309
- // versionCap: '',
310
242
  config: '',
311
243
  },
312
244
  borrowIncentive: {
313
245
  id: '0x045811c127a4063d78683ea61fa987b9252a798b0d3ae9e927e25adcbe5549e2',
314
- adminCap:
315
- '0xc486afa253646f4d381e81d7f1df8aa4723b845a6bb356f69bad635ffefffe2c',
246
+ config:
247
+ '0xe5fec608d3a30a1f75b24d2c67d227524075aa6f5ee22e5eccedacd9145b1d9d',
316
248
  object:
317
249
  '0x045811c127a4063d78683ea61fa987b9252a798b0d3ae9e927e25adcbe5549e2',
318
- query: '0xdbc22fe051d384691634cd3b9fe473b09723084a1e4c128728c42e2de3b2228f',
319
250
  incentivePools:
320
- '0xd214b7055554dd65f27a2c74366377dde63e66c498508ef3fc9f7d76a32b4465',
251
+ '0xb06657692f7f4d9eb0d7b7d6ac24db30e6fdaed64b09dee49664b496f687de46',
321
252
  incentiveAccounts:
322
- '0x717cd4d3e78e8c45f7570c0857f696f8c7a68248218a258aa49bff99b3ff7175',
323
- config:
324
- '0xe5fec608d3a30a1f75b24d2c67d227524075aa6f5ee22e5eccedacd9145b1d9d',
325
- // version: '',
326
- // versionCap: '',
253
+ '0x0bf8168d983c18edcc6b2c2b2e85d2bdac84764babfecf1b567f98801fbf4942',
254
+ query: '0xdbc22fe051d384691634cd3b9fe473b09723084a1e4c128728c42e2de3b2228f',
255
+ adminCap:
256
+ '0xc486afa253646f4d381e81d7f1df8aa4723b845a6bb356f69bad635ffefffe2c',
327
257
  },
328
258
  vesca: {
329
259
  id: '0x0c7f5568dbd69488437ee95f2d9a028724e1de12432965ff8acca7c67310ba46',
@@ -341,32 +271,32 @@ export const TEST_ADDRESSES: AddressesInterface = {
341
271
  subsTable:
342
272
  '0x4756b716670ff62760b22bebed73c6eb2c2cb118674a2eea3a56ebea9e27ae76',
343
273
  subsTableId:
344
- '0xe9fa5d464d28fe30ad060ea32af577c68c9e82aca48ad1f10f13f35338472778',
274
+ '0x924b56d383b45445984a80002185b670aa2e72cd7df496d345f45f9407a12c07',
345
275
  subsWhitelist:
346
276
  '0xfc72adae643da4f2fe080adc1e2cca981eadcb518facb02324eeaab169752ffb',
347
277
  },
348
278
  referral: {
349
- id: '0x709ce9b97a63c6815c385ffd31c354dcd8f760984610581be23b838af4c6f60b',
279
+ id: '0x1bf5a8ce77050d8052549d743e16b469f15aa6b81b752b78b6ebb65179665f5a',
350
280
  object:
351
281
  '0x5658d4bf5ddcba27e4337b4262108b3ad1716643cac8c2054ac341538adc72ec',
352
282
  adminCap:
353
283
  '0xc5dc06b9074291259f2cac460c940012c781c4430e42125c541cc43101c3bcbd',
354
284
  referralBindings:
355
- '0xf63299d58789d99de94092b9011323466e55ca0c1ea1a7a3786a589af46e1c09',
285
+ '0xcf184487782bed962bf678001efe775d31fb94b9992333a57594cf15d79d5ced',
356
286
  bindingTableId:
357
- '0x1c8202b17267ec8d6cf97ca013615354181a04f179570e42601ff2dae19294b1',
287
+ '0x41a50e258c0a266ce84e0e1a618dbf70b878cc943909e613089a50afcceb2bc0',
358
288
  referralRevenuePool:
359
- '0x6abd852caf90769c1b185cdf636d841673fa95528f0550f018b8a138bd283c07',
289
+ '0xc24e3e5e37032f29a3dd91a9a1f057af8821b7e6c148e9683900ac8b6d30f0c6',
360
290
  revenueTableId:
361
- '0x595baa3654c297bff84ab7786a2d250f019cefc66e8df8e89fd9d41e02bd30dd',
291
+ '0x669dfb0f47fccbbe2ae8a0bfce2672a994ef3f1c7049621405cce2f91733bdc1',
362
292
  referralTiers:
363
- '0x962cb903d8d7346190c5204785ccbb91b61086aa764f674c8145df82335cf83e',
293
+ '0x144350f3db9b46d11b140084cd54e6de0b9c3b8d265ce8059b51d0ef58ea464b',
364
294
  tiersTableId:
365
- '0xeac755a7a8b7798530905ac79e8c114f19d0f130f6eab012954f08faac29c75d',
295
+ '0xad5e36fce7358a3ef94a56eb89ee7f1968100c1a9d967c1731154083e1dda1fb',
366
296
  authorizedWitnessList:
367
297
  '0xf21b0ed043c9bb70842c0129159f4943dbcc3c9ef2f2f808af65f8be25cfd20e',
368
298
  version:
369
- '0x1bd4b7285f72e11c316b828c7c47b3f4da18dcec9f9b3dba6d8629cbb6f93e5e',
299
+ '0x3545849eb97723e676a476ec9d4fe5f2eb0eb2c6b78972851114fd4c7ed4639f',
370
300
  },
371
301
  loyaltyProgram: {
372
302
  id: '0xab7c4e6d53ef862a1115d0c381fd33e05f9c206b79f322a54990b1e8c2fe3446',
@@ -378,15 +308,15 @@ export const TEST_ADDRESSES: AddressesInterface = {
378
308
  '0x574a11f8a0fbaa05b8f559cb65634e8eb20f26b1ec29e7d58de9167f3cedd0f7',
379
309
  },
380
310
  veScaLoyaltyProgram: {
381
- id: '0x120dd97cb2be154d3c0e65e697594bf9cd4a7ce36f0eea0f1d70601f4a0b83eb',
311
+ id: '0x51bd8c455caedad9d7fd47f9ee75876668c4d6bbede95af39c0aebde46043f00',
382
312
  object:
383
- '0x120dd97cb2be154d3c0e65e697594bf9cd4a7ce36f0eea0f1d70601f4a0b83eb',
313
+ '0x51bd8c455caedad9d7fd47f9ee75876668c4d6bbede95af39c0aebde46043f00',
384
314
  adminCap:
385
- '0x9877e840e32705b80cb375115d5ff9dcd58f0c68204b7e15aa431b8cb547aaca',
315
+ '0xb2d52e0ebb260cb42699be6a9804e12d6fa17b79ef1e43f9996df5ca71bac0ae',
386
316
  veScaRewardPool:
387
- '0x1b4f09e30dbb6e1442f6710c52568295d120cc4ff2ae02449a11070b3faf2c86',
317
+ '0x4fe34992bf2261c3c6c14b2dbf9606ce65a505c45ff778ac129ce7dea9b0cadf',
388
318
  veScaRewardTableId:
389
- '0xb63dc27b258ae4066544f58a987931a5a2f78ebe872319381b62eb65c3ac5560',
319
+ '0x85d3e557d9bbed617b9cbc09982a0c9a6f6f4fc9ecce49b59124206c409c4774',
390
320
  },
391
321
  scoin: {
392
322
  id: '0x826a4934bee9487e558eed603cf42f30cdc4321d6f31083930791b95f903b9f9',
@@ -394,62 +324,89 @@ export const TEST_ADDRESSES: AddressesInterface = {
394
324
  ssui: {
395
325
  coinType:
396
326
  '0x88618204de2dfdc2597681a8441ee726b0dc13494c41e319c3264eb7b35fea90::scallop_sui::SCALLOP_SUI',
327
+ metaData: '',
328
+ symbol: 'sSUI',
397
329
  treasury:
398
330
  '0x03f1d94a40bd9f5d556bacb5c5245732b185572f6a29b36ad8b555d9a8a24f09',
399
- metaData:
400
- '0xfc9f2b2aa98be8d2dc95603cd531bdb38bcb894c82929d435d84a1985282e838',
401
- symbol: 'sSUI',
402
331
  },
403
332
  ssca: {
404
333
  coinType:
405
334
  '0x9f64a180373a6b66595025ae16a4ab701f0af1dd5c7ce1ac91dc112e52c2a3f8::scallop_sca::SCALLOP_SCA',
406
- treasury:
407
- '0x1b05d2cd8b20dba19da073a54195fc52d2f438ea19dea0713bae7a7dab308199',
408
- metaData:
409
- '0xf1bf00be79b48c064f99fa5d1d4389e44776a269888b57b2f9a923080882ea73',
335
+ metaData: '',
410
336
  symbol: 'sSCA',
411
- },
412
- safsui: {
413
- coinType:
414
- '0xe66ae8fd59e37f78e355dafb130b7c167ca4ec8792a424031a1a1eac96244ada::scallop_af_sui::SCALLOP_AF_SUI',
415
337
  treasury:
416
- '0xc57357a64593aa54bc23d7936129119b86876a200107481578f304762217061a',
417
- metaData:
418
- '0x42179b69f82ea26e3763345ee0fb1cea8b1bd355168b3241ceb727ec82bb0688',
419
- symbol: 'safSUI',
338
+ '0x1b05d2cd8b20dba19da073a54195fc52d2f438ea19dea0713bae7a7dab308199',
420
339
  },
421
340
  susdc: {
422
341
  coinType:
423
342
  '0x55ed015f9f006c0c96ad36ebe3b3570d088e8498f52defea48e5634c110e485c::scallop_usdc::SCALLOP_USDC',
424
343
  treasury:
425
344
  '0x6ef82ef94472dcb8c2cdeac8df38874024c08570ca165986ba56d1e38fe0c0a3',
426
- metaData:
427
- '0xad94e42c05ab0eb54c9d9a1bcf3689bcd330710d6b300956213aa35387b727c9',
428
345
  symbol: 'sUSDC',
346
+ metaData:
347
+ '0x763a21eba338e00bc684aaad80491c89eea5f247b59c47df45b17610c9ad58f2',
429
348
  },
430
349
  sdeep: {
431
350
  coinType:
432
351
  '0x34f0a2e793e1f79ceac72cfe3bb95f65541da449418289ccd12922d16140c882::scallop_deep::SCALLOP_DEEP',
352
+ metaData: '',
353
+ symbol: 'sDEEP',
433
354
  treasury:
434
355
  '0x71d41465cf2d16fa0206126526bebdf65c8871d1fcfbd0c2237db2306afd67ba',
435
- metaData:
436
- '0x63e749a506bbae17ca63fd41a270e2b9b0a08dade1964bfa620ecba94c8be4f9',
437
- symbol: 'sDEEP',
438
356
  },
439
357
  sfud: {
440
358
  coinType:
441
359
  '0x3b23c05f917052255a0b16a534dbd4446911aa4a30bd3497cdf5b736551e7ef8::scallop_fud::SCALLOP_FUD',
360
+ metaData: '',
361
+ symbol: 'sFUD',
442
362
  treasury:
443
363
  '0x858c492d51425b922c040c1a389e185b3b00d565e7d72ead1a81dc733104660d',
444
- metaData:
445
- '0x0cd9fb845663dd5e1f7c48a321ab1c523a54c70243711a5a115523945396e54f',
446
- symbol: 'sFUD',
447
364
  },
448
365
  },
449
366
  },
367
+ // scoin: {
368
+ // id: '0x826a4934bee9487e558eed603cf42f30cdc4321d6f31083930791b95f903b9f9',
369
+ // coins: {
370
+ // ssui: {
371
+ // coinType:
372
+ // '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI',
373
+ // metaData: '0xac724644f481f4870ecdc29b9549aa8ea5180f10827c0d97b493f9f65a91455d',
374
+ // symbol: 'sSUI',
375
+ // treasury: '0x5c1678c8261ac9eec024d4d630006a9f55c80dc0b1aa38a003fcb1d425818c6b',
376
+ // },
377
+ // ssca: {
378
+ // coinType:
379
+ // '0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA',
380
+ // treasury: '0xe04bfc95e00252bd654ee13c08edef9ac5e4b6ae4074e8390db39e9a0109c529',
381
+ // metaData: '0x27e3877491b308dfac46fb3d9f7dfa6a1e8b7dc3c374e92ecda7976055746964',
382
+ // symbol: 'sSCA',
383
+ // },
384
+ // susdc: {
385
+ // coinType:
386
+ // '0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC',
387
+ // treasury: '0xbe6b63021f3d82e0e7e977cdd718ed7c019cf2eba374b7b546220402452f938e',
388
+ // metaData: '0x763a21eba338e00bc684aaad80491c89eea5f247b59c47df45b17610c9ad58f2',
389
+ // symbol: 'sUSDC',
390
+ // },
391
+ // sdeep: {
392
+ // coinType:
393
+ // '0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP',
394
+ // treasury: '0xc63838fabe37b25ad897392d89876d920f5e0c6a406bf3abcb84753d2829bc88',
395
+ // metaData: '0x2443014594a500a9119e11c6c6a86e865834f496c4614280ce8cace33c0b072e',
396
+ // symbol: 'sDEEP',
397
+ // },
398
+ // sfud: {
399
+ // coinType:
400
+ // '0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD',
401
+ // treasury: '0xf25212f11d182decff7a86165699a73e3d5787aced203ca539f43cfbc10db867',
402
+ // metaData: '0x4e03390de36b8c84e0a8297d3d0d08a8a34bed93787e37fcb26bfc26df33226c',
403
+ // symbol: 'sFUD',
404
+ // },
405
+ // },
406
+ // },
450
407
  };
451
408
 
452
- export const TEST_WHITELIST = {
409
+ export const WHITELIST = {
453
410
  lending: new Set([
454
411
  'usdc',
455
412
  // 'sbeth',
@@ -463,7 +420,7 @@ export const TEST_WHITELIST = {
463
420
  // 'wapt',
464
421
  // 'wsol',
465
422
  // 'cetus',
466
- 'afsui',
423
+ // 'afsui',
467
424
  // 'hasui',
468
425
  // 'vsui',
469
426
  'sca',
@@ -489,7 +446,7 @@ export const TEST_WHITELIST = {
489
446
  // 'wapt',
490
447
  // 'wsol',
491
448
  // 'cetus',
492
- 'afsui',
449
+ // 'afsui',
493
450
  // 'hasui',
494
451
  // 'vsui',
495
452
  'sca',
@@ -511,7 +468,7 @@ export const TEST_WHITELIST = {
511
468
  // 'wapt',
512
469
  // 'wsol',
513
470
  // 'cetus',
514
- 'afsui',
471
+ // 'afsui',
515
472
  // 'hasui',
516
473
  // 'vsui',
517
474
  'sca',
@@ -557,7 +514,7 @@ export const TEST_WHITELIST = {
557
514
  'ssui',
558
515
  // 'swusdc',
559
516
  // 'swusdt',
560
- 'safsui',
517
+ // 'safsui',
561
518
  // 'shasui',
562
519
  // 'svsui',
563
520
  // 'sweth',
@@ -584,7 +541,7 @@ export const TEST_WHITELIST = {
584
541
  emerging: new Set(['wal', 'deep', 'sca', 'cetus']),
585
542
  };
586
543
 
587
- export const TEST_POOL_ADDRESSES = {
544
+ export const POOL_ADDRESSES = {
588
545
  usdc: {
589
546
  coinName: 'usdc',
590
547
  symbol: 'USDC',
@@ -792,49 +749,4 @@ export const TEST_POOL_ADDRESSES = {
792
749
  flashloanFeeObject:
793
750
  '0xd54dfb677e9e011e2451375a7a2e318b4f2225c2a0b369bde0afcef8cbb1a863',
794
751
  },
795
- afsui: {
796
- coinName: 'afsui',
797
- symbol: 'afSUI',
798
- lendingPoolAddress:
799
- '0x8eb75cd4c5050c4c9950f11694bb32b644706d24b9129981df3b52d2080ad45d',
800
- collateralPoolAddress:
801
- '0x48c5455eb1a9f1422c617a89a41927e166cfb49b829100980d4369f9f079d75c',
802
- borrowDynamic:
803
- '0x8f5d749372526ef651b6ba6ffede9bf17b8a96f90cda2a64893366a1d5c89491',
804
- interestModel:
805
- '0x9e82e24542804156386df51ddce8399fca0981a77e710542847f981febf231e9',
806
- riskModel:
807
- '0xfe1b5c5a883d8693effb11b35965538f9777e3c3d89298db2b57252916df14bd',
808
- borrowFeeKey:
809
- '0xabc6422db2d4ee01635ddaeaa44ba68370eebd785d2c4632515f841ae9bc47d9',
810
- supplyLimitKey:
811
- '0x61a2054eb37f543c0d774da57f2c9542aad8d79a197f748ac08ef5df6cc47028',
812
- borrowLimitKey:
813
- '0x4459498a043872cd107ea917493fee0baf2d37a273c7538e1d6581cc61b92af8',
814
- isolatedAssetKey: '',
815
- isIsolated: false,
816
- spool: '0xeedf438abcaa6ce4d9625ffca110920592d5867e4c5637d84ad9f466c4feb800',
817
- spoolReward:
818
- '0x89255a2f86ed7fbfef35ab8b7be48cc7667015975be2685dd9a55a9a64baf76e',
819
- sCoinType:
820
- '0xe66ae8fd59e37f78e355dafb130b7c167ca4ec8792a424031a1a1eac96244ada::scallop_af_sui::SCALLOP_AF_SUI',
821
- sCoinTreasury:
822
- '0xc57357a64593aa54bc23d7936129119b86876a200107481578f304762217061a',
823
- sCoinMetadataId:
824
- '0x42179b69f82ea26e3763345ee0fb1cea8b1bd355168b3241ceb727ec82bb0688',
825
- sCoinSymbol: 'safSUI',
826
- sCoinName: 'safsui',
827
- coinMetadataId:
828
- '0x2f9217f533e51334873a39b8026a4aa6919497b47f49d0986a4f1aec66f8a34d',
829
- coinType:
830
- '0xf325ce1300e8dac124071d3152c5c5ee6174914f8bc2161e88329cf579246efc::afsui::AFSUI',
831
- spoolName: 'safsui',
832
- decimals: 9,
833
- pythFeed:
834
- '23d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744',
835
- pythFeedObjectId:
836
- '0x801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37',
837
- flashloanFeeObject:
838
- '0xac87fde83d434554ec300c1334c9a622aa5b59e82a04334dc99e1cc1f75d4eae',
839
- },
840
752
  };
@@ -1,12 +1,6 @@
1
- export const SUPPORT_ORACLES = ['supra', 'switchboard', 'pyth'] as const;
2
- export const X_ORACLE_RULES = ['primary', 'secondary'] as const;
3
- export const SUPPORT_ORACLE_LST = ['pyth'] as const;
4
- export const SUPPORT_SUI_LST = ['afsui'] as const;
1
+ import { xOracleListType } from 'src/types';
5
2
 
6
- export const X_ORACLE_LIST: Record<
7
- string,
8
- Record<(typeof X_ORACLE_RULES)[number], (typeof SUPPORT_ORACLES)[number][]>
9
- > = {
3
+ export const xOracleList: xOracleListType = {
10
4
  usdc: { primary: ['pyth'], secondary: [] },
11
5
  sbeth: { primary: ['pyth'], secondary: [] },
12
6
  sbusdt: { primary: ['pyth'], secondary: [] },
package/src/index.ts CHANGED
@@ -10,4 +10,4 @@ export {
10
10
  ScallopIndexer,
11
11
  ScallopUtils,
12
12
  } from './models';
13
- export * from './types';
13
+ export type * from './types';
@@ -1,4 +1,3 @@
1
- // export type * from './interface';
2
1
  export { default as Scallop } from './scallop';
3
2
  export { default as ScallopClient } from './scallopClient';
4
3
  export { default as ScallopBuilder } from './scallopBuilder';
@@ -7,6 +6,6 @@ export { default as ScallopAxios } from './scallopAxios';
7
6
  export { default as ScallopConstants } from './scallopConstants';
8
7
  export { default as ScallopIndexer } from './scallopIndexer';
9
8
  export { default as ScallopQuery } from './scallopQuery';
10
- export { default as ScallopQueryClient } from './scallopQueryClient';
9
+ export { default as ScallopQueryClient } from '../models/scallopQueryClient';
11
10
  export { default as ScallopUtils } from './scallopUtils';
12
11
  export { default as ScallopSuiKit } from './scallopSuiKit';
@@ -1,9 +1,9 @@
1
- import type { default as ScallopAddress } from './scallopAddress';
2
- import type { default as ScallopBuilder } from './scallopBuilder';
3
- import type { default as ScallopConstants } from './scallopConstants';
4
- import type { default as ScallopQuery } from './scallopQuery';
5
- import type { default as ScallopSuiKit } from './scallopSuiKit';
6
- import type { default as ScallopUtils } from './scallopUtils';
1
+ import ScallopAddress from './scallopAddress';
2
+ import ScallopBuilder from './scallopBuilder';
3
+ import ScallopConstants from './scallopConstants';
4
+ import ScallopQuery from './scallopQuery';
5
+ import ScallopSuiKit from './scallopSuiKit';
6
+ import ScallopUtils from './scallopUtils';
7
7
 
8
8
  interface ScallopBaseInterface {
9
9
  scallopSuiKit: ScallopSuiKit;