Skip to content

Commit 72dbb81

Browse files
committed
need to update readme
1 parent de3cf5d commit 72dbb81

File tree

5 files changed

+20
-10
lines changed

5 files changed

+20
-10
lines changed

target_chains/solana/sdk/js/pyth_solana_receiver/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ Instantiate it with a Solana web3 `Connection` and anchor `Wallet`:
6565
import { PythSolanaReceiver } from "@pythnetwork/pyth-solana-receiver";
6666
import { Connection, Keypair, PublicKey } from "@solana/web3.js";
6767
import { Wallet } from "@coral-xyz/anchor";
68+
import { sendTransactions } from "@pythnetwork/solana-utils";
6869

6970
const connection = new Connection("https://api.mainnet-beta.solana.com");
7071
const wallet = new Wallet(

target_chains/solana/sdk/js/pyth_solana_receiver/examples/post_price_update.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Wallet } from "@coral-xyz/anchor";
44
import fs from "fs";
55
import os from "os";
66
import { HermesClient } from "@pythnetwork/hermes-client";
7+
import { sendTransactions } from "@pythnetwork/solana-utils";
78

89
// Get price feed ids from https://pyth.network/developers/price-feed-ids#pyth-evm-stable
910
const SOL_PRICE_FEED_ID =
@@ -57,12 +58,13 @@ async function main() {
5758

5859
// Send the instructions in the builder in 1 or more transactions.
5960
// The builder will pack the instructions into transactions automatically.
60-
await pythSolanaReceiver.provider.sendAll(
61+
sendTransactions(
6162
await transactionBuilder.buildVersionedTransactions({
6263
computeUnitPriceMicroLamports: 100000,
6364
tightComputeBudget: true,
6465
}),
65-
{ preflightCommitment: "processed" }
66+
pythSolanaReceiver.connection,
67+
pythSolanaReceiver.wallet
6668
);
6769
}
6870

target_chains/solana/sdk/js/pyth_solana_receiver/examples/post_price_update_from_benchmarks.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { InstructionWithEphemeralSigners, PythSolanaReceiver } from "../";
44
import { Wallet } from "@coral-xyz/anchor";
55
import fs from "fs";
66
import os from "os";
7+
import { sendTransactions } from "@pythnetwork/solana-utils";
78

89
// Get price feed ids from https://pyth.network/developers/price-feed-ids#pyth-evm-stable
910
const SOL_PRICE_FEED_ID =
@@ -55,12 +56,13 @@ async function main() {
5556

5657
// Send the instructions in the builder in 1 or more transactions.
5758
// The builder will pack the instructions into transactions automatically.
58-
await pythSolanaReceiver.provider.sendAll(
59+
sendTransactions(
5960
await transactionBuilder.buildVersionedTransactions({
6061
computeUnitPriceMicroLamports: 100000,
6162
tightComputeBudget: true,
6263
}),
63-
{ preflightCommitment: "processed" }
64+
pythSolanaReceiver.connection,
65+
pythSolanaReceiver.wallet
6466
);
6567
}
6668

target_chains/solana/sdk/js/pyth_solana_receiver/examples/post_price_update_instructions.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Wallet } from "@coral-xyz/anchor";
44
import fs from "fs";
55
import os from "os";
66
import { HermesClient } from "@pythnetwork/hermes-client";
7+
import { sendTransactions } from "@pythnetwork/solana-utils";
78

89
// Get price feed ids from https://pyth.network/developers/price-feed-ids#pyth-evm-stable
910
const SOL_PRICE_FEED_ID =
@@ -49,11 +50,13 @@ async function main() {
4950

5051
const transactions = await pythSolanaReceiver.batchIntoVersionedTransactions(
5152
[...postInstructions, ...consumerInstructions, ...closeInstructions],
52-
{ computeUnitPriceMicroLamports: 100000 }
53+
{ computeUnitPriceMicroLamports: 100000, tightComputeBudget: true }
5354
); // Put all the instructions together
54-
await pythSolanaReceiver.provider.sendAll(transactions, {
55-
preflightCommitment: "processed",
56-
});
55+
await sendTransactions(
56+
transactions,
57+
pythSolanaReceiver.connection,
58+
pythSolanaReceiver.wallet
59+
);
5760
}
5861

5962
// Fetch price update data from Hermes

target_chains/solana/sdk/js/pyth_solana_receiver/examples/update_price_feed.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Wallet } from "@coral-xyz/anchor";
44
import fs from "fs";
55
import os from "os";
66
import { HermesClient } from "@pythnetwork/hermes-client";
7+
import { sendTransactions } from "@pythnetwork/solana-utils";
78

89
// Get price feed ids from https://pyth.network/developers/price-feed-ids#pyth-evm-stable
910
const SOL_PRICE_FEED_ID =
@@ -57,12 +58,13 @@ async function main() {
5758

5859
// Send the instructions in the builder in 1 or more transactions.
5960
// The builder will pack the instructions into transactions automatically.
60-
await pythSolanaReceiver.provider.sendAll(
61+
sendTransactions(
6162
await transactionBuilder.buildVersionedTransactions({
6263
computeUnitPriceMicroLamports: 100000,
6364
tightComputeBudget: true,
6465
}),
65-
{ preflightCommitment: "processed" }
66+
pythSolanaReceiver.connection,
67+
pythSolanaReceiver.wallet
6668
);
6769
}
6870

0 commit comments

Comments
 (0)