@layerzerolabs/lz-solana-sdk-v2 3.0.14 → 3.0.16

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/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # @layerzerolabs/lz-solana-sdk-v2
2
2
 
3
+ ## 3.0.16
4
+
5
+ ### Patch Changes
6
+
7
+ - 87a4bc9: islander mainnet
8
+ - Updated dependencies [87a4bc9]
9
+ - @layerzerolabs/lz-corekit-solana@3.0.16
10
+ - @layerzerolabs/lz-definitions@3.0.16
11
+ - @layerzerolabs/lz-foundation@3.0.16
12
+ - @layerzerolabs/lz-serdes@3.0.16
13
+ - @layerzerolabs/lz-utilities@3.0.16
14
+ - @layerzerolabs/lz-v2-utilities@3.0.16
15
+
16
+ ## 3.0.15
17
+
18
+ ### Patch Changes
19
+
20
+ - 67856bd: endpoints
21
+ - Updated dependencies [67856bd]
22
+ - @layerzerolabs/lz-corekit-solana@3.0.15
23
+ - @layerzerolabs/lz-definitions@3.0.15
24
+ - @layerzerolabs/lz-foundation@3.0.15
25
+ - @layerzerolabs/lz-v2-utilities@3.0.15
26
+
3
27
  ## 3.0.14
4
28
 
5
29
  ### Patch Changes
package/README.md ADDED
@@ -0,0 +1,132 @@
1
+ # @layerzerolabs/lz-solana-sdk-v2
2
+
3
+ The LayerZero Solana SDK V2 package provides a set of essential utilities and modules to facilitate the development and integration of applications with the Solana blockchain. It includes functions for managing deployments, handling wallets, interacting with contracts, and more.
4
+
5
+ ## Features
6
+
7
+ - **Deployment Management**: Functions for reading, writing, and managing deployments.
8
+ - **Wallet Management**: Functions for handling Solana wallets.
9
+ - **Contract Interaction**: Functions for interacting with deployed contracts.
10
+ - **Event Extraction**: Functions for extracting events from transactions.
11
+ - **Price Feed Management**: Functions for managing price feeds.
12
+ - **Utility Functions**: Various utility functions for Solana development.
13
+
14
+ ## Installation
15
+
16
+ To install the LayerZero Solana SDK V2 package, you can use npm or yarn:
17
+
18
+ ```sh
19
+ npm install @layerzerolabs/lz-solana-sdk-v2
20
+ ```
21
+
22
+ or
23
+
24
+ ```sh
25
+ yarn add @layerzerolabs/lz-solana-sdk-v2
26
+ ```
27
+
28
+ ## Usage
29
+
30
+ ### Deployment Management
31
+
32
+ #### getProgramKeypair
33
+
34
+ Gets the program keypair for a specified network and program.
35
+
36
+ ```typescript
37
+ import { getProgramKeypair } from "@layerzerolabs/lz-solana-sdk-v2";
38
+
39
+ const network = "solana-sandbox-local";
40
+ const program = "endpoint";
41
+
42
+ const programKeypair = getProgramKeypair(network, program);
43
+ console.log(`Program Keypair: ${programKeypair.toBase58()}`);
44
+ ```
45
+
46
+ ### Wallet Management
47
+
48
+ #### getChainWallet
49
+
50
+ Retrieves a chain wallet for a specified stage and name.
51
+
52
+ ```typescript
53
+ import { getChainWallet } from "@layerzerolabs/lz-solana-sdk-v2";
54
+
55
+ const stage = "production";
56
+ const name = "oracle";
57
+
58
+ const wallet = getChainWallet(stage, name);
59
+ console.log(`Wallet Address: ${wallet.publicKey.toBase58()}`);
60
+ ```
61
+
62
+ ### Contract Interaction
63
+
64
+ #### initEndpoint
65
+
66
+ Initializes the endpoint settings, including eid and admin, and registers the blocked message library.
67
+
68
+ ```typescript
69
+ import { Endpoint } from "@layerzerolabs/lz-solana-sdk-v2";
70
+
71
+ const endpointProgram = new Endpoint(programPublicKey);
72
+ const endpointId = 1;
73
+ const payer = new PublicKey("payerPublicKey");
74
+ const admin = new PublicKey("adminPublicKey");
75
+
76
+ const instruction = endpointProgram.initEndpoint(endpointId, payer, admin);
77
+ console.log(`Transaction Instruction: ${instruction}`);
78
+ ```
79
+
80
+ ### Event Extraction
81
+
82
+ #### extractSentPacketEventByTxHash
83
+
84
+ Extracts the sent packet event by transaction hash.
85
+
86
+ ```typescript
87
+ import { extractSentPacketEventByTxHash } from "@layerzerolabs/lz-solana-sdk-v2";
88
+
89
+ const connection = new Connection("https://api.mainnet-beta.solana.com");
90
+ const program = new PublicKey("programPublicKey");
91
+ const signature = "transactionSignature";
92
+
93
+ extractSentPacketEventByTxHash(connection, program, signature).then((events) => {
94
+ console.log(`Sent Packet Events: ${events}`);
95
+ });
96
+ ```
97
+
98
+ ### Price Feed Management
99
+
100
+ #### initPriceFeed
101
+
102
+ Initializes the price feed.
103
+
104
+ ```typescript
105
+ import { PriceFeed } from "@layerzerolabs/lz-solana-sdk-v2";
106
+
107
+ const priceFeedProgram = new PriceFeed(programPublicKey);
108
+ const connection = new Connection("https://api.mainnet-beta.solana.com");
109
+ const payer = new PublicKey("payerPublicKey");
110
+ const admin = new PublicKey("adminPublicKey");
111
+ const updaters = [new PublicKey("updaterPublicKey")];
112
+
113
+ priceFeedProgram.initPriceFeed(connection, payer, admin, updaters).then((instruction) => {
114
+ console.log(`Transaction Instruction: ${instruction}`);
115
+ });
116
+ ```
117
+
118
+ ### Utility Functions
119
+
120
+ #### deriveLzReceiveTypesAccountsPDA
121
+
122
+ Derives the LZ receive types accounts PDA.
123
+
124
+ ```typescript
125
+ import { deriveLzReceiveTypesAccountsPDA } from "@layerzerolabs/lz-solana-sdk-v2";
126
+
127
+ const program = new PublicKey("programPublicKey");
128
+ const oappId = new PublicKey("oappId");
129
+
130
+ const [pda, bump] = deriveLzReceiveTypesAccountsPDA(program, oappId);
131
+ console.log(`PDA: ${pda.toBase58()}, Bump: ${bump}`);
132
+ ```
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "dvn-paxos",
3
+ "network": "solana-mainnet",
4
+ "address": "2riPXyzsFhSasZTxbEeWuuvHu4P5c49x4ARJQ4wgLiTF",
5
+ "compatibleVersions": [
6
+ "v2"
7
+ ],
8
+ "deployer": "3aRdyCavVWhxSvV7vUjndhhSqVJJjGBsLEFjoc2ok1y8"
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "dvn-paxos",
3
+ "network": "solana-testnet",
4
+ "address": "2riPXyzsFhSasZTxbEeWuuvHu4P5c49x4ARJQ4wgLiTF",
5
+ "compatibleVersions": [
6
+ "v2"
7
+ ],
8
+ "deployer": "8Av75SWJqZtUt3Jm1NPLedAiQyGg4ayp6pf2AoWUhJ3n"
9
+ }