@glamsystems/glam-sdk 0.1.19 → 0.1.21

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 CHANGED
@@ -1,5 +1,7 @@
1
1
  # GLAM SDK
2
2
 
3
+ ![NPM Version](https://img.shields.io/npm/v/%40glamsystems%2Fglam-sdk)
4
+
3
5
  A TypeScript SDK for interacting with the GLAM Protocol.
4
6
 
5
7
  ## Installation
@@ -11,43 +13,7 @@ npm i @glamsystems/glam-sdk
11
13
  ## Getting Started
12
14
 
13
15
  - [GLAM docs](https://docs.glam.systems)
14
- - [TypeScript API docs](#)
15
16
 
16
17
  ## Examples
17
18
 
18
- ### Set up a GLAM client and interact with a vault
19
-
20
- ```ts
21
- import * as anchor from "@coral-xyz/anchor";
22
- import { GlamClient, WSOL } from "@glamsystems/glam-sdk";
23
- import { PublicKey } from "@solana/web3.js";
24
-
25
- // Need to set ANCHOR_PROVIDER_URL and ANCHOR_WALLET env variables
26
- // ANCHOR_PROVIDER_URL=...
27
- // ANCHOR_WALLET=...
28
- const glamClient = new GlamClient();
29
- const statePda = new PublicKey("FMHLPaEeCbuivqsAfHrr28FpWJ9oKHTx3jzFbb3tYhq4");
30
-
31
- async function main() {
32
- const vaultPda = glamClient.getVaultPda(statePda);
33
-
34
- console.log("statePda:", statePda.toBase58());
35
- console.log("vaultPda:", vaultPda.toBase58());
36
-
37
- const vaultWsolBalance = await glamClient.getVaultTokenBalance(statePda, WSOL);
38
- console.log("vaultWsolBalance:", vaultWsolBalance.toString());
39
-
40
- // Wrap 0.1 SOL
41
- const txSig = await glamClient.wsol.wrap(statePda, new anchor.BN(100_000_000));
42
- console.log("txSig:", txSig);
43
-
44
- // wSOL balance after wrap should increase by 0.1 SOL
45
- const vaultWsolBalanceAfter = await glamClient.getVaultTokenBalance(statePda, WSOL);
46
- console.log("vaultWsolBalanceAfter:", vaultWsolBalanceAfter.toString());
47
- }
48
-
49
- main().catch((error) => {
50
- console.error("Error:", error);
51
- process.exit(1);
52
- });
53
- ```
19
+ See [examples](./examples).