@haven-fi/solauto-sdk 1.0.184 → 1.0.186
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/clients/solautoClient.d.ts +1 -2
- package/dist/clients/solautoClient.d.ts.map +1 -1
- package/dist/clients/solautoClient.js +0 -1
- package/dist/clients/txHandler.d.ts +1 -2
- package/dist/clients/txHandler.d.ts.map +1 -1
- package/dist/clients/txHandler.js +3 -3
- package/dist/constants/solautoConstants.d.ts +0 -6
- package/dist/constants/solautoConstants.d.ts.map +1 -1
- package/dist/constants/solautoConstants.js +2 -7
- package/dist/transactions/transactionsManager.d.ts.map +1 -1
- package/dist/transactions/transactionsManager.js +2 -4
- package/dist/utils/generalUtils.js +1 -1
- package/package.json +1 -1
- package/src/clients/solautoClient.ts +1 -1
- package/src/clients/txHandler.ts +5 -3
- package/src/constants/solautoConstants.ts +3 -10
- package/src/transactions/transactionsManager.ts +2 -4
- package/src/utils/generalUtils.ts +2 -2
- package/tests/transactions/solautoMarginfi.ts +4 -1
@@ -18,7 +18,6 @@ export interface SolautoClientArgs {
|
|
18
18
|
referredByAuthority?: PublicKey;
|
19
19
|
}
|
20
20
|
export declare abstract class SolautoClient extends TxHandler {
|
21
|
-
localTest?: boolean | undefined;
|
22
21
|
lendingPlatform: LendingPlatform;
|
23
22
|
authority: PublicKey;
|
24
23
|
signer: Signer;
|
@@ -43,7 +42,7 @@ export declare abstract class SolautoClient extends TxHandler {
|
|
43
42
|
solautoFeesSupplyTa: PublicKey;
|
44
43
|
authorityLutAddress?: PublicKey;
|
45
44
|
livePositionUpdates: LivePositionUpdates;
|
46
|
-
constructor(heliusApiUrl: string, localTest?: boolean
|
45
|
+
constructor(heliusApiUrl: string, localTest?: boolean);
|
47
46
|
initialize(args: SolautoClientArgs, lendingPlatform: LendingPlatform): Promise<void>;
|
48
47
|
resetLiveTxUpdates(success?: boolean): Promise<void>;
|
49
48
|
abstract protocolAccount(): PublicKey;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solautoClient.d.ts","sourceRoot":"","sources":["../../src/clients/solautoClient.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAA6B,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvE,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,EAEhC,sBAAsB,EAMvB,MAAM,cAAc,CAAC;AAOtB,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;
|
1
|
+
{"version":3,"file":"solautoClient.d.ts","sourceRoot":"","sources":["../../src/clients/solautoClient.ts"],"names":[],"mappings":"AAAA,OAAO,gCAAgC,CAAC;AACxC,OAAO,EAA6B,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,EACL,MAAM,EACN,kBAAkB,EAOnB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,a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AI,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"}
|
@@ -18,7 +18,6 @@ const txHandler_1 = require("./txHandler");
|
|
18
18
|
class SolautoClient extends txHandler_1.TxHandler {
|
19
19
|
constructor(heliusApiUrl, localTest) {
|
20
20
|
super(heliusApiUrl, localTest);
|
21
|
-
this.localTest = localTest;
|
22
21
|
this.livePositionUpdates = new generalUtils_2.LivePositionUpdates();
|
23
22
|
this.umi = this.umi.use({
|
24
23
|
install(umi) {
|
@@ -1,11 +1,10 @@
|
|
1
1
|
import { Umi } from "@metaplex-foundation/umi";
|
2
2
|
import { Connection } from "@solana/web3.js";
|
3
3
|
export declare abstract class TxHandler {
|
4
|
-
localTest?: boolean | undefined;
|
5
4
|
heliusApiUrl: string;
|
6
5
|
umi: Umi;
|
7
6
|
connection: Connection;
|
8
|
-
constructor(heliusApiUrl: string, localTest?: boolean
|
7
|
+
constructor(heliusApiUrl: string, localTest?: boolean);
|
9
8
|
log(...args: any[]): void;
|
10
9
|
abstract defaultLookupTables(): string[];
|
11
10
|
abstract resetLiveTxUpdates(success?: boolean): Promise<void>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"txHandler.d.ts","sourceRoot":"","sources":["../../src/clients/txHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;
|
1
|
+
{"version":3,"file":"txHandler.d.ts","sourceRoot":"","sources":["../../src/clients/txHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAG7C,8BAAsB,SAAS;IACtB,YAAY,EAAG,MAAM,CAAC;IACtB,GAAG,EAAG,GAAG,CAAC;IACV,UAAU,EAAG,UAAU,CAAC;gBAG7B,YAAY,EAAE,MAAM,EACpB,SAAS,CAAC,EAAE,OAAO;IAYrB,GAAG,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,IAAI;IAIzB,QAAQ,CAAC,mBAAmB,IAAI,MAAM,EAAE;IAExC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;CAC9D"}
|
@@ -2,15 +2,15 @@
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.TxHandler = void 0;
|
4
4
|
const utils_1 = require("../utils");
|
5
|
-
const constants_1 = require("../constants");
|
6
5
|
class TxHandler {
|
7
6
|
constructor(heliusApiUrl, localTest) {
|
8
|
-
this.localTest = localTest;
|
9
7
|
this.heliusApiUrl = heliusApiUrl;
|
10
8
|
const [connection, umi] = (0, utils_1.getSolanaRpcConnection)(this.heliusApiUrl);
|
11
9
|
this.connection = connection;
|
12
10
|
this.umi = umi;
|
13
|
-
|
11
|
+
if (!globalThis.LOCAL_TEST && localTest) {
|
12
|
+
globalThis.LOCAL_TEST = Boolean(localTest);
|
13
|
+
}
|
14
14
|
}
|
15
15
|
log(...args) {
|
16
16
|
(0, utils_1.consoleLog)(...args);
|
@@ -11,10 +11,4 @@ export declare const PRICES: {
|
|
11
11
|
};
|
12
12
|
export declare const SOLAUTO_LUT = "9D4xwZwDf46n9ft5gQxZzq3rBbdRXsXojKQLZbBdskPY";
|
13
13
|
export declare const STANDARD_LUT_ACCOUNTS: string[];
|
14
|
-
declare class RuntimeData {
|
15
|
-
localTest: boolean;
|
16
|
-
constructor();
|
17
|
-
}
|
18
|
-
export declare const RUNTIME_DATA: RuntimeData;
|
19
|
-
export {};
|
20
14
|
//# sourceMappingURL=solautoConstants.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solautoConstants.d.ts","sourceRoot":"","sources":["../../src/constants/solautoConstants.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"solautoConstants.d.ts","sourceRoot":"","sources":["../../src/constants/solautoConstants.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,YAAY,QAAQ,CAAC;AAElC,eAAO,MAAM,qBAAqB,OAAO,CAAC;AAC1C,eAAO,MAAM,iCAAiC,IAAI,CAAC;AACnD,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AAQpC,eAAO,MAAM,MAAM,EAAE;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;KAAE,CAAA;CAAO,CAAC;AAE9E,eAAO,MAAM,WAAW,iDAAiD,CAAC;AAE1E,eAAO,MAAM,qBAAqB,UAWjC,CAAC"}
|
@@ -1,12 +1,13 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.
|
3
|
+
exports.STANDARD_LUT_ACCOUNTS = exports.SOLAUTO_LUT = exports.PRICES = exports.MIN_BOOST_GAP_BPS = exports.MIN_REPAY_GAP_BPS = exports.MIN_POSITION_STATE_FRESHNESS_SECS = exports.DEFAULT_LIMIT_GAP_BPS = exports.BASIS_POINTS = void 0;
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
5
5
|
const spl_token_1 = require("@solana/spl-token");
|
6
6
|
// import { JitoRpcConnection } from "jito-ts";
|
7
7
|
const generated_1 = require("../generated");
|
8
8
|
const generalAccounts_1 = require("./generalAccounts");
|
9
9
|
const jupiter_sdk_1 = require("../jupiter-sdk");
|
10
|
+
globalThis.LOCAL_TEST = false;
|
10
11
|
exports.BASIS_POINTS = 10000;
|
11
12
|
exports.DEFAULT_LIMIT_GAP_BPS = 1000;
|
12
13
|
exports.MIN_POSITION_STATE_FRESHNESS_SECS = 5;
|
@@ -31,9 +32,3 @@ exports.STANDARD_LUT_ACCOUNTS = [
|
|
31
32
|
web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY.toString(),
|
32
33
|
jupiter_sdk_1.JUPITER_PROGRAM_ID
|
33
34
|
];
|
34
|
-
class RuntimeData {
|
35
|
-
constructor() {
|
36
|
-
this.localTest = false;
|
37
|
-
}
|
38
|
-
}
|
39
|
-
exports.RUNTIME_DATA = new RuntimeData();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AA0C7D,qBAAa,eAAe;IAKjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CACV;QAAE,EAAE,EAAE,kBAAkB,CAAC;QAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,SAAS,CACxE;IACM,IAAI,CAAC,EAAE,MAAM;IATtB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EAC7B,OAAO,GAAE,MAAU,EACnB,UAAU,GAAE,MAAY;YAQpB,uBAAuB;IAwCrC,OAAO,CAAC,YAAY;YA8CN,aAAa;IAoBd,UAAU,CACrB,YAAY,EAAE,eAAe,EAAE,EAC/B,eAAe,CAAC,EAAE,kBAAkB,GACnC,OAAO,CAAC,0BAA0B,CAAC;IAyEzB,IAAI,CACf,KAAK,EAAE,eAAe,EAAE,EACxB,eAAe,CAAC,EAAE,kBAAkB,EACpC,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,0BAA0B,CAAC;
|
1
|
+
{"version":3,"file":"transactionsManager.d.ts","sourceRoot":"","sources":["../../src/transactions/transactionsManager.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAKzD,OAAO,EACL,aAAa,EAEd,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAa,MAAM,YAAY,CAAC;AA0C7D,qBAAa,eAAe;IAKjB,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CACV;QAAE,EAAE,EAAE,kBAAkB,CAAC;QAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,SAAS,CACxE;IACM,IAAI,CAAC,EAAE,MAAM;IATtB,oBAAoB,EAAG,MAAM,EAAE,CAAC;IAChC,EAAE,CAAC,EAAE,kBAAkB,CAAC;gBAGf,OAAO,EAAE,CACd,UAAU,EAAE,MAAM,KACf,OAAO,CACV;QAAE,EAAE,EAAE,kBAAkB,CAAC;QAAC,oBAAoB,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,GAAG,SAAS,CACxE,EACM,IAAI,CAAC,EAAE,MAAM,YAAA;IAGhB,UAAU;IAIV,OAAO,CAAC,UAAU,EA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C,EAAE,OAAO,GACpB,OAAO,CAAC,0BAA0B,CAAC;YAwGxB,eAAe;CAkD9B"}
|
@@ -218,7 +218,7 @@ class TransactionsManager {
|
|
218
218
|
const items = [...transactions];
|
219
219
|
const client = this.txHandler;
|
220
220
|
const updateLookupTable = await client.updateLookupTable();
|
221
|
-
const updateLutTxName = "
|
221
|
+
const updateLutTxName = "create lookup table";
|
222
222
|
if (updateLookupTable &&
|
223
223
|
updateLookupTable.updateLutTx.getInstructions().length > 0 &&
|
224
224
|
updateLookupTable?.needsToBeIsolated) {
|
@@ -319,9 +319,7 @@ class TransactionsManager {
|
|
319
319
|
this.updateStatus(itemSet.name(), TransactionStatus.Skipped, attemptNum);
|
320
320
|
}
|
321
321
|
else {
|
322
|
-
|
323
|
-
await this.debugAccounts(itemSet, tx);
|
324
|
-
}
|
322
|
+
await this.debugAccounts(itemSet, tx);
|
325
323
|
await this.sendTransaction(tx, itemSet.name(), attemptNum, prioritySetting);
|
326
324
|
}
|
327
325
|
}, this.retries, this.retryDelay, this.errorsToThrow);
|
@@ -15,7 +15,7 @@ const pythConstants_1 = require("../constants/pythConstants");
|
|
15
15
|
const numberUtils_1 = require("./numberUtils");
|
16
16
|
const solautoConstants_1 = require("../constants/solautoConstants");
|
17
17
|
function consoleLog(...args) {
|
18
|
-
if (
|
18
|
+
if (globalThis.LOCAL_TEST) {
|
19
19
|
console.log(...args);
|
20
20
|
}
|
21
21
|
}
|
package/package.json
CHANGED
package/src/clients/txHandler.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import { Umi } from "@metaplex-foundation/umi";
|
2
2
|
import { Connection } from "@solana/web3.js";
|
3
3
|
import { consoleLog, getSolanaRpcConnection } from "../utils";
|
4
|
-
import { RUNTIME_DATA } from "../constants";
|
5
4
|
|
6
5
|
export abstract class TxHandler {
|
7
6
|
public heliusApiUrl!: string;
|
@@ -10,13 +9,16 @@ export abstract class TxHandler {
|
|
10
9
|
|
11
10
|
constructor(
|
12
11
|
heliusApiUrl: string,
|
13
|
-
|
12
|
+
localTest?: boolean
|
14
13
|
) {
|
15
14
|
this.heliusApiUrl = heliusApiUrl;
|
16
15
|
const [connection, umi] = getSolanaRpcConnection(this.heliusApiUrl);
|
17
16
|
this.connection = connection;
|
18
17
|
this.umi = umi;
|
19
|
-
|
18
|
+
|
19
|
+
if (!(globalThis as any).LOCAL_TEST && localTest) {
|
20
|
+
(globalThis as any).LOCAL_TEST = Boolean(localTest);
|
21
|
+
}
|
20
22
|
}
|
21
23
|
|
22
24
|
log(...args: any[]): void {
|
@@ -14,6 +14,8 @@ import { SOLAUTO_PROGRAM_ID } from "../generated";
|
|
14
14
|
import { SOLAUTO_MANAGER } from "./generalAccounts";
|
15
15
|
import { JUPITER_PROGRAM_ID } from "../jupiter-sdk";
|
16
16
|
|
17
|
+
(globalThis as any).LOCAL_TEST = false;
|
18
|
+
|
17
19
|
export const BASIS_POINTS = 10000;
|
18
20
|
|
19
21
|
export const DEFAULT_LIMIT_GAP_BPS = 1000;
|
@@ -42,13 +44,4 @@ export const STANDARD_LUT_ACCOUNTS = [
|
|
42
44
|
SYSVAR_RENT_PUBKEY.toString(),
|
43
45
|
SYSVAR_INSTRUCTIONS_PUBKEY.toString(),
|
44
46
|
JUPITER_PROGRAM_ID
|
45
|
-
];
|
46
|
-
|
47
|
-
class RuntimeData {
|
48
|
-
public localTest: boolean;
|
49
|
-
constructor() {
|
50
|
-
this.localTest = false;
|
51
|
-
}
|
52
|
-
}
|
53
|
-
|
54
|
-
export const RUNTIME_DATA = new RuntimeData();
|
47
|
+
];
|
@@ -323,7 +323,7 @@ export class TransactionsManager {
|
|
323
323
|
const client = this.txHandler as SolautoClient;
|
324
324
|
|
325
325
|
const updateLookupTable = await client.updateLookupTable();
|
326
|
-
const updateLutTxName = "
|
326
|
+
const updateLutTxName = "create lookup table";
|
327
327
|
if (
|
328
328
|
updateLookupTable &&
|
329
329
|
updateLookupTable.updateLutTx.getInstructions().length > 0 &&
|
@@ -480,9 +480,7 @@ export class TransactionsManager {
|
|
480
480
|
attemptNum
|
481
481
|
);
|
482
482
|
} else {
|
483
|
-
|
484
|
-
await this.debugAccounts(itemSet, tx);
|
485
|
-
}
|
483
|
+
await this.debugAccounts(itemSet, tx);
|
486
484
|
await this.sendTransaction(
|
487
485
|
tx,
|
488
486
|
itemSet.name(),
|
@@ -7,10 +7,10 @@ import {
|
|
7
7
|
} from "@metaplex-foundation/umi";
|
8
8
|
import { PYTH_PRICE_FEED_IDS } from "../constants/pythConstants";
|
9
9
|
import { fromBaseUnit, toBaseUnit } from "./numberUtils";
|
10
|
-
import { PRICES
|
10
|
+
import { PRICES } from "../constants/solautoConstants";
|
11
11
|
|
12
12
|
export function consoleLog(...args: any[]): void {
|
13
|
-
if (
|
13
|
+
if ((globalThis as any).LOCAL_TEST) {
|
14
14
|
console.log(...args);
|
15
15
|
}
|
16
16
|
}
|
@@ -30,7 +30,10 @@ describe("Solauto Marginfi tests", async () => {
|
|
30
30
|
|
31
31
|
it("open - deposit - borrow - rebalance to 0 - withdraw - close", async () => {
|
32
32
|
|
33
|
-
const client = new SolautoMarginfiClient(
|
33
|
+
const client = new SolautoMarginfiClient(
|
34
|
+
buildHeliusApiUrl(process.env.HELIUS_API_KEY!),
|
35
|
+
true
|
36
|
+
);
|
34
37
|
|
35
38
|
const supply = NATIVE_MINT;
|
36
39
|
const supplyDecimals = 9;
|