@haven-fi/solauto-sdk 1.0.117 → 1.0.118
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 +1 -1
- package/dist/clients/solautoMarginfiClient.d.ts.map +1 -1
- package/dist/clients/solautoMarginfiClient.js +0 -1
- package/dist/utils/marginfiUtils.d.ts.map +1 -1
- package/dist/utils/marginfiUtils.js +4 -4
- package/dist/utils/solauto/generalUtils.js +3 -3
- package/package.json +1 -1
- package/src/clients/solautoClient.ts +2 -1
- package/src/clients/solautoMarginfiClient.ts +0 -1
- package/src/utils/marginfiUtils.ts +7 -5
- package/src/utils/solauto/generalUtils.ts +3 -3
- package/tests/transactions/solautoMarginfi.ts +14 -19
@@ -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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IAAI,kBAAkB;IAYrC,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"}
|
@@ -39,7 +39,7 @@ class SolautoClient extends txHandler_1.TxHandler {
|
|
39
39
|
this.selfManaged = this.positionId === 0;
|
40
40
|
this.lendingPlatform = lendingPlatform;
|
41
41
|
this.solautoPosition = (0, accountUtils_1.getSolautoPositionAccount)(this.authority, this.positionId);
|
42
|
-
this.solautoPositionData = await (0, generated_1.safeFetchSolautoPosition)(this.umi, (0, umi_1.publicKey)(this.solautoPosition));
|
42
|
+
this.solautoPositionData = await (0, generated_1.safeFetchSolautoPosition)(this.umi, (0, umi_1.publicKey)(this.solautoPosition), { commitment: "confirmed" });
|
43
43
|
this.solautoPositionState = this.solautoPositionData?.state;
|
44
44
|
this.supplyMint =
|
45
45
|
(args.supplyMint ??
|
@@ -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,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G,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;IA2DrB,WAAW,CACT,gBAAgB,EAAE,gBAAgB,EAClC,uBAAuB,EAAE,SAAS,GACjC,kBAAkB;IA2BrB,UAAU,CAAC,gBAAgB,EAAE,gBAAgB,GAAG,kBAAkB;IAoFlE,iCAAiC,IAAI,kBAAkB;IASjD,qBAAqB,IAAI,OAAO,CAAC,aAAa,GAAG,SAAS,CAAC;CAgBlE"}
|
@@ -414,7 +414,6 @@ class SolautoMarginfiClient extends solautoClient_1.SolautoClient {
|
|
414
414
|
return state;
|
415
415
|
}
|
416
416
|
const freshState = await (0, marginfiUtils_1.getMarginfiAccountPositionState)(this.umi, this.marginfiAccountPk, this.supplyMint, this.debtMint, this.livePositionUpdates);
|
417
|
-
this.log("Fresh state:", freshState);
|
418
417
|
return freshState;
|
419
418
|
}
|
420
419
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marginfiUtils.d.ts","sourceRoot":"","sources":["../../src/utils/marginfiUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAyB,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAEtE,OAAO,EACL,IAAI,EAKL,MAAM,iBAAiB,CAAC;AAWzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAsB,MAAM,cAAc,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;
|
1
|
+
{"version":3,"file":"marginfiUtils.d.ts","sourceRoot":"","sources":["../../src/utils/marginfiUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;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AC,MAAM,EAAE,MAAM,CAAC,CAAC,CA0B3B"}
|
@@ -60,7 +60,7 @@ async function getMaxLtvAndLiqThreshold(umi, supply, debt, supplyPrice) {
|
|
60
60
|
}
|
61
61
|
async function getAllMarginfiAccountsByAuthority(umi, authority, compatibleWithSolauto) {
|
62
62
|
const marginfiAccounts = await umi.rpc.getProgramAccounts(marginfi_sdk_1.MARGINFI_PROGRAM_ID, {
|
63
|
-
commitment: "
|
63
|
+
commitment: "confirmed",
|
64
64
|
dataSlice: {
|
65
65
|
offset: 0,
|
66
66
|
length: 0,
|
@@ -136,12 +136,12 @@ async function getTokenUsage(umi, bank, isAsset, shares, amountUsedAdjustment) {
|
|
136
136
|
};
|
137
137
|
}
|
138
138
|
async function getMarginfiAccountPositionState(umi, marginfiAccountPk, supplyMint, debtMint, livePositionUpdates) {
|
139
|
-
let marginfiAccount = await (0, marginfi_sdk_1.safeFetchMarginfiAccount)(umi, (0, umi_1.publicKey)(marginfiAccountPk));
|
139
|
+
let marginfiAccount = await (0, marginfi_sdk_1.safeFetchMarginfiAccount)(umi, (0, umi_1.publicKey)(marginfiAccountPk), { commitment: "confirmed" });
|
140
140
|
let supplyBank = supplyMint && supplyMint !== web3_js_1.PublicKey.default
|
141
|
-
? await (0, marginfi_sdk_1.safeFetchBank)(umi, (0, umi_1.publicKey)(marginfiAccounts_1.MARGINFI_ACCOUNTS[supplyMint.toString()].bank))
|
141
|
+
? await (0, marginfi_sdk_1.safeFetchBank)(umi, (0, umi_1.publicKey)(marginfiAccounts_1.MARGINFI_ACCOUNTS[supplyMint.toString()].bank), { commitment: "confirmed" })
|
142
142
|
: null;
|
143
143
|
let debtBank = debtMint && debtMint !== web3_js_1.PublicKey.default
|
144
|
-
? await (0, marginfi_sdk_1.safeFetchBank)(umi, (0, umi_1.publicKey)(marginfiAccounts_1.MARGINFI_ACCOUNTS[debtMint.toString()].bank))
|
144
|
+
? await (0, marginfi_sdk_1.safeFetchBank)(umi, (0, umi_1.publicKey)(marginfiAccounts_1.MARGINFI_ACCOUNTS[debtMint.toString()].bank), { commitment: "confirmed" })
|
145
145
|
: null;
|
146
146
|
let supplyUsage = undefined;
|
147
147
|
let debtUsage = undefined;
|
@@ -105,7 +105,7 @@ async function getSolautoManagedPositions(umi, authority) {
|
|
105
105
|
// authority: Pubkey
|
106
106
|
// lending_platform: u8
|
107
107
|
const accounts = await umi.rpc.getProgramAccounts(generated_1.SOLAUTO_PROGRAM_ID, {
|
108
|
-
commitment: "
|
108
|
+
commitment: "confirmed",
|
109
109
|
dataSlice: {
|
110
110
|
offset: 0,
|
111
111
|
length: 1 + 1 + 1 + 5 + 32 + 1, // bump + position_id + self_managed + padding + authority (pubkey) + lending_platform
|
@@ -147,7 +147,7 @@ async function getSolautoManagedPositions(umi, authority) {
|
|
147
147
|
}
|
148
148
|
async function getAllReferralStates(umi) {
|
149
149
|
const accounts = await umi.rpc.getProgramAccounts(generated_1.SOLAUTO_PROGRAM_ID, {
|
150
|
-
commitment: "
|
150
|
+
commitment: "confirmed",
|
151
151
|
dataSlice: {
|
152
152
|
offset: 0,
|
153
153
|
length: 0,
|
@@ -167,7 +167,7 @@ async function getReferralsByUser(umi, user) {
|
|
167
167
|
// referred_by_state: Pubkey,
|
168
168
|
const userReferralState = (0, accountUtils_1.getReferralState)(user);
|
169
169
|
const accounts = await umi.rpc.getProgramAccounts(generated_1.SOLAUTO_PROGRAM_ID, {
|
170
|
-
commitment: "
|
170
|
+
commitment: "confirmed",
|
171
171
|
dataSlice: {
|
172
172
|
offset: 0,
|
173
173
|
length: 0,
|
package/package.json
CHANGED
@@ -138,7 +138,8 @@ export abstract class SolautoClient extends TxHandler {
|
|
138
138
|
);
|
139
139
|
this.solautoPositionData = await safeFetchSolautoPosition(
|
140
140
|
this.umi,
|
141
|
-
publicKey(this.solautoPosition)
|
141
|
+
publicKey(this.solautoPosition),
|
142
|
+
{ commitment: "confirmed" }
|
142
143
|
);
|
143
144
|
this.solautoPositionState = this.solautoPositionData?.state;
|
144
145
|
|
@@ -23,7 +23,6 @@ import { PositionState, PositionTokenUsage } from "../generated";
|
|
23
23
|
import { USD_DECIMALS } from "../constants/generalAccounts";
|
24
24
|
import { LivePositionUpdates } from "./solauto/generalUtils";
|
25
25
|
import { currentUnixSecondsSolana } from "./solanaUtils";
|
26
|
-
import { getSolautoPositionAccount } from "./accountUtils";
|
27
26
|
|
28
27
|
export function findMarginfiAccounts(bank: PublicKey): MarginfiAssetAccounts {
|
29
28
|
for (const key in MARGINFI_ACCOUNTS) {
|
@@ -123,7 +122,7 @@ export async function getAllMarginfiAccountsByAuthority(
|
|
123
122
|
const marginfiAccounts = await umi.rpc.getProgramAccounts(
|
124
123
|
MARGINFI_PROGRAM_ID,
|
125
124
|
{
|
126
|
-
commitment: "
|
125
|
+
commitment: "confirmed",
|
127
126
|
dataSlice: {
|
128
127
|
offset: 0,
|
129
128
|
length: 0,
|
@@ -237,21 +236,24 @@ export async function getMarginfiAccountPositionState(
|
|
237
236
|
): Promise<PositionState | undefined> {
|
238
237
|
let marginfiAccount = await safeFetchMarginfiAccount(
|
239
238
|
umi,
|
240
|
-
publicKey(marginfiAccountPk)
|
239
|
+
publicKey(marginfiAccountPk),
|
240
|
+
{ commitment: "confirmed" }
|
241
241
|
);
|
242
242
|
|
243
243
|
let supplyBank: Bank | null =
|
244
244
|
supplyMint && supplyMint !== PublicKey.default
|
245
245
|
? await safeFetchBank(
|
246
246
|
umi,
|
247
|
-
publicKey(MARGINFI_ACCOUNTS[supplyMint.toString()].bank)
|
247
|
+
publicKey(MARGINFI_ACCOUNTS[supplyMint.toString()].bank),
|
248
|
+
{ commitment: "confirmed" }
|
248
249
|
)
|
249
250
|
: null;
|
250
251
|
let debtBank: Bank | null =
|
251
252
|
debtMint && debtMint !== PublicKey.default
|
252
253
|
? await safeFetchBank(
|
253
254
|
umi,
|
254
|
-
publicKey(MARGINFI_ACCOUNTS[debtMint.toString()].bank)
|
255
|
+
publicKey(MARGINFI_ACCOUNTS[debtMint.toString()].bank),
|
256
|
+
{ commitment: "confirmed" }
|
255
257
|
)
|
256
258
|
: null;
|
257
259
|
|
@@ -180,7 +180,7 @@ export async function getSolautoManagedPositions(
|
|
180
180
|
// lending_platform: u8
|
181
181
|
|
182
182
|
const accounts = await umi.rpc.getProgramAccounts(SOLAUTO_PROGRAM_ID, {
|
183
|
-
commitment: "
|
183
|
+
commitment: "confirmed",
|
184
184
|
dataSlice: {
|
185
185
|
offset: 0,
|
186
186
|
length: 1 + 1 + 1 + 5 + 32 + 1, // bump + position_id + self_managed + padding + authority (pubkey) + lending_platform
|
@@ -226,7 +226,7 @@ export async function getSolautoManagedPositions(
|
|
226
226
|
|
227
227
|
export async function getAllReferralStates(umi: Umi): Promise<PublicKey[]> {
|
228
228
|
const accounts = await umi.rpc.getProgramAccounts(SOLAUTO_PROGRAM_ID, {
|
229
|
-
commitment: "
|
229
|
+
commitment: "confirmed",
|
230
230
|
dataSlice: {
|
231
231
|
offset: 0,
|
232
232
|
length: 0,
|
@@ -252,7 +252,7 @@ export async function getReferralsByUser(
|
|
252
252
|
|
253
253
|
const userReferralState = getReferralState(user);
|
254
254
|
const accounts = await umi.rpc.getProgramAccounts(SOLAUTO_PROGRAM_ID, {
|
255
|
-
commitment: "
|
255
|
+
commitment: "confirmed",
|
256
256
|
dataSlice: {
|
257
257
|
offset: 0,
|
258
258
|
length: 0,
|
@@ -18,9 +18,6 @@ import {
|
|
18
18
|
} from "../../src/transactions/transactionsManager";
|
19
19
|
import { PublicKey } from "@solana/web3.js";
|
20
20
|
import { USDC_MINT } from "../../src/constants";
|
21
|
-
import {
|
22
|
-
ACCOUNT_SIZE as TOKEN_ACCOUNT_SIZE,
|
23
|
-
} from "@solana/spl-token";
|
24
21
|
|
25
22
|
describe("Solauto Marginfi tests", async () => {
|
26
23
|
const signer = setupTest();
|
@@ -52,14 +49,14 @@ describe("Solauto Marginfi tests", async () => {
|
|
52
49
|
);
|
53
50
|
|
54
51
|
const transactionItems: TransactionItem[] = [];
|
55
|
-
const settingParams: SolautoSettingsParametersInpArgs = {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
};
|
52
|
+
// const settingParams: SolautoSettingsParametersInpArgs = {
|
53
|
+
// boostToBps: 4000,
|
54
|
+
// boostGap: 500,
|
55
|
+
// repayToBps: 7456,
|
56
|
+
// repayGap: 500,
|
57
|
+
// automation: none(),
|
58
|
+
// targetBoostToBps: none(),
|
59
|
+
// };
|
63
60
|
|
64
61
|
// if (client.solautoPositionData === null) {
|
65
62
|
// transactionItems.push(
|
@@ -158,13 +155,11 @@ describe("Solauto Marginfi tests", async () => {
|
|
158
155
|
// )
|
159
156
|
// );
|
160
157
|
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
console.log((await client.umi.rpc.getRent(TOKEN_ACCOUNT_SIZE)).basisPoints);
|
158
|
+
await new TransactionsManager(
|
159
|
+
client,
|
160
|
+
undefined,
|
161
|
+
!payForTransactions ? "only-simulate" : "normal",
|
162
|
+
useJitoBundle
|
163
|
+
).clientSend(transactionItems);
|
169
164
|
});
|
170
165
|
});
|