@scallop-io/sui-scallop-sdk 1.3.0-alpha.5 → 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/constants/queryKeys.d.ts +1 -1
- package/dist/index.js +13 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -10
- 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/constants/queryKeys.ts +2 -2
- package/src/models/scallopBuilder.ts +0 -9
- package/src/models/scallopQuery.ts +1 -1
- package/src/models/scallopUtils.ts +1 -1
- package/src/queries/loyaltyProgramQuery.ts +1 -1
- package/src/types/builder/core.ts +2 -8
package/dist/index.mjs
CHANGED
|
@@ -361,9 +361,9 @@ var queryKeys = {
|
|
|
361
361
|
{ owner }
|
|
362
362
|
]
|
|
363
363
|
},
|
|
364
|
-
|
|
364
|
+
oracle: {
|
|
365
365
|
getPythLatestPriceFeed: (pythPriceId) => [
|
|
366
|
-
"
|
|
366
|
+
"oracle",
|
|
367
367
|
"getPythPriceId",
|
|
368
368
|
{ pythPriceId }
|
|
369
369
|
]
|
|
@@ -4726,7 +4726,7 @@ var ScallopUtils = class {
|
|
|
4726
4726
|
const pythConnection = new SuiPriceServiceConnection(endpoint);
|
|
4727
4727
|
try {
|
|
4728
4728
|
const feed = await this.address.cache.queryClient.fetchQuery({
|
|
4729
|
-
queryKey: queryKeys.
|
|
4729
|
+
queryKey: queryKeys.oracle.getPythLatestPriceFeed(priceId),
|
|
4730
4730
|
queryFn: async () => {
|
|
4731
4731
|
return await pythConnection.getLatestPriceFeeds([priceId]);
|
|
4732
4732
|
}
|
|
@@ -4834,7 +4834,6 @@ import {
|
|
|
4834
4834
|
SuiPythClient,
|
|
4835
4835
|
SuiPriceServiceConnection as SuiPriceServiceConnection2
|
|
4836
4836
|
} from "@pythnetwork/pyth-sui-js";
|
|
4837
|
-
import { TransactionBlock } from "@mysten/sui.js/transactions";
|
|
4838
4837
|
var updateOracles = async (builder, txBlock, assetCoinNames, options = { usePythPullModel: true }) => {
|
|
4839
4838
|
const usePythPullModel = builder.params.usePythPullModel ?? options.usePythPullModel;
|
|
4840
4839
|
assetCoinNames = assetCoinNames ?? [
|
|
@@ -4843,7 +4842,7 @@ var updateOracles = async (builder, txBlock, assetCoinNames, options = { usePyth
|
|
|
4843
4842
|
const rules = builder.isTestnet ? ["pyth"] : ["pyth"];
|
|
4844
4843
|
if (usePythPullModel && rules.includes("pyth")) {
|
|
4845
4844
|
const pythClient = new SuiPythClient(
|
|
4846
|
-
builder.
|
|
4845
|
+
builder.suiKit.client(),
|
|
4847
4846
|
builder.address.get("core.oracles.pyth.state"),
|
|
4848
4847
|
builder.address.get("core.oracles.pyth.wormholeState")
|
|
4849
4848
|
);
|
|
@@ -4856,7 +4855,7 @@ var updateOracles = async (builder, txBlock, assetCoinNames, options = { usePyth
|
|
|
4856
4855
|
const pythConnection = new SuiPriceServiceConnection2(endpoint);
|
|
4857
4856
|
const priceUpdateData = await pythConnection.getPriceFeedsUpdateData(priceIds);
|
|
4858
4857
|
await pythClient.updatePriceFeeds(
|
|
4859
|
-
|
|
4858
|
+
txBlock.txBlock,
|
|
4860
4859
|
// convert txBlock to TransactionBlock because pyth sdk not support new @mysten/sui yet
|
|
4861
4860
|
priceUpdateData,
|
|
4862
4861
|
priceIds
|
|
@@ -7226,7 +7225,6 @@ var ScallopQuery = class {
|
|
|
7226
7225
|
};
|
|
7227
7226
|
|
|
7228
7227
|
// src/models/scallopBuilder.ts
|
|
7229
|
-
import { SuiClient as SuiClientV0 } from "@mysten/sui.js/client";
|
|
7230
7228
|
var ScallopBuilder = class {
|
|
7231
7229
|
constructor(params, instance) {
|
|
7232
7230
|
this.suiKit = instance?.suiKit ?? new SuiKit5(params);
|
|
@@ -7268,9 +7266,6 @@ var ScallopBuilder = class {
|
|
|
7268
7266
|
);
|
|
7269
7267
|
}
|
|
7270
7268
|
this.isTestnet = params.networkType ? params.networkType === "testnet" : false;
|
|
7271
|
-
this.oldSuiClient = new SuiClientV0({
|
|
7272
|
-
url: this.suiKit.suiInteractor.currentFullNode
|
|
7273
|
-
});
|
|
7274
7269
|
}
|
|
7275
7270
|
/**
|
|
7276
7271
|
* Request the scallop API to initialize data.
|