@seedprotocol/arweave 0.7.14-next.1636.g1e2770e → 0.8.1-next.1665.g4ece1f4
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/{ArweaveClient-Cy1laqZ-.js → ArweaveClient-BhqiFB9a.js} +114 -110
- package/dist/ArweaveClient-BhqiFB9a.js.map +1 -0
- package/dist/gateway/readBaseUrls.d.ts +7 -3
- package/dist/gateway/readBaseUrls.d.ts.map +1 -1
- package/dist/index.js +84 -84
- package/dist/index.js.map +1 -1
- package/dist/node.js +1 -1
- package/package.json +1 -1
- package/dist/ArweaveClient-Cy1laqZ-.js.map +0 -1
|
@@ -79,21 +79,21 @@ var _ = Symbol.for("@seedprotocol/arweave:clientOwner"), ce = Object.freeze({ pa
|
|
|
79
79
|
function le() {
|
|
80
80
|
globalThis[_] = ce;
|
|
81
81
|
}
|
|
82
|
-
var
|
|
82
|
+
var ue = class extends Error {
|
|
83
83
|
constructor() {
|
|
84
84
|
super("Two copies of @seedprotocol/arweave are loaded, and the Arweave client was registered on the other copy (e.g. by SeedClient). Reads through this copy would use a different client and gateway. Make sure every @seedprotocol/* package is the same version and installed once (`npm ls @seedprotocol/arweave`). With Vite, keep @seedprotocol/* packages out of optimizeDeps.exclude so they are pre-bundled together, and dedupe them (seedVitePlugin does) when they are linked into the app."), this.name = "DuplicateArweaveModuleError";
|
|
85
85
|
}
|
|
86
86
|
};
|
|
87
|
-
function
|
|
87
|
+
function de() {
|
|
88
88
|
let e = globalThis[_];
|
|
89
|
-
if (e !== void 0 && e !== ce) throw new
|
|
89
|
+
if (e !== void 0 && e !== ce) throw new ue();
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function fe() {
|
|
92
92
|
delete globalThis[_];
|
|
93
93
|
}
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region src/ArweaveClient/BaseArweaveClient.ts
|
|
96
|
-
function
|
|
96
|
+
function v(e) {
|
|
97
97
|
let t = e.trim();
|
|
98
98
|
return t.startsWith("http://") ? {
|
|
99
99
|
protocol: "http",
|
|
@@ -106,7 +106,7 @@ function y(e) {
|
|
|
106
106
|
host: t.replace(/\/$/, "")
|
|
107
107
|
};
|
|
108
108
|
}
|
|
109
|
-
var
|
|
109
|
+
var y = n, b = "https", x = !1, S = !1, C = class e {
|
|
110
110
|
static _impl = null;
|
|
111
111
|
static configure(t) {
|
|
112
112
|
if (!t) throw Error("Cannot configure ArweaveClient with undefined or null. Ensure the platform-specific ArweaveClient is properly created.");
|
|
@@ -121,9 +121,9 @@ var b = n, x = "https", S = !1, C = !1, w = class e {
|
|
|
121
121
|
}
|
|
122
122
|
static resolveGateway() {
|
|
123
123
|
let e = ne();
|
|
124
|
-
return e && !
|
|
125
|
-
protocol:
|
|
126
|
-
host:
|
|
124
|
+
return e && !x && !S ? v(e) : {
|
|
125
|
+
protocol: b,
|
|
126
|
+
host: y
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
129
|
static getHost() {
|
|
@@ -162,22 +162,22 @@ var b = n, x = "https", S = !1, C = !1, w = class e {
|
|
|
162
162
|
return `${e}://${t}`;
|
|
163
163
|
}
|
|
164
164
|
static setHost(e) {
|
|
165
|
-
let t =
|
|
166
|
-
|
|
165
|
+
let t = v(e);
|
|
166
|
+
y = t.host, b = t.protocol, x = !0, S = !1;
|
|
167
167
|
}
|
|
168
168
|
static isReadGatewayLocked() {
|
|
169
|
-
return
|
|
169
|
+
return x;
|
|
170
170
|
}
|
|
171
171
|
static resetReadGatewaySelectionStateForTests() {
|
|
172
|
-
|
|
172
|
+
S = !1;
|
|
173
173
|
}
|
|
174
174
|
static setPreferredReadGateway(e) {
|
|
175
|
-
let t =
|
|
176
|
-
|
|
175
|
+
let t = v(e);
|
|
176
|
+
y = t.host, b = t.protocol, x = !1;
|
|
177
177
|
}
|
|
178
178
|
static applyProbedReadGateway(e) {
|
|
179
|
-
let t =
|
|
180
|
-
|
|
179
|
+
let t = v(e);
|
|
180
|
+
y = t.host, b = t.protocol, x = !1, S = !0;
|
|
181
181
|
}
|
|
182
182
|
static getEndpoint() {
|
|
183
183
|
return `${this.getBaseUrl()}/graphql`;
|
|
@@ -209,99 +209,99 @@ var b = n, x = "https", S = !1, C = !1, w = class e {
|
|
|
209
209
|
static downloadFiles(t) {
|
|
210
210
|
return e.requireImpl().downloadFiles(t);
|
|
211
211
|
}
|
|
212
|
-
},
|
|
213
|
-
function
|
|
212
|
+
}, pe = 1, me = 6e4, w = pe, T = me, E = /* @__PURE__ */ new Map();
|
|
213
|
+
function D(e) {
|
|
214
214
|
let t = e.trim();
|
|
215
215
|
return t ? (t.startsWith("http://") ? t = t.slice(7) : t.startsWith("https://") && (t = t.slice(8)), t.replace(/\/$/, "").toLowerCase()) : "";
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
let t =
|
|
217
|
+
function he(e) {
|
|
218
|
+
let t = E.get(e);
|
|
219
219
|
return t || (t = {
|
|
220
220
|
failures: 0,
|
|
221
221
|
openedAt: null,
|
|
222
222
|
halfOpenProbeInFlight: !1
|
|
223
|
-
},
|
|
223
|
+
}, E.set(e, t)), t;
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
return e.openedAt == null ? "closed" : t - e.openedAt >=
|
|
225
|
+
function O(e, t) {
|
|
226
|
+
return e.openedAt == null ? "closed" : t - e.openedAt >= T ? "half-open" : "open";
|
|
227
227
|
}
|
|
228
|
-
function
|
|
229
|
-
e.failureThreshold != null && e.failureThreshold >= 1 && (
|
|
228
|
+
function ge(e) {
|
|
229
|
+
e.failureThreshold != null && e.failureThreshold >= 1 && (w = e.failureThreshold), e.openDurationMs != null && e.openDurationMs >= 0 && (T = e.openDurationMs);
|
|
230
230
|
}
|
|
231
|
-
function
|
|
232
|
-
|
|
231
|
+
function _e() {
|
|
232
|
+
E.clear(), w = pe, T = me;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
let n =
|
|
234
|
+
function k(e, t = Date.now()) {
|
|
235
|
+
let n = D(e);
|
|
236
236
|
if (!n) return !1;
|
|
237
|
-
let r =
|
|
237
|
+
let r = E.get(n);
|
|
238
238
|
if (!r) return !1;
|
|
239
|
-
let i =
|
|
239
|
+
let i = O(r, t);
|
|
240
240
|
return !!(i === "open" || i === "half-open" && r.halfOpenProbeInFlight);
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
let n =
|
|
242
|
+
function ve(e, t = Date.now()) {
|
|
243
|
+
let n = D(e);
|
|
244
244
|
if (!n) return "closed";
|
|
245
|
-
let r =
|
|
246
|
-
return r ?
|
|
245
|
+
let r = E.get(n);
|
|
246
|
+
return r ? O(r, t) : "closed";
|
|
247
247
|
}
|
|
248
|
-
function
|
|
249
|
-
let n =
|
|
248
|
+
function A(e, t = Date.now()) {
|
|
249
|
+
let n = D(e);
|
|
250
250
|
if (!n) return;
|
|
251
|
-
let r =
|
|
252
|
-
|
|
251
|
+
let r = he(n);
|
|
252
|
+
O(r, t) === "half-open" && (r.halfOpenProbeInFlight = !0);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
255
|
-
let t =
|
|
254
|
+
function j(e) {
|
|
255
|
+
let t = D(e), n = t ? E.get(t) : void 0;
|
|
256
256
|
n && (n.halfOpenProbeInFlight = !1);
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
let t =
|
|
260
|
-
t &&
|
|
258
|
+
function M(e) {
|
|
259
|
+
let t = D(e);
|
|
260
|
+
t && E.set(t, {
|
|
261
261
|
failures: 0,
|
|
262
262
|
openedAt: null,
|
|
263
263
|
halfOpenProbeInFlight: !1
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
|
-
function
|
|
267
|
-
let n =
|
|
266
|
+
function N(e, t = Date.now()) {
|
|
267
|
+
let n = D(e);
|
|
268
268
|
if (!n) return;
|
|
269
|
-
let r =
|
|
270
|
-
r.failures += 1, r.halfOpenProbeInFlight = !1, r.failures >=
|
|
269
|
+
let r = he(n);
|
|
270
|
+
r.failures += 1, r.halfOpenProbeInFlight = !1, r.failures >= w && (r.openedAt = t);
|
|
271
271
|
}
|
|
272
|
-
function
|
|
272
|
+
function ye(e = Date.now()) {
|
|
273
273
|
let t = [];
|
|
274
|
-
for (let n of
|
|
274
|
+
for (let n of E.keys()) k(n, e) && t.push(n);
|
|
275
275
|
return t;
|
|
276
276
|
}
|
|
277
277
|
//#endregion
|
|
278
278
|
//#region src/ArweaveClient/selectReadGateway.ts
|
|
279
|
-
var
|
|
280
|
-
function
|
|
281
|
-
|
|
279
|
+
var P = 18e4, be = 6e4, xe = 5e3, F = null, I = null, L = null;
|
|
280
|
+
function R() {
|
|
281
|
+
F = null, I = null;
|
|
282
282
|
}
|
|
283
283
|
function Se() {
|
|
284
|
-
|
|
284
|
+
R(), L = null, _e(), C.resetReadGatewaySelectionStateForTests(), C.isReadGatewayLocked() || C.setPreferredReadGateway(n);
|
|
285
285
|
}
|
|
286
286
|
function Ce() {
|
|
287
|
-
return
|
|
287
|
+
return C.isReadGatewayLocked() ? !0 : F && Date.now() < F.expiresAt ? F.healthy : L != null;
|
|
288
288
|
}
|
|
289
289
|
function we() {
|
|
290
|
-
return
|
|
290
|
+
return L;
|
|
291
291
|
}
|
|
292
292
|
async function z(e, t = {}) {
|
|
293
293
|
if (t instanceof AbortSignal) throw TypeError("probeGateway takes options: pass { signal }, not an AbortSignal");
|
|
294
|
-
let { signal: n, timeoutMs: r =
|
|
294
|
+
let { signal: n, timeoutMs: r = xe, recordCircuit: i = !0 } = t, a = `${e.replace(/\/$/, "")}/info`, o = e;
|
|
295
295
|
try {
|
|
296
296
|
o = new URL(e.includes("://") ? e : `https://${e}`).host;
|
|
297
297
|
} catch {
|
|
298
298
|
o = e.replace(/^https?:\/\//, "").replace(/\/$/, "");
|
|
299
299
|
}
|
|
300
300
|
if (i) {
|
|
301
|
-
if (
|
|
302
|
-
|
|
301
|
+
if (k(o)) return !1;
|
|
302
|
+
A(o);
|
|
303
303
|
}
|
|
304
|
-
let s = (e) => (i && (e ?
|
|
304
|
+
let s = (e) => (i && (e ? M(o) : N(o)), e), c = () => (i && j(o), !1);
|
|
305
305
|
if (n?.aborted) return c();
|
|
306
306
|
let l = new AbortController(), u = setTimeout(() => l.abort(), r), d = () => l.abort(n?.reason);
|
|
307
307
|
n?.addEventListener("abort", d, { once: !0 });
|
|
@@ -329,44 +329,44 @@ async function z(e, t = {}) {
|
|
|
329
329
|
async function Te(e, t = "https", n) {
|
|
330
330
|
for (let r of e) {
|
|
331
331
|
let e = r.trim().replace(/\/$/, "");
|
|
332
|
-
if (e && !
|
|
332
|
+
if (e && !k(e) && await z(`${t}://${e}`, { signal: n })) return e;
|
|
333
333
|
}
|
|
334
334
|
return null;
|
|
335
335
|
}
|
|
336
336
|
function Ee() {
|
|
337
|
-
return f(
|
|
337
|
+
return f(C.getHost());
|
|
338
338
|
}
|
|
339
339
|
async function B(e) {
|
|
340
|
-
if (
|
|
341
|
-
if (
|
|
342
|
-
if (
|
|
343
|
-
|
|
344
|
-
let t = await Te(Ee(),
|
|
345
|
-
if (!t && e?.aborted) return
|
|
346
|
-
if (
|
|
347
|
-
host:
|
|
340
|
+
if (C.isReadGatewayLocked()) return C.getHost();
|
|
341
|
+
if (F && Date.now() < F.expiresAt) return F.host;
|
|
342
|
+
if (I) return I;
|
|
343
|
+
I = (async () => {
|
|
344
|
+
let t = await Te(Ee(), C.getProtocol(), e);
|
|
345
|
+
if (!t && e?.aborted) return L ?? C.getHost();
|
|
346
|
+
if (C.isReadGatewayLocked()) F = {
|
|
347
|
+
host: C.getHost(),
|
|
348
348
|
healthy: !0,
|
|
349
|
-
expiresAt: Date.now() +
|
|
349
|
+
expiresAt: Date.now() + P
|
|
350
350
|
};
|
|
351
|
-
else if (t)
|
|
351
|
+
else if (t) C.applyProbedReadGateway(t), L = t, F = {
|
|
352
352
|
host: t,
|
|
353
353
|
healthy: !0,
|
|
354
|
-
expiresAt: Date.now() +
|
|
354
|
+
expiresAt: Date.now() + P
|
|
355
355
|
};
|
|
356
356
|
else {
|
|
357
|
-
let e =
|
|
358
|
-
|
|
357
|
+
let e = L ?? C.getHost();
|
|
358
|
+
L && C.getHost() !== L && C.applyProbedReadGateway(L), F = {
|
|
359
359
|
host: e,
|
|
360
360
|
healthy: !1,
|
|
361
|
-
expiresAt: Date.now() +
|
|
361
|
+
expiresAt: Date.now() + be
|
|
362
362
|
};
|
|
363
363
|
}
|
|
364
|
-
return
|
|
364
|
+
return F.host;
|
|
365
365
|
})();
|
|
366
366
|
try {
|
|
367
|
-
return await
|
|
367
|
+
return await I;
|
|
368
368
|
} finally {
|
|
369
|
-
|
|
369
|
+
I = null;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
372
|
//#endregion
|
|
@@ -599,7 +599,7 @@ function J(e, t, n) {
|
|
|
599
599
|
r && !t.has(r) && (t.add(r), e.push(r));
|
|
600
600
|
}
|
|
601
601
|
function Y(e) {
|
|
602
|
-
let t = K(), n =
|
|
602
|
+
let t = K(), n = C.getProtocol(), r = t ? He(t) : e?.fallbackHosts?.length ? [...e.fallbackHosts] : f(C.getHost()), i = [], a = /* @__PURE__ */ new Set();
|
|
603
603
|
for (let e of r) {
|
|
604
604
|
let t = e.trim();
|
|
605
605
|
t && J(i, a, /^https?:\/\//i.test(t) ? t : `${n}://${t}`);
|
|
@@ -641,16 +641,20 @@ async function Xe(e, t) {
|
|
|
641
641
|
n.add(i);
|
|
642
642
|
let r = await X(i, e, t);
|
|
643
643
|
if (r) try {
|
|
644
|
-
let { bytes: t } = await se(r, { transactionId: e })
|
|
645
|
-
if (
|
|
644
|
+
let { bytes: t } = await se(r, { transactionId: e });
|
|
645
|
+
if (t.byteLength > 0) return t;
|
|
646
646
|
} catch {}
|
|
647
647
|
}
|
|
648
648
|
};
|
|
649
649
|
return await r(q()) || (await Ye(), r(Y(t)));
|
|
650
650
|
}
|
|
651
|
+
async function Ze(e, t) {
|
|
652
|
+
let n = await Xe(e, t);
|
|
653
|
+
return n && new TextDecoder().decode(n) || void 0;
|
|
654
|
+
}
|
|
651
655
|
//#endregion
|
|
652
656
|
//#region src/graphql/gql/gql.ts
|
|
653
|
-
var
|
|
657
|
+
var Qe = {
|
|
654
658
|
"\n query GetTransactionTags($transactionId: ID!) {\n tags: transaction(id: $transactionId) {\n id\n tags {\n name\n value\n }\n }\n }\n": {
|
|
655
659
|
kind: "Document",
|
|
656
660
|
definitions: [{
|
|
@@ -1004,13 +1008,13 @@ var Ze = {
|
|
|
1004
1008
|
}]
|
|
1005
1009
|
}
|
|
1006
1010
|
};
|
|
1007
|
-
function
|
|
1008
|
-
return
|
|
1011
|
+
function $e(e) {
|
|
1012
|
+
return Qe[e] ?? {};
|
|
1009
1013
|
}
|
|
1010
1014
|
//#endregion
|
|
1011
1015
|
//#region src/ArweaveClient/queries.ts
|
|
1012
|
-
var
|
|
1013
|
-
async function
|
|
1016
|
+
var et = $e("\n query GetTransactionTags($transactionId: ID!) {\n tags: transaction(id: $transactionId) {\n id\n tags {\n name\n value\n }\n }\n }\n"), tt = $e("\n query GetArweaveTransactions(\n $owners: [String!]\n $first: Int\n $after: String\n ) {\n transactions(owners: $owners, first: $first, after: $after) {\n edges {\n cursor\n node {\n id\n anchor\n signature\n block {\n id\n height\n }\n data {\n size\n type\n }\n tags {\n name\n value\n }\n }\n }\n pageInfo {\n hasNextPage\n }\n }\n }\n"), nt = 1e4, rt = 2e4, it = 1e3, at = (e) => e >= 500 || e === 429;
|
|
1017
|
+
async function ot(e, t, n) {
|
|
1014
1018
|
let r = new AbortController(), i = setTimeout(() => r.abort(), n);
|
|
1015
1019
|
try {
|
|
1016
1020
|
let n = await fetch(`${e.replace(/\/$/, "")}/${encodeURIComponent(t)}`, {
|
|
@@ -1018,7 +1022,7 @@ async function at(e, t, n) {
|
|
|
1018
1022
|
credentials: "omit",
|
|
1019
1023
|
signal: r.signal
|
|
1020
1024
|
});
|
|
1021
|
-
return await n.body?.cancel().catch(() => {}),
|
|
1025
|
+
return await n.body?.cancel().catch(() => {}), at(n.status) ? {
|
|
1022
1026
|
kind: "retry",
|
|
1023
1027
|
status: n.status
|
|
1024
1028
|
} : {
|
|
@@ -1034,23 +1038,23 @@ async function at(e, t, n) {
|
|
|
1034
1038
|
clearTimeout(i);
|
|
1035
1039
|
}
|
|
1036
1040
|
}
|
|
1037
|
-
function
|
|
1041
|
+
function st() {
|
|
1038
1042
|
let e = Je(), t = K();
|
|
1039
1043
|
if (t?.activePath !== "hyper-sidecar" && t?.activePath !== "http-proxy") return e;
|
|
1040
1044
|
let n = /* @__PURE__ */ new Set([...q(), t.arweaveBaseUrl.replace(/\/$/, "")]);
|
|
1041
1045
|
return e.filter((e) => n.has(e));
|
|
1042
1046
|
}
|
|
1043
|
-
async function
|
|
1044
|
-
let n = t.timeoutMs ?? 1e4, r = performance.now() + (t.totalTimeoutMs ?? 2e4), i = t.baseUrls ??
|
|
1047
|
+
async function ct(e, t = {}) {
|
|
1048
|
+
let n = t.timeoutMs ?? 1e4, r = performance.now() + (t.totalTimeoutMs ?? 2e4), i = t.baseUrls ?? st(), a = i.filter((e) => !k(e)), o = a.length > 0 ? a : i, s = 500;
|
|
1045
1049
|
for (let [t, i] of o.entries()) {
|
|
1046
1050
|
let a = r - performance.now();
|
|
1047
1051
|
if (a <= 0 || t > 0 && a < Math.min(n, 1e3)) break;
|
|
1048
|
-
let o = await
|
|
1049
|
-
if (o.kind === "answer") return
|
|
1052
|
+
let o = await ot(i, e, Math.min(n, a));
|
|
1053
|
+
if (o.kind === "answer") return M(i), {
|
|
1050
1054
|
status: o.status >= 200 && o.status < 300 ? 200 : o.status,
|
|
1051
1055
|
confirmed: null
|
|
1052
1056
|
};
|
|
1053
|
-
|
|
1057
|
+
N(i), s = o.status;
|
|
1054
1058
|
}
|
|
1055
1059
|
return {
|
|
1056
1060
|
status: s,
|
|
@@ -1059,8 +1063,8 @@ async function st(e, t = {}) {
|
|
|
1059
1063
|
}
|
|
1060
1064
|
//#endregion
|
|
1061
1065
|
//#region src/default/ArweaveClient.ts
|
|
1062
|
-
var Z = t("seedArweave:ArweaveClient"),
|
|
1063
|
-
function
|
|
1066
|
+
var Z = t("seedArweave:ArweaveClient"), lt = 3e4;
|
|
1067
|
+
function ut(e) {
|
|
1064
1068
|
return (t, n) => {
|
|
1065
1069
|
if (typeof AbortController > "u") return fetch(t, n);
|
|
1066
1070
|
let r = new AbortController(), i = n?.signal ?? void 0, a = setTimeout(() => r.abort(/* @__PURE__ */ Error(`Arweave GraphQL request timed out after ${e} ms`)), e), o = () => r.abort(i?.reason);
|
|
@@ -1072,17 +1076,17 @@ function lt(e) {
|
|
|
1072
1076
|
});
|
|
1073
1077
|
};
|
|
1074
1078
|
}
|
|
1075
|
-
var Q = null,
|
|
1076
|
-
let e = `${
|
|
1077
|
-
if (Q &&
|
|
1079
|
+
var Q = null, dt = null, $ = async () => {
|
|
1080
|
+
let e = `${C.getProtocol()}://${C.getHost()}`;
|
|
1081
|
+
if (Q && dt === e) return Q;
|
|
1078
1082
|
let t = await import("arweave"), n = t.default ?? t;
|
|
1079
|
-
return typeof n.init != "function" && typeof n.default?.init == "function" && (n = n.default),
|
|
1080
|
-
},
|
|
1083
|
+
return typeof n.init != "function" && typeof n.default?.init == "function" && (n = n.default), dt = e, Q = n.init(C.getArweaveJsApiConfig()), Q;
|
|
1084
|
+
}, ft = class {
|
|
1081
1085
|
getArweaveClient() {
|
|
1082
|
-
return new e(
|
|
1086
|
+
return new e(C.getEndpoint(), { fetch: ut(lt) });
|
|
1083
1087
|
}
|
|
1084
1088
|
async getTransactionStatus(e) {
|
|
1085
|
-
return
|
|
1089
|
+
return ct(e);
|
|
1086
1090
|
}
|
|
1087
1091
|
async getTransactionData(e, t) {
|
|
1088
1092
|
let n = t?.decode === !1 ? [] : q();
|
|
@@ -1094,8 +1098,8 @@ var Q = null, ut = null, $ = async () => {
|
|
|
1094
1098
|
Z("Error reading preferred gateway response:", e);
|
|
1095
1099
|
}
|
|
1096
1100
|
}
|
|
1097
|
-
if (
|
|
1098
|
-
let n = await fetch(
|
|
1101
|
+
if (C.getGatewayPath()) {
|
|
1102
|
+
let n = await fetch(C.getRawUrl(e));
|
|
1099
1103
|
if (!n.ok) throw Error(`Failed to fetch transaction data: HTTP ${n.status}`);
|
|
1100
1104
|
return t?.string ? n.text() : new Uint8Array(await n.arrayBuffer());
|
|
1101
1105
|
}
|
|
@@ -1113,7 +1117,7 @@ var Q = null, ut = null, $ = async () => {
|
|
|
1113
1117
|
async getTransactionTags(e) {
|
|
1114
1118
|
let t = this.getArweaveClient();
|
|
1115
1119
|
try {
|
|
1116
|
-
let n = await t.request(
|
|
1120
|
+
let n = await t.request(et, { transactionId: e });
|
|
1117
1121
|
return n.tags?.tags ? n.tags.tags.map((e) => ({
|
|
1118
1122
|
name: e.name,
|
|
1119
1123
|
value: e.value
|
|
@@ -1128,7 +1132,7 @@ var Q = null, ut = null, $ = async () => {
|
|
|
1128
1132
|
return n;
|
|
1129
1133
|
}
|
|
1130
1134
|
async downloadFiles(e) {
|
|
1131
|
-
let { transactionIds: t, excludedTransactions: n } = e, r = [], i =
|
|
1135
|
+
let { transactionIds: t, excludedTransactions: n } = e, r = [], i = C.getBaseUrl();
|
|
1132
1136
|
for (let e of t) if (!n?.has(e)) try {
|
|
1133
1137
|
let t = `${i}/raw/${e}`, n = await fetch(t);
|
|
1134
1138
|
if (!n.ok) {
|
|
@@ -1157,6 +1161,6 @@ var Q = null, ut = null, $ = async () => {
|
|
|
1157
1161
|
}
|
|
1158
1162
|
};
|
|
1159
1163
|
//#endregion
|
|
1160
|
-
export {
|
|
1164
|
+
export { s as $, Se as A, M as B, Be as C, R as D, we as E, ve as F, fe as G, C as H, k as I, se as J, oe as K, ye as L, A as M, j as N, Ce as O, ge as P, c as Q, D as R, W as S, B as T, ue as U, _e as V, de as W, g as X, ie as Y, ee as Z, K as _, it as a, u as at, He as b, et as c, re as ct, Xe as d, n as et, X as f, q as g, Y as h, rt as i, i as it, Te as j, z as k, qe as l, m as lt, Je as m, ft as n, o as nt, ct as o, f as ot, Ze as p, ae as q, nt as r, r as rt, tt as s, p as st, lt as t, a as tt, Ye as u, ne as ut, Ke as v, U as w, ke as x, We as y, N as z };
|
|
1161
1165
|
|
|
1162
|
-
//# sourceMappingURL=ArweaveClient-
|
|
1166
|
+
//# sourceMappingURL=ArweaveClient-BhqiFB9a.js.map
|