@scallop-io/sui-scallop-sdk 1.4.1-alpha.1 → 1.4.2-rc.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/constants/common.d.ts +4 -4
- package/dist/constants/enum.d.ts +2 -2
- package/dist/constants/poolAddress.d.ts +16 -4
- package/dist/constants/queryKeys.d.ts +2 -2
- package/dist/constants/tokenBucket.d.ts +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1314 -653
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1269 -609
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopBuilder.d.ts +2 -1
- package/dist/models/scallopCache.d.ts +2 -0
- package/dist/models/scallopQuery.d.ts +46 -20
- package/dist/models/scallopUtils.d.ts +5 -3
- package/dist/queries/borrowIncentiveQuery.d.ts +12 -0
- package/dist/queries/coreQuery.d.ts +18 -17
- package/dist/queries/index.d.ts +2 -0
- package/dist/queries/isolatedAssetQuery.d.ts +2 -2
- package/dist/queries/objectsQuery.d.ts +3 -0
- package/dist/queries/poolAddressesQuery.d.ts +18 -0
- package/dist/queries/portfolioQuery.d.ts +2 -0
- package/dist/queries/priceQuery.d.ts +4 -0
- package/dist/queries/sCoinQuery.d.ts +1 -1
- package/dist/queries/spoolQuery.d.ts +6 -2
- package/dist/test.d.ts +1 -0
- package/dist/types/builder/borrowIncentive.d.ts +5 -5
- package/dist/types/builder/core.d.ts +20 -16
- package/dist/types/builder/loyaltyProgram.d.ts +1 -1
- package/dist/types/builder/referral.d.ts +4 -4
- package/dist/types/builder/sCoin.d.ts +2 -2
- package/dist/types/builder/spool.d.ts +4 -4
- package/dist/types/builder/vesca.d.ts +6 -6
- package/dist/types/query/core.d.ts +22 -5
- package/dist/types/query/spool.d.ts +20 -0
- package/dist/types/utils.d.ts +7 -2
- package/dist/utils/core.d.ts +2 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/query.d.ts +1 -1
- package/dist/utils/util.d.ts +1 -0
- package/package.json +7 -7
- package/src/builders/borrowIncentiveBuilder.ts +28 -15
- package/src/builders/coreBuilder.ts +76 -49
- package/src/builders/loyaltyProgramBuilder.ts +4 -3
- package/src/builders/referralBuilder.ts +23 -10
- package/src/builders/sCoinBuilder.ts +8 -6
- package/src/builders/spoolBuilder.ts +21 -14
- package/src/builders/vescaBuilder.ts +23 -13
- package/src/constants/coinGecko.ts +2 -3
- package/src/constants/common.ts +5 -19
- package/src/constants/enum.ts +20 -35
- package/src/constants/poolAddress.ts +344 -19
- package/src/constants/pyth.ts +2 -3
- package/src/constants/queryKeys.ts +9 -5
- package/src/constants/testAddress.ts +42 -0
- package/src/constants/tokenBucket.ts +2 -2
- package/src/index.ts +1 -0
- package/src/models/scallopBuilder.ts +59 -2
- package/src/models/scallopCache.ts +171 -19
- package/src/models/scallopClient.ts +16 -10
- package/src/models/scallopQuery.ts +36 -28
- package/src/models/scallopUtils.ts +11 -4
- package/src/queries/borrowIncentiveQuery.ts +6 -8
- package/src/queries/borrowLimitQuery.ts +3 -3
- package/src/queries/coreQuery.ts +408 -258
- package/src/queries/index.ts +2 -0
- package/src/queries/isolatedAssetQuery.ts +39 -34
- package/src/queries/objectsQuery.ts +20 -0
- package/src/queries/poolAddressesQuery.ts +146 -0
- package/src/queries/portfolioQuery.ts +31 -13
- package/src/queries/priceQuery.ts +3 -1
- package/src/queries/spoolQuery.ts +189 -122
- package/src/queries/supplyLimitQuery.ts +2 -3
- package/src/test.ts +14 -17
- package/src/types/builder/borrowIncentive.ts +8 -5
- package/src/types/builder/core.ts +23 -17
- package/src/types/builder/loyaltyProgram.ts +1 -1
- package/src/types/builder/referral.ts +6 -4
- package/src/types/builder/sCoin.ts +2 -2
- package/src/types/builder/spool.ts +4 -4
- package/src/types/builder/vesca.ts +9 -6
- package/src/types/query/core.ts +21 -5
- package/src/types/query/spool.ts +21 -0
- package/src/types/utils.ts +8 -3
- package/src/utils/core.ts +18 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/query.ts +21 -5
- package/src/utils/tokenBucket.ts +9 -29
- package/src/utils/util.ts +8 -0
|
@@ -34,8 +34,9 @@ const generateReferralNormalMethod: GenerateReferralNormalMethod = ({
|
|
|
34
34
|
const veScaTable = builder.address.get('vesca.table');
|
|
35
35
|
|
|
36
36
|
return {
|
|
37
|
-
bindToReferral: (veScaKeyId: string) => {
|
|
38
|
-
|
|
37
|
+
bindToReferral: async (veScaKeyId: string) => {
|
|
38
|
+
await builder.moveCall(
|
|
39
|
+
txBlock,
|
|
39
40
|
`${referralIds.referralPgkId}::referral_bindings::bind_ve_sca_referrer`,
|
|
40
41
|
[
|
|
41
42
|
referralIds.referralBindings,
|
|
@@ -46,9 +47,10 @@ const generateReferralNormalMethod: GenerateReferralNormalMethod = ({
|
|
|
46
47
|
[]
|
|
47
48
|
);
|
|
48
49
|
},
|
|
49
|
-
claimReferralTicket: (poolCoinName: SupportCoins) => {
|
|
50
|
+
claimReferralTicket: async (poolCoinName: SupportCoins) => {
|
|
50
51
|
const coinType = builder.utils.parseCoinType(poolCoinName);
|
|
51
|
-
return
|
|
52
|
+
return await builder.moveCall(
|
|
53
|
+
txBlock,
|
|
52
54
|
`${referralIds.referralPgkId}::scallop_referral_program::claim_ve_sca_referral_ticket`,
|
|
53
55
|
[
|
|
54
56
|
referralIds.version,
|
|
@@ -61,9 +63,13 @@ const generateReferralNormalMethod: GenerateReferralNormalMethod = ({
|
|
|
61
63
|
[coinType]
|
|
62
64
|
);
|
|
63
65
|
},
|
|
64
|
-
burnReferralTicket: (
|
|
66
|
+
burnReferralTicket: async (
|
|
67
|
+
ticket: SuiObjectArg,
|
|
68
|
+
poolCoinName: SupportCoins
|
|
69
|
+
) => {
|
|
65
70
|
const coinType = builder.utils.parseCoinType(poolCoinName);
|
|
66
|
-
|
|
71
|
+
await builder.moveCall(
|
|
72
|
+
txBlock,
|
|
67
73
|
`${referralIds.referralPgkId}::scallop_referral_program::burn_ve_sca_referral_ticket`,
|
|
68
74
|
[
|
|
69
75
|
referralIds.version,
|
|
@@ -74,12 +80,13 @@ const generateReferralNormalMethod: GenerateReferralNormalMethod = ({
|
|
|
74
80
|
[coinType]
|
|
75
81
|
);
|
|
76
82
|
},
|
|
77
|
-
claimReferralRevenue: (
|
|
83
|
+
claimReferralRevenue: async (
|
|
78
84
|
veScaKey: SuiObjectArg,
|
|
79
85
|
poolCoinName: SupportCoins
|
|
80
86
|
) => {
|
|
81
87
|
const coinType = builder.utils.parseCoinType(poolCoinName);
|
|
82
|
-
return
|
|
88
|
+
return await builder.moveCall(
|
|
89
|
+
txBlock,
|
|
83
90
|
`${referralIds.referralPgkId}::referral_revenue_pool::claim_revenue_with_ve_sca_key`,
|
|
84
91
|
[
|
|
85
92
|
referralIds.version,
|
|
@@ -106,10 +113,16 @@ const generateReferralQuickMethod: GenerateReferralQuickMethod = ({
|
|
|
106
113
|
const objToTransfer: SuiObjectArg[] = [];
|
|
107
114
|
for (const coinName of coinNames) {
|
|
108
115
|
if (coinName === 'sui') {
|
|
109
|
-
const rewardCoin = txBlock.claimReferralRevenue(
|
|
116
|
+
const rewardCoin = await txBlock.claimReferralRevenue(
|
|
117
|
+
veScaKey,
|
|
118
|
+
coinName
|
|
119
|
+
);
|
|
110
120
|
objToTransfer.push(rewardCoin);
|
|
111
121
|
} else {
|
|
112
|
-
const rewardCoin = txBlock.claimReferralRevenue(
|
|
122
|
+
const rewardCoin = await txBlock.claimReferralRevenue(
|
|
123
|
+
veScaKey,
|
|
124
|
+
coinName
|
|
125
|
+
);
|
|
113
126
|
try {
|
|
114
127
|
// get the matching user coin if exists
|
|
115
128
|
const coins = await builder.suiKit.suiInteractor.selectCoins(
|
|
@@ -20,8 +20,9 @@ const generateSCoinNormalMethod: GenerateSCoinNormalMethod = ({
|
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
return {
|
|
23
|
-
mintSCoin: (marketCoinName, marketCoin) => {
|
|
24
|
-
return
|
|
23
|
+
mintSCoin: async (marketCoinName, marketCoin) => {
|
|
24
|
+
return await builder.moveCall(
|
|
25
|
+
txBlock,
|
|
25
26
|
`${sCoinPkgIds.pkgId}::s_coin_converter::mint_s_coin`,
|
|
26
27
|
[builder.utils.getSCoinTreasury(marketCoinName), marketCoin],
|
|
27
28
|
[
|
|
@@ -30,8 +31,9 @@ const generateSCoinNormalMethod: GenerateSCoinNormalMethod = ({
|
|
|
30
31
|
]
|
|
31
32
|
);
|
|
32
33
|
},
|
|
33
|
-
burnSCoin: (sCoinName, sCoin) => {
|
|
34
|
-
return
|
|
34
|
+
burnSCoin: async (sCoinName, sCoin) => {
|
|
35
|
+
return await builder.moveCall(
|
|
36
|
+
txBlock,
|
|
35
37
|
`${sCoinPkgIds.pkgId}::s_coin_converter::burn_s_coin`,
|
|
36
38
|
[builder.utils.getSCoinTreasury(sCoinName), sCoin],
|
|
37
39
|
[
|
|
@@ -58,7 +60,7 @@ const generateSCoinQuickMethod: GenerateSCoinQuickMethod = ({
|
|
|
58
60
|
);
|
|
59
61
|
|
|
60
62
|
txBlock.transferObjects([leftCoin], sender);
|
|
61
|
-
return txBlock.mintSCoin(marketCoinName, takeCoin);
|
|
63
|
+
return await txBlock.mintSCoin(marketCoinName, takeCoin);
|
|
62
64
|
},
|
|
63
65
|
burnSCoinQuick: async (sCoinName, amount) => {
|
|
64
66
|
const sender = requireSender(txBlock);
|
|
@@ -70,7 +72,7 @@ const generateSCoinQuickMethod: GenerateSCoinQuickMethod = ({
|
|
|
70
72
|
);
|
|
71
73
|
|
|
72
74
|
txBlock.transferObjects([leftCoin], sender);
|
|
73
|
-
return txBlock.burnSCoin(sCoinName, takeCoin);
|
|
75
|
+
return await txBlock.burnSCoin(sCoinName, takeCoin);
|
|
74
76
|
},
|
|
75
77
|
};
|
|
76
78
|
};
|
|
@@ -100,10 +100,10 @@ const stakeHelper = async (
|
|
|
100
100
|
? await builder.selectSCoin(txBlock, coinName, amount, sender)
|
|
101
101
|
: await builder.selectMarketCoin(txBlock, coinName, amount, sender);
|
|
102
102
|
if (isSCoin) {
|
|
103
|
-
const marketCoin = txBlock.burnSCoin(coinName, takeCoin);
|
|
104
|
-
txBlock.stake(stakeAccount, marketCoin, coinName);
|
|
103
|
+
const marketCoin = await txBlock.burnSCoin(coinName, takeCoin);
|
|
104
|
+
await txBlock.stake(stakeAccount, marketCoin, coinName);
|
|
105
105
|
} else {
|
|
106
|
-
txBlock.stake(stakeAccount, takeCoin, coinName);
|
|
106
|
+
await txBlock.stake(stakeAccount, takeCoin, coinName);
|
|
107
107
|
}
|
|
108
108
|
txBlock.transferObjects([leftCoin], sender);
|
|
109
109
|
return totalAmount;
|
|
@@ -127,43 +127,46 @@ const generateSpoolNormalMethod: GenerateSpoolNormalMethod = ({
|
|
|
127
127
|
spoolPkg: builder.address.get('spool.id'),
|
|
128
128
|
};
|
|
129
129
|
return {
|
|
130
|
-
createStakeAccount: (stakeMarketCoinName) => {
|
|
130
|
+
createStakeAccount: async (stakeMarketCoinName) => {
|
|
131
131
|
const marketCoinType =
|
|
132
132
|
builder.utils.parseMarketCoinType(stakeMarketCoinName);
|
|
133
133
|
const stakePoolId = builder.address.get(
|
|
134
134
|
`spool.pools.${stakeMarketCoinName}.id`
|
|
135
135
|
);
|
|
136
|
-
return
|
|
136
|
+
return await builder.moveCall(
|
|
137
|
+
txBlock,
|
|
137
138
|
`${spoolIds.spoolPkg}::user::new_spool_account`,
|
|
138
139
|
[stakePoolId, SUI_CLOCK_OBJECT_ID],
|
|
139
140
|
[marketCoinType]
|
|
140
141
|
);
|
|
141
142
|
},
|
|
142
|
-
stake: (stakeAccount, coin, stakeMarketCoinName) => {
|
|
143
|
+
stake: async (stakeAccount, coin, stakeMarketCoinName) => {
|
|
143
144
|
const marketCoinType =
|
|
144
145
|
builder.utils.parseMarketCoinType(stakeMarketCoinName);
|
|
145
146
|
const stakePoolId = builder.address.get(
|
|
146
147
|
`spool.pools.${stakeMarketCoinName}.id`
|
|
147
148
|
);
|
|
148
|
-
|
|
149
|
+
await builder.moveCall(
|
|
150
|
+
txBlock,
|
|
149
151
|
`${spoolIds.spoolPkg}::user::stake`,
|
|
150
152
|
[stakePoolId, stakeAccount, coin, SUI_CLOCK_OBJECT_ID],
|
|
151
153
|
[marketCoinType]
|
|
152
154
|
);
|
|
153
155
|
},
|
|
154
|
-
unstake: (stakeAccount, amount, stakeMarketCoinName) => {
|
|
156
|
+
unstake: async (stakeAccount, amount, stakeMarketCoinName) => {
|
|
155
157
|
const marketCoinType =
|
|
156
158
|
builder.utils.parseMarketCoinType(stakeMarketCoinName);
|
|
157
159
|
const stakePoolId = builder.address.get(
|
|
158
160
|
`spool.pools.${stakeMarketCoinName}.id`
|
|
159
161
|
);
|
|
160
|
-
return
|
|
162
|
+
return await builder.moveCall(
|
|
163
|
+
txBlock,
|
|
161
164
|
`${spoolIds.spoolPkg}::user::unstake`,
|
|
162
165
|
[stakePoolId, stakeAccount, amount, SUI_CLOCK_OBJECT_ID],
|
|
163
166
|
[marketCoinType]
|
|
164
167
|
);
|
|
165
168
|
},
|
|
166
|
-
claim: (stakeAccount, stakeMarketCoinName) => {
|
|
169
|
+
claim: async (stakeAccount, stakeMarketCoinName) => {
|
|
167
170
|
const stakePoolId = builder.address.get(
|
|
168
171
|
`spool.pools.${stakeMarketCoinName}.id`
|
|
169
172
|
) as string;
|
|
@@ -174,7 +177,8 @@ const generateSpoolNormalMethod: GenerateSpoolNormalMethod = ({
|
|
|
174
177
|
builder.utils.parseMarketCoinType(stakeMarketCoinName);
|
|
175
178
|
const rewardCoinName = spoolRewardCoins[stakeMarketCoinName];
|
|
176
179
|
const rewardCoinType = builder.utils.parseCoinType(rewardCoinName);
|
|
177
|
-
return
|
|
180
|
+
return await builder.moveCall(
|
|
181
|
+
txBlock,
|
|
178
182
|
`${spoolIds.spoolPkg}::user::redeem_rewards`,
|
|
179
183
|
[stakePoolId, rewardPoolId, stakeAccount, SUI_CLOCK_OBJECT_ID],
|
|
180
184
|
[marketCoinType, rewardCoinType]
|
|
@@ -265,7 +269,7 @@ const generateSpoolQuickMethod: GenerateSpoolQuickMethod = ({
|
|
|
265
269
|
for (const account of stakeAccounts) {
|
|
266
270
|
if (account.staked === 0) continue;
|
|
267
271
|
const amountToUnstake = Math.min(amount, account.staked);
|
|
268
|
-
const marketCoin = txBlock.unstake(
|
|
272
|
+
const marketCoin = await txBlock.unstake(
|
|
269
273
|
account.id,
|
|
270
274
|
amountToUnstake,
|
|
271
275
|
stakeMarketCoinName
|
|
@@ -273,7 +277,10 @@ const generateSpoolQuickMethod: GenerateSpoolQuickMethod = ({
|
|
|
273
277
|
|
|
274
278
|
// convert to new sCoin
|
|
275
279
|
if (returnSCoin) {
|
|
276
|
-
const sCoin = txBlock.mintSCoin(
|
|
280
|
+
const sCoin = await txBlock.mintSCoin(
|
|
281
|
+
stakeMarketCoinName,
|
|
282
|
+
marketCoin
|
|
283
|
+
);
|
|
277
284
|
toTransfer.push(sCoin);
|
|
278
285
|
} else {
|
|
279
286
|
toTransfer.push(marketCoin);
|
|
@@ -301,7 +308,7 @@ const generateSpoolQuickMethod: GenerateSpoolQuickMethod = ({
|
|
|
301
308
|
);
|
|
302
309
|
const rewardCoins: TransactionResult[] = [];
|
|
303
310
|
for (const accountId of stakeAccountIds) {
|
|
304
|
-
const rewardCoin = txBlock.claim(accountId, stakeMarketCoinName);
|
|
311
|
+
const rewardCoin = await txBlock.claim(accountId, stakeMarketCoinName);
|
|
305
312
|
rewardCoins.push(rewardCoin);
|
|
306
313
|
}
|
|
307
314
|
return rewardCoins;
|
|
@@ -89,8 +89,9 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
89
89
|
};
|
|
90
90
|
|
|
91
91
|
return {
|
|
92
|
-
lockSca: (scaCoin, unlockAtInSecondTimestamp) => {
|
|
93
|
-
return
|
|
92
|
+
lockSca: async (scaCoin, unlockAtInSecondTimestamp) => {
|
|
93
|
+
return await builder.moveCall(
|
|
94
|
+
txBlock,
|
|
94
95
|
`${veScaIds.pkgId}::ve_sca::mint_ve_sca_key`,
|
|
95
96
|
[
|
|
96
97
|
veScaIds.config,
|
|
@@ -103,8 +104,9 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
103
104
|
[]
|
|
104
105
|
);
|
|
105
106
|
},
|
|
106
|
-
extendLockPeriod: (veScaKey, newUnlockAtInSecondTimestamp) => {
|
|
107
|
-
|
|
107
|
+
extendLockPeriod: async (veScaKey, newUnlockAtInSecondTimestamp) => {
|
|
108
|
+
await builder.moveCall(
|
|
109
|
+
txBlock,
|
|
108
110
|
`${veScaIds.pkgId}::ve_sca::extend_lock_period`,
|
|
109
111
|
[
|
|
110
112
|
veScaIds.config,
|
|
@@ -117,8 +119,9 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
117
119
|
[]
|
|
118
120
|
);
|
|
119
121
|
},
|
|
120
|
-
extendLockAmount: (veScaKey, scaCoin) => {
|
|
121
|
-
|
|
122
|
+
extendLockAmount: async (veScaKey, scaCoin) => {
|
|
123
|
+
await builder.moveCall(
|
|
124
|
+
txBlock,
|
|
122
125
|
`${veScaIds.pkgId}::ve_sca::lock_more_sca`,
|
|
123
126
|
[
|
|
124
127
|
veScaIds.config,
|
|
@@ -131,8 +134,13 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
131
134
|
[]
|
|
132
135
|
);
|
|
133
136
|
},
|
|
134
|
-
renewExpiredVeSca: (
|
|
135
|
-
|
|
137
|
+
renewExpiredVeSca: async (
|
|
138
|
+
veScaKey,
|
|
139
|
+
scaCoin,
|
|
140
|
+
newUnlockAtInSecondTimestamp
|
|
141
|
+
) => {
|
|
142
|
+
await builder.moveCall(
|
|
143
|
+
txBlock,
|
|
136
144
|
`${veScaIds.pkgId}::ve_sca::renew_expired_ve_sca`,
|
|
137
145
|
[
|
|
138
146
|
veScaIds.config,
|
|
@@ -146,8 +154,9 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
146
154
|
[]
|
|
147
155
|
);
|
|
148
156
|
},
|
|
149
|
-
redeemSca: (veScaKey) => {
|
|
150
|
-
return
|
|
157
|
+
redeemSca: async (veScaKey) => {
|
|
158
|
+
return await builder.moveCall(
|
|
159
|
+
txBlock,
|
|
151
160
|
`${veScaIds.pkgId}::ve_sca::redeem`,
|
|
152
161
|
[
|
|
153
162
|
veScaIds.config,
|
|
@@ -159,8 +168,9 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
159
168
|
[]
|
|
160
169
|
);
|
|
161
170
|
},
|
|
162
|
-
mintEmptyVeSca: () => {
|
|
163
|
-
return
|
|
171
|
+
mintEmptyVeSca: async () => {
|
|
172
|
+
return await builder.moveCall(
|
|
173
|
+
txBlock,
|
|
164
174
|
`${veScaIds.pkgId}::ve_sca::mint_ve_sca_placeholder_key`,
|
|
165
175
|
[veScaIds.config, veScaIds.table],
|
|
166
176
|
[]
|
|
@@ -346,7 +356,7 @@ const generateQuickVeScaMethod: GenerateVeScaQuickMethod = ({
|
|
|
346
356
|
checkVesca(veSca?.unlockAt);
|
|
347
357
|
|
|
348
358
|
if (veSca) {
|
|
349
|
-
const sca = txBlock.redeemSca(veSca.keyId);
|
|
359
|
+
const sca = await txBlock.redeemSca(veSca.keyId);
|
|
350
360
|
if (transferSca) {
|
|
351
361
|
txBlock.transferObjects([sca], sender);
|
|
352
362
|
return;
|
package/src/constants/common.ts
CHANGED
|
@@ -9,7 +9,6 @@ export const ADDRESSES_ID =
|
|
|
9
9
|
? ('65fb07c39c845425d71d7b18' as const)
|
|
10
10
|
: ('675c65cd301dd817ea262e76' as const);
|
|
11
11
|
// : ('66f8e7ed9bb9e07fdfb86bbb' as const);
|
|
12
|
-
// : ('664dfe22898c36c159e28bc8' as const);
|
|
13
12
|
|
|
14
13
|
export const PROTOCOL_OBJECT_ID = IS_VE_SCA_TEST
|
|
15
14
|
? ('0xc9f859f98ca352a11b97a038c4b4162bee437b8df8caa047990fe9cb03d4f778' as const)
|
|
@@ -45,9 +44,8 @@ export const SUPPORT_POOLS = [
|
|
|
45
44
|
'hasui',
|
|
46
45
|
'vsui',
|
|
47
46
|
'sca',
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// 'deep',
|
|
47
|
+
'fud',
|
|
48
|
+
'deep',
|
|
51
49
|
] as const;
|
|
52
50
|
|
|
53
51
|
export const SUPPORT_COLLATERALS = [
|
|
@@ -93,9 +91,8 @@ export const SUPPORT_SCOIN = [
|
|
|
93
91
|
'scetus',
|
|
94
92
|
'swsol',
|
|
95
93
|
'swbtc',
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
// 'sfud',
|
|
94
|
+
'sdeep',
|
|
95
|
+
'sfud',
|
|
99
96
|
] as const;
|
|
100
97
|
|
|
101
98
|
export const SUPPORT_SUI_BRIDGE = ['sbeth'] as const;
|
|
@@ -110,18 +107,7 @@ export const SUPPORT_WORMHOLE = [
|
|
|
110
107
|
|
|
111
108
|
export const SUPPORT_SPOOLS_REWARDS = ['sui'] as const;
|
|
112
109
|
|
|
113
|
-
export const SUPPORT_BORROW_INCENTIVE_POOLS = [
|
|
114
|
-
'sui',
|
|
115
|
-
'wusdc',
|
|
116
|
-
'wusdt',
|
|
117
|
-
'afsui',
|
|
118
|
-
'hasui',
|
|
119
|
-
'vsui',
|
|
120
|
-
'weth',
|
|
121
|
-
'sbeth',
|
|
122
|
-
'sca',
|
|
123
|
-
'usdc',
|
|
124
|
-
] as const;
|
|
110
|
+
export const SUPPORT_BORROW_INCENTIVE_POOLS = [...SUPPORT_POOLS] as const;
|
|
125
111
|
|
|
126
112
|
export const SUPPORT_BORROW_INCENTIVE_REWARDS = [
|
|
127
113
|
...SUPPORT_POOLS,
|
package/src/constants/enum.ts
CHANGED
|
@@ -16,9 +16,8 @@ export const coinDecimals: types.SupportCoinDecimals = {
|
|
|
16
16
|
hasui: 9,
|
|
17
17
|
vsui: 9,
|
|
18
18
|
sca: 9,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
// fud: 5,
|
|
19
|
+
deep: 6,
|
|
20
|
+
fud: 5,
|
|
22
21
|
susdc: 6,
|
|
23
22
|
sweth: 8,
|
|
24
23
|
ssbeth: 8,
|
|
@@ -33,9 +32,8 @@ export const coinDecimals: types.SupportCoinDecimals = {
|
|
|
33
32
|
shasui: 9,
|
|
34
33
|
svsui: 9,
|
|
35
34
|
ssca: 9,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
// sfud: 5,
|
|
35
|
+
sdeep: 6,
|
|
36
|
+
sfud: 5,
|
|
39
37
|
};
|
|
40
38
|
|
|
41
39
|
export const assetCoins: types.AssetCoins = {
|
|
@@ -53,9 +51,8 @@ export const assetCoins: types.AssetCoins = {
|
|
|
53
51
|
hasui: 'hasui',
|
|
54
52
|
vsui: 'vsui',
|
|
55
53
|
sca: 'sca',
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// fud: 'fud',
|
|
54
|
+
deep: 'deep',
|
|
55
|
+
fud: 'fud',
|
|
59
56
|
};
|
|
60
57
|
|
|
61
58
|
export const marketCoins: types.MarketCoins = {
|
|
@@ -73,9 +70,8 @@ export const marketCoins: types.MarketCoins = {
|
|
|
73
70
|
shasui: 'shasui',
|
|
74
71
|
svsui: 'svsui',
|
|
75
72
|
ssca: 'ssca',
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
// sfud: 'sfud',
|
|
73
|
+
sdeep: 'sdeep',
|
|
74
|
+
sfud: 'sfud',
|
|
79
75
|
};
|
|
80
76
|
|
|
81
77
|
export const sCoins: types.SCoins = {
|
|
@@ -92,9 +88,8 @@ export const sCoins: types.SCoins = {
|
|
|
92
88
|
ssca: 'ssca',
|
|
93
89
|
swsol: 'swsol',
|
|
94
90
|
swbtc: 'swbtc',
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
// sdeep: 'sdeep',
|
|
91
|
+
sfud: 'sfud',
|
|
92
|
+
sdeep: 'sdeep',
|
|
98
93
|
};
|
|
99
94
|
|
|
100
95
|
export const stakeMarketCoins: types.StakeMarketCoins = {
|
|
@@ -143,8 +138,8 @@ export const coinIds: types.AssetCoinIds = {
|
|
|
143
138
|
? '0x6cd813061a3adf3602b76545f076205f0c8e7ec1d3b1eab9a1da7992c18c0524'
|
|
144
139
|
: '0x7016aae72cfc67f2fadf55769c0a7dd54291a583b63051a5ed71081cce836ac6',
|
|
145
140
|
// isolated assets
|
|
146
|
-
|
|
147
|
-
|
|
141
|
+
deep: '0xdeeb7a4662eec9f2f3def03fb937a663dddaa2e215b8078a284d026b7946c270',
|
|
142
|
+
fud: '0x76cb819b01abed502bee8a702b4c2d547532c12f25001c9dea795a5e631c26f1',
|
|
148
143
|
};
|
|
149
144
|
|
|
150
145
|
export const wormholeCoinIds: types.WormholeCoinIds = {
|
|
@@ -166,22 +161,12 @@ export const sCoinIds: types.SCoinIds = {
|
|
|
166
161
|
'0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC',
|
|
167
162
|
ssbeth:
|
|
168
163
|
'0xb14f82d8506d139eacef109688d1b71e7236bcce9b2c0ad526abcd6aa5be7de0::scallop_sb_eth::SCALLOP_SB_ETH',
|
|
169
|
-
|
|
170
|
-
// ssui: '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI',
|
|
171
|
-
// swusdc:
|
|
172
|
-
// '0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
173
|
-
// swusdt:
|
|
174
|
-
// '0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
175
|
-
// ssca: '0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA',
|
|
176
|
-
|
|
177
|
-
// test values
|
|
178
|
-
ssui: '0xf569919046f19a0c40b519ecfbb6ca0319698cd5908716c29b62ef56541f298b::scallop_sui::SCALLOP_SUI',
|
|
179
|
-
swusdt:
|
|
180
|
-
'0xac781d9f73058ff5e69f9bf8dde32f2e8c71c66d7fe8497fc83b2d9182254b22::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
164
|
+
ssui: '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI',
|
|
181
165
|
swusdc:
|
|
182
|
-
'
|
|
183
|
-
|
|
184
|
-
|
|
166
|
+
'0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
167
|
+
swusdt:
|
|
168
|
+
'0xe6e5a012ec20a49a3d1d57bd2b67140b96cd4d3400b9d79e541f7bdbab661f95::scallop_wormhole_usdt::SCALLOP_WORMHOLE_USDT',
|
|
169
|
+
ssca: '0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA',
|
|
185
170
|
scetus:
|
|
186
171
|
'0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS',
|
|
187
172
|
sweth:
|
|
@@ -196,9 +181,9 @@ export const sCoinIds: types.SCoinIds = {
|
|
|
196
181
|
'0x1392650f2eca9e3f6ffae3ff89e42a3590d7102b80e2b430f674730bc30d3259::scallop_wormhole_sol::SCALLOP_WORMHOLE_SOL',
|
|
197
182
|
swbtc:
|
|
198
183
|
'0x2cf76a9cf5d3337961d1154283234f94da2dcff18544dfe5cbdef65f319591b5::scallop_wormhole_btc::SCALLOP_WORMHOLE_BTC',
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
184
|
+
sdeep:
|
|
185
|
+
'0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP',
|
|
186
|
+
sfud: '0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD',
|
|
202
187
|
} as const;
|
|
203
188
|
|
|
204
189
|
export const sCoinTypeToName = Object.entries(sCoinIds).reduce(
|