@scallop-io/sui-scallop-sdk 1.3.4-alpha.3 → 1.3.4-alpha.5

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 (127) hide show
  1. package/dist/builders/borrowIncentiveBuilder.d.ts +12 -0
  2. package/dist/builders/coreBuilder.d.ts +12 -0
  3. package/dist/builders/index.d.ts +12 -0
  4. package/dist/builders/loyaltyProgramBuilder.d.ts +12 -0
  5. package/dist/builders/oracle.d.ts +14 -0
  6. package/dist/builders/referralBuilder.d.ts +12 -0
  7. package/dist/builders/sCoinBuilder.d.ts +4 -0
  8. package/dist/builders/spoolBuilder.d.ts +12 -0
  9. package/dist/builders/vescaBuilder.d.ts +25 -0
  10. package/dist/constants/cache.d.ts +14 -0
  11. package/dist/constants/coinGecko.d.ts +2 -0
  12. package/dist/constants/common.d.ts +20 -0
  13. package/dist/constants/enum.d.ts +14 -0
  14. package/dist/constants/flashloan.d.ts +2 -0
  15. package/dist/constants/index.d.ts +12 -0
  16. package/dist/constants/poolAddress.d.ts +5 -0
  17. package/dist/constants/pyth.d.ts +5 -0
  18. package/dist/constants/queryKeys.d.ts +56 -0
  19. package/dist/constants/rpc.d.ts +1 -0
  20. package/dist/constants/testAddress.d.ts +2 -0
  21. package/dist/constants/tokenBucket.d.ts +2 -0
  22. package/dist/constants/vesca.d.ts +5 -0
  23. package/dist/index.d.ts +3 -0
  24. package/dist/index.js +1462 -1464
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +1461 -1464
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/models/index.d.ts +8 -0
  29. package/dist/models/scallop.d.ts +74 -0
  30. package/dist/models/scallopAddress.d.ts +150 -0
  31. package/dist/models/scallopBuilder.d.ts +89 -0
  32. package/dist/models/scallopCache.d.ts +74 -0
  33. package/dist/models/scallopClient.d.ts +321 -0
  34. package/dist/models/scallopIndexer.d.ts +89 -0
  35. package/dist/models/scallopQuery.d.ts +489 -0
  36. package/dist/models/scallopUtils.d.ts +227 -0
  37. package/dist/models/suiKit.d.ts +2 -0
  38. package/dist/queries/borrowIncentiveQuery.d.ts +61 -0
  39. package/dist/queries/coreQuery.d.ts +167 -0
  40. package/dist/queries/index.d.ts +11 -0
  41. package/dist/queries/isolatedAssetQuery.d.ts +14 -0
  42. package/dist/queries/loyaltyProgramQuery.d.ts +10 -0
  43. package/dist/queries/portfolioQuery.d.ts +73 -0
  44. package/dist/queries/priceQuery.d.ts +16 -0
  45. package/dist/queries/referralQuery.d.ts +7 -0
  46. package/dist/queries/sCoinQuery.d.ts +41 -0
  47. package/dist/queries/spoolQuery.d.ts +70 -0
  48. package/dist/queries/supplyLimitQuery.d.ts +9 -0
  49. package/dist/queries/vescaQuery.d.ts +36 -0
  50. package/dist/test.d.ts +0 -0
  51. package/dist/types/address.d.ts +107 -0
  52. package/dist/types/builder/borrowIncentive.d.ts +35 -0
  53. package/dist/types/builder/core.d.ts +56 -0
  54. package/dist/types/builder/index.d.ts +25 -0
  55. package/dist/types/builder/loyaltyProgram.d.ts +23 -0
  56. package/dist/types/builder/referral.d.ts +30 -0
  57. package/dist/types/builder/sCoin.d.ts +37 -0
  58. package/dist/types/builder/spool.d.ts +29 -0
  59. package/dist/types/builder/vesca.d.ts +51 -0
  60. package/dist/types/constant/common.d.ts +24 -0
  61. package/dist/types/constant/enum.d.ts +48 -0
  62. package/dist/types/constant/index.d.ts +2 -0
  63. package/dist/types/index.d.ts +6 -0
  64. package/dist/types/model.d.ts +54 -0
  65. package/dist/types/query/borrowIncentive.d.ts +124 -0
  66. package/dist/types/query/core.d.ts +361 -0
  67. package/dist/types/query/index.d.ts +7 -0
  68. package/dist/types/query/loyaltyProgram.d.ts +5 -0
  69. package/dist/types/query/portfolio.d.ts +115 -0
  70. package/dist/types/query/sCoin.d.ts +1 -0
  71. package/dist/types/query/spool.d.ts +122 -0
  72. package/dist/types/query/vesca.d.ts +26 -0
  73. package/dist/types/utils.d.ts +21 -0
  74. package/dist/utils/builder.d.ts +15 -0
  75. package/dist/utils/index.d.ts +5 -0
  76. package/dist/utils/indexer.d.ts +17 -0
  77. package/dist/utils/query.d.ts +62 -0
  78. package/dist/utils/tokenBucket.d.ts +11 -0
  79. package/dist/utils/util.d.ts +26 -0
  80. package/package.json +2 -2
  81. package/src/builders/borrowIncentiveBuilder.ts +8 -8
  82. package/src/builders/coreBuilder.ts +5 -5
  83. package/src/builders/index.ts +2 -2
  84. package/src/builders/oracle.ts +4 -4
  85. package/src/builders/referralBuilder.ts +1 -1
  86. package/src/builders/spoolBuilder.ts +6 -6
  87. package/src/builders/vescaBuilder.ts +4 -4
  88. package/src/constants/coinGecko.ts +1 -1
  89. package/src/constants/enum.ts +1 -1
  90. package/src/constants/index.ts +1 -0
  91. package/src/models/scallop.ts +5 -5
  92. package/src/models/scallopAddress.ts +9 -6
  93. package/src/models/scallopBuilder.ts +4 -5
  94. package/src/models/scallopCache.ts +4 -4
  95. package/src/models/scallopClient.ts +4 -4
  96. package/src/models/scallopIndexer.ts +3 -4
  97. package/src/models/scallopQuery.ts +13 -6
  98. package/src/models/scallopUtils.ts +11 -8
  99. package/src/models/suiKit.ts +1 -1
  100. package/src/queries/borrowIncentiveQuery.ts +5 -5
  101. package/src/queries/coreQuery.ts +5 -5
  102. package/src/queries/index.ts +8 -5
  103. package/src/queries/portfolioQuery.ts +4 -4
  104. package/src/queries/priceQuery.ts +2 -2
  105. package/src/queries/spoolQuery.ts +5 -5
  106. package/src/queries/vescaQuery.ts +2 -2
  107. package/src/test.ts +30 -0
  108. package/src/types/address.ts +1 -1
  109. package/src/types/builder/borrowIncentive.ts +3 -3
  110. package/src/types/builder/core.ts +3 -3
  111. package/src/types/builder/index.ts +5 -4
  112. package/src/types/builder/referral.ts +1 -1
  113. package/src/types/builder/sCoin.ts +1 -1
  114. package/src/types/builder/spool.ts +2 -2
  115. package/src/types/constant/common.ts +1 -1
  116. package/src/types/model.ts +2 -2
  117. package/src/types/query/borrowIncentive.ts +2 -2
  118. package/src/types/query/core.ts +1 -1
  119. package/src/types/query/portfolio.ts +2 -2
  120. package/src/types/query/spool.ts +1 -1
  121. package/src/utils/builder.ts +1 -1
  122. package/src/utils/index.ts +2 -2
  123. package/src/utils/query.ts +3 -3
  124. package/src/utils/tokenBucket.ts +1 -1
  125. package/src/utils/util.ts +4 -4
  126. /package/src/queries/{isolatedAsset.ts → isolatedAssetQuery.ts} +0 -0
  127. /package/src/queries/{supplyLimit.ts → supplyLimitQuery.ts} +0 -0
@@ -1,6 +1,6 @@
1
1
  import axios, { AxiosInstance } from 'axios';
2
- import { SDK_API_BASE_URL } from '../constants';
3
- import type {
2
+ import { DEFAULT_CACHE_OPTIONS, SDK_API_BASE_URL } from 'src/constants';
3
+ import {
4
4
  Market,
5
5
  MarketPools,
6
6
  MarketPool,
@@ -20,9 +20,8 @@ import type {
20
20
  BorrowIncentivePoolPoints,
21
21
  SupportBorrowIncentiveRewardCoins,
22
22
  ScallopIndexerInstanceParams,
23
- } from '../types';
23
+ } from 'src/types';
24
24
  import { ScallopCache } from './scallopCache';
25
- import { DEFAULT_CACHE_OPTIONS } from 'src/constants/cache';
26
25
  import { SuiKit } from '@scallop-io/sui-kit';
27
26
  import { queryKeys } from 'src/constants';
28
27
 
@@ -1,5 +1,10 @@
1
1
  import { SuiKit } from '@scallop-io/sui-kit';
2
- import { ADDRESSES_ID, SUPPORT_POOLS, SUPPORT_SPOOLS } from '../constants';
2
+ import {
3
+ ADDRESSES_ID,
4
+ SUPPORT_POOLS,
5
+ SUPPORT_SPOOLS,
6
+ DEFAULT_CACHE_OPTIONS,
7
+ } from 'src/constants';
3
8
  import {
4
9
  queryMarket,
5
10
  getObligations,
@@ -34,7 +39,7 @@ import {
34
39
  getFlashLoanFees,
35
40
  getVeSca,
36
41
  getBorrowIncentivePools,
37
- } from '../queries';
42
+ } from 'src/queries';
38
43
  import {
39
44
  ScallopQueryParams,
40
45
  SupportStakeMarketCoins,
@@ -50,12 +55,11 @@ import {
50
55
  MarketPool,
51
56
  CoinPrices,
52
57
  MarketPools,
53
- } from '../types';
58
+ } from 'src/types';
54
59
  import { ScallopAddress } from './scallopAddress';
55
60
  import { ScallopUtils } from './scallopUtils';
56
61
  import { ScallopIndexer } from './scallopIndexer';
57
62
  import { ScallopCache } from './scallopCache';
58
- import { DEFAULT_CACHE_OPTIONS } from 'src/constants/cache';
59
63
  import { SuiObjectData } from '@mysten/sui/client';
60
64
  import {
61
65
  getSCoinAmount,
@@ -64,9 +68,12 @@ import {
64
68
  getSCoinTotalSupply,
65
69
  } from 'src/queries/sCoinQuery';
66
70
  import { normalizeSuiAddress } from '@mysten/sui/utils';
67
- import { getSupplyLimit } from 'src/queries/supplyLimit';
71
+ import {
72
+ getSupplyLimit,
73
+ getIsolatedAssets,
74
+ isIsolatedAsset,
75
+ } from 'src/queries';
68
76
  import { withIndexerFallback } from 'src/utils/indexer';
69
- import { getIsolatedAssets, isIsolatedAsset } from 'src/queries/isolatedAsset';
70
77
  import { newSuiKit } from './suiKit';
71
78
 
72
79
  /**
@@ -21,8 +21,8 @@ import {
21
21
  COIN_GECKGO_IDS,
22
22
  POOL_ADDRESSES,
23
23
  sCoinTypeToName,
24
- } from '../constants';
25
- import { getPythPrices, queryObligation } from '../queries';
24
+ } from 'src/constants';
25
+ import { getPythPrices, queryObligation } from 'src/queries';
26
26
  import {
27
27
  parseDataFromPythPriceFeed,
28
28
  isMarketCoin,
@@ -30,11 +30,15 @@ import {
30
30
  findClosestUnlockRound,
31
31
  isSuiBridgeAsset,
32
32
  isWormholeAsset,
33
- } from '../utils';
34
- import { PYTH_ENDPOINTS, PYTH_FEED_IDS } from 'src/constants/pyth';
33
+ } from 'src/utils';
34
+ import {
35
+ DEFAULT_CACHE_OPTIONS,
36
+ PYTH_ENDPOINTS,
37
+ PYTH_FEED_IDS,
38
+ queryKeys,
39
+ } from 'src/constants';
35
40
  import { ScallopCache } from './scallopCache';
36
- import { DEFAULT_CACHE_OPTIONS } from 'src/constants/cache';
37
- import type {
41
+ import {
38
42
  ScallopUtilsParams,
39
43
  SupportCoins,
40
44
  SupportAssetCoins,
@@ -48,8 +52,7 @@ import type {
48
52
  SupportSuiBridgeCoins,
49
53
  SupportWormholeCoins,
50
54
  PoolAddressInfo,
51
- } from '../types';
52
- import { queryKeys } from 'src/constants';
55
+ } from 'src/types';
53
56
  import type { SuiObjectArg, SuiTxArg, SuiTxBlock } from '@scallop-io/sui-kit';
54
57
  import { newSuiKit } from './suiKit';
55
58
 
@@ -1,5 +1,5 @@
1
1
  import { SuiKit, SuiKitParams } from '@scallop-io/sui-kit';
2
- import { RPC_PROVIDERS } from 'src/constants/rpc';
2
+ import { RPC_PROVIDERS } from 'src/constants';
3
3
 
4
4
  export const newSuiKit = (params: SuiKitParams) => {
5
5
  return new SuiKit({
@@ -1,12 +1,12 @@
1
1
  import { normalizeStructTag } from '@mysten/sui/utils';
2
- import { SUPPORT_BORROW_INCENTIVE_POOLS } from '../constants';
2
+ import { SUPPORT_BORROW_INCENTIVE_POOLS } from 'src/constants';
3
3
  import {
4
4
  parseOriginBorrowIncentivePoolData,
5
5
  parseOriginBorrowIncentiveAccountData,
6
6
  calculateBorrowIncentivePoolPointData,
7
- } from '../utils';
8
- import type { ScallopAddress, ScallopQuery, ScallopUtils } from '../models';
9
- import type {
7
+ } from 'src/utils';
8
+ import type { ScallopAddress, ScallopQuery, ScallopUtils } from 'src/models';
9
+ import {
10
10
  BorrowIncentivePoolsQueryInterface,
11
11
  BorrowIncentivePools,
12
12
  BorrowIncentiveAccountsQueryInterface,
@@ -17,7 +17,7 @@ import type {
17
17
  OptionalKeys,
18
18
  BorrowIncentivePool,
19
19
  CoinPrices,
20
- } from '../types';
20
+ } from 'src/types';
21
21
  import BigNumber from 'bignumber.js';
22
22
 
23
23
  /**
@@ -6,16 +6,16 @@ import {
6
6
  BORROW_FEE_PROTOCOL_ID,
7
7
  USE_TEST_ADDRESS,
8
8
  FlashLoanFeeObjectMap,
9
- } from '../constants';
9
+ } from 'src/constants';
10
10
  import {
11
11
  parseOriginMarketPoolData,
12
12
  calculateMarketPoolData,
13
13
  parseOriginMarketCollateralData,
14
14
  calculateMarketCollateralData,
15
- } from '../utils';
15
+ } from 'src/utils';
16
16
  import type { SuiObjectResponse, SuiObjectData } from '@mysten/sui/client';
17
17
  import type { SuiObjectArg } from '@scallop-io/sui-kit';
18
- import type { ScallopAddress, ScallopCache, ScallopQuery } from '../models';
18
+ import type { ScallopAddress, ScallopCache, ScallopQuery } from 'src/models';
19
19
  import {
20
20
  Market,
21
21
  MarketPools,
@@ -36,9 +36,9 @@ import {
36
36
  SupportMarketCoins,
37
37
  OptionalKeys,
38
38
  CoinPrices,
39
- } from '../types';
39
+ } from 'src/types';
40
40
  import BigNumber from 'bignumber.js';
41
- import { getSupplyLimit } from './supplyLimit';
41
+ import { getSupplyLimit } from './supplyLimitQuery';
42
42
  // import { isIsolatedAsset } from './isolatedAsset';
43
43
 
44
44
  /**
@@ -1,8 +1,11 @@
1
- export * from './coreQuery';
2
- export * from './spoolQuery';
3
1
  export * from './borrowIncentiveQuery';
4
- export * from './priceQuery';
2
+ export * from './coreQuery';
3
+ export * from './isolatedAssetQuery';
4
+ export * from './loyaltyProgramQuery';
5
5
  export * from './portfolioQuery';
6
- export * from './vescaQuery';
6
+ export * from './priceQuery';
7
7
  export * from './referralQuery';
8
- export * from './loyaltyProgramQuery';
8
+ export * from './sCoinQuery';
9
+ export * from './spoolQuery';
10
+ export * from './supplyLimitQuery';
11
+ export * from './vescaQuery';
@@ -4,10 +4,10 @@ import {
4
4
  SUPPORT_COLLATERALS,
5
5
  SUPPORT_POOLS,
6
6
  SUPPORT_SPOOLS,
7
- } from '../constants';
7
+ } from 'src/constants';
8
8
  import { minBigNumber, estimatedFactor } from 'src/utils';
9
- import type { ScallopQuery } from '../models';
10
- import type {
9
+ import type { ScallopQuery } from 'src/models';
10
+ import {
11
11
  Market,
12
12
  SupportPoolCoins,
13
13
  MarketPool,
@@ -26,7 +26,7 @@ import type {
26
26
  SupportBorrowIncentiveCoins,
27
27
  ObligationBorrowIcentiveReward,
28
28
  SupportBorrowIncentiveRewardCoins,
29
- } from '../types';
29
+ } from 'src/types';
30
30
 
31
31
  /**
32
32
  * Get user lending infomation for specific pools.
@@ -1,6 +1,6 @@
1
1
  import { SuiObjectData } from '@mysten/sui/client';
2
- import type { ScallopAddress } from '../models';
3
- import type { SupportAssetCoins } from '../types';
2
+ import type { ScallopAddress } from 'src/models';
3
+ import { SupportAssetCoins } from 'src/types';
4
4
 
5
5
  /**
6
6
  * Get price from pyth fee object.
@@ -1,15 +1,15 @@
1
1
  import { normalizeStructTag } from '@mysten/sui/utils';
2
- import { SUPPORT_SPOOLS } from '../constants';
2
+ import { SUPPORT_SPOOLS } from 'src/constants';
3
3
  import {
4
4
  parseOriginSpoolData,
5
5
  calculateSpoolData,
6
6
  parseOriginSpoolRewardPoolData,
7
7
  calculateSpoolRewardPoolData,
8
8
  isMarketCoin,
9
- } from '../utils';
9
+ } from 'src/utils';
10
10
  import type { SuiObjectResponse } from '@mysten/sui/client';
11
- import type { ScallopQuery, ScallopUtils } from '../models';
12
- import type {
11
+ import type { ScallopQuery, ScallopUtils } from 'src/models';
12
+ import {
13
13
  MarketPool,
14
14
  Spools,
15
15
  Spool,
@@ -20,7 +20,7 @@ import type {
20
20
  SupportStakeCoins,
21
21
  CoinPrices,
22
22
  MarketPools,
23
- } from '../types';
23
+ } from 'src/types';
24
24
 
25
25
  /**
26
26
  * Get spools data.
@@ -1,17 +1,17 @@
1
1
  import BigNumber from 'bignumber.js';
2
- import { VeScaTreasuryFields, VeScaTreasuryInfo, Vesca } from '../types';
3
2
  import {
4
3
  type SuiObjectResponse,
5
4
  type SuiObjectData,
6
5
  DevInspectResults,
7
6
  } from '@mysten/sui/client';
8
- import type { ScallopUtils } from '../models';
7
+ import type { ScallopUtils } from 'src/models';
9
8
  import { MAX_LOCK_DURATION } from 'src/constants';
10
9
  import { SUI_CLOCK_OBJECT_ID, SuiTxBlock } from '@scallop-io/sui-kit';
11
10
  import { bcs } from '@mysten/sui/bcs';
12
11
  import { z as zod } from 'zod';
13
12
  import { queryKeys } from 'src/constants';
14
13
  import assert from 'assert';
14
+ import { Vesca, VeScaTreasuryFields, VeScaTreasuryInfo } from 'src/types';
15
15
  /**
16
16
  * Query all owned veSca key.
17
17
  *
package/src/test.ts ADDED
@@ -0,0 +1,30 @@
1
+ // import { ScallopQuery } from './models';
2
+ // const main = async () => {
3
+ // try {
4
+ // const query = new ScallopQuery({
5
+ // walletAddress:
6
+ // '0x61819c99588108d9f7710047e6ad8f2da598de8e98a26ea62bd7ad9847f5123c',
7
+ // });
8
+ // await query.init();
9
+ // const { suppliedValue: haSuiLendingValue } =
10
+ // await query.getLending('hasui');
11
+ // const obligations = await query.getObligationAccounts();
12
+
13
+ // const haSuiCollateralUsdValue = Object.values(obligations).reduce(
14
+ // (acc, obligation) => {
15
+ // acc += obligation?.collaterals.hasui?.depositedValue ?? 0;
16
+ // return acc;
17
+ // },
18
+ // 0
19
+ // );
20
+
21
+ // const totalStaked = haSuiCollateralUsdValue + haSuiLendingValue;
22
+ // console.log(totalStaked);
23
+ // } catch (e) {
24
+ // console.error(e);
25
+ // } finally {
26
+ // process.exit(0);
27
+ // }
28
+ // };
29
+
30
+ // main();
@@ -1,4 +1,4 @@
1
- import { SUPPORT_ORACLES } from '../constants';
1
+ import { SUPPORT_ORACLES } from 'src/constants';
2
2
  import type {
3
3
  SupportAssetCoins,
4
4
  SupportOracleType,
@@ -3,11 +3,11 @@ import type {
3
3
  SuiObjectArg,
4
4
  } from '@scallop-io/sui-kit';
5
5
  import type { TransactionResult } from '@mysten/sui/transactions';
6
- import type { ScallopBuilder } from '../../models';
7
- import type {
6
+ import type { ScallopBuilder } from 'src/models';
7
+ import {
8
8
  SupportBorrowIncentiveCoins,
9
9
  SupportBorrowIncentiveRewardCoins,
10
- } from '../constant';
10
+ } from 'src/types';
11
11
 
12
12
  export type BorrowIncentiveIds = {
13
13
  borrowIncentivePkg: string;
@@ -3,12 +3,12 @@ import type {
3
3
  SuiObjectArg,
4
4
  } from '@scallop-io/sui-kit';
5
5
  import type { Argument, TransactionResult } from '@mysten/sui/transactions';
6
- import type { ScallopBuilder } from '../../models';
7
- import type {
6
+ import type { ScallopBuilder } from 'src/models';
7
+ import {
8
8
  SupportCollateralCoins,
9
9
  SupportPoolCoins,
10
10
  SupportAssetCoins,
11
- } from '../constant';
11
+ } from 'src/types';
12
12
  import { SuiTxBlockWithSpool } from '.';
13
13
 
14
14
  export type CoreIds = {
@@ -5,14 +5,15 @@ import type { VeScaTxBlock } from './vesca';
5
5
  import type { ReferralTxBlock } from './referral';
6
6
  import { LoyaltyProgramTxBlock } from './loyaltyProgram';
7
7
  import { SCoinTxBlock } from './sCoin';
8
- import { SupportAssetCoins } from '../constant';
8
+ import { SupportAssetCoins } from 'src/types';
9
9
 
10
- export type * from './core';
11
- export type * from './spool';
12
10
  export type * from './borrowIncentive';
13
- export type * from './vesca';
11
+ export type * from './core';
14
12
  export type * from './loyaltyProgram';
13
+ export type * from './referral';
15
14
  export type * from './sCoin';
15
+ export type * from './spool';
16
+ export type * from './vesca';
16
17
 
17
18
  export type BaseScallopTxBlock = ReferralTxBlock &
18
19
  LoyaltyProgramTxBlock &
@@ -4,7 +4,7 @@ import {
4
4
  SuiTxBlock as SuiKitTxBlock,
5
5
  } from '@scallop-io/sui-kit';
6
6
  import { ScallopBuilder } from 'src/models';
7
- import { SupportPoolCoins } from '../constant';
7
+ import { SupportPoolCoins } from 'src/types';
8
8
 
9
9
  export type ReferralIds = {
10
10
  referralPgkId: string;
@@ -3,7 +3,7 @@ import {
3
3
  SuiTxBlock as SuiKitTxBlock,
4
4
  TransactionResult,
5
5
  } from '@scallop-io/sui-kit';
6
- import { SupportSCoin } from '../constant';
6
+ import { SupportSCoin } from 'src/types';
7
7
  import { ScallopBuilder } from 'src/models';
8
8
  import { BaseScallopTxBlock } from '.';
9
9
 
@@ -4,8 +4,8 @@ import type {
4
4
  SuiObjectArg,
5
5
  } from '@scallop-io/sui-kit';
6
6
  import type { TransactionResult } from '@mysten/sui/transactions';
7
- import type { ScallopBuilder } from '../../models';
8
- import type { SupportStakeMarketCoins } from '../constant';
7
+ import type { ScallopBuilder } from 'src/models';
8
+ import { SupportStakeMarketCoins } from 'src/types';
9
9
  import { SuiTxBlockWithSCoin } from '.';
10
10
 
11
11
  export type SpoolIds = {
@@ -10,7 +10,7 @@ import {
10
10
  SUPPORT_SCOIN,
11
11
  SUPPORT_SUI_BRIDGE,
12
12
  SUPPORT_WORMHOLE,
13
- } from '../../constants';
13
+ } from 'src/constants';
14
14
 
15
15
  type ParseMarketCoins<T extends string> = `s${T}`;
16
16
  type ParseCoins<T extends string> = T extends `s${infer R}` ? R : never;
@@ -7,8 +7,8 @@ import type {
7
7
  ScallopUtils,
8
8
  ScallopBuilder,
9
9
  ScallopIndexer,
10
- } from '../models';
11
- import { ScallopCache } from 'src/models/scallopCache';
10
+ } from 'src/models';
11
+ import { ScallopCache } from 'src/models';
12
12
  import { AddressesInterface } from './address';
13
13
 
14
14
  export type ScallopClientFnReturnType<T extends boolean> = T extends true
@@ -1,7 +1,7 @@
1
- import type {
1
+ import {
2
2
  SupportBorrowIncentiveCoins,
3
3
  SupportBorrowIncentiveRewardCoins,
4
- } from '../constant';
4
+ } from 'src/types';
5
5
 
6
6
  export interface BorrowIncentiveAccountKey {
7
7
  id: string;
@@ -4,7 +4,7 @@ import type {
4
4
  SupportMarketCoins,
5
5
  CoinWrappedType,
6
6
  SupportSCoin,
7
- } from '../constant';
7
+ } from 'src/types';
8
8
 
9
9
  type OptionalKeys<T> = {
10
10
  [K in keyof T]?: T[K];
@@ -1,10 +1,10 @@
1
1
  import type { MarketPool } from './core';
2
2
  import type { Spool } from './spool';
3
- import type {
3
+ import {
4
4
  SupportPoolCoins,
5
5
  SupportCollateralCoins,
6
6
  SupportBorrowIncentiveRewardCoins,
7
- } from '../constant';
7
+ } from 'src/types';
8
8
 
9
9
  type OptionalKeys<T> = {
10
10
  [K in keyof T]?: T[K];
@@ -1,4 +1,4 @@
1
- import type { SupportStakeMarketCoins } from '../constant';
1
+ import { SupportStakeMarketCoins } from 'src/types';
2
2
 
3
3
  type OptionalKeys<T> = {
4
4
  [K in keyof T]?: T[K];
@@ -5,7 +5,7 @@ import {
5
5
  MAX_LOCK_ROUNDS,
6
6
  MIN_INITIAL_LOCK_AMOUNT,
7
7
  MIN_TOP_UP_AMOUNT,
8
- } from '../constants';
8
+ } from 'src/constants';
9
9
  import type { SuiObjectArg } from '@scallop-io/sui-kit';
10
10
 
11
11
  /**
@@ -1,5 +1,5 @@
1
1
  export * from './builder';
2
+ export * from './indexer';
2
3
  export * from './query';
3
- export * from './util';
4
4
  export * from './tokenBucket';
5
- export * from './indexer';
5
+ export * from './util';
@@ -1,7 +1,7 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import { normalizeStructTag, parseStructTag } from '@mysten/sui/utils';
3
- import type { ScallopUtils } from '../models';
4
- import type {
3
+ import type { ScallopUtils } from 'src/models';
4
+ import {
5
5
  OriginMarketPoolData,
6
6
  ParsedMarketPoolData,
7
7
  CalculatedMarketPoolData,
@@ -26,7 +26,7 @@ import type {
26
26
  OriginBorrowIncentiveAccountPoolData,
27
27
  ParsedBorrowIncentiveAccountPoolData,
28
28
  SupportBorrowIncentiveRewardCoins,
29
- } from '../types';
29
+ } from 'src/types';
30
30
 
31
31
  /**
32
32
  * Parse origin market pool data to a more readable format.
@@ -1,4 +1,4 @@
1
- import { DEFAULT_INTERVAL_IN_MS } from 'src/constants/tokenBucket';
1
+ import { DEFAULT_INTERVAL_IN_MS } from 'src/constants';
2
2
 
3
3
  class TokenBucket {
4
4
  private tokensPerInterval: number;
package/src/utils/util.ts CHANGED
@@ -8,16 +8,16 @@ import {
8
8
  SUPPORT_SCOIN,
9
9
  SUPPORT_SUI_BRIDGE,
10
10
  SUPPORT_WORMHOLE,
11
- } from '../constants';
12
- import type { ScallopAddress } from '../models';
13
- import type {
11
+ } from 'src/constants';
12
+ import type { ScallopAddress } from 'src/models';
13
+ import {
14
14
  SupportAssetCoins,
15
15
  SupportCoins,
16
16
  SupportMarketCoins,
17
17
  SupportSCoin,
18
18
  SupportSuiBridgeCoins,
19
19
  SupportWormholeCoins,
20
- } from '../types';
20
+ } from 'src/types';
21
21
 
22
22
  const COIN_SET = Array.from(
23
23
  new Set([