@scallop-io/sui-scallop-sdk 1.3.0-alpha.6 → 1.3.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.js +10 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2 -7
- package/dist/index.mjs.map +1 -1
- package/dist/models/scallopBuilder.d.ts +0 -2
- package/dist/models/scallopQuery.d.ts +1 -1
- package/dist/queries/loyaltyProgramQuery.d.ts +1 -1
- package/dist/types/builder/core.d.ts +3 -3
- package/package.json +2 -3
- package/src/builders/oracle.ts +2 -3
- package/src/models/scallopBuilder.ts +0 -9
- package/src/models/scallopQuery.ts +1 -1
- package/src/queries/loyaltyProgramQuery.ts +1 -1
- package/src/types/builder/core.ts +2 -8
package/dist/index.js
CHANGED
|
@@ -4903,14 +4903,13 @@ var import_utils24 = require("@mysten/sui/utils");
|
|
|
4903
4903
|
var import_sui_kit14 = require("@scallop-io/sui-kit");
|
|
4904
4904
|
|
|
4905
4905
|
// src/builders/coreBuilder.ts
|
|
4906
|
-
var
|
|
4906
|
+
var import_transactions = require("@mysten/sui/transactions");
|
|
4907
4907
|
var import_utils13 = require("@mysten/sui/utils");
|
|
4908
4908
|
var import_sui_kit5 = require("@scallop-io/sui-kit");
|
|
4909
4909
|
|
|
4910
4910
|
// src/builders/oracle.ts
|
|
4911
4911
|
var import_utils12 = require("@mysten/sui/utils");
|
|
4912
4912
|
var import_pyth_sui_js2 = require("@pythnetwork/pyth-sui-js");
|
|
4913
|
-
var import_transactions = require("@mysten/sui.js/transactions");
|
|
4914
4913
|
var updateOracles = async (builder, txBlock, assetCoinNames, options = { usePythPullModel: true }) => {
|
|
4915
4914
|
const usePythPullModel = builder.params.usePythPullModel ?? options.usePythPullModel;
|
|
4916
4915
|
assetCoinNames = assetCoinNames ?? [
|
|
@@ -4919,7 +4918,7 @@ var updateOracles = async (builder, txBlock, assetCoinNames, options = { usePyth
|
|
|
4919
4918
|
const rules = builder.isTestnet ? ["pyth"] : ["pyth"];
|
|
4920
4919
|
if (usePythPullModel && rules.includes("pyth")) {
|
|
4921
4920
|
const pythClient = new import_pyth_sui_js2.SuiPythClient(
|
|
4922
|
-
builder.
|
|
4921
|
+
builder.suiKit.client(),
|
|
4923
4922
|
builder.address.get("core.oracles.pyth.state"),
|
|
4924
4923
|
builder.address.get("core.oracles.pyth.wormholeState")
|
|
4925
4924
|
);
|
|
@@ -4932,7 +4931,7 @@ var updateOracles = async (builder, txBlock, assetCoinNames, options = { usePyth
|
|
|
4932
4931
|
const pythConnection = new import_pyth_sui_js2.SuiPriceServiceConnection(endpoint);
|
|
4933
4932
|
const priceUpdateData = await pythConnection.getPriceFeedsUpdateData(priceIds);
|
|
4934
4933
|
await pythClient.updatePriceFeeds(
|
|
4935
|
-
|
|
4934
|
+
txBlock.txBlock,
|
|
4936
4935
|
// convert txBlock to TransactionBlock because pyth sdk not support new @mysten/sui yet
|
|
4937
4936
|
priceUpdateData,
|
|
4938
4937
|
priceIds
|
|
@@ -5416,7 +5415,7 @@ var generateCoreQuickMethod = ({
|
|
|
5416
5415
|
};
|
|
5417
5416
|
};
|
|
5418
5417
|
var newCoreTxBlock = (builder, initTxBlock) => {
|
|
5419
|
-
const txBlock = initTxBlock instanceof
|
|
5418
|
+
const txBlock = initTxBlock instanceof import_transactions.Transaction ? new import_sui_kit5.SuiTxBlock(initTxBlock) : initTxBlock ? initTxBlock : new import_sui_kit5.SuiTxBlock();
|
|
5420
5419
|
const normalMethod = generateCoreNormalMethod({
|
|
5421
5420
|
builder,
|
|
5422
5421
|
txBlock
|
|
@@ -5444,7 +5443,7 @@ var newCoreTxBlock = (builder, initTxBlock) => {
|
|
|
5444
5443
|
};
|
|
5445
5444
|
|
|
5446
5445
|
// src/builders/spoolBuilder.ts
|
|
5447
|
-
var
|
|
5446
|
+
var import_transactions2 = require("@mysten/sui/transactions");
|
|
5448
5447
|
var import_utils15 = require("@mysten/sui/utils");
|
|
5449
5448
|
var import_sui_kit6 = require("@scallop-io/sui-kit");
|
|
5450
5449
|
var requireStakeAccountIds = async (...params) => {
|
|
@@ -5638,7 +5637,7 @@ var generateSpoolQuickMethod = ({
|
|
|
5638
5637
|
};
|
|
5639
5638
|
};
|
|
5640
5639
|
var newSpoolTxBlock = (builder, initTxBlock) => {
|
|
5641
|
-
const txBlock = initTxBlock instanceof
|
|
5640
|
+
const txBlock = initTxBlock instanceof import_transactions2.Transaction ? new import_sui_kit6.SuiTxBlock(initTxBlock) : initTxBlock ? initTxBlock : new import_sui_kit6.SuiTxBlock();
|
|
5642
5641
|
const normalMethod = generateSpoolNormalMethod({
|
|
5643
5642
|
builder,
|
|
5644
5643
|
txBlock
|
|
@@ -5666,7 +5665,7 @@ var newSpoolTxBlock = (builder, initTxBlock) => {
|
|
|
5666
5665
|
};
|
|
5667
5666
|
|
|
5668
5667
|
// src/builders/borrowIncentiveBuilder.ts
|
|
5669
|
-
var
|
|
5668
|
+
var import_transactions3 = require("@mysten/sui/transactions");
|
|
5670
5669
|
var import_utils17 = require("@mysten/sui/utils");
|
|
5671
5670
|
var import_sui_kit7 = require("@scallop-io/sui-kit");
|
|
5672
5671
|
var requireObligationInfo2 = async (...params) => {
|
|
@@ -5868,7 +5867,7 @@ var generateBorrowIncentiveQuickMethod = ({ builder, txBlock }) => {
|
|
|
5868
5867
|
};
|
|
5869
5868
|
};
|
|
5870
5869
|
var newBorrowIncentiveTxBlock = (builder, initTxBlock) => {
|
|
5871
|
-
const txBlock = initTxBlock instanceof
|
|
5870
|
+
const txBlock = initTxBlock instanceof import_transactions3.Transaction ? new import_sui_kit7.SuiTxBlock(initTxBlock) : initTxBlock ? initTxBlock : new import_sui_kit7.SuiTxBlock();
|
|
5872
5871
|
const normalMethod = generateBorrowIncentiveNormalMethod({
|
|
5873
5872
|
builder,
|
|
5874
5873
|
txBlock
|
|
@@ -6306,7 +6305,7 @@ var newReferralTxBlock = (builder, initTxBlock) => {
|
|
|
6306
6305
|
};
|
|
6307
6306
|
|
|
6308
6307
|
// src/builders/loyaltyProgramBuilder.ts
|
|
6309
|
-
var
|
|
6308
|
+
var import_transactions4 = require("@mysten/sui/transactions");
|
|
6310
6309
|
var import_sui_kit10 = require("@scallop-io/sui-kit");
|
|
6311
6310
|
var generateLoyaltyProgramNormalMethod = ({ builder, txBlock }) => {
|
|
6312
6311
|
const loyaltyProgramIds = {
|
|
@@ -6347,7 +6346,7 @@ var generateLoyaltyProgramQuickMethod = ({
|
|
|
6347
6346
|
};
|
|
6348
6347
|
};
|
|
6349
6348
|
var newLoyaltyProgramTxBlock = (builder, initTxBlock) => {
|
|
6350
|
-
const txBlock = initTxBlock instanceof
|
|
6349
|
+
const txBlock = initTxBlock instanceof import_transactions4.Transaction ? new import_sui_kit10.SuiTxBlock(initTxBlock) : initTxBlock ? initTxBlock : new import_sui_kit10.SuiTxBlock();
|
|
6351
6350
|
const normalMethod = generateLoyaltyProgramNormalMethod({
|
|
6352
6351
|
builder,
|
|
6353
6352
|
txBlock
|
|
@@ -7294,7 +7293,6 @@ var ScallopQuery = class {
|
|
|
7294
7293
|
};
|
|
7295
7294
|
|
|
7296
7295
|
// src/models/scallopBuilder.ts
|
|
7297
|
-
var import_client = require("@mysten/sui.js/client");
|
|
7298
7296
|
var ScallopBuilder = class {
|
|
7299
7297
|
constructor(params, instance) {
|
|
7300
7298
|
this.suiKit = instance?.suiKit ?? new import_sui_kit14.SuiKit(params);
|
|
@@ -7336,9 +7334,6 @@ var ScallopBuilder = class {
|
|
|
7336
7334
|
);
|
|
7337
7335
|
}
|
|
7338
7336
|
this.isTestnet = params.networkType ? params.networkType === "testnet" : false;
|
|
7339
|
-
this.oldSuiClient = new import_client.SuiClient({
|
|
7340
|
-
url: this.suiKit.suiInteractor.currentFullNode
|
|
7341
|
-
});
|
|
7342
7337
|
}
|
|
7343
7338
|
/**
|
|
7344
7339
|
* Request the scallop API to initialize data.
|