@haven-fi/solauto-sdk 1.0.546 → 1.0.547
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,8 +23,8 @@ function createTransactionInstruction(instruction) {
|
|
23
23
|
});
|
24
24
|
}
|
25
25
|
async function getJupQuote(swapDetails) {
|
26
|
-
const memecoinSwap = (0, generalUtils_1.tokenInfo)(swapDetails.inputMint)
|
27
|
-
(0, generalUtils_1.tokenInfo)(swapDetails.outputMint)
|
26
|
+
const memecoinSwap = (0, generalUtils_1.tokenInfo)(swapDetails.inputMint)?.isMeme ||
|
27
|
+
(0, generalUtils_1.tokenInfo)(swapDetails.outputMint)?.isMeme;
|
28
28
|
return await (0, generalUtils_1.retryWithExponentialBackoff)(async (attemptNum) => await jupApi.quoteGet({
|
29
29
|
amount: Number(swapDetails.amount),
|
30
30
|
inputMint: swapDetails.inputMint.toString(),
|
package/package.json
CHANGED
@@ -51,8 +51,8 @@ function createTransactionInstruction(
|
|
51
51
|
|
52
52
|
export async function getJupQuote(swapDetails: JupSwapInput) {
|
53
53
|
const memecoinSwap =
|
54
|
-
tokenInfo(swapDetails.inputMint)
|
55
|
-
tokenInfo(swapDetails.outputMint)
|
54
|
+
tokenInfo(swapDetails.inputMint)?.isMeme ||
|
55
|
+
tokenInfo(swapDetails.outputMint)?.isMeme;
|
56
56
|
|
57
57
|
return await retryWithExponentialBackoff(
|
58
58
|
async (attemptNum: number) =>
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { describe, it } from "mocha";
|
2
|
-
import { none, publicKey, some
|
2
|
+
import { none, publicKey, some } from "@metaplex-foundation/umi";
|
3
3
|
import { setupTest } from "../shared";
|
4
4
|
import { SolautoMarginfiClient } from "../../src/clients/solautoMarginfiClient";
|
5
5
|
import {
|
@@ -43,29 +43,6 @@ import {
|
|
43
43
|
import { PriorityFeeSetting } from "../../src/types";
|
44
44
|
import { buildIronforgeApiUrl, fromBaseUnit, tokenInfo, USD_DECIMALS } from "../../dist";
|
45
45
|
|
46
|
-
async function getAssets(
|
47
|
-
umi: Umi,
|
48
|
-
mints: PublicKey[]
|
49
|
-
) {
|
50
|
-
const response = await fetch(umi.rpc.getEndpoint(), {
|
51
|
-
method: 'POST',
|
52
|
-
headers: {
|
53
|
-
'Content-Type': 'application/json',
|
54
|
-
},
|
55
|
-
body: JSON.stringify({
|
56
|
-
jsonrpc: '2.0',
|
57
|
-
id: 'get-assets',
|
58
|
-
method: 'getAssetBatch',
|
59
|
-
params: {
|
60
|
-
ids: mints.map((x) => x.toString()),
|
61
|
-
},
|
62
|
-
}),
|
63
|
-
});
|
64
|
-
const res = await response.json();
|
65
|
-
return res;
|
66
|
-
}
|
67
|
-
|
68
|
-
|
69
46
|
describe("Solauto Marginfi tests", async () => {
|
70
47
|
// const signer = setupTest();
|
71
48
|
const signer = setupTest("solauto-manager");
|
@@ -85,21 +62,18 @@ describe("Solauto Marginfi tests", async () => {
|
|
85
62
|
const supplyDecimals = 6;
|
86
63
|
const debtDecimals = 6;
|
87
64
|
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
console.log(await getAssets(client.umi, [NATIVE_MINT, new PublicKey(USDC)]));
|
102
|
-
return;
|
65
|
+
await client.initialize({
|
66
|
+
signer,
|
67
|
+
positionId,
|
68
|
+
authority: new PublicKey("FKYQs7KgRvaKQHxXwb8HKfoBcFdSxLL3JvHWpPdVQ16v"),
|
69
|
+
// new: true,
|
70
|
+
// marginfiAccount: new PublicKey(
|
71
|
+
// ""
|
72
|
+
// ),
|
73
|
+
// marginfiGroup: new PublicKey(""),
|
74
|
+
// supplyMint: new PublicKey(""),
|
75
|
+
// debtMint: new PublicKey(USDC),
|
76
|
+
});
|
103
77
|
|
104
78
|
const transactionItems: TransactionItem[] = [];
|
105
79
|
// const settingParams: SolautoSettingsParametersInpArgs = {
|