@scallop-io/sui-scallop-sdk 1.4.27 → 1.5.0
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/index.d.mts +30 -2
- package/dist/index.d.ts +30 -2
- package/dist/index.js +53 -52
- package/dist/index.mjs +7 -7
- package/package.json +1 -1
- package/src/builders/borrowIncentiveBuilder.ts +11 -25
- package/src/builders/coreBuilder.ts +15 -72
- package/src/builders/oracle.ts +73 -46
- package/src/builders/referralBuilder.ts +9 -20
- package/src/builders/spoolBuilder.ts +10 -38
- package/src/builders/vescaBuilder.ts +11 -26
- package/src/constants/enum.ts +10 -5
- package/src/constants/index.ts +1 -0
- package/src/constants/poolAddress.ts +343 -184
- package/src/constants/testAddress.ts +79 -287
- package/src/constants/xoracle.ts +28 -0
- package/src/models/scallopPrice.ts +0 -0
- package/src/models/scallopQuery.ts +41 -8
- package/src/models/scallopUtils.ts +1 -1
- package/src/queries/coreQuery.ts +16 -6
- package/src/queries/index.ts +1 -0
- package/src/queries/vescaQuery.ts +8 -17
- package/src/queries/xOracleQuery.ts +124 -0
- package/src/types/address.ts +1 -0
- package/src/types/constant/index.ts +1 -0
- package/src/types/constant/xOracle.ts +11 -0
- package/src/utils/util.ts +1 -1
|
@@ -87,6 +87,11 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
87
87
|
treasury: builder.address.get('vesca.treasury'),
|
|
88
88
|
config: builder.address.get('vesca.config'),
|
|
89
89
|
};
|
|
90
|
+
const clockObjectRef = txBlock.sharedObjectRef({
|
|
91
|
+
objectId: SUI_CLOCK_OBJECT_ID,
|
|
92
|
+
mutable: false,
|
|
93
|
+
initialSharedVersion: '1',
|
|
94
|
+
});
|
|
90
95
|
|
|
91
96
|
return {
|
|
92
97
|
lockSca: (scaCoin, unlockAtInSecondTimestamp) => {
|
|
@@ -99,11 +104,7 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
99
104
|
veScaIds.treasury,
|
|
100
105
|
scaCoin,
|
|
101
106
|
unlockAtInSecondTimestamp,
|
|
102
|
-
|
|
103
|
-
objectId: SUI_CLOCK_OBJECT_ID,
|
|
104
|
-
mutable: false,
|
|
105
|
-
initialSharedVersion: '1',
|
|
106
|
-
}),
|
|
107
|
+
clockObjectRef,
|
|
107
108
|
],
|
|
108
109
|
[]
|
|
109
110
|
);
|
|
@@ -118,11 +119,7 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
118
119
|
veScaIds.table,
|
|
119
120
|
veScaIds.treasury,
|
|
120
121
|
newUnlockAtInSecondTimestamp,
|
|
121
|
-
|
|
122
|
-
objectId: SUI_CLOCK_OBJECT_ID,
|
|
123
|
-
mutable: false,
|
|
124
|
-
initialSharedVersion: '1',
|
|
125
|
-
}),
|
|
122
|
+
clockObjectRef,
|
|
126
123
|
],
|
|
127
124
|
[]
|
|
128
125
|
);
|
|
@@ -137,11 +134,7 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
137
134
|
veScaIds.table,
|
|
138
135
|
veScaIds.treasury,
|
|
139
136
|
scaCoin,
|
|
140
|
-
|
|
141
|
-
objectId: SUI_CLOCK_OBJECT_ID,
|
|
142
|
-
mutable: false,
|
|
143
|
-
initialSharedVersion: '1',
|
|
144
|
-
}),
|
|
137
|
+
clockObjectRef,
|
|
145
138
|
],
|
|
146
139
|
[]
|
|
147
140
|
);
|
|
@@ -157,11 +150,7 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
157
150
|
veScaIds.treasury,
|
|
158
151
|
scaCoin,
|
|
159
152
|
newUnlockAtInSecondTimestamp,
|
|
160
|
-
|
|
161
|
-
objectId: SUI_CLOCK_OBJECT_ID,
|
|
162
|
-
mutable: false,
|
|
163
|
-
initialSharedVersion: '1',
|
|
164
|
-
}),
|
|
153
|
+
clockObjectRef,
|
|
165
154
|
],
|
|
166
155
|
[]
|
|
167
156
|
);
|
|
@@ -175,11 +164,7 @@ const generateNormalVeScaMethod: GenerateVeScaNormalMethod = ({
|
|
|
175
164
|
veScaKey,
|
|
176
165
|
veScaIds.table,
|
|
177
166
|
veScaIds.treasury,
|
|
178
|
-
|
|
179
|
-
objectId: SUI_CLOCK_OBJECT_ID,
|
|
180
|
-
mutable: false,
|
|
181
|
-
initialSharedVersion: '1',
|
|
182
|
-
}),
|
|
167
|
+
clockObjectRef,
|
|
183
168
|
],
|
|
184
169
|
[]
|
|
185
170
|
);
|
|
@@ -372,7 +357,7 @@ const generateQuickVeScaMethod: GenerateVeScaQuickMethod = ({
|
|
|
372
357
|
checkVesca(veSca?.unlockAt);
|
|
373
358
|
|
|
374
359
|
if (veSca) {
|
|
375
|
-
const sca =
|
|
360
|
+
const sca = txBlock.redeemSca(veSca.keyId);
|
|
376
361
|
if (transferSca) {
|
|
377
362
|
txBlock.transferObjects([sca], sender);
|
|
378
363
|
return;
|
package/src/constants/enum.ts
CHANGED
|
@@ -205,8 +205,10 @@ export const voloCoinIds: types.VoloCoinIds = {
|
|
|
205
205
|
|
|
206
206
|
// PROD VERSION
|
|
207
207
|
export const sCoinIds: types.SCoinIds = {
|
|
208
|
-
ssui: '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI',
|
|
209
|
-
|
|
208
|
+
// ssui: '0xaafc4f740de0dd0dde642a31148fb94517087052f19afb0f7bed1dc41a50c77b::scallop_sui::SCALLOP_SUI', // @TODO: restore on prod
|
|
209
|
+
ssui: '0x88618204de2dfdc2597681a8441ee726b0dc13494c41e319c3264eb7b35fea90::scallop_sui::SCALLOP_SUI',
|
|
210
|
+
// ssca: '0x5ca17430c1d046fae9edeaa8fd76c7b4193a00d764a0ecfa9418d733ad27bc1e::scallop_sca::SCALLOP_SCA', // @TODO: restore on prod
|
|
211
|
+
ssca: '0x9f64a180373a6b66595025ae16a4ab701f0af1dd5c7ce1ac91dc112e52c2a3f8::scallop_sca::SCALLOP_SCA',
|
|
210
212
|
scetus:
|
|
211
213
|
'0xea346ce428f91ab007210443efcea5f5cdbbb3aae7e9affc0ca93f9203c31f0c::scallop_cetus::SCALLOP_CETUS',
|
|
212
214
|
smusd:
|
|
@@ -228,7 +230,8 @@ export const sCoinIds: types.SCoinIds = {
|
|
|
228
230
|
'0xe1a1cc6bcf0001a015eab84bcc6713393ce20535f55b8b6f35c142e057a25fbe::scallop_v_sui::SCALLOP_V_SUI',
|
|
229
231
|
// stable coins
|
|
230
232
|
susdc:
|
|
231
|
-
'0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC',
|
|
233
|
+
// '0x854950aa624b1df59fe64e630b2ba7c550642e9342267a33061d59fb31582da5::scallop_usdc::SCALLOP_USDC', // @TODO: restore on prod
|
|
234
|
+
'0x55ed015f9f006c0c96ad36ebe3b3570d088e8498f52defea48e5634c110e485c::scallop_usdc::SCALLOP_USDC',
|
|
232
235
|
swusdc:
|
|
233
236
|
'0xad4d71551d31092230db1fd482008ea42867dbf27b286e9c70a79d2a6191d58d::scallop_wormhole_usdc::SCALLOP_WORMHOLE_USDC',
|
|
234
237
|
swusdt:
|
|
@@ -239,8 +242,10 @@ export const sCoinIds: types.SCoinIds = {
|
|
|
239
242
|
'0xd285cbbf54c87fd93cd15227547467bb3e405da8bbf2ab99f83f323f88ac9a65::scallop_usdy::SCALLOP_USDY',
|
|
240
243
|
// isolated assets
|
|
241
244
|
sdeep:
|
|
242
|
-
'0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP',
|
|
243
|
-
|
|
245
|
+
// '0xeb7a05a3224837c5e5503575aed0be73c091d1ce5e43aa3c3e716e0ae614608f::scallop_deep::SCALLOP_DEEP', // @TODO: restore on prod
|
|
246
|
+
'0x34f0a2e793e1f79ceac72cfe3bb95f65541da449418289ccd12922d16140c882::scallop_deep::SCALLOP_DEEP',
|
|
247
|
+
// sfud: '0xe56d5167f427cbe597da9e8150ef5c337839aaf46891d62468dcf80bdd8e10d1::scallop_fud::SCALLOP_FUD', // @TODO: restore on prod
|
|
248
|
+
sfud: '0x3b23c05f917052255a0b16a534dbd4446911aa4a30bd3497cdf5b736551e7ef8::scallop_fud::SCALLOP_FUD',
|
|
244
249
|
sblub:
|
|
245
250
|
'0xe72f65446eabfad2103037af2d49d24599106fb44bf4c046c1e7e9acf6844dd0::scallop_blub::SCALLOP_BLUB',
|
|
246
251
|
// Sui bridge assets
|
package/src/constants/index.ts
CHANGED