@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,61 +0,0 @@
1
- import type { ScallopAddress, ScallopQuery, ScallopUtils } from '../models';
2
- import type { BorrowIncentivePoolsQueryInterface, SupportBorrowIncentiveCoins, BorrowIncentivePool } from '../types';
3
- /**
4
- * Query borrow incentive pools data using moveCall
5
- * @param address
6
- * @returns
7
- */
8
- export declare const queryBorrowIncentivePools: (address: ScallopAddress) => Promise<BorrowIncentivePoolsQueryInterface | undefined>;
9
- /**
10
- * Get borrow incentive pools data.
11
- *
12
- * @param query - The Scallop query instance.
13
- * @param borrowIncentiveCoinNames - Specific an array of support borrow incentive coin name.
14
- * @param indexer - Whether to use indexer.
15
- * @return Borrow incentive pools data.
16
- */
17
- export declare const getBorrowIncentivePools: (query: ScallopQuery, borrowIncentiveCoinNames?: SupportBorrowIncentiveCoins[], indexer?: boolean) => Promise<{
18
- usdc?: BorrowIncentivePool | undefined;
19
- sbeth?: BorrowIncentivePool | undefined;
20
- weth?: BorrowIncentivePool | undefined;
21
- wusdc?: BorrowIncentivePool | undefined;
22
- wusdt?: BorrowIncentivePool | undefined;
23
- sui?: BorrowIncentivePool | undefined;
24
- afsui?: BorrowIncentivePool | undefined;
25
- hasui?: BorrowIncentivePool | undefined;
26
- vsui?: BorrowIncentivePool | undefined;
27
- sca?: BorrowIncentivePool | undefined;
28
- }>;
29
- /**
30
- * Query borrow incentive accounts data.
31
- *
32
- * @param query - The Scallop query instance.
33
- * @param borrowIncentiveCoinNames - Specific an array of support borrow incentive coin name.
34
- * @return Borrow incentive accounts data.
35
- */
36
- export declare const queryBorrowIncentiveAccounts: ({ utils, }: {
37
- utils: ScallopUtils;
38
- }, obligationId: string, borrowIncentiveCoinNames?: SupportBorrowIncentiveCoins[]) => Promise<{
39
- usdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
40
- sbeth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
41
- weth?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
42
- wusdc?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
43
- wusdt?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
44
- sui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
45
- afsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
46
- hasui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
47
- vsui?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
48
- sca?: import("../types").ParsedBorrowIncentiveAccountData | undefined;
49
- }>;
50
- /**
51
- * Check veSca bind status
52
- * @param query
53
- * @param veScaKey
54
- * @returns
55
- */
56
- export declare const getBindedObligationId: ({ address, }: {
57
- address: ScallopAddress;
58
- }, veScaKeyId: string) => Promise<string | null>;
59
- export declare const getBindedVeScaKey: ({ address, }: {
60
- address: ScallopAddress;
61
- }, obligationId: string) => Promise<string | null>;
@@ -1,167 +0,0 @@
1
- import type { SuiObjectData } from '@mysten/sui/client';
2
- import type { SuiObjectArg } from '@scallop-io/sui-kit';
3
- import type { ScallopAddress, ScallopCache, ScallopQuery } from '../models';
4
- import { Market, MarketPool, MarketCollateral, SupportAssetCoins, SupportPoolCoins, SupportCollateralCoins, ObligationQueryInterface, Obligation, SupportMarketCoins, OptionalKeys } from '../types';
5
- /**
6
- * Query market data.
7
- *
8
- * @description
9
- * Use inspectTxn call to obtain the data provided in the scallop contract query module.
10
- *
11
- * @param query - The Scallop query instance.
12
- * @param indexer - Whether to use indexer.
13
- * @return Market data.
14
- */
15
- export declare const queryMarket: (query: ScallopQuery, indexer?: boolean) => Promise<Market>;
16
- /**
17
- * Get coin market pools data.
18
- *
19
- * @description
20
- * To obtain all market pools information at once, it is recommended to use
21
- * the `queryMarket` method to reduce time consumption.
22
- *
23
- * @param query - The Scallop query instance.
24
- * @param coinNames - Specific an array of support pool coin name.
25
- * @param indexer - Whether to use indexer.
26
- * @return Market pools data.
27
- */
28
- export declare const getMarketPools: (query: ScallopQuery, poolCoinNames?: SupportPoolCoins[], indexer?: boolean) => Promise<{
29
- usdc?: MarketPool | undefined;
30
- sbeth?: MarketPool | undefined;
31
- weth?: MarketPool | undefined;
32
- wbtc?: MarketPool | undefined;
33
- wusdc?: MarketPool | undefined;
34
- wusdt?: MarketPool | undefined;
35
- sui?: MarketPool | undefined;
36
- wapt?: MarketPool | undefined;
37
- wsol?: MarketPool | undefined;
38
- cetus?: MarketPool | undefined;
39
- afsui?: MarketPool | undefined;
40
- hasui?: MarketPool | undefined;
41
- vsui?: MarketPool | undefined;
42
- sca?: MarketPool | undefined;
43
- }>;
44
- /**
45
- * Get market pool data.
46
- *
47
- * @param query - The Scallop query instance.
48
- * @param poolCoinName - Specific support pool coin name.
49
- * @param indexer - Whether to use indexer.
50
- * @param marketObject - The market object.
51
- * @param coinPrice - The coin price.
52
- * @returns Market pool data.
53
- */
54
- export declare const getMarketPool: (query: ScallopQuery, poolCoinName: SupportPoolCoins, indexer?: boolean, marketObject?: SuiObjectData | null, coinPrice?: number) => Promise<MarketPool | undefined>;
55
- /**
56
- * Get coin market collaterals data.
57
- *
58
- * @description
59
- * To obtain all market collaterals information at once, it is recommended to use
60
- * the `queryMarket` method to reduce time consumption.
61
- *
62
- * @param query - The Scallop query instance.
63
- * @param collateralCoinNames - Specific an array of support collateral coin name.
64
- * @param indexer - Whether to use indexer.
65
- * @return Market collaterals data.
66
- */
67
- export declare const getMarketCollaterals: (query: ScallopQuery, collateralCoinNames?: SupportCollateralCoins[], indexer?: boolean) => Promise<{
68
- usdc?: MarketCollateral | undefined;
69
- sbeth?: MarketCollateral | undefined;
70
- weth?: MarketCollateral | undefined;
71
- wbtc?: MarketCollateral | undefined;
72
- wusdc?: MarketCollateral | undefined;
73
- wusdt?: MarketCollateral | undefined;
74
- sui?: MarketCollateral | undefined;
75
- wapt?: MarketCollateral | undefined;
76
- wsol?: MarketCollateral | undefined;
77
- cetus?: MarketCollateral | undefined;
78
- afsui?: MarketCollateral | undefined;
79
- hasui?: MarketCollateral | undefined;
80
- vsui?: MarketCollateral | undefined;
81
- sca?: MarketCollateral | undefined;
82
- }>;
83
- /**
84
- * Get market collateral data.
85
- *
86
- * @param query - The Scallop query instance.
87
- * @param collateralCoinName - Specific support collateral coin name.
88
- * @param indexer - Whether to use indexer.
89
- * @param marketObject - The market object.
90
- * @param coinPrice - The coin price.
91
- * @returns Market collateral data.
92
- */
93
- export declare const getMarketCollateral: (query: ScallopQuery, collateralCoinName: SupportCollateralCoins, indexer?: boolean, marketObject?: SuiObjectData | null, coinPrice?: number) => Promise<MarketCollateral | undefined>;
94
- /**
95
- * Query all owned obligations.
96
- *
97
- * @param query - The Scallop query instance.
98
- * @param ownerAddress - The owner address.
99
- * @return Owned obligations.
100
- */
101
- export declare const getObligations: ({ address, }: {
102
- address: ScallopAddress;
103
- }, ownerAddress: string) => Promise<Obligation[]>;
104
- /**
105
- * Query obligation locked status.
106
- *
107
- * @param query - The Scallop query instance.
108
- * @param obligation - The obligation id or the obligation object.
109
- * @return Obligation locked status.
110
- */
111
- export declare const getObligationLocked: (cache: ScallopCache, obligation: string | SuiObjectData) => Promise<boolean>;
112
- /**
113
- * Query obligation data.
114
- *
115
- * @description
116
- * Use inspectTxn call to obtain the data provided in the scallop contract query module.
117
- *
118
- * @param query - The Scallop query instance.
119
- * @param obligationId - The obligation id.
120
- * @return Obligation data.
121
- */
122
- export declare const queryObligation: ({ address, }: {
123
- address: ScallopAddress;
124
- }, obligationId: SuiObjectArg) => Promise<ObligationQueryInterface | undefined>;
125
- /**
126
- * Query all owned coin amount.
127
- *
128
- * @param query - The Scallop query instance.
129
- * @param assetCoinNames - Specific an array of support asset coin name.
130
- * @param ownerAddress - The owner address.
131
- * @return All owned coin amounts.
132
- */
133
- export declare const getCoinAmounts: (query: ScallopQuery, assetCoinNames?: SupportAssetCoins[], ownerAddress?: string) => Promise<OptionalKeys<Record<SupportAssetCoins, number>>>;
134
- /**
135
- * Query owned coin amount.
136
- *
137
- * @param query - The Scallop query instance.
138
- * @param assetCoinName - Specific support asset coin name.
139
- * @param ownerAddress - The owner address.
140
- * @return Owned coin amount.
141
- */
142
- export declare const getCoinAmount: (query: ScallopQuery, assetCoinName: SupportAssetCoins, ownerAddress?: string) => Promise<number>;
143
- /**
144
- * Query all owned market coins (sCoin) amount.
145
- *
146
- * @param query - The Scallop query instance.
147
- * @param marketCoinNames - Specific an array of support market coin name.
148
- * @param ownerAddress - The owner address.
149
- * @return All owned market coins amount.
150
- */
151
- export declare const getMarketCoinAmounts: (query: ScallopQuery, marketCoinNames?: SupportMarketCoins[], ownerAddress?: string) => Promise<OptionalKeys<Record<SupportMarketCoins, number>>>;
152
- /**
153
- * Query owned market coin (sCoin) amount.
154
- *
155
- * @param query - The Scallop query instance.
156
- * @param marketCoinNames - Specific support market coin name.
157
- * @param ownerAddress - The owner address.
158
- * @return Owned market coin amount.
159
- */
160
- export declare const getMarketCoinAmount: (query: ScallopQuery, marketCoinName: SupportMarketCoins, ownerAddress?: string) => Promise<number>;
161
- /**
162
- * Get flashloan fee for specific asset
163
- * @param query - The Scallop query instance.
164
- * @param assetNames - Specific an array of support pool coin name.
165
- * @returns Record of asset name to flashloan fee in decimal
166
- */
167
- export declare const getFlashLoanFees: (query: ScallopQuery, assetNames: SupportPoolCoins[]) => Promise<Record<SupportPoolCoins, number>>;
@@ -1,8 +0,0 @@
1
- export * from './coreQuery';
2
- export * from './spoolQuery';
3
- export * from './borrowIncentiveQuery';
4
- export * from './priceQuery';
5
- export * from './portfolioQuery';
6
- export * from './vescaQuery';
7
- export * from './referralQuery';
8
- export * from './loyaltyProgramQuery';
@@ -1,14 +0,0 @@
1
- import { ScallopAddress, ScallopUtils } from 'src/models';
2
- import { SupportPoolCoins } from 'src/types';
3
- /**
4
- * Return list of isolated assets coin types
5
- * @param utils ScallopUtils
6
- * @returns list of isolated assets coin types
7
- */
8
- export declare const getIsolatedAssets: (address: ScallopAddress) => Promise<string[]>;
9
- /**
10
- * Check if the coin type is an isolated asset
11
- * @param coinName coin name
12
- * @returns true if the coin type is an isolated asset
13
- */
14
- export declare const isIsolatedAsset: (utils: ScallopUtils, coinName: SupportPoolCoins) => Promise<boolean>;
@@ -1,10 +0,0 @@
1
- import { SuiObjectData } from '@mysten/sui/client';
2
- import { ScallopQuery } from 'src/models';
3
- import { LoyaltyProgramInfo } from 'src/types';
4
- /**
5
- * Get user's loyalty program information and pending rewards if exists
6
- * @param query
7
- * @param veScaKey
8
- * @returns
9
- */
10
- export declare const getLoyaltyProgramInformations: (query: ScallopQuery, veScaKey?: string | SuiObjectData) => Promise<LoyaltyProgramInfo | null>;
@@ -1,73 +0,0 @@
1
- import type { ScallopQuery } from '../models';
2
- import type { Market, SupportPoolCoins, MarketPool, Spool, StakeAccount, Lending, ObligationAccount, CoinAmounts, CoinPrices, TotalValueLocked } from '../types';
3
- /**
4
- * Get user lending infomation for specific pools.
5
- *
6
- * @param query - The ScallopQuery instance.
7
- * @param poolCoinNames - Specific an array of support pool coin name.
8
- * @param ownerAddress - The owner address.
9
- * @param indexer - Whether to use indexer.
10
- * @return User lending infomation for specific pools.
11
- */
12
- export declare const getLendings: (query: ScallopQuery, poolCoinNames?: SupportPoolCoins[], ownerAddress?: string, indexer?: boolean) => Promise<{
13
- usdc?: Lending | undefined;
14
- sbeth?: Lending | undefined;
15
- weth?: Lending | undefined;
16
- wbtc?: Lending | undefined;
17
- wusdc?: Lending | undefined;
18
- wusdt?: Lending | undefined;
19
- sui?: Lending | undefined;
20
- wapt?: Lending | undefined;
21
- wsol?: Lending | undefined;
22
- cetus?: Lending | undefined;
23
- afsui?: Lending | undefined;
24
- hasui?: Lending | undefined;
25
- vsui?: Lending | undefined;
26
- sca?: Lending | undefined;
27
- }>;
28
- /**
29
- * Get user lending infomation for specific pool.
30
- *
31
- * @description
32
- * The lending information includes the spool information extended by it.
33
- *
34
- * @param query - The ScallopQuery instance.
35
- * @param poolCoinName - Specific support coin name.
36
- * @param ownerAddress - The owner address.
37
- * @param indexer - Whether to use indexer.
38
- * @param marketPool - The market pool data.
39
- * @param spool - The spool data.
40
- * @param stakeAccounts - The stake accounts data.
41
- * @param coinAmount - The coin amount.
42
- * @param marketCoinAmount - The market coin amount.
43
- * @return User lending infomation for specific pool.
44
- */
45
- export declare const getLending: (query: ScallopQuery, poolCoinName: SupportPoolCoins, ownerAddress?: string, indexer?: boolean, marketPool?: MarketPool, spool?: Spool, stakeAccounts?: StakeAccount[], coinAmount?: number, marketCoinAmount?: number, coinPrice?: number, sCoinAmount?: number) => Promise<Lending>;
46
- /**
47
- * Get all obligation accounts data.
48
- *
49
- * @param query - The Scallop query instance.
50
- * @param ownerAddress - The owner address.
51
- * @param indexer - Whether to use indexer.
52
- * @return All obligation accounts data.
53
- */
54
- export declare const getObligationAccounts: (query: ScallopQuery, ownerAddress?: string, indexer?: boolean) => Promise<{
55
- [x: string]: ObligationAccount | undefined;
56
- }>;
57
- /**
58
- * Get obligation account data.
59
- *
60
- * @param query - The Scallop query instance.
61
- * @param obligationId - The obligation id.
62
- * @param indexer - Whether to use indexer.
63
- * @return Obligation account data.
64
- */
65
- export declare const getObligationAccount: (query: ScallopQuery, obligationId: string, ownerAddress?: string, indexer?: boolean, market?: Market, coinPrices?: CoinPrices, coinAmounts?: CoinAmounts) => Promise<ObligationAccount>;
66
- /**
67
- * Get total value locked data.
68
- *
69
- * @param query - The Scallop query instance.
70
- * @param indexer - Whether to use indexer.
71
- * @return Total value locked data.
72
- */
73
- export declare const getTotalValueLocked: (query: ScallopQuery, indexer?: boolean) => Promise<TotalValueLocked>;
@@ -1,16 +0,0 @@
1
- import { SuiObjectData } from '@mysten/sui/client';
2
- import type { ScallopAddress } from '../models';
3
- import type { SupportAssetCoins } from '../types';
4
- /**
5
- * Get price from pyth fee object.
6
- *
7
- * @param query - The Scallop query instance.
8
- * @param assetCoinName - Specific support asset coin name.
9
- * @return Asset coin price.
10
- */
11
- export declare const getPythPrice: ({ address, }: {
12
- address: ScallopAddress;
13
- }, assetCoinName: SupportAssetCoins, priceFeedObject?: SuiObjectData | null) => Promise<number>;
14
- export declare const getPythPrices: ({ address, }: {
15
- address: ScallopAddress;
16
- }, assetCoinNames: SupportAssetCoins[]) => Promise<Record<SupportAssetCoins, number>>;
@@ -1,7 +0,0 @@
1
- import { ScallopAddress } from 'src/models';
2
- /**
3
- * Query the veScaKeyId from the referral bindings table using the borrower address
4
- * @param query
5
- * @returns
6
- */
7
- export declare const queryVeScaKeyIdFromReferralBindings: (address: ScallopAddress, refereeAddress: string) => Promise<string | null>;
@@ -1,41 +0,0 @@
1
- import { ScallopQuery, ScallopUtils } from 'src/models';
2
- import { OptionalKeys, SupportSCoin, sCoinBalance } from 'src/types';
3
- /**
4
- * Get total supply of sCoin
5
- * @param query
6
- * @param sCoinName
7
- * @returns `number`
8
- */
9
- export declare const getSCoinTotalSupply: ({ utils, }: {
10
- utils: ScallopUtils;
11
- }, sCoinName: SupportSCoin) => Promise<sCoinBalance>;
12
- /**
13
- * Query all owned sCoin amount.
14
- *
15
- * @param query - The Scallop query instance.
16
- * @param sCoinNames - Specific an array of support sCoin name.
17
- * @param ownerAddress - The owner address.
18
- * @return All owned sCoins amount.
19
- */
20
- export declare const getSCoinAmounts: ({ utils, }: {
21
- utils: ScallopUtils;
22
- }, sCoinNames?: SupportSCoin[], ownerAddress?: string) => Promise<OptionalKeys<Record<"susdc" | "sweth" | "ssui" | "swusdc" | "swusdt" | "scetus" | "safsui" | "shasui" | "svsui" | "ssbeth" | "ssca" | "swsol" | "swbtc", number>>>;
23
- /**
24
- * Query owned sCoin amount.
25
- *
26
- * @param query - The Scallop query instance.
27
- * @param sCoinNames - Specific support sCoin name.
28
- * @param ownerAddress - The owner address.
29
- * @return Owned sCoin amount.
30
- */
31
- export declare const getSCoinAmount: ({ utils, }: {
32
- utils: ScallopUtils;
33
- }, sCoinName: SupportSCoin, ownerAddress?: string) => Promise<number>;
34
- /**
35
- * Get swap rate from sCoin A to sCoin B.
36
- * @param fromSCoin
37
- * @param toSCoin
38
- * @param underlyingCoinPrice - The price of the underlying coin. For example, if fromSCoin is sSUI and toSCoin is sUSDC, then underlyingCoinPrice represents the price of 1 SUI in USDC.
39
- * @returns number
40
- */
41
- export declare const getSCoinSwapRate: (query: ScallopQuery, fromSCoin: SupportSCoin, toSCoin: SupportSCoin, underlyingCoinPrice?: number) => Promise<number>;
@@ -1,70 +0,0 @@
1
- import type { ScallopQuery, ScallopUtils } from '../models';
2
- import type { MarketPool, Spool, StakePool, StakeRewardPool, StakeAccounts, SupportStakeMarketCoins, CoinPrices } from '../types';
3
- /**
4
- * Get spools data.
5
- *
6
- * @param query - The Scallop query instance.
7
- * @param marketCoinNames - Specific an array of support stake market coin name.
8
- * @param indexer - Whether to use indexer.
9
- * @return Spools data.
10
- */
11
- export declare const getSpools: (query: ScallopQuery, stakeMarketCoinNames?: SupportStakeMarketCoins[], indexer?: boolean) => Promise<{
12
- susdc?: Spool | undefined;
13
- sweth?: Spool | undefined;
14
- ssui?: Spool | undefined;
15
- swusdc?: Spool | undefined;
16
- swusdt?: Spool | undefined;
17
- scetus?: Spool | undefined;
18
- safsui?: Spool | undefined;
19
- shasui?: Spool | undefined;
20
- svsui?: Spool | undefined;
21
- }>;
22
- /**
23
- * Get spool data.
24
- *
25
- * @param query - The Scallop query instance.
26
- * @param marketCoinName - Specific support stake market coin name.
27
- * @param indexer - Whether to use indexer.
28
- * @param marketPool - The market pool data.
29
- * @param coinPrices - The coin prices.
30
- * @return Spool data.
31
- */
32
- export declare const getSpool: (query: ScallopQuery, marketCoinName: SupportStakeMarketCoins, indexer?: boolean, marketPool?: MarketPool, coinPrices?: CoinPrices) => Promise<Spool | undefined>;
33
- /**
34
- * Get all stake accounts of the owner.
35
- *
36
- * @param query - The Scallop query instance.
37
- * @param ownerAddress - Owner address.
38
- * @return Stake accounts.
39
- */
40
- export declare const getStakeAccounts: ({ utils, }: {
41
- utils: ScallopUtils;
42
- }, ownerAddress?: string) => Promise<StakeAccounts>;
43
- /**
44
- * Get stake pool data.
45
- *
46
- * @description
47
- * For backward compatible, it is recommended to use `getSpool` method
48
- * to get stake pool info in spool data.
49
- *
50
- * @param query - The Scallop query instance.
51
- * @param marketCoinName - Specific support stake market coin name.
52
- * @return Stake pool data.
53
- */
54
- export declare const getStakePool: ({ utils, }: {
55
- utils: ScallopUtils;
56
- }, marketCoinName: SupportStakeMarketCoins) => Promise<StakePool | undefined>;
57
- /**
58
- * Get stake reward pool of the owner.
59
- *
60
- * @description
61
- * For backward compatible, it is recommended to use `getSpool` method
62
- * to get reward info in spool data.
63
- *
64
- * @param query - The Scallop query instance.
65
- * @param marketCoinName - Specific support stake market coin name.
66
- * @return Stake reward pool.
67
- */
68
- export declare const getStakeRewardPool: ({ utils, }: {
69
- utils: ScallopUtils;
70
- }, marketCoinName: SupportStakeMarketCoins) => Promise<StakeRewardPool | undefined>;
@@ -1,9 +0,0 @@
1
- import { ScallopUtils } from 'src/models';
2
- import { SupportPoolCoins } from 'src/types';
3
- /**
4
- * Return supply limit of a pool (including the decimals)
5
- * @param utils
6
- * @param poolName
7
- * @returns supply limit (decimals included)
8
- */
9
- export declare const getSupplyLimit: (utils: ScallopUtils, poolName: SupportPoolCoins) => Promise<string | null>;
@@ -1,36 +0,0 @@
1
- import { VeScaTreasuryInfo, Vesca } from '../types';
2
- import { type SuiObjectData } from '@mysten/sui/client';
3
- import type { ScallopUtils } from '../models';
4
- /**
5
- * Query all owned veSca key.
6
- *
7
- * @param query - The Scallop query instance.
8
- * @param ownerAddress - The owner address.
9
- * @return Owned veSca key.
10
- */
11
- export declare const getVescaKeys: (utils: ScallopUtils, ownerAddress?: string) => Promise<SuiObjectData[]>;
12
- /**
13
- * Query all owned veSca.
14
- *
15
- * @param query - The Scallop query instance.
16
- * @param ownerAddress - The owner address.
17
- * @return Owned veScas.
18
- */
19
- export declare const getVeScas: ({ utils, }: {
20
- utils: ScallopUtils;
21
- }, ownerAddress: string, excludeEmpty?: boolean) => Promise<Vesca[]>;
22
- /**
23
- * Get veSca data.
24
- *
25
- * @param query - The Scallop query instance.
26
- * @param veScaKey - The vesca key id.
27
- * @param ownerAddress - The owner address.
28
- * @returns Vesca data.
29
- */
30
- export declare const getVeSca: (utils: ScallopUtils, veScaKey: string | SuiObjectData) => Promise<Vesca | undefined>;
31
- /**
32
- * Get veSCA treasury informations
33
- * @param query
34
- * @returns VeScaTreasuryInfo
35
- */
36
- export declare const getVeScaTreasuryInfo: (utils: ScallopUtils) => Promise<VeScaTreasuryInfo | null>;
@@ -1,107 +0,0 @@
1
- import { SUPPORT_ORACLES } from '../constants';
2
- import type { SupportAssetCoins, SupportOracleType, SupportPackageType, SupportSCoin, SupportStakeMarketCoins } from './constant';
3
- export interface AddressesInterface {
4
- core: {
5
- version: string;
6
- versionCap: string;
7
- object: string;
8
- market: string;
9
- adminCap: string;
10
- coinDecimalsRegistry: string;
11
- obligationAccessStore: string;
12
- coins: Partial<Record<SupportAssetCoins, {
13
- id: string;
14
- treasury: string;
15
- metaData: string;
16
- oracle: {
17
- [K in SupportOracleType]: K extends (typeof SUPPORT_ORACLES)[0] ? string : K extends (typeof SUPPORT_ORACLES)[1] ? string : K extends (typeof SUPPORT_ORACLES)[2] ? {
18
- feed: string;
19
- feedObject: string;
20
- } : never;
21
- };
22
- }>>;
23
- oracles: {
24
- [K in SupportOracleType]: K extends (typeof SUPPORT_ORACLES)[0] ? {
25
- registry: string;
26
- registryCap: string;
27
- holder: string;
28
- } : K extends (typeof SUPPORT_ORACLES)[1] ? {
29
- registry: string;
30
- registryCap: string;
31
- } : K extends (typeof SUPPORT_ORACLES)[2] ? {
32
- registry: string;
33
- registryCap: string;
34
- state: string;
35
- wormhole: string;
36
- wormholeState: string;
37
- } : never;
38
- } & {
39
- xOracle: string;
40
- xOracleCap: string;
41
- };
42
- packages: Partial<Record<SupportPackageType, {
43
- id: string;
44
- upgradeCap: string;
45
- }>>;
46
- };
47
- spool: {
48
- id: string;
49
- adminCap: string;
50
- object: string;
51
- config: string;
52
- pools: Partial<Record<SupportStakeMarketCoins, {
53
- id: string;
54
- rewardPoolId: string;
55
- }>>;
56
- };
57
- borrowIncentive: {
58
- id: string;
59
- adminCap: string;
60
- object: string;
61
- query: string;
62
- config: string;
63
- incentivePools: string;
64
- incentiveAccounts: string;
65
- };
66
- vesca: {
67
- id: string;
68
- object: string;
69
- adminCap: string;
70
- tableId: string;
71
- table: string;
72
- treasury: string;
73
- config: string;
74
- };
75
- referral: {
76
- id: string;
77
- version: string;
78
- object: string;
79
- adminCap: string;
80
- referralBindings: string;
81
- bindingTableId: string;
82
- referralRevenuePool: string;
83
- revenueTableId: string;
84
- referralTiers: string;
85
- tiersTableId: string;
86
- authorizedWitnessList: string;
87
- };
88
- loyaltyProgram: {
89
- id: string;
90
- object: string;
91
- rewardPool: string;
92
- userRewardTableId: string;
93
- };
94
- scoin: {
95
- id: string;
96
- coins: Partial<Record<SupportSCoin, {
97
- coinType: string;
98
- treasury: string;
99
- }>>;
100
- };
101
- }
102
- type AddressPathsProps<T> = T extends string ? [] : {
103
- [K in Extract<keyof T, string>]: [K, ...AddressPathsProps<T[K]>];
104
- }[Extract<keyof T, string>];
105
- type Join<T extends string[], D extends string> = T extends [] ? never : T extends [infer F] ? F : T extends [infer F, ...infer R] ? F extends string ? `${F}${D}${Join<Extract<R, string[]>, D>}` : never : string;
106
- export type AddressStringPath = Join<AddressPathsProps<AddressesInterface>, '.'>;
107
- export {};
@@ -1,35 +0,0 @@
1
- import type { SuiTxBlock as SuiKitTxBlock, SuiObjectArg } from '@scallop-io/sui-kit';
2
- import type { TransactionResult } from '@mysten/sui/transactions';
3
- import type { ScallopBuilder } from '../../models';
4
- import type { SupportBorrowIncentiveCoins, SupportBorrowIncentiveRewardCoins } from '../constant';
5
- export type BorrowIncentiveIds = {
6
- borrowIncentivePkg: string;
7
- query: string;
8
- config: string;
9
- incentivePools: string;
10
- incentiveAccounts: string;
11
- obligationAccessStore: string;
12
- };
13
- export type BorrowIncentiveNormalMethods = {
14
- stakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
15
- stakeObligationWithVesca: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, veScaKey: SuiObjectArg) => void;
16
- unstakeObligation: (obligation: SuiObjectArg, obligationKey: SuiObjectArg) => void;
17
- claimBorrowIncentive: (obligation: SuiObjectArg, obligationKey: SuiObjectArg, coinName: SupportBorrowIncentiveCoins, rewardType: SupportBorrowIncentiveRewardCoins) => TransactionResult;
18
- deactivateBoost: (obligation: SuiObjectArg, veScaKey: SuiObjectArg) => void;
19
- };
20
- export type BorrowIncentiveQuickMethods = {
21
- stakeObligationQuick(obligation?: SuiObjectArg, obligationKey?: SuiObjectArg): Promise<void>;
22
- stakeObligationWithVeScaQuick(obligation?: SuiObjectArg, obligationKey?: SuiObjectArg, veScaKey?: SuiObjectArg): Promise<void>;
23
- unstakeObligationQuick(obligation?: SuiObjectArg, obligationKey?: SuiObjectArg): Promise<void>;
24
- claimBorrowIncentiveQuick(coinName: SupportBorrowIncentiveCoins, rewardType: SupportBorrowIncentiveRewardCoins, obligation?: SuiObjectArg, obligationKey?: SuiObjectArg): Promise<TransactionResult>;
25
- };
26
- export type SuiTxBlockWithBorrowIncentiveNormalMethods = SuiKitTxBlock & BorrowIncentiveNormalMethods;
27
- export type BorrowIncentiveTxBlock = SuiTxBlockWithBorrowIncentiveNormalMethods & BorrowIncentiveQuickMethods;
28
- export type GenerateBorrowIncentiveNormalMethod = (params: {
29
- builder: ScallopBuilder;
30
- txBlock: SuiKitTxBlock;
31
- }) => BorrowIncentiveNormalMethods;
32
- export type GenerateBorrowIncentiveQuickMethod = (params: {
33
- builder: ScallopBuilder;
34
- txBlock: SuiTxBlockWithBorrowIncentiveNormalMethods;
35
- }) => BorrowIncentiveQuickMethods;