@scallop-io/sui-scallop-sdk 1.4.23 → 1.4.24-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 (93) hide show
  1. package/dist/index.d.mts +3119 -0
  2. package/dist/index.d.ts +3119 -3
  3. package/dist/index.js +77 -10021
  4. package/dist/index.mjs +15 -9948
  5. package/package.json +3 -4
  6. package/src/constants/coinGecko.ts +12 -4
  7. package/src/constants/common.ts +2 -0
  8. package/src/constants/enum.ts +8 -0
  9. package/src/constants/poolAddress.ts +34 -0
  10. package/src/constants/pyth.ts +1 -0
  11. package/src/constants/testAddress.ts +2 -0
  12. package/src/models/scallopIndexer.ts +11 -0
  13. package/src/models/scallopQuery.ts +19 -3
  14. package/src/queries/poolAddressesQuery.ts +6 -3
  15. package/src/queries/priceQuery.ts +10 -3
  16. package/src/utils/util.ts +8 -3
  17. package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
  18. package/dist/builders/coreBuilder.d.ts +0 -12
  19. package/dist/builders/index.d.ts +0 -12
  20. package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
  21. package/dist/builders/oracle.d.ts +0 -14
  22. package/dist/builders/referralBuilder.d.ts +0 -12
  23. package/dist/builders/sCoinBuilder.d.ts +0 -4
  24. package/dist/builders/spoolBuilder.d.ts +0 -12
  25. package/dist/builders/vescaBuilder.d.ts +0 -25
  26. package/dist/constants/cache.d.ts +0 -14
  27. package/dist/constants/coinGecko.d.ts +0 -2
  28. package/dist/constants/common.d.ts +0 -20
  29. package/dist/constants/enum.d.ts +0 -14
  30. package/dist/constants/flashloan.d.ts +0 -2
  31. package/dist/constants/index.d.ts +0 -12
  32. package/dist/constants/poolAddress.d.ts +0 -27
  33. package/dist/constants/pyth.d.ts +0 -5
  34. package/dist/constants/queryKeys.d.ts +0 -54
  35. package/dist/constants/rpc.d.ts +0 -1
  36. package/dist/constants/testAddress.d.ts +0 -2
  37. package/dist/constants/vesca.d.ts +0 -5
  38. package/dist/index.js.map +0 -1
  39. package/dist/index.mjs.map +0 -1
  40. package/dist/models/index.d.ts +0 -8
  41. package/dist/models/scallop.d.ts +0 -73
  42. package/dist/models/scallopAddress.d.ts +0 -150
  43. package/dist/models/scallopBuilder.d.ts +0 -90
  44. package/dist/models/scallopCache.d.ts +0 -81
  45. package/dist/models/scallopClient.d.ts +0 -321
  46. package/dist/models/scallopIndexer.d.ts +0 -89
  47. package/dist/models/scallopQuery.d.ts +0 -682
  48. package/dist/models/scallopUtils.d.ts +0 -229
  49. package/dist/models/suiKit.d.ts +0 -2
  50. package/dist/queries/borrowIncentiveQuery.d.ts +0 -82
  51. package/dist/queries/borrowLimitQuery.d.ts +0 -9
  52. package/dist/queries/coreQuery.d.ts +0 -171
  53. package/dist/queries/index.d.ts +0 -14
  54. package/dist/queries/isolatedAssetQuery.d.ts +0 -14
  55. package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
  56. package/dist/queries/objectsQuery.d.ts +0 -2
  57. package/dist/queries/poolAddressesQuery.d.ts +0 -29
  58. package/dist/queries/portfolioQuery.d.ts +0 -143
  59. package/dist/queries/priceQuery.d.ts +0 -58
  60. package/dist/queries/referralQuery.d.ts +0 -7
  61. package/dist/queries/sCoinQuery.d.ts +0 -41
  62. package/dist/queries/spoolQuery.d.ts +0 -74
  63. package/dist/queries/supplyLimitQuery.d.ts +0 -9
  64. package/dist/queries/vescaQuery.d.ts +0 -36
  65. package/dist/types/address.d.ts +0 -107
  66. package/dist/types/builder/borrowIncentive.d.ts +0 -35
  67. package/dist/types/builder/core.d.ts +0 -56
  68. package/dist/types/builder/index.d.ts +0 -24
  69. package/dist/types/builder/loyaltyProgram.d.ts +0 -23
  70. package/dist/types/builder/referral.d.ts +0 -30
  71. package/dist/types/builder/sCoin.d.ts +0 -37
  72. package/dist/types/builder/spool.d.ts +0 -29
  73. package/dist/types/builder/vesca.d.ts +0 -51
  74. package/dist/types/constant/common.d.ts +0 -24
  75. package/dist/types/constant/enum.d.ts +0 -48
  76. package/dist/types/constant/index.d.ts +0 -2
  77. package/dist/types/index.d.ts +0 -6
  78. package/dist/types/model.d.ts +0 -60
  79. package/dist/types/query/borrowIncentive.d.ts +0 -124
  80. package/dist/types/query/core.d.ts +0 -380
  81. package/dist/types/query/index.d.ts +0 -7
  82. package/dist/types/query/loyaltyProgram.d.ts +0 -5
  83. package/dist/types/query/portfolio.d.ts +0 -119
  84. package/dist/types/query/sCoin.d.ts +0 -1
  85. package/dist/types/query/spool.d.ts +0 -142
  86. package/dist/types/query/vesca.d.ts +0 -26
  87. package/dist/types/utils.d.ts +0 -22
  88. package/dist/utils/builder.d.ts +0 -15
  89. package/dist/utils/core.d.ts +0 -2
  90. package/dist/utils/index.d.ts +0 -5
  91. package/dist/utils/indexer.d.ts +0 -17
  92. package/dist/utils/query.d.ts +0 -62
  93. package/dist/utils/util.d.ts +0 -27
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scallop-io/sui-scallop-sdk",
3
- "version": "1.4.23",
3
+ "version": "1.4.24-alpha.2",
4
4
  "description": "Typescript sdk for interacting with Scallop contract on SUI",
5
5
  "keywords": [
6
6
  "sui",
@@ -148,9 +148,8 @@
148
148
  },
149
149
  "scripts": {
150
150
  "clean": "rm -rf tsconfig.tsbuildinfo ./dist",
151
- "build": "pnpm run build:types && pnpm run build:tsup",
152
- "build:tsup": "tsup ./src/index.ts --format esm,cjs --sourcemap",
153
- "build:types": "tsc --build",
151
+ "build": "pnpm run build:tsup",
152
+ "build:tsup": "tsup ./src/index.ts --format esm,cjs --splitting --minify --treeshake --dts",
154
153
  "watch:tsup": "tsup ./src/index.ts --format esm,cjs --clean --splitting --watch",
155
154
  "watch:types": "tsc --watch",
156
155
  "watch": "pnpm run clean & pnpm run watch:types & pnpm run watch:tsup",
@@ -1,24 +1,32 @@
1
1
  import { SupportPoolCoins } from 'src/types/constant/common';
2
2
 
3
3
  export const COIN_GECKGO_IDS: Record<SupportPoolCoins, string> = {
4
- usdc: 'usdc',
4
+ // Sui Bridge
5
5
  sbeth: 'ethereum',
6
6
  sbusdt: 'tether',
7
7
  sbwbtc: 'bitcoin',
8
+ // Wormhole
8
9
  weth: 'ethereum',
9
10
  wbtc: 'bitcoin',
10
11
  wusdc: 'usdc',
11
12
  wusdt: 'tether',
12
- sui: 'sui',
13
13
  wapt: 'aptos',
14
14
  wsol: 'solana',
15
- cetus: 'cetus-protocol',
15
+ // Sui Native
16
+ usdc: 'usdc',
17
+ // Sui LST
18
+ sui: 'sui',
16
19
  afsui: 'sui',
17
20
  hasui: 'sui',
18
21
  vsui: 'sui',
19
- sca: 'scallop-2',
22
+ // Stable
20
23
  fdusd: 'first-digital-usd',
24
+ // DeFi
25
+ cetus: 'cetus-protocol',
26
+ sca: 'scallop-2',
21
27
  deep: 'deepbook',
28
+ // Isolated Asset
22
29
  fud: 'fud-the-pug',
23
30
  blub: 'blub',
31
+ musd: '', // @TODO: add coinGecko id
24
32
  };
@@ -50,6 +50,7 @@ export const SUPPORT_POOLS = [
50
50
  'deep',
51
51
  'fdusd',
52
52
  'blub',
53
+ 'musd',
53
54
  ] as const;
54
55
 
55
56
  export const SUPPORT_COLLATERALS = [
@@ -104,6 +105,7 @@ export const SUPPORT_SCOIN = [
104
105
  'sfud',
105
106
  'sfdusd',
106
107
  'sblub',
108
+ 'smusd',
107
109
  ] as const;
108
110
 
109
111
  export const SUPPORT_SUI_BRIDGE = ['sbeth', 'sbusdt', 'sbwbtc'] as const;
@@ -22,6 +22,7 @@ export const coinDecimals: types.SupportCoinDecimals = {
22
22
  deep: 6,
23
23
  fud: 5,
24
24
  blub: 2,
25
+ musd: 9,
25
26
  susdc: 6,
26
27
  sweth: 8,
27
28
  ssbeth: 8,
@@ -42,6 +43,7 @@ export const coinDecimals: types.SupportCoinDecimals = {
42
43
  sdeep: 6,
43
44
  sfud: 5,
44
45
  sblub: 2,
46
+ smusd: 9,
45
47
  };
46
48
 
47
49
  export const assetCoins: types.AssetCoins = {
@@ -65,6 +67,7 @@ export const assetCoins: types.AssetCoins = {
65
67
  deep: 'deep',
66
68
  fud: 'fud',
67
69
  blub: 'blub',
70
+ musd: 'musd',
68
71
  };
69
72
 
70
73
  export const marketCoins: types.MarketCoins = {
@@ -88,6 +91,7 @@ export const marketCoins: types.MarketCoins = {
88
91
  sdeep: 'sdeep',
89
92
  sfud: 'sfud',
90
93
  sblub: 'sblub',
94
+ smusd: 'smusd',
91
95
  };
92
96
 
93
97
  export const sCoins: types.SCoins = {
@@ -110,6 +114,7 @@ export const sCoins: types.SCoins = {
110
114
  sfud: 'sfud',
111
115
  sdeep: 'sdeep',
112
116
  sblub: 'sblub',
117
+ smusd: 'smusd',
113
118
  };
114
119
 
115
120
  export const stakeMarketCoins: types.StakeMarketCoins = {
@@ -170,6 +175,7 @@ export const coinIds: types.AssetCoinIds = {
170
175
  sbeth: '0xd0e89b2af5e4910726fbcd8b8dd37bb79b29e5f83f7491bca830e94f7f226d29',
171
176
  sbusdt: '0x375f70cf2ae4c00bf37117d0c85a2c71545e6ee05c4a5c7d282cd66a4504b068',
172
177
  sbwbtc: '0xaafb102dd0902f5055cadecd687fb5b71ca82ef0e0285d90afde828ec58ca96b',
178
+ musd: '0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722',
173
179
  };
174
180
 
175
181
  export const wormholeCoinIds: types.WormholeCoinIds = {
@@ -227,6 +233,8 @@ export const sCoinIds: types.SCoinIds = {
227
233
  '0xb1d7df34829d1513b73ba17cb7ad90c88d1e104bb65ab8f62f13e0cc103783d3::scallop_sb_usdt::SCALLOP_SB_USDT',
228
234
  ssbwbtc:
229
235
  '0x08c0fe357d3a138f4552bee393ce3a28a45bebcca43373d6a90bc44ab76f82e2::scallop_sb_wbtc::SCALLOP_SB_WBTC',
236
+ smusd:
237
+ '0x0a228d1c59071eccf3716076a1f71216846ee256d9fb07ea11fb7c1eb56435a5::scallop_musd::SCALLOP_MUSD',
230
238
  } as const;
231
239
 
232
240
  export const sCoinTypeToName = Object.entries(sCoinIds).reduce(
@@ -786,4 +786,38 @@ export const POOL_ADDRESSES: OptionalKeys<
786
786
  pythFeedObjectId:
787
787
  '0x5f6583b2b0fe1ecf94aaffeaab8a838794693960cea48c0da282d5f4a24be027',
788
788
  },
789
+ // @TODO: add pyth feed
790
+ musd: {
791
+ coinName: 'musd',
792
+ symbol: 'mUSD',
793
+ lendingPoolAddress:
794
+ '0x0565254220e7ca857a87341898bdebeb9e5d6f8f8fe68eb25dd3e257d41a0b0c',
795
+ collateralPoolAddress: undefined,
796
+ borrowDynamic:
797
+ '0x9448dc2ae8054d5b735fd617fb4ca57046ddc98bfff91ce31de1df452f3bf695',
798
+ interestModel:
799
+ '0xc3b57c57814e22ac42c7062922a0437ebf40495e37aee32cbb94cba0693970ed',
800
+ riskModel: undefined,
801
+ borrowFeeKey:
802
+ '0xfdb02d76dc67553fd15f42f1de49ca79cd2812bdaf8bcd079cfe17ce23ed9fc4',
803
+ supplyLimitKey:
804
+ '0x340aaae070f9489b59c4257610babf6f170abf43fbe51cf7de1e2e04492f6823',
805
+ isolatedAssetKey:
806
+ '0xe10f03b13d2cdb46543130bafaf1884c9a5a7712b5932aae15b2f8d4fc31a774',
807
+ sCoinTreasury:
808
+ '0xadfd554635ccc87e992f23ca838f0f16c14874e324a1b79b77f6bfe118edea9f',
809
+ sCoinType:
810
+ '0x0a228d1c59071eccf3716076a1f71216846ee256d9fb07ea11fb7c1eb56435a5::scallop_musd::SCALLOP_MUSD',
811
+ sCoinName: 'smusd',
812
+ sCoinSymbol: 'smUSD',
813
+ coinMetadataId:
814
+ '0xc154abd271b24032a2c80d96c1b82109490bb600ed189ef881d8c9467ed44a4f',
815
+ coinType:
816
+ '0xe44df51c0b21a27ab915fa1fe2ca610cd3eaa6d9666fe5e62b988bf7f0bd8722::musd::MUSD',
817
+ sCoinMetadataId:
818
+ '0xb924f8c3d4b993172d4fc553c1ea242e8ca539e83edc3edaf5512ae44dfa6863',
819
+ decimals: 0,
820
+ pythFeed: '',
821
+ pythFeedObjectId: '',
822
+ },
789
823
  };
@@ -28,4 +28,5 @@ export const PYTH_FEED_IDS: Record<SupportPoolCoins, string> = {
28
28
  deep: '29bdd5248234e33bd93d3b81100b5fa32eaa5997843847e2c2cb16d7c6d9f7ff',
29
29
  fud: '6a4090703da959247727f2b490eb21aea95c8684ecfac675f432008830890c75',
30
30
  blub: '5fc11ffe4975b624be495be038da30e30bee2004d8ae6282b5364577ef4ca92c',
31
+ musd: '', // @TODO: add mUSD pyth
31
32
  };
@@ -243,6 +243,8 @@ export const TEST_ADDRESSES: AddressesInterface = {
243
243
  sbwbtc: {},
244
244
  // @ts-ignore
245
245
  blub: {},
246
+ // @ts-ignore
247
+ musd: {},
246
248
  fdusd: {
247
249
  id: '0xf16e6b723f242ec745dfd7634ad072c42d5c1d9ac9d62a39c381303eaa57693a',
248
250
  metaData:
@@ -269,4 +269,15 @@ export class ScallopIndexer {
269
269
  public async getCoinPrice(poolCoinName: SupportPoolCoins): Promise<number> {
270
270
  return (await this.getMarketPool(poolCoinName))?.coinPrice ?? 0;
271
271
  }
272
+
273
+ public async getCoinPrices(): Promise<Record<string, number>> {
274
+ const marketPools = await this.getMarketPools();
275
+ return Object.entries(marketPools).reduce(
276
+ (prev, [coinName, market]) => {
277
+ prev[coinName] = market.coinPrice;
278
+ return prev;
279
+ },
280
+ {} as Record<string, number>
281
+ );
282
+ }
272
283
  }
@@ -851,6 +851,14 @@ export class ScallopQuery {
851
851
  return this.indexer.getCoinPrice(poolName);
852
852
  }
853
853
 
854
+ /**
855
+ * Get all supported pool price from indexer
856
+ * @returns prices data
857
+ */
858
+ public async getCoinPricesByIndexer() {
859
+ return this.indexer.getCoinPrices();
860
+ }
861
+
854
862
  /**
855
863
  * Get all coin prices, including sCoin
856
864
  * @returns prices data
@@ -858,16 +866,24 @@ export class ScallopQuery {
858
866
  public async getAllCoinPrices(args?: {
859
867
  marketPools?: MarketPools;
860
868
  coinPrices?: CoinPrices;
869
+ indexer?: boolean;
861
870
  }) {
862
- return getAllCoinPrices(this, args?.marketPools, args?.coinPrices);
871
+ return getAllCoinPrices(
872
+ this,
873
+ args?.marketPools,
874
+ args?.coinPrices,
875
+ args?.indexer
876
+ );
863
877
  }
864
878
 
865
879
  /**
866
880
  * Query all address (lending pool, collateral pool, borrow dynamics, interest models, etc.) of all pool
867
881
  * @returns
868
882
  */
869
- public async getPoolAddresses() {
870
- return getAllAddresses(this);
883
+ public async getPoolAddresses(
884
+ pools: SupportPoolCoins[] = [...SUPPORT_POOLS]
885
+ ) {
886
+ return getAllAddresses(this, pools);
871
887
  }
872
888
 
873
889
  /**
@@ -1,8 +1,11 @@
1
- import { PYTH_FEED_IDS, SUPPORT_POOLS } from 'src/constants';
1
+ import { PYTH_FEED_IDS } from 'src/constants';
2
2
  import { ScallopQuery } from 'src/models';
3
3
  import { OptionalKeys, SupportPoolCoins } from 'src/types';
4
4
 
5
- export const getAllAddresses = async (query: ScallopQuery) => {
5
+ export const getAllAddresses = async (
6
+ query: ScallopQuery,
7
+ pools: SupportPoolCoins[]
8
+ ) => {
6
9
  const results: OptionalKeys<
7
10
  Record<
8
11
  SupportPoolCoins,
@@ -44,7 +47,7 @@ export const getAllAddresses = async (query: ScallopQuery) => {
44
47
 
45
48
  const fields = marketObject.content.fields as any;
46
49
 
47
- const coinTypesPairs = SUPPORT_POOLS.reduce(
50
+ const coinTypesPairs = pools.reduce(
48
51
  (acc, pool) => {
49
52
  acc.push([pool, query.utils.parseCoinType(pool).substring(2)]);
50
53
  return acc;
@@ -133,16 +133,23 @@ export const getPythPrices = async (
133
133
  export const getAllCoinPrices = async (
134
134
  query: ScallopQuery,
135
135
  marketPools?: MarketPools,
136
- coinPrices?: CoinPrices
136
+ coinPrices?: CoinPrices,
137
+ indexer: boolean = false
137
138
  ) => {
138
- coinPrices = coinPrices ?? (await query.utils.getCoinPrices());
139
+ coinPrices =
140
+ coinPrices ??
141
+ (indexer
142
+ ? await query.getCoinPricesByIndexer()
143
+ : await query.utils.getCoinPrices());
144
+
139
145
  marketPools =
140
146
  marketPools ??
141
- (await query.getMarketPools(undefined, { coinPrices })).pools;
147
+ (await query.getMarketPools(undefined, { coinPrices, indexer })).pools;
142
148
 
143
149
  if (!marketPools) {
144
150
  throw new Error(`Failed to fetch market pool for getAllCoinPrices`);
145
151
  }
152
+
146
153
  const sCoinPrices: OptionalKeys<Record<SupportSCoin, number>> = {};
147
154
  SUPPORT_SCOIN.forEach((sCoinName) => {
148
155
  const coinName = query.utils.parseCoinName(sCoinName);
package/src/utils/util.ts CHANGED
@@ -55,10 +55,13 @@ export const parseAssetSymbol = (coinName: SupportCoins): string => {
55
55
  return `w${coinName.slice(1).toUpperCase()}`;
56
56
  }
57
57
  if (isSuiBridgeAsset(coinName)) {
58
- if (coinName.startsWith('sbw') && coinName.length > 3) {
59
- return `sbw${coinName.slice(3).toUpperCase()}`;
58
+ switch (coinName) {
59
+ case 'sbwbtc':
60
+ return 'sbwBTC';
61
+ default: {
62
+ return `sb${coinName.slice(2).toUpperCase()}`;
63
+ }
60
64
  }
61
- return `sb${coinName.slice(2).toUpperCase()}`;
62
65
  }
63
66
  if (isMarketCoin(coinName)) {
64
67
  const assetCoinName = coinName.slice(1).toLowerCase() as SupportAssetCoins;
@@ -71,6 +74,8 @@ export const parseAssetSymbol = (coinName: SupportCoins): string => {
71
74
  return 'haSUI';
72
75
  case 'vsui':
73
76
  return 'vSUI';
77
+ case 'musd':
78
+ return 'mUSD';
74
79
  default:
75
80
  return coinName.toUpperCase();
76
81
  }
@@ -1,12 +0,0 @@
1
- import { Transaction } from '@mysten/sui/transactions';
2
- import { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
3
- import type { ScallopBuilder } from 'src/models';
4
- import type { BorrowIncentiveTxBlock, ScallopTxBlock } from '../types';
5
- /**
6
- * Create an enhanced transaction block instance for interaction with borrow incentive modules of the Scallop contract.
7
- *
8
- * @param builder - Scallop builder instance.
9
- * @param initTxBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
10
- * @return Scallop borrow incentive txBlock.
11
- */
12
- export declare const newBorrowIncentiveTxBlock: (builder: ScallopBuilder, initTxBlock?: ScallopTxBlock | SuiKitTxBlock | Transaction) => BorrowIncentiveTxBlock;
@@ -1,12 +0,0 @@
1
- import { Transaction } from '@mysten/sui/transactions';
2
- import { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
3
- import type { ScallopBuilder } from '../models';
4
- import type { CoreTxBlock, ScallopTxBlock, SuiTxBlockWithSpool } from '../types';
5
- /**
6
- * Create an enhanced transaction block instance for interaction with core modules of the Scallop contract.
7
- *
8
- * @param builder - Scallop builder instance.
9
- * @param initTxBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
10
- * @return Scallop core txBlock.
11
- */
12
- export declare const newCoreTxBlock: (builder: ScallopBuilder, initTxBlock?: ScallopTxBlock | SuiKitTxBlock | Transaction | SuiTxBlockWithSpool) => CoreTxBlock;
@@ -1,12 +0,0 @@
1
- import { Transaction } from '@mysten/sui/transactions';
2
- import { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
3
- import type { ScallopBuilder } from '../models';
4
- import type { ScallopTxBlock } from '../types';
5
- /**
6
- * Create a new ScallopTxBlock instance.
7
- *
8
- * @param builder - Scallop builder instance.
9
- * @param txBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
10
- * @return ScallopTxBlock.
11
- */
12
- export declare const newScallopTxBlock: (builder: ScallopBuilder, initTxBlock?: ScallopTxBlock | SuiKitTxBlock | Transaction) => ScallopTxBlock;
@@ -1,12 +0,0 @@
1
- import { Transaction } from '@mysten/sui/transactions';
2
- import { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
3
- import { ScallopBuilder } from 'src/models';
4
- import { LoyaltyProgramTxBlock, ScallopTxBlock } from 'src/types';
5
- /**
6
- * Create an enhanced transaction block instance for interaction with loyalty program modules of the Scallop contract.
7
- *
8
- * @param builder - Scallop builder instance.
9
- * @param initTxBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
10
- * @return Scallop loyalty program txBlock.
11
- */
12
- export declare const newLoyaltyProgramTxBlock: (builder: ScallopBuilder, initTxBlock?: ScallopTxBlock | SuiKitTxBlock | Transaction) => LoyaltyProgramTxBlock;
@@ -1,14 +0,0 @@
1
- import type { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
2
- import type { ScallopBuilder } from '../models';
3
- import type { SupportAssetCoins } from '../types';
4
- /**
5
- * Update the price of the oracle for multiple coin.
6
- *
7
- * @param builder - The scallop builder.
8
- * @param txBlock - TxBlock created by SuiKit.
9
- * @param assetCoinNames - Specific an array of support asset coin name.
10
- * @param options - The options for update oracles.
11
- */
12
- export declare const updateOracles: (builder: ScallopBuilder, txBlock: SuiKitTxBlock, assetCoinNames?: SupportAssetCoins[], options?: {
13
- usePythPullModel: boolean;
14
- }) => Promise<void>;
@@ -1,12 +0,0 @@
1
- import { ScallopBuilder } from 'src/models';
2
- import { ScallopTxBlock } from 'src/types';
3
- import { SuiTxBlock as SuiKitTxBlock, Transaction } from '@scallop-io/sui-kit';
4
- import { ReferralTxBlock } from 'src/types/builder/referral';
5
- /**
6
- * Create an enhanced transaction block instance for interaction with borrow incentive modules of the Scallop contract.
7
- *
8
- * @param builder - Scallop builder instance.
9
- * @param initTxBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
10
- * @return Scallop referral txBlock.
11
- */
12
- export declare const newReferralTxBlock: (builder: ScallopBuilder, initTxBlock?: ScallopTxBlock | SuiKitTxBlock | Transaction) => ReferralTxBlock;
@@ -1,4 +0,0 @@
1
- import { Transaction, SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
2
- import { ScallopBuilder } from 'src/models';
3
- import { BaseScallopTxBlock, SCoinTxBlock, ScallopTxBlock } from 'src/types';
4
- export declare const newSCoinTxBlock: (builder: ScallopBuilder, initTxBlock?: ScallopTxBlock | SuiKitTxBlock | Transaction | BaseScallopTxBlock) => SCoinTxBlock;
@@ -1,12 +0,0 @@
1
- import { Transaction } from '@mysten/sui/transactions';
2
- import { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
3
- import type { ScallopBuilder } from '../models';
4
- import type { SpoolTxBlock, ScallopTxBlock, SuiTxBlockWithSCoin } from '../types';
5
- /**
6
- * Create an enhanced transaction block instance for interaction with spool modules of the Scallop contract.
7
- *
8
- * @param builder - Scallop builder instance.
9
- * @param initTxBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
10
- * @return Scallop spool txBlock.
11
- */
12
- export declare const newSpoolTxBlock: (builder: ScallopBuilder, initTxBlock?: ScallopTxBlock | SuiKitTxBlock | Transaction | SuiTxBlockWithSCoin) => SpoolTxBlock;
@@ -1,25 +0,0 @@
1
- import { SuiTxBlock, Transaction, SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
2
- import { ScallopBuilder } from '../models';
3
- import type { SuiObjectArg } from '@scallop-io/sui-kit';
4
- import type { ScallopTxBlock, VeScaTxBlock } from 'src/types';
5
- /**
6
- * Check and get veSCA data from transaction block.
7
- *
8
- * @description
9
- * If the veScaKey id is provided, directly return it.
10
- * Otherwise, automatically get veScaKey from the sender.
11
- *
12
- * @param builder - Scallop builder instance.
13
- * @param txBlock - TxBlock created by SuiKit.
14
- * @param veScaKey - veSCA key.
15
- * @return veSCA key, ID, locked amount and unlock at timestamp.
16
- */
17
- export declare const requireVeSca: (builder: ScallopBuilder, SuiTxBlock: SuiTxBlock, veScaKey?: SuiObjectArg | undefined) => Promise<import("src/types").Vesca | undefined>;
18
- /**
19
- * Create an enhanced transaction block instance for interaction with veSCA modules of the Scallop contract.
20
- *
21
- * @param builder - Scallop builder instance.
22
- * @param initTxBlock - Scallop txBlock, txBlock created by SuiKit, or original transaction block.
23
- * @return Scallop borrow incentive txBlock.
24
- */
25
- export declare const newVeScaTxBlock: (builder: ScallopBuilder, initTxBlock?: ScallopTxBlock | SuiKitTxBlock | Transaction) => VeScaTxBlock;
@@ -1,14 +0,0 @@
1
- /**
2
- * Default cache options for the QueryClient.
3
- * @type {QueryClientConfig}
4
- * @description Default cache options for the QueryClient
5
- * We set the default to 5s to prevent duplicate requests from being requested (e.g. query MarketObject, etc.)
6
- */
7
- export declare const DEFAULT_CACHE_OPTIONS: {
8
- defaultOptions: {
9
- queries: {
10
- staleTime: number;
11
- gcTime: number;
12
- };
13
- };
14
- };
@@ -1,2 +0,0 @@
1
- import { SupportPoolCoins } from 'src/types/constant/common';
2
- export declare const COIN_GECKGO_IDS: Record<SupportPoolCoins, string>;
@@ -1,20 +0,0 @@
1
- export declare const API_BASE_URL: "https://sui.apis.scallop.io";
2
- export declare const SDK_API_BASE_URL: "https://sdk.api.scallop.io";
3
- export declare const IS_VE_SCA_TEST: boolean;
4
- export declare const USE_TEST_ADDRESS: boolean;
5
- export declare const ADDRESSES_ID: "65fb07c39c845425d71d7b18" | "675c65cd301dd817ea262e76";
6
- export declare const PROTOCOL_OBJECT_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xefe8b36d5b2e43728cc323298626b83177803521d195cfb11e15b910e892fddf";
7
- export declare const BORROW_FEE_PROTOCOL_ID: "0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778" | "0xc38f849e81cfe46d4e4320f508ea7dda42934a329d5a6571bb4c3cb6ea63f5da";
8
- export declare const SCA_COIN_TYPE: "0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524::sca::SCA" | "0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6::sca::SCA";
9
- export declare const OLD_BORROW_INCENTIVE_PROTOCOL_ID: "0xc63072e7f5f4983a2efaf5bdba1480d5e7d74d57948e1c7cc436f8e22cbeb410";
10
- export declare const SUPPORT_POOLS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fud", "deep", "fdusd", "blub"];
11
- export declare const SUPPORT_COLLATERALS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fdusd"];
12
- export declare const SUPPORT_SPOOLS: readonly ["susdc", "sweth", "ssui", "swusdc", "swusdt", "scetus", "safsui", "shasui", "svsui"];
13
- export declare const SUPPORT_SCOIN: readonly ["susdc", "ssbeth", "ssbusdt", "ssbwbtc", "ssui", "swusdc", "swusdt", "safsui", "shasui", "svsui", "sweth", "ssca", "scetus", "swsol", "swbtc", "sdeep", "sfud", "sfdusd", "sblub"];
14
- export declare const SUPPORT_SUI_BRIDGE: readonly ["sbeth", "sbusdt", "sbwbtc"];
15
- export declare const SUPPORT_WORMHOLE: readonly ["wusdc", "wusdt", "weth", "wbtc", "wapt", "wsol"];
16
- export declare const SUPPORT_SPOOLS_REWARDS: readonly ["sui"];
17
- export declare const SUPPORT_BORROW_INCENTIVE_POOLS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fud", "deep", "fdusd", "blub"];
18
- export declare const SUPPORT_BORROW_INCENTIVE_REWARDS: readonly ["usdc", "sbeth", "sbusdt", "sbwbtc", "weth", "wbtc", "wusdc", "wusdt", "sui", "wapt", "wsol", "cetus", "afsui", "hasui", "vsui", "sca", "fud", "deep", "fdusd", "blub", "susdc", "ssbeth", "ssbusdt", "ssbwbtc", "ssui", "swusdc", "swusdt", "safsui", "shasui", "svsui", "sweth", "ssca", "scetus", "swsol", "swbtc", "sdeep", "sfud", "sfdusd", "sblub"];
19
- export declare const SUPPORT_ORACLES: readonly ["supra", "switchboard", "pyth"];
20
- export declare const SUPPORT_PACKAGES: readonly ["coinDecimalsRegistry", "math", "whitelist", "x", "protocol", "protocolWhitelist", "query", "supra", "pyth", "switchboard", "xOracle", "testCoin"];
@@ -1,14 +0,0 @@
1
- import type * as types from '../types';
2
- export declare const coinDecimals: types.SupportCoinDecimals;
3
- export declare const assetCoins: types.AssetCoins;
4
- export declare const marketCoins: types.MarketCoins;
5
- export declare const sCoins: types.SCoins;
6
- export declare const stakeMarketCoins: types.StakeMarketCoins;
7
- export declare const spoolRewardCoins: types.StakeRewardCoins;
8
- export declare const suiBridgeCoins: types.SuiBridgeCoins;
9
- export declare const coinIds: types.AssetCoinIds;
10
- export declare const wormholeCoinIds: types.WormholeCoinIds;
11
- export declare const voloCoinIds: types.VoloCoinIds;
12
- export declare const sCoinIds: types.SCoinIds;
13
- export declare const sCoinTypeToName: Record<string, "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub">;
14
- export declare const sCoinRawNameToName: Record<string, "susdc" | "ssbeth" | "ssbusdt" | "ssbwbtc" | "sweth" | "swbtc" | "swusdc" | "swusdt" | "ssui" | "swsol" | "scetus" | "safsui" | "shasui" | "svsui" | "ssca" | "sfud" | "sdeep" | "sfdusd" | "sblub">;
@@ -1,2 +0,0 @@
1
- import { OptionalKeys, SupportPoolCoins } from 'src/types';
2
- export declare const FlashLoanFeeObjectMap: OptionalKeys<Record<SupportPoolCoins, string>>;
@@ -1,12 +0,0 @@
1
- export * from './cache';
2
- export * from './coinGecko';
3
- export * from './common';
4
- export * from './enum';
5
- export * from './flashloan';
6
- export * from './poolAddress';
7
- export * from './pyth';
8
- export * from './queryKeys';
9
- export * from './rpc';
10
- export * from './testAddress';
11
- export * from './vesca';
12
- export * from './testAddress';
@@ -1,27 +0,0 @@
1
- import { OptionalKeys, SupportPoolCoins } from 'src/types';
2
- export declare const POOL_ADDRESSES: OptionalKeys<Record<SupportPoolCoins, {
3
- coinName: string;
4
- symbol: string;
5
- coinType: string;
6
- lendingPoolAddress: string;
7
- borrowDynamic: string;
8
- interestModel: string;
9
- borrowFeeKey: string;
10
- coinMetadataId: string;
11
- decimals: number;
12
- pythFeed: string;
13
- pythFeedObjectId: string;
14
- collateralPoolAddress?: string;
15
- riskModel?: string;
16
- supplyLimitKey?: string;
17
- borrowLimitKey?: string;
18
- sCoinType?: string;
19
- sCoinName?: string;
20
- sCoinSymbol?: string;
21
- sCoinMetadataId?: string;
22
- sCoinTreasury?: string;
23
- isolatedAssetKey?: string;
24
- spool?: string;
25
- spoolReward?: string;
26
- spoolName?: string;
27
- }>>;
@@ -1,5 +0,0 @@
1
- import { SupportPoolCoins } from 'src/types';
2
- export declare const PYTH_ENDPOINTS: {
3
- [k in 'mainnet' | 'testnet']: string[];
4
- };
5
- export declare const PYTH_FEED_IDS: Record<SupportPoolCoins, string>;
@@ -1,54 +0,0 @@
1
- import type { GetDynamicFieldObjectParams, GetDynamicFieldsParams, GetOwnedObjectsParams, SuiObjectData, SuiObjectDataOptions } from '@mysten/sui/client';
2
- import type { SuiObjectArg, SuiTxArg } from '@scallop-io/sui-kit';
3
- export declare const queryKeys: {
4
- api: {
5
- getAddresses: (addressesId?: string) => (string | {
6
- addressesId: string | undefined;
7
- })[];
8
- getMarket: () => string[];
9
- getSpools: () => string[];
10
- getBorrowIncentivePool: () => string[];
11
- getTotalValueLocked: () => string[];
12
- };
13
- rpc: {
14
- getInspectTxn: (queryTarget?: string, args?: SuiObjectArg[], typeArgs?: any[]) => (string | {
15
- queryTarget: string | undefined;
16
- args: string;
17
- typeArgs: string | undefined;
18
- })[];
19
- getObject: (objectId?: string, options?: SuiObjectDataOptions) => (string | {
20
- objectId: string | undefined;
21
- options: SuiObjectDataOptions | undefined;
22
- })[];
23
- getObjects: (objectIds?: string[]) => (string | {
24
- objectIds: string;
25
- })[];
26
- getOwnedObjects: (input?: Partial<GetOwnedObjectsParams>) => (string | {
27
- walletAddress: string | undefined;
28
- cursor: string | undefined;
29
- options: SuiObjectDataOptions | undefined;
30
- filter: string;
31
- limit: number | undefined;
32
- })[];
33
- getDynamicFields: (input?: Partial<GetDynamicFieldsParams>) => (string | {
34
- parentId: string | undefined;
35
- cursor: string | undefined;
36
- limit: number | undefined;
37
- })[];
38
- getDynamicFieldObject: (input?: Partial<GetDynamicFieldObjectParams>) => (string | {
39
- parentId: string | undefined;
40
- name: string;
41
- })[];
42
- getTotalVeScaTreasuryAmount: (refreshArgs?: any[], vescaAmountArgs?: (string | SuiObjectData | SuiTxArg)[]) => (string | {
43
- refreshArgs: string;
44
- vescaAmountArgs: string;
45
- })[];
46
- getAllCoinBalances: (owner?: string) => (string | {
47
- owner: string | undefined;
48
- })[];
49
- getNormalizedMoveFunction: (target?: string) => (string | undefined)[];
50
- };
51
- oracle: {
52
- getPythLatestPriceFeeds: () => string[];
53
- };
54
- };
@@ -1 +0,0 @@
1
- export declare const RPC_PROVIDERS: string[];
@@ -1,2 +0,0 @@
1
- import { AddressesInterface } from 'src/types';
2
- export declare const TEST_ADDRESSES: AddressesInterface;
@@ -1,5 +0,0 @@
1
- export declare const UNLOCK_ROUND_DURATION: number;
2
- export declare const MAX_LOCK_ROUNDS: 1460;
3
- export declare const MAX_LOCK_DURATION: number;
4
- export declare const MIN_INITIAL_LOCK_AMOUNT: 10000000000;
5
- export declare const MIN_TOP_UP_AMOUNT: 1000000000;