@pythnetwork/pyth-solana-receiver 0.7.0 → 0.8.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/PythSolanaReceiver.d.ts +3 -3
- package/lib/PythSolanaReceiver.d.ts.map +1 -1
- package/lib/PythSolanaReceiver.js +4 -4
- package/lib/vaa.d.ts +1 -1
- package/lib/vaa.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ Applications can therefore store the address of a price feed account and read it
|
|
|
52
52
|
Price feed accounts have a fixed address derived from the feed id and a shard id.
|
|
53
53
|
The shard id allows different applications to use different accounts for the same feed, thereby reducing the impact of solana congestion.
|
|
54
54
|
This method of using Pyth prices is a good fit for applications that always want to use the most recent price.
|
|
55
|
-
Additionally, the [Price Scheduler](../../../../../../../price_pusher/) can be used to continuously write fresh updates to a price feed account, freeing applications from worrying about writing their own updates.
|
|
55
|
+
Additionally, the [Price Scheduler](../../../../../../../apps/price_pusher/) can be used to continuously write fresh updates to a price feed account, freeing applications from worrying about writing their own updates.
|
|
56
56
|
|
|
57
57
|
This SDK provides methods for working with both types of accounts.
|
|
58
58
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { AnchorProvider, IdlAccounts, Program } from "@coral-xyz/anchor";
|
|
3
|
-
import { Connection, Signer, Transaction, VersionedTransaction } from "@solana/web3.js";
|
|
3
|
+
import { AddressLookupTableAccount, Connection, Signer, Transaction, VersionedTransaction } from "@solana/web3.js";
|
|
4
4
|
import { PythSolanaReceiver as PythSolanaReceiverProgram } from "./idl/pyth_solana_receiver";
|
|
5
5
|
import { WormholeCoreBridgeSolana } from "./idl/wormhole_core_bridge_solana";
|
|
6
6
|
import { PublicKey } from "@solana/web3.js";
|
|
@@ -50,7 +50,7 @@ export declare class PythTransactionBuilder extends TransactionBuilder {
|
|
|
50
50
|
readonly closeInstructions: InstructionWithEphemeralSigners[];
|
|
51
51
|
readonly priceFeedIdToPriceUpdateAccount: Record<string, PublicKey>;
|
|
52
52
|
readonly closeUpdateAccounts: boolean;
|
|
53
|
-
constructor(pythSolanaReceiver: PythSolanaReceiver, config: PythTransactionBuilderConfig);
|
|
53
|
+
constructor(pythSolanaReceiver: PythSolanaReceiver, config: PythTransactionBuilderConfig, addressLookupTable?: AddressLookupTableAccount);
|
|
54
54
|
/**
|
|
55
55
|
* Add instructions to post price updates to the builder.
|
|
56
56
|
* Use this function to post fully verified price updates from the present or from the past for your program to consume.
|
|
@@ -271,7 +271,7 @@ export declare class PythSolanaReceiver {
|
|
|
271
271
|
/**
|
|
272
272
|
* Returns a set of versioned transactions that contain the provided instructions in the same order and with efficient batching
|
|
273
273
|
*/
|
|
274
|
-
batchIntoVersionedTransactions(instructions: InstructionWithEphemeralSigners[], priorityFeeConfig: PriorityFeeConfig): Promise<{
|
|
274
|
+
batchIntoVersionedTransactions(instructions: InstructionWithEphemeralSigners[], priorityFeeConfig: PriorityFeeConfig, addressLookupTable?: AddressLookupTableAccount): Promise<{
|
|
275
275
|
tx: VersionedTransaction;
|
|
276
276
|
signers: Signer[];
|
|
277
277
|
}[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PythSolanaReceiver.d.ts","sourceRoot":"","sources":["../src/PythSolanaReceiver.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACzE,OAAO,EACL,UAAU,EACV,MAAM,EACN,WAAW,EACX,oBAAoB,EACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,kBAAkB,IAAI,yBAAyB,EAEhD,MAAM,4BAA4B,CAAC;AACpC,OAAO,EACL,wBAAwB,EAEzB,MAAM,mCAAmC,CAAC;AAU3C,OAAO,EAAE,SAAS,EAAW,MAAM,iBAAiB,CAAC;AAarD,OAAO,EAAE,MAAM,EAAE,MAAM,m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;IAU7D;;;;OAIG;IACG,uBAAuB,CAC3B,kBAAkB,EAAE,SAAS,GAC5B,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAMrC;;;;;OAKG;IACG,qBAAqB,CACzB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GAAG,MAAM,GAC3B,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC;IAMrC;;;;;OAKG;IACH,0BAA0B,CACxB,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,GAAG,MAAM,GAC3B,SAAS;IAQZ;;;OAGG;IACG,2BAA2B;CAOlC"}
|
|
@@ -46,8 +46,8 @@ class PythTransactionBuilder extends solana_utils_1.TransactionBuilder {
|
|
|
46
46
|
closeInstructions;
|
|
47
47
|
priceFeedIdToPriceUpdateAccount;
|
|
48
48
|
closeUpdateAccounts;
|
|
49
|
-
constructor(pythSolanaReceiver, config) {
|
|
50
|
-
super(pythSolanaReceiver.wallet.publicKey, pythSolanaReceiver.connection);
|
|
49
|
+
constructor(pythSolanaReceiver, config, addressLookupTable) {
|
|
50
|
+
super(pythSolanaReceiver.wallet.publicKey, pythSolanaReceiver.connection, addressLookupTable);
|
|
51
51
|
this.pythSolanaReceiver = pythSolanaReceiver;
|
|
52
52
|
this.closeInstructions = [];
|
|
53
53
|
this.priceFeedIdToPriceUpdateAccount = {};
|
|
@@ -460,8 +460,8 @@ class PythSolanaReceiver {
|
|
|
460
460
|
/**
|
|
461
461
|
* Returns a set of versioned transactions that contain the provided instructions in the same order and with efficient batching
|
|
462
462
|
*/
|
|
463
|
-
async batchIntoVersionedTransactions(instructions, priorityFeeConfig) {
|
|
464
|
-
return solana_utils_1.TransactionBuilder.batchIntoVersionedTransactions(this.wallet.publicKey, this.connection, instructions, priorityFeeConfig);
|
|
463
|
+
async batchIntoVersionedTransactions(instructions, priorityFeeConfig, addressLookupTable) {
|
|
464
|
+
return solana_utils_1.TransactionBuilder.batchIntoVersionedTransactions(this.wallet.publicKey, this.connection, instructions, priorityFeeConfig, addressLookupTable);
|
|
465
465
|
}
|
|
466
466
|
/**
|
|
467
467
|
* Fetch the contents of a price update account
|
package/lib/vaa.d.ts
CHANGED
|
@@ -38,7 +38,7 @@ export declare const VAA_START = 46;
|
|
|
38
38
|
*/
|
|
39
39
|
export declare function buildEncodedVaaCreateInstruction(wormhole: Program<WormholeCoreBridgeSolana>, vaa: Buffer, encodedVaaKeypair: Keypair): Promise<InstructionWithEphemeralSigners>;
|
|
40
40
|
/**
|
|
41
|
-
* Writing the VAA to
|
|
41
|
+
* Writing the VAA to an encoded VAA account is done in 2 instructions.
|
|
42
42
|
*
|
|
43
43
|
* The first one writes the first `VAA_SPLIT_INDEX` bytes and the second one writes the rest.
|
|
44
44
|
*
|
package/lib/vaa.js
CHANGED
|
@@ -62,7 +62,7 @@ async function buildEncodedVaaCreateInstruction(wormhole, vaa, encodedVaaKeypair
|
|
|
62
62
|
}
|
|
63
63
|
exports.buildEncodedVaaCreateInstruction = buildEncodedVaaCreateInstruction;
|
|
64
64
|
/**
|
|
65
|
-
* Writing the VAA to
|
|
65
|
+
* Writing the VAA to an encoded VAA account is done in 2 instructions.
|
|
66
66
|
*
|
|
67
67
|
* The first one writes the first `VAA_SPLIT_INDEX` bytes and the second one writes the rest.
|
|
68
68
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pythnetwork/pyth-solana-receiver",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Pyth solana receiver SDK",
|
|
5
5
|
"homepage": "https://pyth.network",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"@pythnetwork/solana-utils": "*",
|
|
49
49
|
"@solana/web3.js": "^1.90.0"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "6535e7fe613c560e21b872a584c888d066c8b5f6"
|
|
52
52
|
}
|