@haven-fi/solauto-sdk 1.0.388 → 1.0.391
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.
- package/dist/constants/marginfiAccounts.js +14 -14
- package/dist/constants/tokenConstants.js +6 -6
- package/dist/utils/priceUtils.js +1 -1
- package/dist/utils/switchboardUtils.js +1 -1
- package/package.json +2 -2
- package/src/constants/marginfiAccounts.ts +14 -14
- package/src/constants/tokenConstants.ts +6 -6
- package/src/utils/priceUtils.ts +1 -1
- package/src/utils/switchboardUtils.ts +1 -1
- package/tests/transactions/solautoMarginfi.ts +1 -1
@@ -190,19 +190,19 @@ exports.MARGINFI_ACCOUNTS = {
|
|
190
190
|
priceOracle: USDC_PRICE_ORACLE,
|
191
191
|
},
|
192
192
|
},
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
193
|
+
["DESG67cExEcw7d6MmENLEzaocR8pLrhfiw9VrNtGWUKD"]: {
|
194
|
+
[tokens.HMTR]: {
|
195
|
+
bank: "Br3yzg2WSb81RaFWK9UsKtq8fD5viwooZG34mKqQWxdM",
|
196
|
+
liquidityVault: "J45Je52qv2rDBuCQWPwp3bjRhf3bGzRWhKZtGDuLooCX",
|
197
|
+
vaultAuthority: "CKDsAKjNruDSz4tmUairh8PDGD1Rqh9WMTLWERYnnZrH",
|
198
|
+
priceOracle: switchboardConstants_1.SWITCHBOARD_PRICE_FEED_IDS[tokens.HMTR.toString()],
|
199
|
+
},
|
200
|
+
[tokens.USDC]: {
|
201
|
+
bank: "9yNnhJ8c1vGbu3DMf6eeeUi6TDJ2ddGgaRA88rL2R3rP",
|
202
|
+
liquidityVault: "4U1UBjXrPrW7JuQ894JbLUBqcb5LFfK9rfkWFwT7EdQ9",
|
203
|
+
vaultAuthority: "CY74V1r48kuuHA6APD3AaU2oPV1mBqe9srikrQQSHNR6",
|
204
|
+
priceOracle: USDC_PRICE_ORACLE,
|
205
|
+
}
|
206
|
+
}
|
207
207
|
};
|
208
208
|
exports.MARGINFI_ACCOUNTS_LOOKUP_TABLE = "GAjmWmBPcH5Gxbiykasydj6RsCEaCLyHEvK6kHdFigc6";
|
@@ -49,7 +49,7 @@ exports.ALL_SUPPORTED_TOKENS = [
|
|
49
49
|
exports.POPCAT,
|
50
50
|
exports.RETARDIO,
|
51
51
|
exports.BILLY,
|
52
|
-
|
52
|
+
exports.HMTR,
|
53
53
|
];
|
54
54
|
exports.TOKEN_INFO = {
|
55
55
|
[web3_js_1.PublicKey.default.toString()]: {
|
@@ -161,9 +161,9 @@ exports.TOKEN_INFO = {
|
|
161
161
|
decimals: 6,
|
162
162
|
isMeme: true,
|
163
163
|
},
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
164
|
+
[exports.HMTR]: {
|
165
|
+
ticker: "HMTR",
|
166
|
+
decimals: 0,
|
167
|
+
isMeme: true,
|
168
|
+
},
|
169
169
|
};
|
package/dist/utils/priceUtils.js
CHANGED
@@ -68,7 +68,7 @@ async function getSwitchboardPrices(mints) {
|
|
68
68
|
if (mints.length === 0) {
|
69
69
|
return [];
|
70
70
|
}
|
71
|
-
const crossbar =
|
71
|
+
const crossbar = on_demand_1.CrossbarClient.default();
|
72
72
|
let prices = [];
|
73
73
|
try {
|
74
74
|
prices = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => {
|
@@ -25,7 +25,7 @@ function getPullFeed(conn, mint, wallet) {
|
|
25
25
|
return new on_demand_1.PullFeed(program, new web3_js_1.PublicKey(switchboardConstants_1.SWITCHBOARD_PRICE_FEED_IDS[mint.toString()]));
|
26
26
|
}
|
27
27
|
async function buildSwbSubmitResponseTx(conn, signer, mint) {
|
28
|
-
const crossbar =
|
28
|
+
const crossbar = on_demand_1.CrossbarClient.default();
|
29
29
|
const feed = getPullFeed(conn, mint, (0, umi_web3js_adapters_1.toWeb3JsPublicKey)(signer.publicKey));
|
30
30
|
const [pullIx, responses] = await (0, generalUtils_1.retryWithExponentialBackoff)(async () => await feed.fetchUpdateIx({
|
31
31
|
crossbarClient: crossbar,
|
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.391",
|
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",
|
@@ -23,7 +23,7 @@
|
|
23
23
|
"@mrgnlabs/mrgn-common": "^1.8.0",
|
24
24
|
"@solana/spl-token": "^0.4.0",
|
25
25
|
"@solana/web3.js": "=1.95.8",
|
26
|
-
"@switchboard-xyz/on-demand": "
|
26
|
+
"@switchboard-xyz/on-demand": "=1.2.51",
|
27
27
|
"axios": "^1.7.8",
|
28
28
|
"bs58": "^5.0.0",
|
29
29
|
"cross-fetch": "^4.0.0",
|
@@ -172,20 +172,20 @@ export const MARGINFI_ACCOUNTS: {
|
|
172
172
|
priceOracle: USDC_PRICE_ORACLE,
|
173
173
|
},
|
174
174
|
},
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
175
|
+
["DESG67cExEcw7d6MmENLEzaocR8pLrhfiw9VrNtGWUKD"]: {
|
176
|
+
[tokens.HMTR]: {
|
177
|
+
bank: "Br3yzg2WSb81RaFWK9UsKtq8fD5viwooZG34mKqQWxdM",
|
178
|
+
liquidityVault: "J45Je52qv2rDBuCQWPwp3bjRhf3bGzRWhKZtGDuLooCX",
|
179
|
+
vaultAuthority: "CKDsAKjNruDSz4tmUairh8PDGD1Rqh9WMTLWERYnnZrH",
|
180
|
+
priceOracle: SWITCHBOARD_PRICE_FEED_IDS[tokens.HMTR.toString()],
|
181
|
+
},
|
182
|
+
[tokens.USDC]: {
|
183
|
+
bank: "9yNnhJ8c1vGbu3DMf6eeeUi6TDJ2ddGgaRA88rL2R3rP",
|
184
|
+
liquidityVault: "4U1UBjXrPrW7JuQ894JbLUBqcb5LFfK9rfkWFwT7EdQ9",
|
185
|
+
vaultAuthority: "CY74V1r48kuuHA6APD3AaU2oPV1mBqe9srikrQQSHNR6",
|
186
|
+
priceOracle: USDC_PRICE_ORACLE,
|
187
|
+
}
|
188
|
+
}
|
189
189
|
};
|
190
190
|
|
191
191
|
export const MARGINFI_ACCOUNTS_LOOKUP_TABLE =
|
@@ -48,7 +48,7 @@ export const ALL_SUPPORTED_TOKENS = [
|
|
48
48
|
POPCAT,
|
49
49
|
RETARDIO,
|
50
50
|
BILLY,
|
51
|
-
|
51
|
+
HMTR,
|
52
52
|
];
|
53
53
|
|
54
54
|
interface TokenInfo {
|
@@ -170,9 +170,9 @@ export const TOKEN_INFO: { [key: string]: TokenInfo } = {
|
|
170
170
|
decimals: 6,
|
171
171
|
isMeme: true,
|
172
172
|
},
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
173
|
+
[HMTR]: {
|
174
|
+
ticker: "HMTR",
|
175
|
+
decimals: 0,
|
176
|
+
isMeme: true,
|
177
|
+
},
|
178
178
|
};
|
package/src/utils/priceUtils.ts
CHANGED
@@ -48,7 +48,7 @@ export async function buildSwbSubmitResponseTx(
|
|
48
48
|
signer: Signer,
|
49
49
|
mint: PublicKey
|
50
50
|
): Promise<TransactionItemInputs | undefined> {
|
51
|
-
const crossbar =
|
51
|
+
const crossbar = CrossbarClient.default();
|
52
52
|
const feed = getPullFeed(conn, mint, toWeb3JsPublicKey(signer.publicKey));
|
53
53
|
const [pullIx, responses] = await retryWithExponentialBackoff(
|
54
54
|
async () =>
|
@@ -133,7 +133,7 @@ describe("Solauto Marginfi tests", async () => {
|
|
133
133
|
// );
|
134
134
|
// console.log(stateKeverage);
|
135
135
|
|
136
|
-
|
136
|
+
console.log(await fetchTokenPrices([new PublicKey(HMTR)]));
|
137
137
|
|
138
138
|
const transactionItems: TransactionItem[] = [];
|
139
139
|
// const settingParams: SolautoSettingsParametersInpArgs = {
|