@pythnetwork/price-pusher 7.0.0 → 7.0.1

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.
@@ -21,6 +21,7 @@ declare const _default: {
21
21
  "jito-keypair-file": Options;
22
22
  "jito-tip-lamports": Options;
23
23
  "jito-bundle-size": Options;
24
+ "updates-per-jito-bundle": Options;
24
25
  };
25
26
  handler: (argv: any) => void;
26
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/solana/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAgBhC,OAAO,EACL,cAAc,EAEf,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;oBAwDH,GAAG;;AAtD9B,wBA2JE;AAEF,eAAO,MAAM,cAAc,MAAO,cAAc,UAAU,MAAM,SAO/D,CAAC"}
1
+ {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/solana/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAgBhC,OAAO,EACL,cAAc,EAEf,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;oBA6DH,GAAG;;AA3D9B,wBAkKE;AAEF,eAAO,MAAM,cAAc,MAAO,cAAc,UAAU,MAAM,SAO/D,CAAC"}
@@ -84,6 +84,11 @@ exports.default = {
84
84
  type: "number",
85
85
  default: 2,
86
86
  },
87
+ "updates-per-jito-bundle": {
88
+ description: "Number of transactions in each bundle",
89
+ type: "number",
90
+ default: 6,
91
+ },
87
92
  ...options.priceConfigFile,
88
93
  ...options.priceServiceEndpoint,
89
94
  ...options.pythContractAddress,
@@ -94,7 +99,7 @@ exports.default = {
94
99
  ...options.controllerLogLevel,
95
100
  },
96
101
  handler: function (argv) {
97
- const { endpoint, keypairFile, shardId, computeUnitPriceMicroLamports, priceConfigFile, priceServiceEndpoint, pythContractAddress, pushingFrequency, pollingFrequency, jitoEndpoint, jitoKeypairFile, jitoTipLamports, jitoBundleSize, logLevel, priceServiceConnectionLogLevel, controllerLogLevel, } = argv;
102
+ const { endpoint, keypairFile, shardId, computeUnitPriceMicroLamports, priceConfigFile, priceServiceEndpoint, pythContractAddress, pushingFrequency, pollingFrequency, jitoEndpoint, jitoKeypairFile, jitoTipLamports, jitoBundleSize, updatesPerJitoBundle, logLevel, priceServiceConnectionLogLevel, controllerLogLevel, } = argv;
98
103
  const logger = (0, pino_1.default)({ level: logLevel });
99
104
  const priceConfigs = (0, price_config_1.readPriceConfigFile)(priceConfigFile);
100
105
  const priceServiceConnection = new price_service_client_1.PriceServiceConnection(priceServiceEndpoint, {
@@ -112,7 +117,7 @@ exports.default = {
112
117
  if (jitoTipLamports) {
113
118
  const jitoKeypair = web3_js_1.Keypair.fromSecretKey(Uint8Array.from(JSON.parse(fs_1.default.readFileSync(jitoKeypairFile, "ascii"))));
114
119
  const jitoClient = (0, searcher_1.searcherClient)(jitoEndpoint, jitoKeypair);
115
- solanaPricePusher = new solana_1.SolanaPricePusherJito(pythSolanaReceiver, priceServiceConnection, logger.child({ module: "SolanaPricePusherJito" }), shardId, jitoTipLamports, jitoClient, jitoBundleSize);
120
+ solanaPricePusher = new solana_1.SolanaPricePusherJito(pythSolanaReceiver, priceServiceConnection, logger.child({ module: "SolanaPricePusherJito" }), shardId, jitoTipLamports, jitoClient, jitoBundleSize, updatesPerJitoBundle);
116
121
  (0, exports.onBundleResult)(jitoClient, logger.child({ module: "JitoClient" }));
117
122
  }
118
123
  else {
@@ -32,7 +32,8 @@ export declare class SolanaPricePusherJito implements IPricePusher {
32
32
  private jitoTipLamports;
33
33
  private searcherClient;
34
34
  private jitoBundleSize;
35
- constructor(pythSolanaReceiver: PythSolanaReceiver, priceServiceConnection: PriceServiceConnection, logger: Logger, shardId: number, jitoTipLamports: number, searcherClient: SearcherClient, jitoBundleSize: number);
35
+ private updatesPerJitoBundle;
36
+ constructor(pythSolanaReceiver: PythSolanaReceiver, priceServiceConnection: PriceServiceConnection, logger: Logger, shardId: number, jitoTipLamports: number, searcherClient: SearcherClient, jitoBundleSize: number, updatesPerJitoBundle: number);
36
37
  updatePriceFeed(priceIds: string[], _pubTimesToPush: number[]): Promise<void>;
37
38
  }
38
39
  //# sourceMappingURL=solana.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../src/solana/solana.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,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;AAK3E,OAAO,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAC;AAExE,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAE9B,qBAAa,mBAAoB,SAAQ,kBAAkB;IAEvD,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,OAAO;IAEf,OAAO,CAAC,MAAM;gBAHN,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,MAAM,EACvB,UAAU,EAAE,SAAS,EAAE,EACf,MAAM,EAAE,MAAM,EACtB,MAAM,EAAE;QACN,gBAAgB,EAAE,iBAAiB,CAAC;KACrC;YAOW,WAAW;IAUnB,KAAK;IAOL,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;CA0B3E;AAED,qBAAa,iBAAkB,YAAW,YAAY;IAElD,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,sBAAsB;IAC9B,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MAAM;IAGhC,eAAe,CACnB,QAAQ,EAAE,MAAM,EAAE,EAElB,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,IAAI,CAAC;CAuCjB"}
@@ -96,7 +96,6 @@ class SolanaPricePusher {
96
96
  }
97
97
  }
98
98
  exports.SolanaPricePusher = SolanaPricePusher;
99
- const UPDATES_PER_JITO_BUNDLE = 7;
100
99
  class SolanaPricePusherJito {
101
100
  pythSolanaReceiver;
102
101
  priceServiceConnection;
@@ -105,7 +104,8 @@ class SolanaPricePusherJito {
105
104
  jitoTipLamports;
106
105
  searcherClient;
107
106
  jitoBundleSize;
108
- constructor(pythSolanaReceiver, priceServiceConnection, logger, shardId, jitoTipLamports, searcherClient, jitoBundleSize) {
107
+ updatesPerJitoBundle;
108
+ constructor(pythSolanaReceiver, priceServiceConnection, logger, shardId, jitoTipLamports, searcherClient, jitoBundleSize, updatesPerJitoBundle) {
109
109
  this.pythSolanaReceiver = pythSolanaReceiver;
110
110
  this.priceServiceConnection = priceServiceConnection;
111
111
  this.logger = logger;
@@ -113,6 +113,7 @@ class SolanaPricePusherJito {
113
113
  this.jitoTipLamports = jitoTipLamports;
114
114
  this.searcherClient = searcherClient;
115
115
  this.jitoBundleSize = jitoBundleSize;
116
+ this.updatesPerJitoBundle = updatesPerJitoBundle;
116
117
  }
117
118
  async updatePriceFeed(priceIds,
118
119
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -125,12 +126,12 @@ class SolanaPricePusherJito {
125
126
  this.logger.error(err, "getPriceFeedsUpdateData failed");
126
127
  return;
127
128
  }
128
- for (let i = 0; i < priceIds.length; i += UPDATES_PER_JITO_BUNDLE) {
129
+ for (let i = 0; i < priceIds.length; i += this.updatesPerJitoBundle) {
129
130
  const transactionBuilder = this.pythSolanaReceiver.newTransactionBuilder({
130
131
  closeUpdateAccounts: true,
131
132
  });
132
133
  await transactionBuilder.addUpdatePriceFeed(priceFeedUpdateData.map((x) => {
133
- return (0, price_service_sdk_1.sliceAccumulatorUpdateData)(Buffer.from(x, "base64"), i, i + UPDATES_PER_JITO_BUNDLE).toString("base64");
134
+ return (0, price_service_sdk_1.sliceAccumulatorUpdateData)(Buffer.from(x, "base64"), i, i + this.updatesPerJitoBundle).toString("base64");
134
135
  }), this.shardId);
135
136
  const transactions = await transactionBuilder.buildVersionedTransactions({
136
137
  jitoTipLamports: this.jitoTipLamports,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pythnetwork/price-pusher",
3
- "version": "7.0.0",
3
+ "version": "7.0.1",
4
4
  "description": "Pyth Price Pusher",
5
5
  "homepage": "https://pyth.network",
6
6
  "main": "lib/index.js",
@@ -62,7 +62,7 @@
62
62
  "@pythnetwork/pyth-sdk-solidity": "3.1.0",
63
63
  "@pythnetwork/pyth-solana-receiver": "0.8.0",
64
64
  "@pythnetwork/pyth-sui-js": "2.0.0",
65
- "@pythnetwork/solana-utils": "0.4.1",
65
+ "@pythnetwork/solana-utils": "0.4.2",
66
66
  "@solana/web3.js": "^1.93.0",
67
67
  "@truffle/hdwallet-provider": "^2.1.3",
68
68
  "@types/pino": "^7.0.5",
@@ -77,5 +77,5 @@
77
77
  "yaml": "^2.1.1",
78
78
  "yargs": "^17.5.1"
79
79
  },
80
- "gitHead": "05dc9c8e06b9643bb365db494e67cac843d7b90a"
80
+ "gitHead": "27656f9e609abaa5943489f1407c6595cfdbfc2e"
81
81
  }