@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.
- package/dist/builders/borrowIncentiveBuilder.d.ts +2 -2
- package/dist/builders/coreBuilder.d.ts +2 -2
- package/dist/builders/index.d.ts +2 -2
- package/dist/builders/loyaltyProgramBuilder.d.ts +2 -2
- package/dist/builders/referralBuilder.d.ts +2 -2
- package/dist/builders/sCoinBuilder.d.ts +2 -2
- package/dist/builders/spoolBuilder.d.ts +2 -2
- package/dist/builders/vescaBuilder.d.ts +2 -2
- package/dist/constants/common.d.ts +4 -4
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/vesca.d.ts +3 -3
- package/dist/index.js +87 -71
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +90 -77
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopBuilder.d.ts +10 -8
- package/dist/models/scallopCache.d.ts +5 -9
- package/dist/models/scallopClient.d.ts +2 -2
- package/dist/models/scallopQuery.d.ts +1 -1
- package/dist/models/scallopUtils.d.ts +2 -2
- package/dist/queries/coreQuery.d.ts +3 -3
- package/dist/queries/loyaltyProgramQuery.d.ts +1 -1
- package/dist/queries/priceQuery.d.ts +1 -1
- package/dist/queries/vescaQuery.d.ts +1 -1
- package/dist/test.d.ts +1 -0
- package/dist/types/builder/borrowIncentive.d.ts +1 -1
- package/dist/types/builder/core.d.ts +16 -16
- package/dist/types/builder/spool.d.ts +3 -3
- package/dist/types/builder/vesca.d.ts +5 -5
- package/dist/types/model.d.ts +4 -4
- package/dist/types/query/vesca.d.ts +1 -1
- package/dist/utils/query.d.ts +1 -1
- package/dist/utils/util.d.ts +1 -0
- package/package.json +13 -9
- package/src/builders/borrowIncentiveBuilder.ts +6 -6
- package/src/builders/coreBuilder.ts +15 -15
- package/src/builders/index.ts +2 -2
- package/src/builders/loyaltyProgramBuilder.ts +5 -5
- package/src/builders/oracle.ts +5 -4
- package/src/builders/referralBuilder.ts +6 -6
- package/src/builders/sCoinBuilder.ts +5 -8
- package/src/builders/spoolBuilder.ts +9 -9
- package/src/builders/vescaBuilder.ts +5 -5
- package/src/constants/common.ts +4 -4
- package/src/constants/index.ts +1 -1
- package/src/constants/vesca.ts +5 -6
- package/src/models/scallopBuilder.ts +14 -7
- package/src/models/scallopCache.ts +43 -34
- package/src/models/scallopClient.ts +8 -6
- package/src/models/scallopQuery.ts +2 -2
- package/src/models/scallopUtils.ts +3 -3
- package/src/queries/borrowIncentiveQuery.ts +1 -1
- package/src/queries/coreQuery.ts +4 -4
- package/src/queries/loyaltyProgramQuery.ts +1 -1
- package/src/queries/priceQuery.ts +1 -1
- package/src/queries/sCoinQuery.ts +2 -2
- package/src/queries/spoolQuery.ts +4 -5
- package/src/queries/vescaQuery.ts +6 -3
- package/src/test.ts +26 -0
- package/src/types/address.ts +26 -26
- package/src/types/builder/borrowIncentive.ts +1 -1
- package/src/types/builder/core.ts +26 -28
- package/src/types/builder/spool.ts +2 -3
- package/src/types/builder/vesca.ts +5 -9
- package/src/types/model.ts +4 -7
- package/src/types/query/vesca.ts +1 -1
- 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
|
|
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:
|
|
36
|
+
obligation: SuiObjectArg,
|
|
39
37
|
obligationHotPotato: SuiObjectArg
|
|
40
38
|
) => void;
|
|
41
39
|
openObligationEntry: () => void;
|
|
42
40
|
addCollateral: (
|
|
43
|
-
obligation:
|
|
41
|
+
obligation: SuiObjectArg,
|
|
44
42
|
coin: SuiObjectArg,
|
|
45
43
|
collateralCoinName: SupportCollateralCoins
|
|
46
44
|
) => void;
|
|
47
45
|
takeCollateral: (
|
|
48
|
-
obligation:
|
|
49
|
-
obligationKey:
|
|
50
|
-
amount:
|
|
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:
|
|
68
|
-
obligationKey:
|
|
69
|
-
amount:
|
|
65
|
+
obligation: SuiObjectArg,
|
|
66
|
+
obligationKey: SuiObjectArg,
|
|
67
|
+
amount: number,
|
|
70
68
|
poolCoinName: SupportPoolCoins
|
|
71
69
|
) => TransactionResult;
|
|
72
70
|
borrowWithReferral: (
|
|
73
|
-
obligation:
|
|
74
|
-
obligationKey:
|
|
71
|
+
obligation: SuiObjectArg,
|
|
72
|
+
obligationKey: SuiObjectArg,
|
|
75
73
|
borrowReferral: SuiObjectArg,
|
|
76
|
-
amount:
|
|
74
|
+
amount: number,
|
|
77
75
|
poolCoinName: SupportPoolCoins
|
|
78
76
|
) => TransactionResult;
|
|
79
77
|
borrowEntry: (
|
|
80
|
-
obligation:
|
|
81
|
-
obligationKey:
|
|
82
|
-
amount:
|
|
78
|
+
obligation: SuiObjectArg,
|
|
79
|
+
obligationKey: SuiObjectArg,
|
|
80
|
+
amount: number,
|
|
83
81
|
poolCoinName: SupportPoolCoins
|
|
84
82
|
) => void;
|
|
85
83
|
repay: (
|
|
86
|
-
obligation:
|
|
84
|
+
obligation: SuiObjectArg,
|
|
87
85
|
coin: SuiObjectArg,
|
|
88
86
|
poolCoinName: SupportPoolCoins
|
|
89
87
|
) => void;
|
|
90
88
|
borrowFlashLoan: (
|
|
91
|
-
amount:
|
|
89
|
+
amount: number,
|
|
92
90
|
poolCoinName: SupportPoolCoins
|
|
93
91
|
) => TransactionResult;
|
|
94
92
|
repayFlashLoan: (
|
|
95
93
|
coin: SuiObjectArg,
|
|
96
|
-
loan:
|
|
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?:
|
|
103
|
+
obligationId?: SuiObjectArg
|
|
106
104
|
) => Promise<void>;
|
|
107
105
|
takeCollateralQuick: (
|
|
108
106
|
amount: number,
|
|
109
107
|
collateralCoinName: SupportCollateralCoins,
|
|
110
|
-
obligationId?:
|
|
111
|
-
obligationKey?:
|
|
108
|
+
obligationId?: SuiObjectArg,
|
|
109
|
+
obligationKey?: SuiObjectArg
|
|
112
110
|
) => Promise<TransactionResult>;
|
|
113
111
|
borrowQuick: (
|
|
114
112
|
amount: number,
|
|
115
113
|
poolCoinName: SupportPoolCoins,
|
|
116
|
-
obligationId?:
|
|
117
|
-
obligationKey?:
|
|
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?:
|
|
124
|
-
obligationKey?:
|
|
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?:
|
|
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
|
|
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:
|
|
26
|
+
amount: number,
|
|
28
27
|
stakeMarketCoinName: SupportStakeMarketCoins
|
|
29
28
|
) => TransactionResult;
|
|
30
29
|
claim: (
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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:
|
|
15
|
+
unlockAtInSecondTimestamp: number
|
|
20
16
|
) => TransactionResult;
|
|
21
17
|
extendLockPeriod: (
|
|
22
18
|
veScaKey: SuiObjectArg,
|
|
23
|
-
newUnlockAtInSecondTimestamp:
|
|
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:
|
|
25
|
+
newUnlockAtInSecondTimestamp: number
|
|
30
26
|
) => void;
|
|
31
27
|
redeemSca: (veScaKey: SuiObjectArg) => TransactionResult;
|
|
32
28
|
mintEmptyVeSca: () => TransactionResult;
|
package/src/types/model.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
import type { SuiTransactionBlockResponse } from '@mysten/sui
|
|
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
|
-
:
|
|
15
|
+
: Transaction;
|
|
19
16
|
|
|
20
17
|
export type ScallopClientVeScaReturnType<T extends boolean> = T extends true
|
|
21
18
|
? SuiTransactionBlockResponse
|
|
22
19
|
: {
|
|
23
|
-
tx:
|
|
20
|
+
tx: Transaction;
|
|
24
21
|
scaCoin: TransactionResult;
|
|
25
22
|
};
|
|
26
23
|
|
package/src/types/query/vesca.ts
CHANGED
package/src/utils/query.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import BigNumber from 'bignumber.js';
|
|
2
|
-
import { normalizeStructTag, parseStructTag } from '@mysten/sui
|
|
2
|
+
import { normalizeStructTag, parseStructTag } from '@mysten/sui/utils';
|
|
3
3
|
import type { ScallopUtils } from '../models';
|
|
4
4
|
import type {
|
|
5
5
|
OriginMarketPoolData,
|