@haven-fi/solauto-sdk 1.0.105 → 1.0.107

Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
1
- {"version":3,"file":"solautoClient.d.ts","sourceRoot":"","sources":["../../src/clients/solautoClient.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAEL,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAOnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,aAAa,EAEd,MAAM,iDAAiD,CAAC;AACzD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,eAAe,EACf,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,wBAAwB,EACxB,yBAAyB,EACzB,gCAAgC,EAChC,sBAAsB,EAMvB,MAAM,cAAc,CAAC;AAStB,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAKvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAMnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,WAAW,iBAAiB;IAChC,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,aAAa,CAAC;IAEvB,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB,mBAAmB,CAAC,EAAE,SAAS,CAAC;CACjC;AAED,8BAAsB,aAAc,SAAQ,SAAS;IAmC1C,SAAS,CAAC,EAAE,OAAO;IAlCrB,eAAe,EAAG,eAAe,CAAC;IAElC,SAAS,EAAG,SAAS,CAAC;IACtB,MAAM,EAAG,MAAM,CAAC;IAEhB,UAAU,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AAkB;IAEf,qBAAqB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CAalE"}
@@ -127,7 +127,6 @@ class SolautoClient extends txHandler_1.TxHandler {
127
127
  const lookupTable = this.authorityLutAddress
128
128
  ? await this.connection.getAddressLookupTable(this.authorityLutAddress)
129
129
  : null;
130
- console.log(lookupTable?.value);
131
130
  if (!lookupTable || lookupTable?.value === null) {
132
131
  this.authorityLutAddress = undefined;
133
132
  }
@@ -254,6 +253,7 @@ class SolautoClient extends txHandler_1.TxHandler {
254
253
  positionSupplyTa: (0, umi_1.publicKey)(this.positionSupplyTa),
255
254
  positionDebtTa: (0, umi_1.publicKey)(this.positionDebtTa),
256
255
  signerDebtTa: (0, umi_1.publicKey)(this.signerDebtTa),
256
+ protocolAccount: (0, umi_1.publicKey)(this.protocolAccount())
257
257
  });
258
258
  }
259
259
  cancelDCAIx() {
@@ -13,6 +13,7 @@ export type ClosePositionInstructionAccounts = {
13
13
  tokenProgram?: PublicKey | Pda;
14
14
  ataProgram?: PublicKey | Pda;
15
15
  solautoPosition: PublicKey | Pda;
16
+ protocolAccount: PublicKey | Pda;
16
17
  signerSupplyTa: PublicKey | Pda;
17
18
  positionSupplyTa: PublicKey | Pda;
18
19
  positionSupplyCollateralTa?: PublicKey | Pda;
@@ -1 +1 @@
1
- {"version":3,"file":"closePosition.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/closePosition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAIX,MAAM,sCAAsC,CAAC;AAQ9C,MAAM,MAAM,gCAAgC,GAAG;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,UAAU,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC7B,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,cAAc,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,gBAAgB,EAAE,SAAS,GAAG,GAAG,CAAC;IAClC,0BAA0B,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC7C,cAAc,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,EAAE,SAAS,GAAG,GAAG,CAAC;CAC/B,CAAC;AAGF,MAAM,MAAM,4BAA4B,GAAG;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAErE,MAAM,MAAM,gCAAgC,GAAG,EAAE,CAAC;AAElD,wBAAgB,yCAAyC,IAAI,UAAU,CACrE,gCAAgC,EAChC,4BAA4B,CAC7B,CAcA;AAGD,wBAAgB,aAAa,CAC3B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAClC,KAAK,EAAE,gCAAgC,GACtC,kBAAkB,CAyGpB"}
1
+ {"version":3,"file":"closePosition.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/closePosition.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAIX,MAAM,sCAAsC,CAAC;AAQ9C,MAAM,MAAM,gCAAgC,GAAG;IAC7C,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,UAAU,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC7B,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,cAAc,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,gBAAgB,EAAE,SAAS,GAAG,GAAG,CAAC;IAClC,0BAA0B,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC7C,cAAc,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,EAAE,SAAS,GAAG,GAAG,CAAC;CAC/B,CAAC;AAGF,MAAM,MAAM,4BAA4B,GAAG;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAErE,MAAM,MAAM,gCAAgC,GAAG,EAAE,CAAC;AAElD,wBAAgB,yCAAyC,IAAI,UAAU,CACrE,gCAAgC,EAChC,4BAA4B,CAC7B,CAcA;AAGD,wBAAgB,aAAa,CAC3B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAClC,KAAK,EAAE,gCAAgC,GACtC,kBAAkB,CA8GpB"}
@@ -48,28 +48,33 @@ function closePosition(context, input) {
48
48
  isWritable: true,
49
49
  value: input.solautoPosition ?? null,
50
50
  },
51
- signerSupplyTa: {
51
+ protocolAccount: {
52
52
  index: 5,
53
53
  isWritable: true,
54
+ value: input.protocolAccount ?? null,
55
+ },
56
+ signerSupplyTa: {
57
+ index: 6,
58
+ isWritable: true,
54
59
  value: input.signerSupplyTa ?? null,
55
60
  },
56
61
  positionSupplyTa: {
57
- index: 6,
62
+ index: 7,
58
63
  isWritable: true,
59
64
  value: input.positionSupplyTa ?? null,
60
65
  },
61
66
  positionSupplyCollateralTa: {
62
- index: 7,
67
+ index: 8,
63
68
  isWritable: true,
64
69
  value: input.positionSupplyCollateralTa ?? null,
65
70
  },
66
71
  positionDebtTa: {
67
- index: 8,
72
+ index: 9,
68
73
  isWritable: true,
69
74
  value: input.positionDebtTa ?? null,
70
75
  },
71
76
  signerDebtTa: {
72
- index: 9,
77
+ index: 10,
73
78
  isWritable: true,
74
79
  value: input.signerDebtTa ?? null,
75
80
  },
@@ -1 +1 @@
1
- {"version":3,"file":"solanaUtils.d.ts","sourceRoot":"","sources":["../../src/utils/solanaUtils.ts"],"names":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AC,UAAU,GAAG,SAAS,CAAC,CAmDjC"}
@@ -160,9 +160,6 @@ async function sendSingleOptimizedTransaction(umi, connection, tx, simulateOnly,
160
160
  console.log("Serialized transaction size: ", tx.getTransactionSize(umi));
161
161
  const feeEstimate = await getComputeUnitPriceEstimate(umi, tx, prioritySetting);
162
162
  console.log("Compute unit price: ", feeEstimate);
163
- console.log("INSTRUCTIONS:");
164
- console.log(tx.getInstructions());
165
- console.log("SImULATING...");
166
163
  const simulationResult = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await simulateTransaction(connection, (0, umi_web3js_adapters_1.toWeb3JsTransaction)(await (await assembleFinalTransaction(umi.identity, tx, feeEstimate, 1400000).setLatestBlockhash(umi)).build(umi))));
167
164
  const computeUnitLimit = Math.round(simulationResult.value.unitsConsumed * 1.1);
168
165
  console.log("Compute unit limit: ", computeUnitLimit);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haven-fi/solauto-sdk",
3
- "version": "1.0.105",
3
+ "version": "1.0.107",
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",
@@ -265,7 +265,6 @@ export abstract class SolautoClient extends TxHandler {
265
265
  const lookupTable = this.authorityLutAddress
266
266
  ? await this.connection.getAddressLookupTable(this.authorityLutAddress)
267
267
  : null;
268
- console.log(lookupTable?.value);
269
268
  if (!lookupTable || lookupTable?.value === null) {
270
269
  this.authorityLutAddress = undefined;
271
270
  }
@@ -438,6 +437,7 @@ export abstract class SolautoClient extends TxHandler {
438
437
  positionSupplyTa: publicKey(this.positionSupplyTa),
439
438
  positionDebtTa: publicKey(this.positionDebtTa),
440
439
  signerDebtTa: publicKey(this.signerDebtTa),
440
+ protocolAccount: publicKey(this.protocolAccount())
441
441
  });
442
442
  }
443
443
 
@@ -33,6 +33,7 @@ export type ClosePositionInstructionAccounts = {
33
33
  tokenProgram?: PublicKey | Pda;
34
34
  ataProgram?: PublicKey | Pda;
35
35
  solautoPosition: PublicKey | Pda;
36
+ protocolAccount: PublicKey | Pda;
36
37
  signerSupplyTa: PublicKey | Pda;
37
38
  positionSupplyTa: PublicKey | Pda;
38
39
  positionSupplyCollateralTa?: PublicKey | Pda;
@@ -102,28 +103,33 @@ export function closePosition(
102
103
  isWritable: true as boolean,
103
104
  value: input.solautoPosition ?? null,
104
105
  },
105
- signerSupplyTa: {
106
+ protocolAccount: {
106
107
  index: 5,
107
108
  isWritable: true as boolean,
109
+ value: input.protocolAccount ?? null,
110
+ },
111
+ signerSupplyTa: {
112
+ index: 6,
113
+ isWritable: true as boolean,
108
114
  value: input.signerSupplyTa ?? null,
109
115
  },
110
116
  positionSupplyTa: {
111
- index: 6,
117
+ index: 7,
112
118
  isWritable: true as boolean,
113
119
  value: input.positionSupplyTa ?? null,
114
120
  },
115
121
  positionSupplyCollateralTa: {
116
- index: 7,
122
+ index: 8,
117
123
  isWritable: true as boolean,
118
124
  value: input.positionSupplyCollateralTa ?? null,
119
125
  },
120
126
  positionDebtTa: {
121
- index: 8,
127
+ index: 9,
122
128
  isWritable: true as boolean,
123
129
  value: input.positionDebtTa ?? null,
124
130
  },
125
131
  signerDebtTa: {
126
- index: 9,
132
+ index: 10,
127
133
  isWritable: true as boolean,
128
134
  value: input.signerDebtTa ?? null,
129
135
  },
@@ -290,9 +290,6 @@ export async function sendSingleOptimizedTransaction(
290
290
  const feeEstimate = await getComputeUnitPriceEstimate(umi, tx, prioritySetting);
291
291
  console.log("Compute unit price: ", feeEstimate);
292
292
 
293
- console.log("INSTRUCTIONS:");
294
- console.log(tx.getInstructions());
295
- console.log("SImULATING...");
296
293
  const simulationResult = await retryWithExponentialBackoff(
297
294
  async () =>
298
295
  await simulateTransaction(
@@ -25,9 +25,10 @@ describe("Solauto Marginfi tests", async () => {
25
25
 
26
26
  const payForTransactions = false;
27
27
  const useJitoBundle = false;
28
- const positionId = 2;
28
+ const positionId = 255;
29
29
 
30
30
  it("open - deposit - borrow - rebalance to 0 - withdraw - close", async () => {
31
+
31
32
  const client = new SolautoMarginfiClient(process.env.HELIUS_API_KEY!, true);
32
33
 
33
34
  const supply = NATIVE_MINT;
@@ -38,7 +39,7 @@ describe("Solauto Marginfi tests", async () => {
38
39
  {
39
40
  signer,
40
41
  positionId,
41
- authority: new PublicKey("AprYCPiVeKMCgjQ2ZufwChMzvQ5kFjJo2ekTLSkXsQDm")
42
+ authority: new PublicKey("92xmP49BQycn3t2HkGxLAweN3jjrExxSNpywA3xF7mYY")
42
43
  // marginfiAccount: new PublicKey(
43
44
  // "4nNvUXF5YqHFcH2nGweSiuvy1ct7V5FXfoCLKFYUN36z"
44
45
  // ),
@@ -58,13 +59,13 @@ describe("Solauto Marginfi tests", async () => {
58
59
  };
59
60
 
60
61
  // if (client.solautoPositionData === null) {
61
- // transactionItems.push(
62
- // new TransactionItem(async () => {
63
- // return {
64
- // tx: client.openPosition(),
65
- // };
66
- // }, "open position")
67
- // );
62
+ // transactionItems.push(
63
+ // new TransactionItem(async () => {
64
+ // return {
65
+ // tx: client.openPosition(settingParams),
66
+ // };
67
+ // }, "open position")
68
+ // );
68
69
 
69
70
  // const initialSupplyUsd = 150;
70
71
  // transactionItems.push(
@@ -154,11 +155,12 @@ describe("Solauto Marginfi tests", async () => {
154
155
  // )
155
156
  // );
156
157
 
157
- // await new TransactionsManager(
158
- // client,
159
- // undefined,
160
- // !payForTransactions,
161
- // useJitoBundle
162
- // ).clientSend(transactionItems);
158
+ await new TransactionsManager(
159
+ client,
160
+ undefined,
161
+ !payForTransactions,
162
+ useJitoBundle
163
+ ).clientSend(transactionItems);
164
+
163
165
  });
164
166
  });