@haven-fi/solauto-sdk 1.0.746 → 1.0.747
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.
@@ -34,7 +34,7 @@ class ClientTransactionsManager extends transactionsManager_1.TransactionsManage
|
|
34
34
|
.filter((x) => x.tx && x.tx.getInstructions().length > 0)
|
35
35
|
.map((x) => x.tx)));
|
36
36
|
if (updateLutTx) {
|
37
|
-
choresBefore.prepend(updateLutTx);
|
37
|
+
choresBefore = choresBefore.prepend(updateLutTx);
|
38
38
|
}
|
39
39
|
if (choresBefore.getInstructions().length) {
|
40
40
|
const chore = new types_1.TransactionItem(async () => ({ tx: choresBefore }), constants_1.CHORES_TX_NAME);
|
package/local/txSandbox.ts
CHANGED
@@ -1,12 +1,14 @@
|
|
1
1
|
import { Keypair, PublicKey } from "@solana/web3.js";
|
2
2
|
import { createSignerFromKeypair } from "@metaplex-foundation/umi";
|
3
|
-
import { fromWeb3JsKeypair } from "@metaplex-foundation/umi-web3js-adapters";
|
3
|
+
import { fromWeb3JsKeypair, fromWeb3JsPublicKey } from "@metaplex-foundation/umi-web3js-adapters";
|
4
4
|
import {
|
5
5
|
ClientTransactionsManager,
|
6
6
|
consoleLog,
|
7
|
+
fetchReferralState,
|
7
8
|
getBatches,
|
8
9
|
getClient,
|
9
10
|
getPositionExBulk,
|
11
|
+
getReferralState,
|
10
12
|
getSolanaRpcConnection,
|
11
13
|
getSolautoManagedPositions,
|
12
14
|
LendingPlatform,
|
@@ -26,7 +28,7 @@ const payForTransaction = false;
|
|
26
28
|
const testProgram = false;
|
27
29
|
const lpEnv: ProgramEnv = "Prod";
|
28
30
|
|
29
|
-
let [, umi] = getSolanaRpcConnection(
|
31
|
+
let [conn, umi] = getSolanaRpcConnection(
|
30
32
|
LOCAL_IRONFORGE_API_URL,
|
31
33
|
testProgram ? SOLAUTO_TEST_PROGRAM : SOLAUTO_PROD_PROGRAM,
|
32
34
|
lpEnv
|
@@ -38,32 +40,39 @@ const signer = createSignerFromKeypair(
|
|
38
40
|
);
|
39
41
|
|
40
42
|
export async function main() {
|
41
|
-
const client = getClient(LendingPlatform.Marginfi, {
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
});
|
48
|
-
|
49
|
-
await client.initializeExistingSolautoPosition({
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
});
|
56
|
-
|
57
|
-
const transactionItems = [rebalance(client)];
|
58
|
-
|
59
|
-
const txManager = new ClientTransactionsManager({
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
});
|
65
|
-
const statuses = await txManager.send(transactionItems);
|
66
|
-
consoleLog(statuses);
|
43
|
+
// const client = getClient(LendingPlatform.Marginfi, {
|
44
|
+
// signer,
|
45
|
+
// showLogs: true,
|
46
|
+
// rpcUrl: LOCAL_IRONFORGE_API_URL,
|
47
|
+
// programId: testProgram ? SOLAUTO_TEST_PROGRAM : SOLAUTO_PROD_PROGRAM,
|
48
|
+
// lpEnv,
|
49
|
+
// });
|
50
|
+
|
51
|
+
// await client.initializeExistingSolautoPosition({
|
52
|
+
// positionId: 1,
|
53
|
+
// authority: new PublicKey("Bk6mdg4mg9BD217vZwk8WDv7YJ66VyPPRhhQpaZsQPfL"),
|
54
|
+
// // lpUserAccount: new PublicKey(
|
55
|
+
// // "GEokw9jqbh6d1xUNA3qaeYFFetbSR5Y1nt7C3chwwgSz"
|
56
|
+
// // ),
|
57
|
+
// });
|
58
|
+
|
59
|
+
// const transactionItems = [rebalance(client)];
|
60
|
+
|
61
|
+
// const txManager = new ClientTransactionsManager({
|
62
|
+
// txHandler: client,
|
63
|
+
// txRunType: payForTransaction ? "normal" : "only-simulate",
|
64
|
+
// priorityFeeSetting: PriorityFeeSetting.Default,
|
65
|
+
// retryConfig: { totalRetries: 4 },
|
66
|
+
// });
|
67
|
+
// const statuses = await txManager.send(transactionItems);
|
68
|
+
// consoleLog(statuses);
|
69
|
+
|
70
|
+
const ref = getReferralState(new PublicKey("9PCRbk8Gvt2zqewLKbxaSyTxA2JMtdQGhMff8EdELXNq"), SOLAUTO_PROD_PROGRAM);
|
71
|
+
|
72
|
+
const data = await fetchReferralState(umi, fromWeb3JsPublicKey(ref));
|
73
|
+
|
74
|
+
const accounts = await conn.getAddressLookupTable(new PublicKey(data.lookupTable));
|
75
|
+
console.log(accounts.value?.state?.addresses);
|
67
76
|
}
|
68
77
|
|
69
78
|
async function refreshAll() {
|
package/package.json
CHANGED