@haven-fi/solauto-sdk 1.0.96 → 1.0.98
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/clients/solautoClient.d.ts.map +1 -1
- package/dist/clients/solautoClient.js +2 -1
- package/dist/transactions/transactionUtils.d.ts.map +1 -1
- package/dist/transactions/transactionUtils.js +1 -1
- package/package.json +1 -1
- package/src/clients/solautoClient.ts +2 -1
- package/src/transactions/transactionUtils.ts +2 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solautoClient.d.ts","sourceRoot":"","sources":["../../src/clients/solautoClient.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAGL,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAQnB,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;AAMvD,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,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BAAkB;IA2DlE,eAAe,IAAI,kBAAkB;IAWrC,WAAW,IAAI,kBAAkB;IA4BjC,QAAQ,CAAC,OAAO,IAAI,kBAAkB;IAEtC,mBAAmB,CAAC,IAAI,EAAE,iBAAiB,GAAG,kBAAkB;IAuFhE,QAAQ,CAAC,WAAW,CAClB,gBAAgB,EAAE,gBAAgB,EAClC,uBAAuB,EAAE,SAAS,GACjC,kBAAkB;IAErB,QAAQ,CAAC,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,kBAAkB;IAE3E,QAAQ,CAAC,SAAS,CAChB,aAAa,EAAE,GAAG,GAAG,GAAG,EACxB,WAAW,EAAE,cAAc,EAC3B,aAAa,EAAE,wBAAwB,EACvC,SAAS,CAAC,EAAE,gBAAgB,EAC5B,2BAA2B,CAAC,EAAE,MAAM,EACpC,WAAW,CAAC,EAAE,MAAM,GACnB,kBAAkB;IAEf,qBAAqB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CAalE"}
|
@@ -78,7 +78,7 @@ class SolautoClient extends txHandler_1.TxHandler {
|
|
78
78
|
this.solautoFeesWallet = generalAccounts_1.SOLAUTO_FEES_WALLET;
|
79
79
|
this.solautoFeesSupplyTa = (0, accountUtils_1.getTokenAccount)(this.solautoFeesWallet, this.supplyMint);
|
80
80
|
this.authorityLutAddress = authorityReferralStateData?.lookupTable && !(0, umi_web3js_adapters_1.toWeb3JsPublicKey)(authorityReferralStateData.lookupTable).equals(web3_js_1.PublicKey.default)
|
81
|
-
? (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(authorityReferralStateData
|
81
|
+
? (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(authorityReferralStateData.lookupTable)
|
82
82
|
: undefined;
|
83
83
|
this.upToDateLutAccounts = (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(this.signer.publicKey).equals(this.authority)
|
84
84
|
? await this.fetchExistingAuthorityLutAccounts()
|
@@ -127,6 +127,7 @@ class SolautoClient extends txHandler_1.TxHandler {
|
|
127
127
|
];
|
128
128
|
}
|
129
129
|
async fetchExistingAuthorityLutAccounts() {
|
130
|
+
this.log(this.authorityLutAddress?.toString());
|
130
131
|
const lookupTable = this.authorityLutAddress
|
131
132
|
? await this.connection.getAddressLookupTable(this.authorityLutAddress)
|
132
133
|
: null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,OAAO,IAAI,eAAe,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,
|
1
|
+
{"version":3,"file":"transactionUtils.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,kBAAkB,EAClB,GAAG,EAGJ,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAGL,OAAO,IAAI,eAAe,EAC3B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAGL,aAAa,EASd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAuMzD,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,EACtB,sBAAsB,EAAE,MAAM,EAAE,GAC/B,OAAO,CAAC,kBAAkB,CAAC,CA8G7B;AAkLD,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,aAAa,EACrB,EAAE,EAAE,kBAAkB,GACrB,OAAO,CAAC,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC,CA4BnD;AAED,wBAAsB,gCAAgC,CACpD,MAAM,EAAE,aAAa,EACrB,2BAA2B,CAAC,EAAE,MAAM,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CACN;IACA,EAAE,EAAE,kBAAkB,CAAC;IACvB,oBAAoB,EAAE,MAAM,EAAE,CAAC;CAChC,GACC,SAAS,CACZ,CAyHA;AAED,wBAAsB,gCAAgC,CACpD,GAAG,EAAE,GAAG,EACR,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,eAAe,GAC5B,OAAO,CAAC,CAAC,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC,CA8BzC"}
|
@@ -327,7 +327,7 @@ async function buildSolautoRebalanceTransaction(client, targetLiqUtilizationRate
|
|
327
327
|
client.log("Not eligible for a rebalance");
|
328
328
|
return undefined;
|
329
329
|
}
|
330
|
-
const values = (0, rebalanceUtils_1.getRebalanceValues)(client.solautoPositionState, client.solautoPositionSettings(), client.solautoPositionActiveDca(), client.solautoPositionData.
|
330
|
+
const values = (0, rebalanceUtils_1.getRebalanceValues)(client.solautoPositionState, client.solautoPositionSettings(), client.solautoPositionActiveDca(), client.solautoPositionData?.feeType ?? generated_1.FeeType.Small, (0, generalUtils_1.currentUnixSeconds)(), constants_1.PRICES[client.supplyMint.toString()].price, constants_1.PRICES[client.debtMint.toString()].price, targetLiqUtilizationRateBps);
|
331
331
|
client.log("Rebalance values: ", values);
|
332
332
|
const swapDetails = (0, rebalanceUtils_1.getJupSwapRebalanceDetails)(client, values, targetLiqUtilizationRateBps, attemptNum);
|
333
333
|
const { jupQuote, lookupTableAddresses, setupInstructions, tokenLedgerIx, swapIx, } = await (0, jupiterUtils_1.getJupSwapTransaction)(client.signer, swapDetails, attemptNum);
|
package/package.json
CHANGED
@@ -205,7 +205,7 @@ export abstract class SolautoClient extends TxHandler {
|
|
205
205
|
);
|
206
206
|
|
207
207
|
this.authorityLutAddress = authorityReferralStateData?.lookupTable && !toWeb3JsPublicKey(authorityReferralStateData.lookupTable).equals(PublicKey.default)
|
208
|
-
? toWeb3JsPublicKey(authorityReferralStateData
|
208
|
+
? toWeb3JsPublicKey(authorityReferralStateData.lookupTable)
|
209
209
|
: undefined;
|
210
210
|
this.upToDateLutAccounts = toWeb3JsPublicKey(this.signer.publicKey).equals(
|
211
211
|
this.authority
|
@@ -271,6 +271,7 @@ export abstract class SolautoClient extends TxHandler {
|
|
271
271
|
}
|
272
272
|
|
273
273
|
async fetchExistingAuthorityLutAccounts(): Promise<PublicKey[]> {
|
274
|
+
this.log(this.authorityLutAddress?.toString());
|
274
275
|
const lookupTable = this.authorityLutAddress
|
275
276
|
? await this.connection.getAddressLookupTable(this.authorityLutAddress)
|
276
277
|
: null;
|
@@ -13,6 +13,7 @@ import {
|
|
13
13
|
Account as SplTokenAccount,
|
14
14
|
} from "@solana/spl-token";
|
15
15
|
import {
|
16
|
+
FeeType,
|
16
17
|
LendingPlatform,
|
17
18
|
ReferralState,
|
18
19
|
SOLAUTO_PROGRAM_ID,
|
@@ -578,7 +579,7 @@ export async function buildSolautoRebalanceTransaction(
|
|
578
579
|
client.solautoPositionState!,
|
579
580
|
client.solautoPositionSettings(),
|
580
581
|
client.solautoPositionActiveDca(),
|
581
|
-
client.solautoPositionData
|
582
|
+
client.solautoPositionData?.feeType ?? FeeType.Small,
|
582
583
|
currentUnixSeconds(),
|
583
584
|
PRICES[client.supplyMint.toString()].price,
|
584
585
|
PRICES[client.debtMint.toString()].price,
|