@scallop-io/sui-scallop-sdk 0.46.55 → 0.46.56

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 (53) hide show
  1. package/dist/constants/common.d.ts +1 -1
  2. package/dist/constants/pyth.d.ts +1 -1
  3. package/dist/index.js +1752 -1602
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1720 -1570
  6. package/dist/index.mjs.map +1 -1
  7. package/dist/models/scallop.d.ts +1 -1
  8. package/dist/models/scallopAddress.d.ts +4 -4
  9. package/dist/models/scallopBuilder.d.ts +2 -2
  10. package/dist/models/scallopCache.d.ts +2 -2
  11. package/dist/models/scallopClient.d.ts +7 -2
  12. package/dist/models/scallopIndexer.d.ts +3 -3
  13. package/dist/models/scallopPrice.d.ts +0 -0
  14. package/dist/models/scallopQuery.d.ts +10 -4
  15. package/dist/models/scallopUtils.d.ts +8 -7
  16. package/dist/queries/borrowIncentiveQuery.d.ts +10 -4
  17. package/dist/queries/coreQuery.d.ts +8 -4
  18. package/dist/queries/priceQuery.d.ts +7 -3
  19. package/dist/queries/referralQuery.d.ts +2 -2
  20. package/dist/queries/sCoinQuery.d.ts +18 -4
  21. package/dist/queries/spoolQuery.d.ts +10 -4
  22. package/dist/queries/vescaQuery.d.ts +7 -5
  23. package/dist/types/builder/vesca.d.ts +2 -1
  24. package/dist/types/model.d.ts +27 -12
  25. package/dist/types/query/core.d.ts +1 -0
  26. package/package.json +1 -1
  27. package/src/builders/borrowIncentiveBuilder.ts +19 -21
  28. package/src/builders/coreBuilder.ts +10 -8
  29. package/src/builders/spoolBuilder.ts +2 -2
  30. package/src/builders/vescaBuilder.ts +12 -4
  31. package/src/constants/common.ts +2 -0
  32. package/src/constants/enum.ts +4 -0
  33. package/src/constants/pyth.ts +2 -2
  34. package/src/models/scallop.ts +14 -20
  35. package/src/models/scallopAddress.ts +15 -5
  36. package/src/models/scallopBuilder.ts +29 -25
  37. package/src/models/scallopCache.ts +2 -2
  38. package/src/models/scallopClient.ts +91 -32
  39. package/src/models/scallopIndexer.ts +15 -8
  40. package/src/models/scallopPrice.ts +0 -0
  41. package/src/models/scallopQuery.ts +47 -25
  42. package/src/models/scallopUtils.ts +75 -74
  43. package/src/queries/borrowIncentiveQuery.ts +40 -29
  44. package/src/queries/coreQuery.ts +38 -24
  45. package/src/queries/portfolioQuery.ts +1 -2
  46. package/src/queries/priceQuery.ts +20 -9
  47. package/src/queries/referralQuery.ts +4 -4
  48. package/src/queries/sCoinQuery.ts +95 -17
  49. package/src/queries/spoolQuery.ts +26 -14
  50. package/src/queries/vescaQuery.ts +32 -26
  51. package/src/types/builder/vesca.ts +8 -1
  52. package/src/types/model.ts +40 -11
  53. package/src/types/query/core.ts +1 -0
@@ -1,11 +1,15 @@
1
1
  import type { SuiTransactionBlockResponse } from '@mysten/sui.js/client';
2
- import type { TransactionBlock } from '@mysten/sui.js/transactions';
2
+ import type {
3
+ TransactionBlock,
4
+ TransactionResult,
5
+ } from '@mysten/sui.js/transactions';
3
6
  import type { SuiKit, SuiKitParams, NetworkType } from '@scallop-io/sui-kit';
4
7
  import type {
5
8
  ScallopAddress,
6
9
  ScallopQuery,
7
10
  ScallopUtils,
8
11
  ScallopBuilder,
12
+ ScallopIndexer,
9
13
  } from '../models';
10
14
  import { ScallopCache } from 'src/models/scallopCache';
11
15
 
@@ -13,13 +17,42 @@ export type ScallopClientFnReturnType<T extends boolean> = T extends true
13
17
  ? SuiTransactionBlockResponse
14
18
  : TransactionBlock;
15
19
 
16
- export type ScallopInstanceParams = {
20
+ export type ScallopClientVeScaReturnType<T extends boolean> = T extends true
21
+ ? SuiTransactionBlockResponse
22
+ : {
23
+ tx: TransactionBlock;
24
+ scaCoin: TransactionResult;
25
+ };
26
+
27
+ export type ScallopBaseInstanceParams = {
17
28
  suiKit?: SuiKit;
29
+ };
30
+
31
+ export type ScallopCacheInstanceParams = ScallopBaseInstanceParams;
32
+
33
+ export type ScallopAddressInstanceParams = ScallopBaseInstanceParams & {
34
+ cache?: ScallopCache;
35
+ };
36
+
37
+ export type ScallopIndexerInstanceParams = {
38
+ cache?: ScallopCache;
39
+ };
40
+
41
+ export type ScallopUtilsInstanceParams = ScallopBaseInstanceParams & {
18
42
  address?: ScallopAddress;
19
- query?: ScallopQuery;
43
+ };
44
+
45
+ export type ScallopQueryInstanceParams = ScallopBaseInstanceParams & {
20
46
  utils?: ScallopUtils;
47
+ indexer?: ScallopIndexer;
48
+ };
49
+
50
+ export type ScallopBuilderInstanceParams = ScallopBaseInstanceParams & {
51
+ query?: ScallopQuery;
52
+ };
53
+
54
+ export type ScallopClientInstanceParams = ScallopBaseInstanceParams & {
21
55
  builder?: ScallopBuilder;
22
- cache: ScallopCache;
23
56
  };
24
57
 
25
58
  export type ScallopAddressParams = {
@@ -30,20 +63,16 @@ export type ScallopAddressParams = {
30
63
 
31
64
  export type ScallopParams = {
32
65
  addressesId?: string;
66
+ walletAddress?: string;
33
67
  } & SuiKitParams;
34
68
 
35
- export type ScallopClientParams = ScallopParams & {
36
- walletAddress?: string;
37
- };
69
+ export type ScallopClientParams = ScallopParams;
38
70
 
39
71
  export type ScallopBuilderParams = ScallopParams & {
40
- walletAddress?: string;
41
72
  pythEndpoints?: string[];
42
73
  };
43
74
 
44
- export type ScallopQueryParams = ScallopParams & {
45
- walletAddress?: string;
46
- };
75
+ export type ScallopQueryParams = ScallopParams;
47
76
 
48
77
  export type ScallopUtilsParams = ScallopParams & {
49
78
  pythEndpoints?: string[];
@@ -125,6 +125,7 @@ export type MarketPool = {
125
125
  symbol: string;
126
126
  coinType: string;
127
127
  marketCoinType: string;
128
+ sCoinType: string;
128
129
  coinWrappedType: CoinWrappedType;
129
130
  coinDecimal: number;
130
131
  coinPrice: number;