@scallop-io/sui-scallop-sdk 1.3.3 → 1.3.4-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 (103) hide show
  1. package/dist/index.js +1258 -1092
  2. package/dist/index.js.map +1 -1
  3. package/dist/index.mjs +1249 -1092
  4. package/dist/index.mjs.map +1 -1
  5. package/package.json +2 -2
  6. package/src/builders/loyaltyProgramBuilder.ts +1 -1
  7. package/src/constants/coinGecko.ts +18 -0
  8. package/src/constants/common.ts +0 -1
  9. package/src/constants/enum.ts +8 -0
  10. package/src/constants/index.ts +6 -0
  11. package/src/constants/poolAddress.ts +94 -0
  12. package/src/constants/pyth.ts +19 -0
  13. package/src/constants/queryKeys.ts +1 -5
  14. package/src/constants/rpc.ts +16 -0
  15. package/src/constants/tokenBucket.ts +1 -1
  16. package/src/models/scallop.ts +3 -2
  17. package/src/models/scallopAddress.ts +2 -2
  18. package/src/models/scallopBuilder.ts +4 -3
  19. package/src/models/scallopCache.ts +1 -1
  20. package/src/models/scallopClient.ts +27 -26
  21. package/src/models/scallopQuery.ts +58 -15
  22. package/src/models/scallopUtils.ts +96 -96
  23. package/src/models/suiKit.ts +11 -0
  24. package/src/queries/borrowIncentiveQuery.ts +6 -13
  25. package/src/queries/coreQuery.ts +37 -22
  26. package/src/queries/loyaltyProgramQuery.ts +1 -1
  27. package/src/queries/portfolioQuery.ts +55 -34
  28. package/src/queries/spoolQuery.ts +17 -17
  29. package/src/types/utils.ts +13 -0
  30. package/src/utils/tokenBucket.ts +2 -1
  31. package/src/utils/util.ts +2 -1
  32. package/dist/builders/borrowIncentiveBuilder.d.ts +0 -12
  33. package/dist/builders/coreBuilder.d.ts +0 -12
  34. package/dist/builders/index.d.ts +0 -12
  35. package/dist/builders/loyaltyProgramBuilder.d.ts +0 -12
  36. package/dist/builders/oracle.d.ts +0 -14
  37. package/dist/builders/referralBuilder.d.ts +0 -12
  38. package/dist/builders/sCoinBuilder.d.ts +0 -4
  39. package/dist/builders/spoolBuilder.d.ts +0 -12
  40. package/dist/builders/vescaBuilder.d.ts +0 -25
  41. package/dist/constants/cache.d.ts +0 -14
  42. package/dist/constants/common.d.ts +0 -20
  43. package/dist/constants/enum.d.ts +0 -13
  44. package/dist/constants/flashloan.d.ts +0 -2
  45. package/dist/constants/index.d.ts +0 -5
  46. package/dist/constants/pyth.d.ts +0 -3
  47. package/dist/constants/queryKeys.d.ts +0 -58
  48. package/dist/constants/testAddress.d.ts +0 -2
  49. package/dist/constants/tokenBucket.d.ts +0 -2
  50. package/dist/constants/vesca.d.ts +0 -5
  51. package/dist/index.d.ts +0 -3
  52. package/dist/models/index.d.ts +0 -8
  53. package/dist/models/scallop.d.ts +0 -74
  54. package/dist/models/scallopAddress.d.ts +0 -150
  55. package/dist/models/scallopBuilder.d.ts +0 -89
  56. package/dist/models/scallopCache.d.ts +0 -74
  57. package/dist/models/scallopClient.d.ts +0 -321
  58. package/dist/models/scallopIndexer.d.ts +0 -89
  59. package/dist/models/scallopPrice.d.ts +0 -0
  60. package/dist/models/scallopQuery.d.ts +0 -474
  61. package/dist/models/scallopUtils.d.ts +0 -217
  62. package/dist/queries/borrowIncentiveQuery.d.ts +0 -61
  63. package/dist/queries/coreQuery.d.ts +0 -167
  64. package/dist/queries/index.d.ts +0 -8
  65. package/dist/queries/isolatedAsset.d.ts +0 -14
  66. package/dist/queries/loyaltyProgramQuery.d.ts +0 -10
  67. package/dist/queries/portfolioQuery.d.ts +0 -73
  68. package/dist/queries/priceQuery.d.ts +0 -16
  69. package/dist/queries/referralQuery.d.ts +0 -7
  70. package/dist/queries/sCoinQuery.d.ts +0 -41
  71. package/dist/queries/spoolQuery.d.ts +0 -70
  72. package/dist/queries/supplyLimit.d.ts +0 -9
  73. package/dist/queries/vescaQuery.d.ts +0 -36
  74. package/dist/types/address.d.ts +0 -107
  75. package/dist/types/builder/borrowIncentive.d.ts +0 -35
  76. package/dist/types/builder/core.d.ts +0 -56
  77. package/dist/types/builder/index.d.ts +0 -24
  78. package/dist/types/builder/loyaltyProgram.d.ts +0 -23
  79. package/dist/types/builder/referral.d.ts +0 -30
  80. package/dist/types/builder/sCoin.d.ts +0 -37
  81. package/dist/types/builder/spool.d.ts +0 -29
  82. package/dist/types/builder/vesca.d.ts +0 -51
  83. package/dist/types/constant/common.d.ts +0 -24
  84. package/dist/types/constant/enum.d.ts +0 -48
  85. package/dist/types/constant/index.d.ts +0 -2
  86. package/dist/types/index.d.ts +0 -6
  87. package/dist/types/model.d.ts +0 -54
  88. package/dist/types/query/borrowIncentive.d.ts +0 -124
  89. package/dist/types/query/core.d.ts +0 -361
  90. package/dist/types/query/index.d.ts +0 -7
  91. package/dist/types/query/loyaltyProgram.d.ts +0 -5
  92. package/dist/types/query/portfolio.d.ts +0 -115
  93. package/dist/types/query/sCoin.d.ts +0 -1
  94. package/dist/types/query/spool.d.ts +0 -122
  95. package/dist/types/query/vesca.d.ts +0 -26
  96. package/dist/types/utils.d.ts +0 -9
  97. package/dist/utils/builder.d.ts +0 -15
  98. package/dist/utils/index.d.ts +0 -5
  99. package/dist/utils/indexer.d.ts +0 -17
  100. package/dist/utils/query.d.ts +0 -62
  101. package/dist/utils/tokenBucket.d.ts +0 -11
  102. package/dist/utils/util.d.ts +0 -26
  103. package/src/models/scallopPrice.ts +0 -0
@@ -1,361 +0,0 @@
1
- import type { SupportPoolCoins, SupportCollateralCoins, SupportMarketCoins, CoinWrappedType, SupportSCoin } from '../constant';
2
- type OptionalKeys<T> = {
3
- [K in keyof T]?: T[K];
4
- };
5
- export type MarketPools = OptionalKeys<Record<SupportPoolCoins, MarketPool>>;
6
- export type MarketCollaterals = OptionalKeys<Record<SupportCollateralCoins, MarketCollateral>>;
7
- export type CoinAmounts = OptionalKeys<Record<SupportPoolCoins, number>>;
8
- export type MarketCoinAmounts = OptionalKeys<Record<SupportMarketCoins, number>>;
9
- export type SCoinAmounts = OptionalKeys<Record<SupportSCoin, number>>;
10
- export type BalanceSheet = {
11
- cash: string;
12
- debt: string;
13
- market_coin_supply: string;
14
- revenue: string;
15
- };
16
- export type BorrowIndex = {
17
- borrow_index: string;
18
- interest_rate: {
19
- fields: {
20
- value: string;
21
- };
22
- };
23
- interest_rate_scale: string;
24
- last_updated: string;
25
- };
26
- export type InterestModel = {
27
- base_borrow_rate_per_sec: {
28
- fields: {
29
- value: string;
30
- };
31
- };
32
- borrow_rate_on_high_kink: {
33
- fields: {
34
- value: string;
35
- };
36
- };
37
- borrow_rate_on_mid_kink: {
38
- fields: {
39
- value: string;
40
- };
41
- };
42
- borrow_weight: {
43
- fields: {
44
- value: string;
45
- };
46
- };
47
- borrow_fee_rate: {
48
- fields: {
49
- value: string;
50
- };
51
- };
52
- high_kink: {
53
- fields: {
54
- value: string;
55
- };
56
- };
57
- interest_rate_scale: string;
58
- max_borrow_rate: {
59
- fields: {
60
- value: string;
61
- };
62
- };
63
- mid_kink: {
64
- fields: {
65
- value: string;
66
- };
67
- };
68
- min_borrow_amount: string;
69
- revenue_factor: {
70
- fields: {
71
- value: string;
72
- };
73
- };
74
- type: {
75
- fields: {
76
- name: string;
77
- };
78
- };
79
- };
80
- export type RiskModel = {
81
- collateral_factor: {
82
- fields: {
83
- value: string;
84
- };
85
- };
86
- liquidation_discount: {
87
- fields: {
88
- value: string;
89
- };
90
- };
91
- liquidation_factor: {
92
- fields: {
93
- value: string;
94
- };
95
- };
96
- liquidation_penalty: {
97
- fields: {
98
- value: string;
99
- };
100
- };
101
- liquidation_revenue_factor: {
102
- fields: {
103
- value: string;
104
- };
105
- };
106
- max_collateral_amount: string;
107
- type: {
108
- fields: {
109
- name: string;
110
- };
111
- };
112
- };
113
- export type CollateralStat = {
114
- amount: string;
115
- };
116
- export type MarketPool = {
117
- coinName: SupportPoolCoins;
118
- symbol: string;
119
- coinType: string;
120
- marketCoinType: string;
121
- sCoinType: string;
122
- coinWrappedType: CoinWrappedType;
123
- coinDecimal: number;
124
- coinPrice: number;
125
- maxSupplyCoin: number;
126
- isIsolated: boolean;
127
- } & Required<Pick<ParsedMarketPoolData, 'highKink' | 'midKink' | 'reserveFactor' | 'borrowWeight' | 'borrowFee' | 'marketCoinSupplyAmount' | 'minBorrowAmount'>> & CalculatedMarketPoolData;
128
- export type MarketCollateral = {
129
- coinName: SupportCollateralCoins;
130
- symbol: string;
131
- coinType: string;
132
- marketCoinType: string;
133
- coinWrappedType: CoinWrappedType;
134
- coinDecimal: number;
135
- coinPrice: number;
136
- } & Required<Pick<ParsedMarketCollateralData, 'collateralFactor' | 'liquidationFactor' | 'liquidationDiscount' | 'liquidationPanelty' | 'liquidationReserveFactor'>> & CalculatedMarketCollateralData;
137
- export type OriginMarketPoolData = {
138
- type: {
139
- name: string;
140
- };
141
- maxBorrowRate: {
142
- value: string;
143
- };
144
- interestRate: {
145
- value: string;
146
- };
147
- interestRateScale: string;
148
- borrowIndex: string;
149
- lastUpdated: string;
150
- cash: string;
151
- debt: string;
152
- marketCoinSupply: string;
153
- reserve: string;
154
- reserveFactor: {
155
- value: string;
156
- };
157
- borrowWeight: {
158
- value: string;
159
- };
160
- borrowFeeRate: {
161
- value: string;
162
- };
163
- baseBorrowRatePerSec: {
164
- value: string;
165
- };
166
- borrowRateOnHighKink: {
167
- value: string;
168
- };
169
- borrowRateOnMidKink: {
170
- value: string;
171
- };
172
- highKink: {
173
- value: string;
174
- };
175
- midKink: {
176
- value: string;
177
- };
178
- minBorrowAmount: string;
179
- };
180
- export type ParsedMarketPoolData = {
181
- coinType: string;
182
- maxBorrowRate: number;
183
- borrowRate: number;
184
- borrowRateScale: number;
185
- borrowIndex: number;
186
- lastUpdated: number;
187
- cashAmount: number;
188
- debtAmount: number;
189
- marketCoinSupplyAmount: number;
190
- reserveAmount: number;
191
- reserveFactor: number;
192
- borrowWeight: number;
193
- borrowFee: number;
194
- baseBorrowRate: number;
195
- borrowRateOnHighKink: number;
196
- borrowRateOnMidKink: number;
197
- highKink: number;
198
- midKink: number;
199
- minBorrowAmount: number;
200
- };
201
- export type CalculatedMarketPoolData = {
202
- baseBorrowApr: number;
203
- baseBorrowApy: number;
204
- borrowAprOnHighKink: number;
205
- borrowApyOnHighKink: number;
206
- borrowAprOnMidKink: number;
207
- borrowApyOnMidKink: number;
208
- maxBorrowApr: number;
209
- maxBorrowApy: number;
210
- borrowApr: number;
211
- borrowApy: number;
212
- borrowIndex: number;
213
- growthInterest: number;
214
- supplyAmount: number;
215
- supplyCoin: number;
216
- borrowAmount: number;
217
- borrowCoin: number;
218
- reserveAmount: number;
219
- reserveCoin: number;
220
- utilizationRate: number;
221
- supplyApr: number;
222
- supplyApy: number;
223
- conversionRate: number;
224
- };
225
- export type OriginMarketCollateralData = {
226
- type: {
227
- name: string;
228
- };
229
- collateralFactor: {
230
- value: string;
231
- };
232
- liquidationFactor: {
233
- value: string;
234
- };
235
- liquidationDiscount: {
236
- value: string;
237
- };
238
- liquidationPanelty: {
239
- value: string;
240
- };
241
- liquidationReserveFactor: {
242
- value: string;
243
- };
244
- maxCollateralAmount: string;
245
- totalCollateralAmount: string;
246
- };
247
- export type ParsedMarketCollateralData = {
248
- coinType: string;
249
- collateralFactor: number;
250
- liquidationFactor: number;
251
- liquidationDiscount: number;
252
- liquidationPanelty: number;
253
- liquidationReserveFactor: number;
254
- maxCollateralAmount: number;
255
- totalCollateralAmount: number;
256
- };
257
- export type CalculatedMarketCollateralData = {
258
- maxDepositAmount: number;
259
- maxDepositCoin: number;
260
- depositAmount: number;
261
- depositCoin: number;
262
- };
263
- export type Market = {
264
- pools: MarketPools;
265
- collaterals: MarketCollaterals;
266
- data?: MarketQueryInterface;
267
- };
268
- export type Obligation = {
269
- id: string;
270
- keyId: string;
271
- locked: boolean;
272
- };
273
- /**
274
- * The query interface for `market_query::market_data` inspectTxn.
275
- */
276
- export interface MarketQueryInterface {
277
- collaterals: {
278
- collateralFactor: {
279
- value: string;
280
- };
281
- liquidationDiscount: {
282
- value: string;
283
- };
284
- liquidationFactor: {
285
- value: string;
286
- };
287
- liquidationPanelty: {
288
- value: string;
289
- };
290
- liquidationReserveFactor: {
291
- value: string;
292
- };
293
- maxCollateralAmount: string;
294
- totalCollateralAmount: string;
295
- type: {
296
- name: string;
297
- };
298
- }[];
299
- pools: {
300
- baseBorrowRatePerSec: {
301
- value: string;
302
- };
303
- borrowRateOnHighKink: {
304
- value: string;
305
- };
306
- borrowRateOnMidKink: {
307
- value: string;
308
- };
309
- maxBorrowRate: {
310
- value: string;
311
- };
312
- highKink: {
313
- value: string;
314
- };
315
- midKink: {
316
- value: string;
317
- };
318
- interestRate: {
319
- value: string;
320
- };
321
- interestRateScale: string;
322
- borrowIndex: string;
323
- lastUpdated: string;
324
- cash: string;
325
- debt: string;
326
- marketCoinSupply: string;
327
- minBorrowAmount: string;
328
- reserve: string;
329
- reserveFactor: {
330
- value: string;
331
- };
332
- borrowWeight: {
333
- value: string;
334
- };
335
- borrowFeeRate: {
336
- value: string;
337
- };
338
- type: {
339
- name: string;
340
- };
341
- }[];
342
- }
343
- /**
344
- * The query interface for `obligation_query::obligation_data` inspectTxn.
345
- */
346
- export interface ObligationQueryInterface {
347
- collaterals: {
348
- type: {
349
- name: string;
350
- };
351
- amount: string;
352
- }[];
353
- debts: {
354
- type: {
355
- name: string;
356
- };
357
- amount: string;
358
- borrowIndex: string;
359
- }[];
360
- }
361
- export {};
@@ -1,7 +0,0 @@
1
- export type * from './core';
2
- export type * from './spool';
3
- export type * from './borrowIncentive';
4
- export type * from './portfolio';
5
- export type * from './vesca';
6
- export type * from './loyaltyProgram';
7
- export type * from './sCoin';
@@ -1,5 +0,0 @@
1
- export type LoyaltyProgramInfo = {
2
- pendingReward: number;
3
- totalPoolReward: number;
4
- isClaimEnabled: boolean;
5
- };
@@ -1,115 +0,0 @@
1
- import type { MarketPool } from './core';
2
- import type { Spool } from './spool';
3
- import type { SupportPoolCoins, SupportCollateralCoins, SupportBorrowIncentiveRewardCoins } from '../constant';
4
- type OptionalKeys<T> = {
5
- [K in keyof T]?: T[K];
6
- };
7
- export type Lendings = OptionalKeys<Record<SupportPoolCoins, Lending>>;
8
- export type ObligationAccounts = OptionalKeys<Record<string, ObligationAccount>>;
9
- export type Lending = Required<Pick<MarketPool, 'coinName' | 'symbol' | 'coinType' | 'marketCoinType' | 'sCoinType' | 'coinDecimal' | 'coinPrice' | 'conversionRate' | 'isIsolated'> & Pick<Spool, 'marketCoinPrice'>> & {
10
- supplyApr: number;
11
- supplyApy: number;
12
- rewardApr: number;
13
- suppliedAmount: number;
14
- suppliedCoin: number;
15
- suppliedValue: number;
16
- stakedMarketAmount: number;
17
- stakedMarketCoin: number;
18
- stakedAmount: number;
19
- stakedCoin: number;
20
- stakedValue: number;
21
- unstakedMarketAmount: number;
22
- unstakedMarketCoin: number;
23
- unstakedAmount: number;
24
- unstakedCoin: number;
25
- unstakedValue: number;
26
- availableSupplyAmount: number;
27
- availableSupplyCoin: number;
28
- availableWithdrawAmount: number;
29
- availableWithdrawCoin: number;
30
- availableStakeAmount: number;
31
- availableStakeCoin: number;
32
- availableUnstakeAmount: number;
33
- availableUnstakeCoin: number;
34
- availableClaimAmount: number;
35
- availableClaimCoin: number;
36
- };
37
- export type ObligationAccount = {
38
- obligationId: string;
39
- totalDepositedValue: number;
40
- totalBorrowedValue: number;
41
- totalBalanceValue: number;
42
- totalBorrowCapacityValue: number;
43
- totalAvailableCollateralValue: number;
44
- totalBorrowedValueWithWeight: number;
45
- totalRequiredCollateralValue: number;
46
- totalUnhealthyCollateralValue: number;
47
- totalRiskLevel: number;
48
- totalDepositedPools: number;
49
- totalBorrowedPools: number;
50
- totalRewardedPools: number;
51
- collaterals: OptionalKeys<Record<SupportCollateralCoins, ObligationCollateral>>;
52
- debts: OptionalKeys<Record<SupportPoolCoins, ObligationDebt>>;
53
- borrowIncentives: OptionalKeys<Record<SupportPoolCoins, ObligationBorrowIncentive>>;
54
- };
55
- export type ObligationCollateral = {
56
- coinName: SupportCollateralCoins;
57
- coinType: string;
58
- symbol: string;
59
- coinDecimal: number;
60
- coinPrice: number;
61
- depositedAmount: number;
62
- depositedCoin: number;
63
- depositedValue: number;
64
- borrowCapacityValue: number;
65
- requiredCollateralValue: number;
66
- availableDepositAmount: number;
67
- availableDepositCoin: number;
68
- availableWithdrawAmount: number;
69
- availableWithdrawCoin: number;
70
- };
71
- export type ObligationDebt = {
72
- coinName: SupportPoolCoins;
73
- coinType: string;
74
- symbol: string;
75
- coinDecimal: number;
76
- coinPrice: number;
77
- borrowedAmount: number;
78
- borrowedCoin: number;
79
- borrowedValue: number;
80
- borrowedValueWithWeight: number;
81
- borrowIndex: number;
82
- requiredRepayAmount: number;
83
- requiredRepayCoin: number;
84
- availableBorrowAmount: number;
85
- availableBorrowCoin: number;
86
- availableRepayAmount: number;
87
- availableRepayCoin: number;
88
- };
89
- export type ObligationBorrowIcentiveReward = {
90
- coinName: SupportBorrowIncentiveRewardCoins;
91
- coinType: string;
92
- symbol: string;
93
- coinDecimal: number;
94
- coinPrice: number;
95
- availableClaimCoin: number;
96
- availableClaimAmount: number;
97
- boostValue: number;
98
- };
99
- export type ObligationBorrowIncentive = {
100
- coinName: SupportPoolCoins;
101
- coinType: string;
102
- symbol: string;
103
- coinDecimal: number;
104
- coinPrice: number;
105
- rewards: ObligationBorrowIcentiveReward[];
106
- };
107
- export type TotalValueLocked = {
108
- supplyValue: number;
109
- borrowValue: number;
110
- totalValue: number;
111
- supplyValueChangeRatio?: number;
112
- borrowValueChangeRatio?: number;
113
- totalValueChangeRatio?: number;
114
- };
115
- export {};
@@ -1 +0,0 @@
1
- export type sCoinBalance = number;
@@ -1,122 +0,0 @@
1
- import type { SupportStakeMarketCoins } from '../constant';
2
- type OptionalKeys<T> = {
3
- [K in keyof T]?: T[K];
4
- };
5
- export type Spools = OptionalKeys<Record<SupportStakeMarketCoins, Spool>>;
6
- export type Spool = {
7
- marketCoinName: SupportStakeMarketCoins;
8
- symbol: string;
9
- coinType: string;
10
- marketCoinType: string;
11
- rewardCoinType: string;
12
- sCoinType: string;
13
- coinDecimal: number;
14
- rewardCoinDecimal: number;
15
- coinPrice: number;
16
- marketCoinPrice: number;
17
- rewardCoinPrice: number;
18
- } & Required<Pick<ParsedSpoolData, 'maxPoint' | 'distributedPoint' | 'maxStake'>> & CalculatedSpoolData & SpoolRewardPool;
19
- export type OriginSpoolData = {
20
- stakeType: {
21
- fields: {
22
- name: string;
23
- };
24
- };
25
- maxDistributedPoint: string;
26
- distributedPoint: string;
27
- distributedPointPerPeriod: string;
28
- pointDistributionTime: string;
29
- maxStake: string;
30
- stakes: string;
31
- index: string;
32
- createdAt: string;
33
- lastUpdate: string;
34
- };
35
- export type ParsedSpoolData = {
36
- stakeType: string;
37
- maxPoint: number;
38
- distributedPoint: number;
39
- pointPerPeriod: number;
40
- period: number;
41
- maxStake: number;
42
- staked: number;
43
- index: number;
44
- createdAt: number;
45
- lastUpdate: number;
46
- };
47
- export type CalculatedSpoolData = {
48
- stakedAmount: number;
49
- stakedCoin: number;
50
- stakedValue: number;
51
- distributedPointPerSec: number;
52
- accumulatedPoints: number;
53
- currentPointIndex: number;
54
- currentTotalDistributedPoint: number;
55
- startDate: Date;
56
- endDate: Date;
57
- };
58
- export type SpoolRewardPool = Required<Pick<ParsedSpoolRewardPoolData, 'exchangeRateNumerator' | 'exchangeRateDenominator'>> & CalculatedSpoolRewardPoolData;
59
- export type OriginSpoolRewardPoolData = {
60
- claimed_rewards: string;
61
- exchange_rate_denominator: string;
62
- exchange_rate_numerator: string;
63
- rewards: string;
64
- spool_id: string;
65
- };
66
- export type ParsedSpoolRewardPoolData = {
67
- claimedRewards: number;
68
- exchangeRateDenominator: number;
69
- exchangeRateNumerator: number;
70
- rewards: number;
71
- spoolId: string;
72
- };
73
- export type CalculatedSpoolRewardPoolData = {
74
- rewardApr: number;
75
- totalRewardAmount: number;
76
- totalRewardCoin: number;
77
- totalRewardValue: number;
78
- remaindRewardAmount: number;
79
- remaindRewardCoin: number;
80
- remaindRewardValue: number;
81
- claimedRewardAmount: number;
82
- claimedRewardCoin: number;
83
- claimedRewardValue: number;
84
- rewardPerSec: number;
85
- };
86
- export type StakePools = OptionalKeys<Record<SupportStakeMarketCoins, StakePool>>;
87
- export type StakeRewardPools = OptionalKeys<Record<SupportStakeMarketCoins, StakeRewardPool>>;
88
- export type StakeAccounts = Record<SupportStakeMarketCoins, StakeAccount[]>;
89
- export interface StakeAccount {
90
- id: string;
91
- type: string;
92
- stakePoolId: string;
93
- stakeType: string;
94
- staked: number;
95
- index: number;
96
- points: number;
97
- totalPoints: number;
98
- }
99
- export interface StakePool {
100
- id: string;
101
- type: string;
102
- maxPoint: number;
103
- distributedPoint: number;
104
- pointPerPeriod: number;
105
- period: number;
106
- maxStake: number;
107
- stakeType: string;
108
- totalStaked: number;
109
- index: number;
110
- createdAt: number;
111
- lastUpdate: number;
112
- }
113
- export interface StakeRewardPool {
114
- id: string;
115
- type: string;
116
- stakePoolId: string;
117
- ratioDenominator: number;
118
- ratioNumerator: number;
119
- rewards: number;
120
- claimedRewards: number;
121
- }
122
- export {};
@@ -1,26 +0,0 @@
1
- import type { SuiObjectRef } from '@mysten/sui/client';
2
- export type Vesca = {
3
- id: string;
4
- keyId: string;
5
- keyObject?: SuiObjectRef;
6
- object: SuiObjectRef;
7
- lockedScaAmount: string;
8
- lockedScaCoin: number;
9
- currentVeScaBalance: number;
10
- unlockAt: number;
11
- };
12
- export type VeScaTreasuryFields = {
13
- total_ve_sca_amount: string;
14
- sca_balance: string;
15
- unlock_schedule: {
16
- fields: {
17
- locked_sca_amount: string;
18
- };
19
- };
20
- };
21
- export type VeScaTreasuryInfo = {
22
- totalLockedSca: number;
23
- totalVeSca: number;
24
- averageLockingPeriod: number;
25
- averageLockingPeriodUnit: string;
26
- };
@@ -1,9 +0,0 @@
1
- import type { SupportAssetCoins } from './constant';
2
- export type OptionalKeys<T> = {
3
- [K in keyof T]?: T[K];
4
- };
5
- export type CoinPrices = OptionalKeys<Record<SupportAssetCoins, number>>;
6
- export type PriceMap = Map<SupportAssetCoins, {
7
- price: number;
8
- publishTime: number;
9
- }>;
@@ -1,15 +0,0 @@
1
- import type { SuiTxBlock as SuiKitTxBlock } from '@scallop-io/sui-kit';
2
- import type { SuiObjectArg } from '@scallop-io/sui-kit';
3
- /**
4
- * Check and get the sender from the transaction block.
5
- *
6
- * @param txBlock - TxBlock created by SuiKit.
7
- * @return Sender of transaction.
8
- */
9
- export declare const requireSender: (txBlock: SuiKitTxBlock) => string;
10
- export declare const checkVesca: (prevUnlockAtInMillisTimestamp?: number) => void;
11
- export declare const checkVescaExpired: (prevUnlockAtInMillisTimestamp: number) => void;
12
- export declare const checkExtendLockPeriod: (lockPeriodInDays: number, newUnlockAtInSecondTimestamp: number, prevUnlockAtInMillisTimestamp?: number) => void;
13
- export declare const checkLockSca: (scaAmountOrCoin: number | SuiObjectArg | undefined, lockPeriodInDays?: number, newUnlockAtInSecondTimestamp?: number, prevUnlockAtInMillisTimestamp?: number) => void;
14
- export declare const checkExtendLockAmount: (scaAmount: number, prevUnlockAtInMillisTimestamp?: number) => void;
15
- export declare const checkRenewExpiredVeSca: (scaAmount: number, lockPeriodInDays: number, prevUnlockAtInMillisTimestamp?: number) => void;
@@ -1,5 +0,0 @@
1
- export * from './builder';
2
- export * from './query';
3
- export * from './util';
4
- export * from './tokenBucket';
5
- export * from './indexer';
@@ -1,17 +0,0 @@
1
- /**
2
- * Generic wrapper for methods with indexer fallback.
3
- *
4
- * @param method - The method to call with fallback behavior.
5
- * @param context - The context (`this`) of the class instance.
6
- * @param args - The arguments to pass to the method.
7
- * @returns The result of the method call.
8
- */
9
- export declare function callMethodWithIndexerFallback(method: Function, context: any, ...args: any[]): Promise<any>;
10
- /**
11
- * This function creates a wrapper for methods that have an indexer parameter.
12
- * It ensures fallback behavior if indexer fails.
13
- *
14
- * @param method - The method to wrap.
15
- * @returns A function that applies indexer fallback.
16
- */
17
- export declare function withIndexerFallback(method: Function): (...args: any[]) => Promise<any>;