@scallop-io/sui-scallop-sdk 2.1.4 → 2.1.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.
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
- package/src/builders/vescaBuilder.ts +15 -11
package/package.json
CHANGED
|
@@ -89,7 +89,11 @@ export const isInSubsTable = async (
|
|
|
89
89
|
value: veScaKey,
|
|
90
90
|
},
|
|
91
91
|
});
|
|
92
|
-
|
|
92
|
+
|
|
93
|
+
if (!resp?.data) return false;
|
|
94
|
+
|
|
95
|
+
const contents = (resp.data.content as any).fields.value.fields.contents;
|
|
96
|
+
return Array.isArray(contents) && contents.length > 0;
|
|
93
97
|
} catch (e) {
|
|
94
98
|
console.error(e);
|
|
95
99
|
return false;
|
|
@@ -463,19 +467,19 @@ const generateQuickVeScaMethod: GenerateVeScaQuickMethod = ({
|
|
|
463
467
|
},
|
|
464
468
|
mergeVeScaQuick: async (targetKey: string, sourceKey: string) => {
|
|
465
469
|
// check targetKey and sourceKey
|
|
470
|
+
const table = builder.address.get('vesca.subsTableId');
|
|
466
471
|
const [isTargetInSubTable, isSourceInSubTable] = await Promise.all([
|
|
467
|
-
isInSubsTable(
|
|
468
|
-
|
|
469
|
-
targetKey,
|
|
470
|
-
builder.address.get('vesca.subsTableId')
|
|
471
|
-
),
|
|
472
|
-
isInSubsTable(
|
|
473
|
-
builder,
|
|
474
|
-
sourceKey,
|
|
475
|
-
builder.address.get('vesca.subsTableId')
|
|
476
|
-
),
|
|
472
|
+
isInSubsTable(builder, targetKey, table),
|
|
473
|
+
isInSubsTable(builder, sourceKey, table),
|
|
477
474
|
]);
|
|
478
475
|
|
|
476
|
+
console.log({
|
|
477
|
+
targetKey,
|
|
478
|
+
sourceKey,
|
|
479
|
+
isTargetInSubTable,
|
|
480
|
+
isSourceInSubTable,
|
|
481
|
+
});
|
|
482
|
+
|
|
479
483
|
const unstakeObligationBeforeStake =
|
|
480
484
|
!!txBlock.txBlock.blockData.transactions.find(
|
|
481
485
|
(txn) =>
|