@haven-fi/solauto-sdk 1.0.135 → 1.0.137
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/clients/solautoClient.js +2 -2
- package/dist/clients/solautoMarginfiClient.d.ts.map +1 -1
- package/dist/clients/solautoMarginfiClient.js +2 -4
- package/dist/generated/instructions/marginfiRebalance.d.ts +2 -2
- package/dist/generated/instructions/marginfiRebalance.d.ts.map +1 -1
- package/dist/generated/instructions/marginfiRebalance.js +4 -4
- package/package.json +1 -1
- package/src/clients/solautoClient.ts +2 -2
- package/src/clients/solautoMarginfiClient.ts +2 -4
- package/src/generated/instructions/marginfiRebalance.ts +6 -6
@@ -123,10 +123,10 @@ class SolautoClient extends txHandler_1.TxHandler {
|
|
123
123
|
lutAccountsToAdd() {
|
124
124
|
return [
|
125
125
|
this.authority,
|
126
|
-
...(this.signer.publicKey.
|
126
|
+
...((0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.signer.publicKey).equals(this.authority)
|
127
127
|
? [this.signerSupplyTa]
|
128
128
|
: []),
|
129
|
-
...(this.signer.publicKey.
|
129
|
+
...((0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.signer.publicKey).equals(this.authority)
|
130
130
|
? [this.signerDebtTa]
|
131
131
|
: []),
|
132
132
|
this.solautoPosition,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solautoMarginfiClient.d.ts","sourceRoot":"","sources":["../../src/clients/solautoMarginfiClient.ts"],"names":[],"mappings":"AAIA,OAAO,EACL,MAAM,EACN,kBAAkB,EAMnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,SAAS,EAA8B,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAM1D,OAAO,EACL,kBAAkB,EAElB,aAAa,EACb,iBAAiB,EACjB,wBAAwB,EACxB,gCAAgC,EAKjC,MAAM,cAAc,CAA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fiClient extends solautoClient_1.SolautoClient {
|
|
293
293
|
supplyBank: (0, umi_1.publicKey)(this.marginfiSupplyAccounts.bank),
|
294
294
|
supplyPriceOracle: (0, umi_1.publicKey)(this.supplyPriceOracle),
|
295
295
|
positionSupplyTa: (0, umi_1.publicKey)(this.positionSupplyTa),
|
296
|
-
|
297
|
-
? (0, umi_1.publicKey)(this.signerSupplyTa)
|
298
|
-
: undefined,
|
296
|
+
authoritySupplyTa: (0, umi_1.publicKey)((0, accountUtils_1.getTokenAccount)(this.authority, this.supplyMint)),
|
299
297
|
vaultSupplyTa: needSupplyAccounts
|
300
298
|
? (0, umi_1.publicKey)(this.marginfiSupplyAccounts.liquidityVault)
|
301
299
|
: undefined,
|
@@ -305,7 +303,7 @@ class SolautoMarginfiClient extends solautoClient_1.SolautoClient {
|
|
305
303
|
debtBank: (0, umi_1.publicKey)(this.marginfiDebtAccounts.bank),
|
306
304
|
debtPriceOracle: (0, umi_1.publicKey)(this.debtPriceOracle),
|
307
305
|
positionDebtTa: (0, umi_1.publicKey)(this.positionDebtTa),
|
308
|
-
|
306
|
+
authorityDebtTa: (0, umi_1.publicKey)((0, accountUtils_1.getTokenAccount)(this.authority, this.debtMint)),
|
309
307
|
vaultDebtTa: needDebtAccounts
|
310
308
|
? (0, umi_1.publicKey)(this.marginfiDebtAccounts.liquidityVault)
|
311
309
|
: undefined,
|
@@ -24,13 +24,13 @@ export type MarginfiRebalanceInstructionAccounts = {
|
|
24
24
|
supplyBank: PublicKey | Pda;
|
25
25
|
supplyPriceOracle?: PublicKey | Pda;
|
26
26
|
positionSupplyTa: PublicKey | Pda;
|
27
|
-
|
27
|
+
authoritySupplyTa?: PublicKey | Pda;
|
28
28
|
vaultSupplyTa?: PublicKey | Pda;
|
29
29
|
supplyVaultAuthority?: PublicKey | Pda;
|
30
30
|
debtBank: PublicKey | Pda;
|
31
31
|
debtPriceOracle?: PublicKey | Pda;
|
32
32
|
positionDebtTa: PublicKey | Pda;
|
33
|
-
|
33
|
+
authorityDebtTa?: PublicKey | Pda;
|
34
34
|
vaultDebtTa?: PublicKey | Pda;
|
35
35
|
debtVaultAuthority?: PublicKey | Pda;
|
36
36
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marginfiRebalance.d.ts","sourceRoot":"","sources":["../../../src/generated/instructions/marginfiRebalance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,OAAO,EACP,MAAM,EACN,gBAAgB,EAChB,GAAG,EACH,SAAS,EACT,MAAM,EACN,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EAMX,MAAM,sCAAsC,CAAC;AAM9C,OAAO,EACL,oBAAoB,EACpB,wBAAwB,EAEzB,MAAM,UAAU,CAAC;AAGlB,MAAM,MAAM,oCAAoC,GAAG;IACjD,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,aAAa,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,YAAY,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,SAAS,EAAE,SAAS,GAAG,GAAG,CAAC;IAC3B,mBAAmB,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IACtC,sBAAsB,EAAE,SAAS,GAAG,GAAG,CAAC;IACxC,kBAAkB,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IACrC,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,aAAa,EAAE,SAAS,GAAG,GAAG,CAAC;IAC/B,eAAe,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,cAAc,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IACjC,UAAU,EAAE,SAAS,GAAG,GAAG,CAAC;IAC5B,iBAAiB,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IACpC,gBAAgB,EAAE,SAAS,GAAG,GAAG,CAAC;IAClC,
|
1
|
+
{"version":3,"file":"marginfiRebalance.d.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,EAAE,SAAS,GAAG,GAAG,CAAC;IAClC,cAAc,EAAE,SAAS,GAAG,GAAG,CAAC;IAChC,eAAe,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAClC,WAAW,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;IAC9B,kBAAkB,CAAC,EAAE,SAAS,GAAG,GAAG,CAAC;CACtC,CAAC;AAGF,MAAM,MAAM,gCAAgC,GAAG;IAC7C,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,oBAAoB,CAAC;IACpC,2BAA2B,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;IAC5C,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,oCAAoC,GAAG;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,wBAAwB,CAAC;IACxC,2BAA2B,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtD,WAAW,EAAE,gBAAgB,CAAC,MAAM,CAAC,CAAC;CACvC,CAAC;AAEF,wBAAgB,6CAA6C,IAAI,UAAU,CACzE,oCAAoC,EACpC,gCAAgC,CACjC,CAqBA;AAGD,MAAM,MAAM,gCAAgC,GAC1C,oCAAoC,CAAC;AAGvC,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,EAClC,KAAK,EAAE,oCAAoC,GAAG,gCAAgC,GAC7E,kBAAkB,CA6KpB"}
|
@@ -103,10 +103,10 @@ function marginfiRebalance(context, input) {
|
|
103
103
|
isWritable: true,
|
104
104
|
value: input.positionSupplyTa ?? null,
|
105
105
|
},
|
106
|
-
|
106
|
+
authoritySupplyTa: {
|
107
107
|
index: 15,
|
108
108
|
isWritable: true,
|
109
|
-
value: input.
|
109
|
+
value: input.authoritySupplyTa ?? null,
|
110
110
|
},
|
111
111
|
vaultSupplyTa: {
|
112
112
|
index: 16,
|
@@ -133,10 +133,10 @@ function marginfiRebalance(context, input) {
|
|
133
133
|
isWritable: true,
|
134
134
|
value: input.positionDebtTa ?? null,
|
135
135
|
},
|
136
|
-
|
136
|
+
authorityDebtTa: {
|
137
137
|
index: 21,
|
138
138
|
isWritable: true,
|
139
|
-
value: input.
|
139
|
+
value: input.authorityDebtTa ?? null,
|
140
140
|
},
|
141
141
|
vaultDebtTa: {
|
142
142
|
index: 22,
|
package/package.json
CHANGED
@@ -260,10 +260,10 @@ export abstract class SolautoClient extends TxHandler {
|
|
260
260
|
lutAccountsToAdd(): PublicKey[] {
|
261
261
|
return [
|
262
262
|
this.authority,
|
263
|
-
...(this.signer.publicKey.
|
263
|
+
...(toWeb3JsPublicKey(this.signer.publicKey).equals(this.authority)
|
264
264
|
? [this.signerSupplyTa]
|
265
265
|
: []),
|
266
|
-
...(this.signer.publicKey.
|
266
|
+
...(toWeb3JsPublicKey(this.signer.publicKey).equals(this.authority)
|
267
267
|
? [this.signerDebtTa]
|
268
268
|
: []),
|
269
269
|
this.solautoPosition,
|
@@ -465,9 +465,7 @@ export class SolautoMarginfiClient extends SolautoClient {
|
|
465
465
|
supplyBank: publicKey(this.marginfiSupplyAccounts.bank),
|
466
466
|
supplyPriceOracle: publicKey(this.supplyPriceOracle),
|
467
467
|
positionSupplyTa: publicKey(this.positionSupplyTa),
|
468
|
-
|
469
|
-
? publicKey(this.signerSupplyTa)
|
470
|
-
: undefined,
|
468
|
+
authoritySupplyTa: publicKey(getTokenAccount(this.authority, this.supplyMint)),
|
471
469
|
vaultSupplyTa: needSupplyAccounts
|
472
470
|
? publicKey(this.marginfiSupplyAccounts.liquidityVault)
|
473
471
|
: undefined,
|
@@ -477,7 +475,7 @@ export class SolautoMarginfiClient extends SolautoClient {
|
|
477
475
|
debtBank: publicKey(this.marginfiDebtAccounts.bank),
|
478
476
|
debtPriceOracle: publicKey(this.debtPriceOracle),
|
479
477
|
positionDebtTa: publicKey(this.positionDebtTa),
|
480
|
-
|
478
|
+
authorityDebtTa: publicKey(getTokenAccount(this.authority, this.debtMint)),
|
481
479
|
vaultDebtTa: needDebtAccounts
|
482
480
|
? publicKey(this.marginfiDebtAccounts.liquidityVault)
|
483
481
|
: undefined,
|
@@ -52,13 +52,13 @@ export type MarginfiRebalanceInstructionAccounts = {
|
|
52
52
|
supplyBank: PublicKey | Pda;
|
53
53
|
supplyPriceOracle?: PublicKey | Pda;
|
54
54
|
positionSupplyTa: PublicKey | Pda;
|
55
|
-
|
55
|
+
authoritySupplyTa?: PublicKey | Pda;
|
56
56
|
vaultSupplyTa?: PublicKey | Pda;
|
57
57
|
supplyVaultAuthority?: PublicKey | Pda;
|
58
58
|
debtBank: PublicKey | Pda;
|
59
59
|
debtPriceOracle?: PublicKey | Pda;
|
60
60
|
positionDebtTa: PublicKey | Pda;
|
61
|
-
|
61
|
+
authorityDebtTa?: PublicKey | Pda;
|
62
62
|
vaultDebtTa?: PublicKey | Pda;
|
63
63
|
debtVaultAuthority?: PublicKey | Pda;
|
64
64
|
};
|
@@ -197,10 +197,10 @@ export function marginfiRebalance(
|
|
197
197
|
isWritable: true as boolean,
|
198
198
|
value: input.positionSupplyTa ?? null,
|
199
199
|
},
|
200
|
-
|
200
|
+
authoritySupplyTa: {
|
201
201
|
index: 15,
|
202
202
|
isWritable: true as boolean,
|
203
|
-
value: input.
|
203
|
+
value: input.authoritySupplyTa ?? null,
|
204
204
|
},
|
205
205
|
vaultSupplyTa: {
|
206
206
|
index: 16,
|
@@ -227,10 +227,10 @@ export function marginfiRebalance(
|
|
227
227
|
isWritable: true as boolean,
|
228
228
|
value: input.positionDebtTa ?? null,
|
229
229
|
},
|
230
|
-
|
230
|
+
authorityDebtTa: {
|
231
231
|
index: 21,
|
232
232
|
isWritable: true as boolean,
|
233
|
-
value: input.
|
233
|
+
value: input.authorityDebtTa ?? null,
|
234
234
|
},
|
235
235
|
vaultDebtTa: {
|
236
236
|
index: 22,
|