@pythnetwork/price-pusher 7.0.2 → 7.1.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/README.md +1 -1
- package/lib/sui/command.js +1 -1
- package/lib/sui/sui.d.ts +2 -2
- package/lib/sui/sui.d.ts.map +1 -1
- package/lib/sui/sui.js +13 -13
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -174,7 +174,7 @@ pnpm run start solana \
|
|
|
174
174
|
|
|
175
175
|
|
|
176
176
|
# Or, run the price pusher docker image instead of building from the source
|
|
177
|
-
docker run public.ecr.aws/pyth-network/xc-price-pusher:v<version> -- <above-arguments>
|
|
177
|
+
docker run public.ecr.aws/pyth-network/xc-price-pusher:v<version> -- npm run start -- <above-arguments>
|
|
178
178
|
```
|
|
179
179
|
|
|
180
180
|
[hermes]: https://github.com/pyth-network/pyth-crosschain/tree/main/apps/hermes
|
package/lib/sui/command.js
CHANGED
|
@@ -33,7 +33,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
33
33
|
const pyth_price_listener_1 = require("../pyth-price-listener");
|
|
34
34
|
const controller_1 = require("../controller");
|
|
35
35
|
const sui_1 = require("./sui");
|
|
36
|
-
const ed25519_1 = require("@mysten/sui
|
|
36
|
+
const ed25519_1 = require("@mysten/sui/keypairs/ed25519");
|
|
37
37
|
const pino_1 = __importDefault(require("pino"));
|
|
38
38
|
exports.default = {
|
|
39
39
|
command: "sui",
|
package/lib/sui/sui.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { ChainPriceListener, IPricePusher, PriceInfo, PriceItem } from "../inter
|
|
|
2
2
|
import { DurationInSeconds } from "../utils";
|
|
3
3
|
import { PriceServiceConnection } from "@pythnetwork/price-service-client";
|
|
4
4
|
import { SuiPythClient } from "@pythnetwork/pyth-sui-js";
|
|
5
|
-
import { Ed25519Keypair } from "@mysten/sui
|
|
6
|
-
import { SuiClient, SuiObjectRef } from "@mysten/sui
|
|
5
|
+
import { Ed25519Keypair } from "@mysten/sui/keypairs/ed25519";
|
|
6
|
+
import { SuiClient, SuiObjectRef } from "@mysten/sui/client";
|
|
7
7
|
import { Logger } from "pino";
|
|
8
8
|
type ObjectId = string;
|
|
9
9
|
export declare class SuiPriceListener extends ChainPriceListener {
|
package/lib/sui/sui.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sui.d.ts","sourceRoot":"","sources":["../../src/sui/sui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"sui.d.ts","sourceRoot":"","sources":["../../src/sui/sui.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAE9D,OAAO,EAAE,SAAS,EAAE,YAAY,EAAkB,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAO9B,KAAK,QAAQ,GAAG,MAAM,CAAC;AAGvB,qBAAa,gBAAiB,SAAQ,kBAAkB;IACtD,OAAO,CAAC,UAAU,CAAgB;IAClC,OAAO,CAAC,QAAQ,CAAY;IAC5B,OAAO,CAAC,MAAM,CA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ChB,iGAAiG;YACnF,qBAAqB;IAInC,sEAAsE;YACxD,oBAAoB;mBAyDb,iBAAiB;mBAsDjB,yBAAyB;mBAgBzB,cAAc;mBAiCd,mBAAmB;mBAwCnB,oBAAoB;CAiE1C"}
|
package/lib/sui/sui.js
CHANGED
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SuiPricePusher = exports.SuiPriceListener = void 0;
|
|
4
4
|
const interface_1 = require("../interface");
|
|
5
5
|
const pyth_sui_js_1 = require("@pythnetwork/pyth-sui-js");
|
|
6
|
-
const transactions_1 = require("@mysten/sui
|
|
7
|
-
const client_1 = require("@mysten/sui
|
|
6
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
|
7
|
+
const client_1 = require("@mysten/sui/client");
|
|
8
8
|
const GAS_FEE_FOR_SPLIT = 2_000_000_000;
|
|
9
9
|
// TODO: read this from on chain config
|
|
10
10
|
const MAX_NUM_GAS_OBJECTS_IN_PTB = 256;
|
|
@@ -146,7 +146,7 @@ class SuiPricePusher {
|
|
|
146
146
|
throw new Error(`Expected a single VAA for all priceIds ${priceIdChunk} but received ${vaas.length} VAAs: ${vaas}`);
|
|
147
147
|
}
|
|
148
148
|
const vaa = vaas[0];
|
|
149
|
-
const tx = new transactions_1.
|
|
149
|
+
const tx = new transactions_1.Transaction();
|
|
150
150
|
await this.pythClient.updatePriceFeeds(tx, [Buffer.from(vaa, "base64")], priceIdChunk);
|
|
151
151
|
txBlocks.push(tx);
|
|
152
152
|
}));
|
|
@@ -167,9 +167,9 @@ class SuiPricePusher {
|
|
|
167
167
|
try {
|
|
168
168
|
tx.setGasPayment([gasObject]);
|
|
169
169
|
tx.setGasBudget(this.gasBudget);
|
|
170
|
-
const result = await this.provider.
|
|
170
|
+
const result = await this.provider.signAndExecuteTransaction({
|
|
171
171
|
signer: this.signer,
|
|
172
|
-
|
|
172
|
+
transaction: tx,
|
|
173
173
|
options: {
|
|
174
174
|
showEffects: true,
|
|
175
175
|
},
|
|
@@ -266,13 +266,13 @@ class SuiPricePusher {
|
|
|
266
266
|
}
|
|
267
267
|
static async splitGasCoinEqually(signer, provider, signerAddress, splitAmount, numGasObjects, gasCoin) {
|
|
268
268
|
// TODO: implement chunking if numGasObjects exceeds MAX_NUM_CREATED_OBJECTS
|
|
269
|
-
const tx = new transactions_1.
|
|
270
|
-
const coins = tx.splitCoins(tx.gas, Array.from({ length: numGasObjects }, () => tx.pure(splitAmount)));
|
|
271
|
-
tx.transferObjects(Array.from({ length: numGasObjects }, (_, i) => coins[i]), tx.pure(signerAddress));
|
|
269
|
+
const tx = new transactions_1.Transaction();
|
|
270
|
+
const coins = tx.splitCoins(tx.gas, Array.from({ length: numGasObjects }, () => tx.pure.u64(splitAmount)));
|
|
271
|
+
tx.transferObjects(Array.from({ length: numGasObjects }, (_, i) => coins[i]), tx.pure.address(signerAddress));
|
|
272
272
|
tx.setGasPayment([gasCoin]);
|
|
273
|
-
const result = await provider.
|
|
273
|
+
const result = await provider.signAndExecuteTransaction({
|
|
274
274
|
signer,
|
|
275
|
-
|
|
275
|
+
transaction: tx,
|
|
276
276
|
options: { showEffects: true },
|
|
277
277
|
});
|
|
278
278
|
const error = result?.effects?.status.error;
|
|
@@ -296,7 +296,7 @@ class SuiPricePusher {
|
|
|
296
296
|
const lockedAddresses = new Set();
|
|
297
297
|
initialLockedAddresses.forEach((value) => lockedAddresses.add(value));
|
|
298
298
|
for (let i = 0; i < gasCoinsChunks.length; i++) {
|
|
299
|
-
const mergeTx = new transactions_1.
|
|
299
|
+
const mergeTx = new transactions_1.Transaction();
|
|
300
300
|
let coins = gasCoinsChunks[i];
|
|
301
301
|
coins = coins.filter((coin) => !lockedAddresses.has(coin.objectId));
|
|
302
302
|
if (finalCoin) {
|
|
@@ -305,9 +305,9 @@ class SuiPricePusher {
|
|
|
305
305
|
mergeTx.setGasPayment(coins);
|
|
306
306
|
let mergeResult;
|
|
307
307
|
try {
|
|
308
|
-
mergeResult = await provider.
|
|
308
|
+
mergeResult = await provider.signAndExecuteTransaction({
|
|
309
309
|
signer,
|
|
310
|
-
|
|
310
|
+
transaction: mergeTx,
|
|
311
311
|
options: { showEffects: true },
|
|
312
312
|
});
|
|
313
313
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pythnetwork/price-pusher",
|
|
3
|
-
"version": "7.0
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Pyth Price Pusher",
|
|
5
5
|
"homepage": "https://pyth.network",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -56,12 +56,12 @@
|
|
|
56
56
|
"@coral-xyz/anchor": "^0.30.0",
|
|
57
57
|
"@injectivelabs/networks": "^1.14.6",
|
|
58
58
|
"@injectivelabs/sdk-ts": "1.10.72",
|
|
59
|
-
"@mysten/sui
|
|
59
|
+
"@mysten/sui": "^1.3.0",
|
|
60
60
|
"@pythnetwork/price-service-client": "1.9.0",
|
|
61
61
|
"@pythnetwork/price-service-sdk": "^1.7.1",
|
|
62
62
|
"@pythnetwork/pyth-sdk-solidity": "3.1.0",
|
|
63
63
|
"@pythnetwork/pyth-solana-receiver": "0.8.0",
|
|
64
|
-
"@pythnetwork/pyth-sui-js": "2.
|
|
64
|
+
"@pythnetwork/pyth-sui-js": "2.1.0",
|
|
65
65
|
"@pythnetwork/solana-utils": "0.4.2",
|
|
66
66
|
"@solana/web3.js": "^1.93.0",
|
|
67
67
|
"@truffle/hdwallet-provider": "^2.1.3",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"yaml": "^2.1.1",
|
|
78
78
|
"yargs": "^17.5.1"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "9a31948be215682091abe580a68666909b976462"
|
|
81
81
|
}
|