@haven-fi/solauto-sdk 1.0.797 → 1.0.799
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.
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"switchboardUtils.d.ts","sourceRoot":"","sources":["../../src/utils/switchboardUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAGV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAsB,MAAM,0BAA0B,CAAC;AAGtE,OAAO,KAAK,QAAQ,MAAM,4BAA4B,CAAC;AAIvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAQjD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,SAAS,EACf,MAAM,CAAC,EAAE,SAAS,8BA0BnB;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,
|
1
|
+
{"version":3,"file":"switchboardUtils.d.ts","sourceRoot":"","sources":["../../src/utils/switchboardUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAGV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,MAAM,EAAsB,MAAM,0BAA0B,CAAC;AAGtE,OAAO,KAAK,QAAQ,MAAM,4BAA4B,CAAC;AAIvD,OAAO,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAQjD,wBAAsB,WAAW,CAC/B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,SAAS,EACf,MAAM,CAAC,EAAE,SAAS,8BA0BnB;AAED,wBAAsB,wBAAwB,CAC5C,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,SAAS,GACd,OAAO,CAAC,qBAAqB,GAAG,SAAS,CAAC,CA6C5C;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,UAAU,EAChB,KAAK,EAAE,SAAS,EAAE,GACjB,OAAO,CAAC;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,EAAE,CAAC,CAuB/D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,WAEzD"}
|
@@ -65,7 +65,7 @@ async function buildSwbSubmitResponseTx(conn, signer, mint) {
|
|
65
65
|
const res = await feed.fetchUpdateIx({
|
66
66
|
gateway: await feed.fetchGatewayUrl(),
|
67
67
|
chain: "solana",
|
68
|
-
network: "mainnet",
|
68
|
+
network: "mainnet-beta",
|
69
69
|
});
|
70
70
|
if (!res[1] || !res[1][0].value) {
|
71
71
|
throw new Error("Unable to fetch Switchboard pull IX");
|
@@ -75,7 +75,9 @@ async function buildSwbSubmitResponseTx(conn, signer, mint) {
|
|
75
75
|
if (!pullIxs || !pullIxs.length) {
|
76
76
|
throw new Error("Unable to fetch SWB crank IX");
|
77
77
|
}
|
78
|
+
(0, generalUtils_1.consoleLog)("Setting price locally...");
|
78
79
|
const price = responses[0].value.toNumber();
|
80
|
+
(0, generalUtils_1.consoleLog)(price);
|
79
81
|
constants_1.PRICES[mint.toString()] = {
|
80
82
|
realtimePrice: price,
|
81
83
|
confInterval: 0,
|
@@ -83,6 +85,7 @@ async function buildSwbSubmitResponseTx(conn, signer, mint) {
|
|
83
85
|
emaConfInterval: 0,
|
84
86
|
time: (0, generalUtils_1.currentUnixSeconds)(),
|
85
87
|
};
|
88
|
+
(0, generalUtils_1.consoleLog)("Returning SWB transaction data...");
|
86
89
|
return {
|
87
90
|
tx: (0, umi_1.transactionBuilder)(pullIxs.map((x) => (0, solanaUtils_1.getWrappedInstruction)(signer, x))),
|
88
91
|
lookupTableAddresses: responses
|
package/local/txSandbox.ts
CHANGED
@@ -30,7 +30,7 @@ import {
|
|
30
30
|
import { getSecretKey } from "./shared";
|
31
31
|
import { NATIVE_MINT } from "@solana/spl-token";
|
32
32
|
|
33
|
-
const payForTransaction =
|
33
|
+
const payForTransaction = false;
|
34
34
|
const testProgram = false;
|
35
35
|
const lpEnv: ProgramEnv = "Prod";
|
36
36
|
|
@@ -80,7 +80,7 @@ export async function main() {
|
|
80
80
|
|
81
81
|
const txManager = new ClientTransactionsManager({
|
82
82
|
txHandler: client,
|
83
|
-
txRunType: "
|
83
|
+
txRunType: payForTransaction ? "normal" : "only-simulate",
|
84
84
|
priorityFeeSetting: PriorityFeeSetting.Default,
|
85
85
|
retryConfig: { totalRetries: 2 },
|
86
86
|
});
|
package/package.json
CHANGED
@@ -63,7 +63,7 @@ export async function buildSwbSubmitResponseTx(
|
|
63
63
|
const res = await feed.fetchUpdateIx({
|
64
64
|
gateway: await feed.fetchGatewayUrl(),
|
65
65
|
chain: "solana",
|
66
|
-
network: "mainnet",
|
66
|
+
network: "mainnet-beta",
|
67
67
|
});
|
68
68
|
if (!res[1] || !res[1][0].value) {
|
69
69
|
throw new Error("Unable to fetch Switchboard pull IX");
|
@@ -78,7 +78,9 @@ export async function buildSwbSubmitResponseTx(
|
|
78
78
|
throw new Error("Unable to fetch SWB crank IX");
|
79
79
|
}
|
80
80
|
|
81
|
+
consoleLog("Setting price locally...");
|
81
82
|
const price = (responses[0].value as Big).toNumber();
|
83
|
+
consoleLog(price);
|
82
84
|
PRICES[mint.toString()] = {
|
83
85
|
realtimePrice: price,
|
84
86
|
confInterval: 0,
|
@@ -87,6 +89,7 @@ export async function buildSwbSubmitResponseTx(
|
|
87
89
|
time: currentUnixSeconds(),
|
88
90
|
};
|
89
91
|
|
92
|
+
consoleLog("Returning SWB transaction data...");
|
90
93
|
return {
|
91
94
|
tx: transactionBuilder(
|
92
95
|
pullIxs.map((x) => getWrappedInstruction(signer, x))
|