@haven-fi/solauto-sdk 1.0.0 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAW,SAAS,EAAwB,MAAM,iBAAiB,CAAC;AAQ3E,OAAO,EAEL,kBAAkB,EAEnB,MAAM,0BAA0B,CAAC;AAQlC,OAAO,EACL,cAAc,EAEf,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,sCAAsC,CAAC;AAEpE,wBAAgB,iBAAiB,IAAI,cAAc,CAKlD;AAED,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,SAAS,CAAC,CAI9D;AAED,wBAAsB,uBAAuB,CAC3C,oBAAoB,GAAE,MAAU,iBAYjC;AAuFD,UAAU,sBAAsB;IAC9B,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,wBAAsB,2BAA2B,CAC/C,MAAM,EAAE,aAAa,EACrB,GAAG,EAAE,kBAAkB,EAAE,EACzB,YAAY,CAAC,EAAE,OAAO,GACrB,OAAO,CAAC,sBAAsB,GAAG,SAAS,CAAC,CAsC7C"}
|
package/dist/utils/jitoUtils.js
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.sendJitoBundledTransactions = exports.waitUntilJitoNextLeader = exports.getRandomTipAccount = exports.getSearcherClient = void 0;
|
4
|
-
const chai_1 = require("chai");
|
5
4
|
const web3_js_1 = require("@solana/web3.js");
|
6
5
|
const umi_web3js_adapters_1 = require("@metaplex-foundation/umi-web3js-adapters");
|
7
6
|
const solautoConstants_1 = require("../constants/solautoConstants");
|
@@ -44,8 +43,8 @@ async function simulateJitoBundle(txs) {
|
|
44
43
|
tx.logs?.forEach((x) => {
|
45
44
|
console.log(x);
|
46
45
|
});
|
46
|
+
throw tx.err;
|
47
47
|
}
|
48
|
-
chai_1.assert.equal(tx.err, undefined);
|
49
48
|
});
|
50
49
|
return simulationResult.value.transactionResults;
|
51
50
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"generalUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/solauto/generalUtils.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"generalUtils.d.ts","sourceRoot":"","sources":["../../../src/utils/solauto/generalUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACvE,OAAO,EACL,kBAAkB,EAClB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,eAAe,EACf,aAAa,EAEb,yBAAyB,EACzB,gCAAgC,EAIjC,MAAM,iBAAiB,CAAC;AAwBzB,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,kBAAkB,GAC7B,MAAM,CAKR;AAED,wBAAgB,+BAA+B,CAC7C,UAAU,EAAE,kBAAkB,GAC7B,OAAO,CAET;AAED,wBAAgB,6BAA6B,CAC3C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,UAAU,EAAE,kBAAkB,EAC9B,oBAAoB,EAAE,MAAM,UAY7B;AAED,wBAAgB,iCAAiC,CAC/C,QAAQ,EAAE,yBAAyB,EACnC,kBAAkB,EAAE,MAAM,GACzB,yBAAyB,CAgB3B;AAED,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,GAAG;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAYA;AAED,wBAAgB,wB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c,EAAE,MAAM,CAAa;IACnC,uBAAuB,EAAE,MAAM,CAAa;IAC5C,QAAQ,EAAE,yBAAyB,GAAG,SAAS,CAAa;IAC5D,SAAS,EAAE,WAAW,GAAG,SAAS,CAAa;IAEtD,GAAG,CAAC,MAAM,EAAE,kBAAkB;IAyD9B,KAAK;IAQL,UAAU,IAAI,OAAO;CAQtB"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@haven-fi/solauto-sdk",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.2",
|
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",
|
@@ -28,10 +28,10 @@
|
|
28
28
|
"rpc-websockets": "7.11.0"
|
29
29
|
},
|
30
30
|
"devDependencies": {
|
31
|
+
"@types/chai": "^4.3.0",
|
32
|
+
"@types/mocha": "^9.1.1",
|
31
33
|
"chai": "^4.3.4",
|
32
34
|
"mocha": "^9.2.2",
|
33
|
-
"ts-mocha": "^10.0.0"
|
34
|
-
"@types/chai": "^4.3.0",
|
35
|
-
"@types/mocha": "^9.1.1"
|
35
|
+
"ts-mocha": "^10.0.0"
|
36
36
|
}
|
37
37
|
}
|
package/src/utils/jitoUtils.ts
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
import { assert } from "chai";
|
2
1
|
import { SolautoClient } from "../clients/solautoClient";
|
3
2
|
import { Keypair, PublicKey, VersionedTransaction } from "@solana/web3.js";
|
4
3
|
import { SimulatedBundleTransactionResult } from "jito-ts";
|
@@ -10,7 +9,6 @@ import {
|
|
10
9
|
} from "../constants/solautoConstants";
|
11
10
|
import {
|
12
11
|
Signer,
|
13
|
-
transactionBuilder,
|
14
12
|
TransactionBuilder,
|
15
13
|
WrappedInstruction,
|
16
14
|
} from "@metaplex-foundation/umi";
|
@@ -18,8 +16,6 @@ import {
|
|
18
16
|
assembleFinalTransaction,
|
19
17
|
getComputeUnitPriceEstimate,
|
20
18
|
getSecretKey,
|
21
|
-
setComputeUnitLimitUmiIx,
|
22
|
-
setComputeUnitPriceUmiIx,
|
23
19
|
systemTransferUmiIx,
|
24
20
|
} from "./solanaUtils";
|
25
21
|
import { Bundle } from "jito-ts/dist/sdk/block-engine/types";
|
@@ -82,8 +78,8 @@ async function simulateJitoBundle(
|
|
82
78
|
tx.logs?.forEach((x) => {
|
83
79
|
console.log(x);
|
84
80
|
});
|
81
|
+
throw tx.err;
|
85
82
|
}
|
86
|
-
assert.equal(tx.err, undefined);
|
87
83
|
});
|
88
84
|
|
89
85
|
return simulationResult.value.transactionResults;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
import { assert } from "chai";
|
2
1
|
import { isOption, isSome, PublicKey } from "@metaplex-foundation/umi";
|
3
2
|
import {
|
4
3
|
AutomationSettings,
|
@@ -18,7 +17,6 @@ import { currentUnixSeconds } from "../generalUtils";
|
|
18
17
|
import { fromBps, toBps } from "../numberUtils";
|
19
18
|
import {
|
20
19
|
MAX_REPAY_GAP_BPS,
|
21
|
-
MIN_POSITION_STATE_FRESHNESS_SECS,
|
22
20
|
UMI,
|
23
21
|
} from "../../constants/solautoConstants";
|
24
22
|
import { getReferralState } from "../accountUtils";
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { describe, it, before } from 'mocha';
|
2
2
|
import { PublicKey } from "@solana/web3.js";
|
3
3
|
import { NATIVE_MINT } from "@solana/spl-token";
|
4
|
+
import { assert } from "chai";
|
4
5
|
import {
|
5
6
|
SolautoMarginfiClient,
|
6
7
|
newMarginfiSolautoManagedPositionArgs,
|
@@ -24,7 +25,6 @@ import {
|
|
24
25
|
toBaseUnit,
|
25
26
|
} from "../../src/utils/numberUtils";
|
26
27
|
import { USD_DECIMALS } from "../../src/constants/generalAccounts";
|
27
|
-
import { assert } from "chai";
|
28
28
|
import {
|
29
29
|
eligibleForNextAutomationPeriod,
|
30
30
|
getAdjustedSettingsFromAutomation,
|