@haven-fi/solauto-sdk 1.0.628 → 1.0.629
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 +3 -4
- package/local/txSandbox.ts +5 -12
- package/package.json +2 -1
package/README.md
CHANGED
@@ -8,16 +8,15 @@ Solauto is a program on the Solana blockchain that lets you manage leveraged lon
|
|
8
8
|
import { PublicKey } from "@solana/web3.js";
|
9
9
|
import * as solauto from "@haven-fi/solauto-sdk";
|
10
10
|
|
11
|
-
//
|
11
|
+
// Create new Solauto client
|
12
12
|
const client = solauto.getClient(solauto.LendingPlatform.MARGINFI, {
|
13
13
|
signer: yourSigner,
|
14
14
|
rpcUrl: "[YOUR_RPC_URL]",
|
15
15
|
});
|
16
16
|
|
17
|
+
// Initialize the client
|
17
18
|
const supplyMint = new PublicKey(NATIVE_MINT);
|
18
19
|
const debtMint = new PublicKey(USDC);
|
19
|
-
|
20
|
-
// Initialize a new position
|
21
20
|
await client.initialize({
|
22
21
|
positionId: 1,
|
23
22
|
new: true,
|
@@ -70,4 +69,4 @@ const transactionItems = [
|
|
70
69
|
const statuses = await new solauto.TransactionsManager(client).clientSend(
|
71
70
|
transactionItems
|
72
71
|
);
|
73
|
-
```
|
72
|
+
```
|
package/local/txSandbox.ts
CHANGED
@@ -8,6 +8,7 @@ import {
|
|
8
8
|
LendingPlatform,
|
9
9
|
LOCAL_IRONFORGE_API_URL,
|
10
10
|
PriorityFeeSetting,
|
11
|
+
rebalance,
|
11
12
|
RebalanceTxBuilder,
|
12
13
|
SOLAUTO_PROD_PROGRAM,
|
13
14
|
SOLAUTO_TEST_PROGRAM,
|
@@ -17,7 +18,7 @@ import {
|
|
17
18
|
import { getSecretKey } from "./shared";
|
18
19
|
|
19
20
|
const payForTransaction = false;
|
20
|
-
const testProgram =
|
21
|
+
const testProgram = true;
|
21
22
|
|
22
23
|
export async function main() {
|
23
24
|
const [, umi] = getSolanaRpcConnection(
|
@@ -38,19 +39,11 @@ export async function main() {
|
|
38
39
|
});
|
39
40
|
|
40
41
|
await client.initialize({
|
41
|
-
positionId:
|
42
|
-
authority: new PublicKey("
|
42
|
+
positionId: 3,
|
43
|
+
authority: new PublicKey("5UqsR2PGzbP8pGPbXEeXx86Gjz2N2UFBAuFZUSVydAEe"),
|
43
44
|
});
|
44
45
|
|
45
|
-
const transactionItems
|
46
|
-
|
47
|
-
transactionItems.push(
|
48
|
-
new TransactionItem(
|
49
|
-
async (attemptNum) =>
|
50
|
-
await new RebalanceTxBuilder(client).buildRebalanceTx(attemptNum),
|
51
|
-
"rebalance"
|
52
|
-
)
|
53
|
-
);
|
46
|
+
const transactionItems = [rebalance(client)];
|
54
47
|
|
55
48
|
const txManager = new TransactionsManager(
|
56
49
|
client,
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@haven-fi/solauto-sdk",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.629",
|
4
4
|
"main": "dist/index.js",
|
5
5
|
"types": "dist/index.d.ts",
|
6
6
|
"description": "Typescript SDK for the Solauto program on the Solana blockchain",
|
@@ -23,6 +23,7 @@
|
|
23
23
|
"@switchboard-xyz/common": "=3.0.12",
|
24
24
|
"@switchboard-xyz/on-demand": "=1.2.51",
|
25
25
|
"axios": "^1.7.8",
|
26
|
+
"borsh": "^2.0.0",
|
26
27
|
"bs58": "^5.0.0",
|
27
28
|
"cross-fetch": "^4.0.0",
|
28
29
|
"dotenv": "^16.4.7",
|