@scallop-io/sui-scallop-sdk 0.47.3 → 1.3.0-alpha.1

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 (67) hide show
  1. package/dist/builders/borrowIncentiveBuilder.d.ts +2 -2
  2. package/dist/builders/coreBuilder.d.ts +2 -2
  3. package/dist/builders/index.d.ts +2 -2
  4. package/dist/builders/loyaltyProgramBuilder.d.ts +2 -2
  5. package/dist/builders/referralBuilder.d.ts +2 -2
  6. package/dist/builders/sCoinBuilder.d.ts +2 -2
  7. package/dist/builders/spoolBuilder.d.ts +2 -2
  8. package/dist/builders/vescaBuilder.d.ts +2 -2
  9. package/dist/constants/common.d.ts +4 -4
  10. package/dist/constants/index.d.ts +1 -1
  11. package/dist/constants/vesca.d.ts +3 -3
  12. package/dist/index.js +87 -71
  13. package/dist/index.js.map +1 -1
  14. package/dist/index.mjs +90 -77
  15. package/dist/index.mjs.map +1 -1
  16. package/dist/models/scallopBuilder.d.ts +10 -8
  17. package/dist/models/scallopCache.d.ts +5 -9
  18. package/dist/models/scallopClient.d.ts +2 -2
  19. package/dist/models/scallopQuery.d.ts +1 -1
  20. package/dist/models/scallopUtils.d.ts +2 -2
  21. package/dist/queries/coreQuery.d.ts +3 -3
  22. package/dist/queries/loyaltyProgramQuery.d.ts +1 -1
  23. package/dist/queries/priceQuery.d.ts +1 -1
  24. package/dist/queries/vescaQuery.d.ts +1 -1
  25. package/dist/test.d.ts +1 -0
  26. package/dist/types/builder/borrowIncentive.d.ts +1 -1
  27. package/dist/types/builder/core.d.ts +16 -16
  28. package/dist/types/builder/spool.d.ts +3 -3
  29. package/dist/types/builder/vesca.d.ts +5 -5
  30. package/dist/types/model.d.ts +4 -4
  31. package/dist/types/query/vesca.d.ts +1 -1
  32. package/dist/utils/query.d.ts +1 -1
  33. package/dist/utils/util.d.ts +1 -0
  34. package/package.json +13 -9
  35. package/src/builders/borrowIncentiveBuilder.ts +6 -6
  36. package/src/builders/coreBuilder.ts +15 -15
  37. package/src/builders/index.ts +2 -2
  38. package/src/builders/loyaltyProgramBuilder.ts +5 -5
  39. package/src/builders/oracle.ts +5 -4
  40. package/src/builders/referralBuilder.ts +6 -6
  41. package/src/builders/sCoinBuilder.ts +5 -8
  42. package/src/builders/spoolBuilder.ts +9 -9
  43. package/src/builders/vescaBuilder.ts +5 -5
  44. package/src/constants/common.ts +4 -4
  45. package/src/constants/index.ts +1 -1
  46. package/src/constants/vesca.ts +5 -6
  47. package/src/models/scallopBuilder.ts +14 -7
  48. package/src/models/scallopCache.ts +43 -34
  49. package/src/models/scallopClient.ts +8 -6
  50. package/src/models/scallopQuery.ts +2 -2
  51. package/src/models/scallopUtils.ts +3 -3
  52. package/src/queries/borrowIncentiveQuery.ts +1 -1
  53. package/src/queries/coreQuery.ts +4 -4
  54. package/src/queries/loyaltyProgramQuery.ts +1 -1
  55. package/src/queries/priceQuery.ts +1 -1
  56. package/src/queries/sCoinQuery.ts +2 -2
  57. package/src/queries/spoolQuery.ts +4 -5
  58. package/src/queries/vescaQuery.ts +6 -3
  59. package/src/test.ts +26 -0
  60. package/src/types/address.ts +26 -26
  61. package/src/types/builder/borrowIncentive.ts +1 -1
  62. package/src/types/builder/core.ts +26 -28
  63. package/src/types/builder/spool.ts +2 -3
  64. package/src/types/builder/vesca.ts +5 -9
  65. package/src/types/model.ts +4 -7
  66. package/src/types/query/vesca.ts +1 -1
  67. package/src/utils/query.ts +1 -1
@@ -1,13 +1,11 @@
1
1
  import type {
2
2
  SuiTxBlock as SuiKitTxBlock,
3
- SuiAddressArg,
4
3
  SuiObjectArg,
5
- SuiTxArg,
6
4
  } from '@scallop-io/sui-kit';
7
5
  import type {
8
6
  TransactionArgument,
9
7
  TransactionResult,
10
- } from '@mysten/sui.js/transactions';
8
+ } from '@mysten/sui/transactions';
11
9
  import type { ScallopBuilder } from '../../models';
12
10
  import type {
13
11
  SupportCollateralCoins,
@@ -35,19 +33,19 @@ type ObligationHotPotato = NestedResult;
35
33
  export type CoreNormalMethods = {
36
34
  openObligation: () => [Obligation, ObligationKey, ObligationHotPotato];
37
35
  returnObligation: (
38
- obligation: SuiAddressArg,
36
+ obligation: SuiObjectArg,
39
37
  obligationHotPotato: SuiObjectArg
40
38
  ) => void;
41
39
  openObligationEntry: () => void;
42
40
  addCollateral: (
43
- obligation: SuiAddressArg,
41
+ obligation: SuiObjectArg,
44
42
  coin: SuiObjectArg,
45
43
  collateralCoinName: SupportCollateralCoins
46
44
  ) => void;
47
45
  takeCollateral: (
48
- obligation: SuiAddressArg,
49
- obligationKey: SuiAddressArg,
50
- amount: SuiTxArg,
46
+ obligation: SuiObjectArg,
47
+ obligationKey: SuiObjectArg,
48
+ amount: number,
51
49
  collateralCoinName: SupportCollateralCoins
52
50
  ) => TransactionResult;
53
51
  deposit: (
@@ -64,36 +62,36 @@ export type CoreNormalMethods = {
64
62
  poolCoinName: SupportPoolCoins
65
63
  ) => void;
66
64
  borrow: (
67
- obligation: SuiAddressArg,
68
- obligationKey: SuiAddressArg,
69
- amount: SuiTxArg,
65
+ obligation: SuiObjectArg,
66
+ obligationKey: SuiObjectArg,
67
+ amount: number,
70
68
  poolCoinName: SupportPoolCoins
71
69
  ) => TransactionResult;
72
70
  borrowWithReferral: (
73
- obligation: SuiAddressArg,
74
- obligationKey: SuiAddressArg,
71
+ obligation: SuiObjectArg,
72
+ obligationKey: SuiObjectArg,
75
73
  borrowReferral: SuiObjectArg,
76
- amount: SuiTxArg,
74
+ amount: number,
77
75
  poolCoinName: SupportPoolCoins
78
76
  ) => TransactionResult;
79
77
  borrowEntry: (
80
- obligation: SuiAddressArg,
81
- obligationKey: SuiAddressArg,
82
- amount: SuiTxArg,
78
+ obligation: SuiObjectArg,
79
+ obligationKey: SuiObjectArg,
80
+ amount: number,
83
81
  poolCoinName: SupportPoolCoins
84
82
  ) => void;
85
83
  repay: (
86
- obligation: SuiAddressArg,
84
+ obligation: SuiObjectArg,
87
85
  coin: SuiObjectArg,
88
86
  poolCoinName: SupportPoolCoins
89
87
  ) => void;
90
88
  borrowFlashLoan: (
91
- amount: SuiTxArg,
89
+ amount: number,
92
90
  poolCoinName: SupportPoolCoins
93
91
  ) => TransactionResult;
94
92
  repayFlashLoan: (
95
93
  coin: SuiObjectArg,
96
- loan: SuiAddressArg,
94
+ loan: SuiObjectArg,
97
95
  poolCoinName: SupportPoolCoins
98
96
  ) => void;
99
97
  };
@@ -102,26 +100,26 @@ export type CoreQuickMethods = {
102
100
  addCollateralQuick: (
103
101
  amount: number,
104
102
  collateralCoinName: SupportCollateralCoins,
105
- obligationId?: SuiAddressArg
103
+ obligationId?: SuiObjectArg
106
104
  ) => Promise<void>;
107
105
  takeCollateralQuick: (
108
106
  amount: number,
109
107
  collateralCoinName: SupportCollateralCoins,
110
- obligationId?: SuiAddressArg,
111
- obligationKey?: SuiAddressArg
108
+ obligationId?: SuiObjectArg,
109
+ obligationKey?: SuiObjectArg
112
110
  ) => Promise<TransactionResult>;
113
111
  borrowQuick: (
114
112
  amount: number,
115
113
  poolCoinName: SupportPoolCoins,
116
- obligationId?: SuiAddressArg,
117
- obligationKey?: SuiAddressArg
114
+ obligationId?: SuiObjectArg,
115
+ obligationKey?: SuiObjectArg
118
116
  ) => Promise<TransactionResult>;
119
117
  borrowWithReferralQuick: (
120
118
  amount: number,
121
119
  poolCoinName: SupportPoolCoins,
122
120
  borrowReferral: SuiObjectArg,
123
- obligationId?: SuiAddressArg,
124
- obligationKey?: SuiAddressArg
121
+ obligationId?: SuiObjectArg,
122
+ obligationKey?: SuiObjectArg
125
123
  ) => Promise<TransactionResult>;
126
124
  depositQuick: (
127
125
  amount: number,
@@ -135,7 +133,7 @@ export type CoreQuickMethods = {
135
133
  repayQuick: (
136
134
  amount: number,
137
135
  poolCoinName: SupportPoolCoins,
138
- obligationId?: SuiAddressArg
136
+ obligationId?: SuiObjectArg
139
137
  ) => Promise<void>;
140
138
  updateAssetPricesQuick: (
141
139
  assetCoinNames?: SupportAssetCoins[]
@@ -2,9 +2,8 @@ import type {
2
2
  SuiTxBlock as SuiKitTxBlock,
3
3
  SuiAddressArg,
4
4
  SuiObjectArg,
5
- SuiTxArg,
6
5
  } from '@scallop-io/sui-kit';
7
- import type { TransactionResult } from '@mysten/sui.js/transactions';
6
+ import type { TransactionResult } from '@mysten/sui/transactions';
8
7
  import type { ScallopBuilder } from '../../models';
9
8
  import type { SupportStakeMarketCoins } from '../constant';
10
9
  import { SuiTxBlockWithSCoin } from '.';
@@ -24,7 +23,7 @@ export type SpoolNormalMethods = {
24
23
  ) => void;
25
24
  unstake: (
26
25
  stakeAccount: SuiAddressArg,
27
- amount: SuiTxArg,
26
+ amount: number,
28
27
  stakeMarketCoinName: SupportStakeMarketCoins
29
28
  ) => TransactionResult;
30
29
  claim: (
@@ -1,9 +1,5 @@
1
- import {
2
- SuiTxBlock as SuiKitTxBlock,
3
- SuiObjectArg,
4
- SuiTxArg,
5
- } from '@scallop-io/sui-kit';
6
- import type { TransactionResult } from '@mysten/sui.js/transactions';
1
+ import { SuiTxBlock as SuiKitTxBlock, SuiObjectArg } from '@scallop-io/sui-kit';
2
+ import type { TransactionResult } from '@mysten/sui/transactions';
7
3
  import { ScallopBuilder } from 'src/models';
8
4
 
9
5
  export type VescaIds = {
@@ -16,17 +12,17 @@ export type VescaIds = {
16
12
  export type VeScaNormalMethods = {
17
13
  lockSca: (
18
14
  scaCoin: SuiObjectArg,
19
- unlockAtInSecondTimestamp: SuiTxArg
15
+ unlockAtInSecondTimestamp: number
20
16
  ) => TransactionResult;
21
17
  extendLockPeriod: (
22
18
  veScaKey: SuiObjectArg,
23
- newUnlockAtInSecondTimestamp: SuiTxArg
19
+ newUnlockAtInSecondTimestamp: number
24
20
  ) => void;
25
21
  extendLockAmount: (veScaKey: SuiObjectArg, scaCoin: SuiObjectArg) => void;
26
22
  renewExpiredVeSca: (
27
23
  veScaKey: SuiObjectArg,
28
24
  scaCoin: SuiObjectArg,
29
- newUnlockAtInSecondTimestamp: SuiTxArg
25
+ newUnlockAtInSecondTimestamp: number
30
26
  ) => void;
31
27
  redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
32
28
  mintEmptyVeSca: () => TransactionResult;
@@ -1,8 +1,5 @@
1
- import type { SuiTransactionBlockResponse } from '@mysten/sui.js/client';
2
- import type {
3
- TransactionBlock,
4
- TransactionResult,
5
- } from '@mysten/sui.js/transactions';
1
+ import type { SuiTransactionBlockResponse } from '@mysten/sui/client';
2
+ import type { Transaction, TransactionResult } from '@mysten/sui/transactions';
6
3
  import type { SuiKit, SuiKitParams, NetworkType } from '@scallop-io/sui-kit';
7
4
  import type {
8
5
  ScallopAddress,
@@ -15,12 +12,12 @@ import { ScallopCache } from 'src/models/scallopCache';
15
12
 
16
13
  export type ScallopClientFnReturnType<T extends boolean> = T extends true
17
14
  ? SuiTransactionBlockResponse
18
- : TransactionBlock;
15
+ : Transaction;
19
16
 
20
17
  export type ScallopClientVeScaReturnType<T extends boolean> = T extends true
21
18
  ? SuiTransactionBlockResponse
22
19
  : {
23
- tx: TransactionBlock;
20
+ tx: Transaction;
24
21
  scaCoin: TransactionResult;
25
22
  };
26
23
 
@@ -1,4 +1,4 @@
1
- import type { SuiObjectRef } from '@mysten/sui.js/client';
1
+ import type { SuiObjectRef } from '@mysten/sui/client';
2
2
 
3
3
  export type Vesca = {
4
4
  id: string;
@@ -1,5 +1,5 @@
1
1
  import BigNumber from 'bignumber.js';
2
- import { normalizeStructTag, parseStructTag } from '@mysten/sui.js/utils';
2
+ import { normalizeStructTag, parseStructTag } from '@mysten/sui/utils';
3
3
  import type { ScallopUtils } from '../models';
4
4
  import type {
5
5
  OriginMarketPoolData,