@haven-fi/solauto-sdk 1.0.825 → 1.0.826
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":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAIV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEH,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAiBlE,wBAAgB,mBAAmB,IAAI,SAAS,CAG/C;AAiGD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB;;;;IAkB/D;
|
|
1
|
+
{"version":3,"file":"jitoUtils.d.ts","sourceRoot":"","sources":["../../src/utils/jitoUtils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EAIV,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,MAAM,EACN,kBAAkB,EAClB,GAAG,EAEH,kBAAkB,EACnB,MAAM,0BAA0B,CAAC;AAGlC,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAiBlE,wBAAgB,mBAAmB,IAAI,SAAS,CAG/C;AAiGD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,kBAAkB;;;;IAkB/D;AAsHD,wBAAsB,2BAA2B,CAC/C,GAAG,EAAE,GAAG,EACR,UAAU,EAAE,UAAU,EACtB,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,MAAM,EAAE,EACtB,YAAY,EAAE,kBAAkB,EAAE,EAClC,MAAM,CAAC,EAAE,kBAAkB,EAC3B,kBAAkB,GAAE,kBAA2C,EAC/D,cAAc,CAAC,EAAE,MAAM,IAAI,EAC3B,eAAe,CAAC,EAAE,eAAe,GAChC,OAAO,CAAC,MAAM,EAAE,GAAG,SAAS,CAAC,CA6G/B"}
|
package/dist/utils/jitoUtils.js
CHANGED
|
@@ -142,13 +142,14 @@ async function pollBundleStatus(umi, bundleId, interval = 1000, timeout = 40000)
|
|
|
142
142
|
if (statuses?.value?.length > 0) {
|
|
143
143
|
(0, generalUtils_1.consoleLog)("Statuses:", statuses);
|
|
144
144
|
const status = statuses.value[0].confirmation_status;
|
|
145
|
-
if (status === "confirmed") {
|
|
145
|
+
if (status === "confirmed" || status === "finalized") {
|
|
146
146
|
return statuses.value[0].transactions;
|
|
147
147
|
}
|
|
148
148
|
const err = statuses.value[0].err;
|
|
149
|
-
|
|
149
|
+
// Jito reports a successful bundle as err: { Ok: null }
|
|
150
|
+
if (err && !("Ok" in err && err.Ok === null)) {
|
|
150
151
|
(0, generalUtils_1.consoleLog)("Jito bundle err:", JSON.stringify(err, null, 2));
|
|
151
|
-
throw new Error(err);
|
|
152
|
+
throw new Error(JSON.stringify(err));
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
155
|
}
|
package/package.json
CHANGED
package/src/utils/jitoUtils.ts
CHANGED
|
@@ -224,13 +224,14 @@ async function pollBundleStatus(
|
|
|
224
224
|
if (statuses?.value?.length > 0) {
|
|
225
225
|
consoleLog("Statuses:", statuses);
|
|
226
226
|
const status = statuses.value[0].confirmation_status;
|
|
227
|
-
if (status === "confirmed") {
|
|
227
|
+
if (status === "confirmed" || status === "finalized") {
|
|
228
228
|
return statuses.value[0].transactions as string[];
|
|
229
229
|
}
|
|
230
230
|
const err = statuses.value[0].err;
|
|
231
|
-
|
|
231
|
+
// Jito reports a successful bundle as err: { Ok: null }
|
|
232
|
+
if (err && !("Ok" in err && err.Ok === null)) {
|
|
232
233
|
consoleLog("Jito bundle err:", JSON.stringify(err, null, 2));
|
|
233
|
-
throw new Error(err);
|
|
234
|
+
throw new Error(JSON.stringify(err));
|
|
234
235
|
}
|
|
235
236
|
}
|
|
236
237
|
}
|