@seedprotocol/arweave 0.5.1

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.
Files changed (53) hide show
  1. package/dist/ArweaveClient/BaseArweaveClient.d.ts +73 -0
  2. package/dist/ArweaveClient/BaseArweaveClient.d.ts.map +1 -0
  3. package/dist/ArweaveClient/IArweaveClient.d.ts +11 -0
  4. package/dist/ArweaveClient/IArweaveClient.d.ts.map +1 -0
  5. package/dist/ArweaveClient/arweaveL1UploadApi.d.ts +52 -0
  6. package/dist/ArweaveClient/arweaveL1UploadApi.d.ts.map +1 -0
  7. package/dist/ArweaveClient/queries.d.ts +44 -0
  8. package/dist/ArweaveClient/queries.d.ts.map +1 -0
  9. package/dist/ArweaveClient/selectReadGateway.d.ts +16 -0
  10. package/dist/ArweaveClient/selectReadGateway.d.ts.map +1 -0
  11. package/dist/ArweaveClient/uploadApiVerification.d.ts +23 -0
  12. package/dist/ArweaveClient/uploadApiVerification.d.ts.map +1 -0
  13. package/dist/constants.d.ts +46 -0
  14. package/dist/constants.d.ts.map +1 -0
  15. package/dist/gateway/gatewayState.d.ts +5 -0
  16. package/dist/gateway/gatewayState.d.ts.map +1 -0
  17. package/dist/gateway/resolveSeedGatewayEndpoints.d.ts +15 -0
  18. package/dist/gateway/resolveSeedGatewayEndpoints.d.ts.map +1 -0
  19. package/dist/gateway/seedGatewayConfig.d.ts +5 -0
  20. package/dist/gateway/seedGatewayConfig.d.ts.map +1 -0
  21. package/dist/graphql/gql/fragment-masking.d.ts +20 -0
  22. package/dist/graphql/gql/fragment-masking.d.ts.map +1 -0
  23. package/dist/graphql/gql/gql.d.ts +42 -0
  24. package/dist/graphql/gql/gql.d.ts.map +1 -0
  25. package/dist/graphql/gql/graphql.d.ts +337 -0
  26. package/dist/graphql/gql/graphql.d.ts.map +1 -0
  27. package/dist/graphql/gql/index.d.ts +3 -0
  28. package/dist/graphql/gql/index.d.ts.map +1 -0
  29. package/dist/index.d.ts +17 -0
  30. package/dist/index.d.ts.map +1 -0
  31. package/dist/index.js +432 -0
  32. package/dist/index.js.map +1 -0
  33. package/dist/mediaRef.d.ts +58 -0
  34. package/dist/mediaRef.d.ts.map +1 -0
  35. package/dist/node/ArweaveClient.d.ts +14 -0
  36. package/dist/node/ArweaveClient.d.ts.map +1 -0
  37. package/dist/node/index.d.ts +7 -0
  38. package/dist/node/index.d.ts.map +1 -0
  39. package/dist/node.js +110 -0
  40. package/dist/node.js.map +1 -0
  41. package/dist/queries-DgB0O5RC.js +512 -0
  42. package/dist/queries-DgB0O5RC.js.map +1 -0
  43. package/dist/relationSeedRef.d.ts +6 -0
  44. package/dist/relationSeedRef.d.ts.map +1 -0
  45. package/dist/shims/typed-document-node.d.ts +5 -0
  46. package/dist/shims/typed-document-node.d.ts.map +1 -0
  47. package/dist/types/arweave.d.ts +57 -0
  48. package/dist/types/arweave.d.ts.map +1 -0
  49. package/dist/types/gateway.d.ts +44 -0
  50. package/dist/types/gateway.d.ts.map +1 -0
  51. package/dist/types/seedConfig.d.ts +26 -0
  52. package/dist/types/seedConfig.d.ts.map +1 -0
  53. package/package.json +57 -0
package/dist/node.js ADDED
@@ -0,0 +1,110 @@
1
+ import { n as e, r as t } from "./queries-DgB0O5RC.js";
2
+ import { GraphQLClient as n } from "graphql-request";
3
+ import r from "arweave";
4
+ import i from "debug";
5
+ //#region src/node/ArweaveClient.ts
6
+ var a = i("seedArweave:node:ArweaveClient"), o = null, s = null, c = () => {
7
+ let e = `${t.getProtocol()}://${t.getHost()}`;
8
+ if (o && s === e) return o;
9
+ s = e;
10
+ let n = t.getHost(), i = t.getProtocol();
11
+ return o = "default" in r && typeof r.default?.init == "function" ? r.default.init({
12
+ host: n,
13
+ protocol: i
14
+ }) : r.init({
15
+ host: n,
16
+ protocol: i
17
+ }), o;
18
+ }, l = class {
19
+ getArweaveClient() {
20
+ return new n(t.getEndpoint());
21
+ }
22
+ async getTransactionStatus(e) {
23
+ let n = t.getStatusUrl(e);
24
+ try {
25
+ let e = await fetch(n);
26
+ return e.status === 404 ? {
27
+ status: 404,
28
+ confirmed: null
29
+ } : e.ok ? (e.body && await e.body.cancel(), {
30
+ status: 200,
31
+ confirmed: null
32
+ }) : {
33
+ status: e.status,
34
+ confirmed: null
35
+ };
36
+ } catch (e) {
37
+ return a("Error fetching transaction status:", e), {
38
+ status: 500,
39
+ confirmed: null
40
+ };
41
+ }
42
+ }
43
+ async getTransactionData(e, t) {
44
+ let n = c();
45
+ try {
46
+ let r = await n.transactions.getData(e, {
47
+ decode: t?.decode ?? !0,
48
+ string: t?.string ?? !1
49
+ });
50
+ return t?.string && typeof r == "string" || r instanceof Uint8Array ? r : typeof r == "string" ? new TextEncoder().encode(r) : r;
51
+ } catch (e) {
52
+ throw a("Error fetching transaction data:", e), e;
53
+ }
54
+ }
55
+ async getTransactionTags(t) {
56
+ let n = this.getArweaveClient();
57
+ try {
58
+ let r = await n.request(e, { transactionId: t });
59
+ return r.tags?.tags ? r.tags.tags.map((e) => ({
60
+ name: e.name,
61
+ value: e.value
62
+ })) : [];
63
+ } catch (e) {
64
+ return a("Error fetching transaction tags:", e), [];
65
+ }
66
+ }
67
+ async createTransaction(e, t) {
68
+ let n = await c().createTransaction({ data: e });
69
+ if (t?.tags) for (let e of t.tags) n.addTag(e.name, e.value);
70
+ return n;
71
+ }
72
+ async downloadFiles(e) {
73
+ let { transactionIds: n, excludedTransactions: r } = e, i = [], o = t.getBaseUrl();
74
+ for (let e of n) if (!r?.has(e)) try {
75
+ let t = `${o}/raw/${e}`, n = await fetch(t);
76
+ if (!n.ok) {
77
+ i.push({
78
+ transactionId: e,
79
+ success: !1,
80
+ error: `HTTP ${n.status}: ${n.statusText}`
81
+ });
82
+ continue;
83
+ }
84
+ let r = await n.arrayBuffer(), a = new Uint8Array(r), s = n.headers.get("content-type") || void 0;
85
+ i.push({
86
+ transactionId: e,
87
+ success: !0,
88
+ contentType: s,
89
+ data: a
90
+ });
91
+ } catch (t) {
92
+ a(`Error downloading transaction ${e}:`, t), i.push({
93
+ transactionId: e,
94
+ success: !1,
95
+ error: t instanceof Error ? t.message : String(t)
96
+ });
97
+ }
98
+ return i;
99
+ }
100
+ }, u = l;
101
+ t.configure(new l()), new l();
102
+ //#endregion
103
+ //#region src/node/index.ts
104
+ function d(e) {
105
+ t.configure(new l()), t.setPreferredReadGateway(e?.arweaveDomain ?? "ar.seedprotocol.io");
106
+ }
107
+ //#endregion
108
+ export { u as ArweaveClient, l as NodeArweaveClient, d as registerNodeArweavePlatform };
109
+
110
+ //# sourceMappingURL=node.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node.js","names":[],"sources":["../src/node/ArweaveClient.ts","../src/node/index.ts"],"sourcesContent":["import { BaseArweaveClient } from '../ArweaveClient/BaseArweaveClient.js';\nimport type { IArweaveClient } from '../ArweaveClient/IArweaveClient.js';\nimport { GraphQLClient } from 'graphql-request';\nimport Arweave from 'arweave';\nimport type {\n TransactionStatus,\n TransactionTag,\n GetDataOptions,\n DownloadFilesParams,\n DownloadResult,\n CreateTransactionOptions,\n} from '../types/arweave.js';\nimport { GET_TRANSACTION_TAGS } from '../ArweaveClient/queries.js';\nimport debug from 'debug';\n\nconst logger = debug('seedArweave:node:ArweaveClient');\n\n// Cached Arweave instance (keyed by gateway so setHost / protocol changes apply)\nlet _arweaveInstance: Arweave | null = null;\nlet _arweaveGatewayKey: string | null = null;\n\n/**\n * Get or create the Arweave instance for Node.js\n */\nconst getArweaveInstance = (): Arweave => {\n const gatewayKey = `${BaseArweaveClient.getProtocol()}://${BaseArweaveClient.getHost()}`;\n if (_arweaveInstance && _arweaveGatewayKey === gatewayKey) {\n return _arweaveInstance;\n }\n\n _arweaveGatewayKey = gatewayKey;\n\n const host = BaseArweaveClient.getHost();\n const protocol = BaseArweaveClient.getProtocol();\n\n // Handle both ES modules and CommonJS exports from arweave package\n if ('default' in Arweave && typeof (Arweave as any).default?.init === 'function') {\n _arweaveInstance = (Arweave as any).default.init({\n host,\n protocol,\n });\n } else {\n _arweaveInstance = Arweave.init({\n host,\n protocol,\n });\n }\n\n return _arweaveInstance!;\n};\n\nexport class NodeArweaveClient implements IArweaveClient {\n getArweaveClient(): GraphQLClient {\n return new GraphQLClient(BaseArweaveClient.getEndpoint());\n }\n\n async getTransactionStatus(transactionId: string): Promise<TransactionStatus> {\n const url = BaseArweaveClient.getStatusUrl(transactionId);\n\n try {\n const response = await fetch(url);\n\n if (response.status === 404) {\n return {\n status: 404,\n confirmed: null,\n };\n }\n\n if (!response.ok) {\n return {\n status: response.status,\n confirmed: null,\n };\n }\n\n if (response.body) {\n await response.body.cancel();\n }\n\n return {\n status: 200,\n confirmed: null,\n };\n } catch (error) {\n logger('Error fetching transaction status:', error);\n return {\n status: 500,\n confirmed: null,\n };\n }\n }\n\n async getTransactionData(\n transactionId: string,\n options?: GetDataOptions\n ): Promise<Uint8Array | string> {\n const arweave = getArweaveInstance();\n\n try {\n const data = await arweave.transactions.getData(transactionId, {\n decode: options?.decode ?? true,\n string: options?.string ?? false,\n });\n\n if (options?.string && typeof data === 'string') {\n return data;\n }\n\n // Ensure we return Uint8Array\n if (data instanceof Uint8Array) {\n return data;\n }\n\n // Handle string data when not requesting string\n if (typeof data === 'string') {\n return new TextEncoder().encode(data);\n }\n\n return data as Uint8Array;\n } catch (error) {\n logger('Error fetching transaction data:', error);\n throw error;\n }\n }\n\n async getTransactionTags(transactionId: string): Promise<TransactionTag[]> {\n const client = this.getArweaveClient();\n \n try {\n const result = await client.request(GET_TRANSACTION_TAGS, { transactionId });\n \n if (!result.tags?.tags) {\n return [];\n }\n\n return result.tags.tags.map((tag: { name: string; value: string }) => ({\n name: tag.name,\n value: tag.value,\n }));\n } catch (error) {\n logger('Error fetching transaction tags:', error);\n return [];\n }\n }\n\n async createTransaction(\n data: string | Uint8Array,\n options?: CreateTransactionOptions\n ): Promise<any> {\n const arweave = getArweaveInstance();\n\n const tx = await arweave.createTransaction({\n data,\n });\n\n // Add tags if provided\n if (options?.tags) {\n for (const tag of options.tags) {\n tx.addTag(tag.name, tag.value);\n }\n }\n\n return tx;\n }\n\n async downloadFiles(params: DownloadFilesParams): Promise<DownloadResult[]> {\n const { transactionIds, excludedTransactions } = params;\n const results: DownloadResult[] = [];\n const baseUrl = BaseArweaveClient.getBaseUrl();\n\n for (const transactionId of transactionIds) {\n // Skip excluded transactions\n if (excludedTransactions?.has(transactionId)) {\n continue;\n }\n\n try {\n const url = `${baseUrl}/raw/${transactionId}`;\n const response = await fetch(url);\n\n if (!response.ok) {\n results.push({\n transactionId,\n success: false,\n error: `HTTP ${response.status}: ${response.statusText}`,\n });\n continue;\n }\n\n const arrayBuffer = await response.arrayBuffer();\n const data = new Uint8Array(arrayBuffer);\n\n // Detect content type\n const contentType = response.headers.get('content-type') || undefined;\n\n results.push({\n transactionId,\n success: true,\n contentType,\n data,\n });\n } catch (error) {\n logger(`Error downloading transaction ${transactionId}:`, error);\n results.push({\n transactionId,\n success: false,\n error: error instanceof Error ? error.message : String(error),\n });\n }\n }\n\n return results;\n }\n}\n\n/** @deprecated Prefer NodeArweaveClient */\nexport const ArweaveClient = NodeArweaveClient;\n\nBaseArweaveClient.configure(new NodeArweaveClient());\n\nconst _check: IArweaveClient = new NodeArweaveClient();\nvoid _check;\n","import './ArweaveClient.js'\nimport { DEFAULT_ARWEAVE_HOST } from '../constants.js'\nimport { BaseArweaveClient } from '../ArweaveClient/BaseArweaveClient.js'\nimport { NodeArweaveClient } from './ArweaveClient.js'\n\nexport { ArweaveClient, NodeArweaveClient } from './ArweaveClient.js'\n\n/** Register Node.js Arweave client and set default read gateway host. */\nexport function registerNodeArweavePlatform(options?: { arweaveDomain?: string }): void {\n BaseArweaveClient.configure(new NodeArweaveClient())\n BaseArweaveClient.setPreferredReadGateway(options?.arweaveDomain ?? DEFAULT_ARWEAVE_HOST)\n}\n"],"mappings":";;;;;AAeA,IAAM,IAAS,EAAM,gCAAgC,GAGjD,IAAmC,MACnC,IAAoC,MAKlC,UAAoC;CACxC,IAAM,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U,IAAI,EAAkB,CAAC,GAEpB,IAAI,EAAkB;;;ACrNrD,SAAgB,EAA4B,GAA4C;CAEtF,AADA,EAAkB,UAAU,IAAI,EAAkB,CAAC,GACnD,EAAkB,wBAAwB,GAAS,iBAAA,oBAAqC;AAC1F"}
@@ -0,0 +1,512 @@
1
+ import "graphql-request";
2
+ import "graphql";
3
+ //#region src/constants.ts
4
+ var e = "ar.seedprotocol.io", t = "", n = "", r = "127.0.0.1", i = 1984, a = `https://${e}/graphql`, o = [
5
+ "ar.seedprotocol.io",
6
+ "arweave.net",
7
+ "arweave.dev",
8
+ "g8way.io",
9
+ "permagate.io",
10
+ "zigza.xyz"
11
+ ], s = ["ARWEAVE_READ_GATEWAYS", "NEXT_PUBLIC_ARWEAVE_READ_GATEWAYS"], c = [
12
+ "NEXT_PUBLIC_ARWEAVE_HOST",
13
+ "ARWEAVE_HOST",
14
+ "VITE_ARWEAVE_HOST"
15
+ ];
16
+ function l(e) {
17
+ let t = e.trim();
18
+ return t.startsWith("http://") ? t.slice(7).replace(/\/$/, "") : t.startsWith("https://") ? t.slice(8).replace(/\/$/, "") : t.replace(/\/$/, "");
19
+ }
20
+ function u() {
21
+ if (!(typeof process > "u" || !process.env)) for (let e of c) {
22
+ let t = process.env[e]?.trim();
23
+ if (t) return l(t);
24
+ }
25
+ }
26
+ function d(t, n) {
27
+ let r = t.trim().toLowerCase().replace(/\/$/, ""), i = e.toLowerCase();
28
+ return r === i ? [...n] : n.filter((e) => e.toLowerCase() !== i);
29
+ }
30
+ function f(e) {
31
+ return m(e, d(e, p()));
32
+ }
33
+ function p() {
34
+ if (typeof process > "u" || !process.env) return [...o];
35
+ for (let e of s) {
36
+ let t = process.env[e]?.trim();
37
+ if (t) return t.split(",").map((e) => e.trim()).filter(Boolean);
38
+ }
39
+ return [...o];
40
+ }
41
+ function m(e, t) {
42
+ let n = /* @__PURE__ */ new Set(), r = [], i = (e) => e.trim().toLowerCase().replace(/\/$/, ""), a = (e) => {
43
+ let t = e.trim().replace(/\/$/, "");
44
+ if (!t) return;
45
+ let a = i(t);
46
+ n.has(a) || (n.add(a), r.push(t));
47
+ };
48
+ a(e);
49
+ for (let e of t) a(e);
50
+ return r;
51
+ }
52
+ function h(e) {
53
+ let t = e.trim().toLowerCase();
54
+ if (!t) return !1;
55
+ if (t.endsWith("arweave.net") || t.endsWith("ar-io.net")) return !0;
56
+ for (let e of o) {
57
+ let n = e.toLowerCase();
58
+ if (t === n || t.endsWith(`.${n}`)) return !0;
59
+ }
60
+ return !1;
61
+ }
62
+ //#endregion
63
+ //#region src/ArweaveClient/BaseArweaveClient.ts
64
+ function g(e) {
65
+ let t = e.trim();
66
+ return t.startsWith("http://") ? {
67
+ protocol: "http",
68
+ host: t.slice(7).replace(/\/$/, "")
69
+ } : t.startsWith("https://") ? {
70
+ protocol: "https",
71
+ host: t.slice(8).replace(/\/$/, "")
72
+ } : {
73
+ protocol: "https",
74
+ host: t.replace(/\/$/, "")
75
+ };
76
+ }
77
+ var _ = e, v = "https", y = !1, b = !1, x = class e {
78
+ static _impl = null;
79
+ static configure(t) {
80
+ if (!t) throw Error("Cannot configure ArweaveClient with undefined or null. Ensure the platform-specific ArweaveClient is properly created.");
81
+ e._impl = t;
82
+ }
83
+ static requireImpl() {
84
+ if (!e._impl) throw Error("ArweaveClient not configured. Import from @seedprotocol/arweave/node to register the Node.js implementation, or ensure SDK platform init has run.");
85
+ return e._impl;
86
+ }
87
+ static resolveGateway() {
88
+ let e = u();
89
+ return e && !y && !b ? g(e) : {
90
+ protocol: v,
91
+ host: _
92
+ };
93
+ }
94
+ static getHost() {
95
+ return this.resolveGateway().host;
96
+ }
97
+ static getProtocol() {
98
+ return this.resolveGateway().protocol;
99
+ }
100
+ static getBaseUrl() {
101
+ let { protocol: e, host: t } = this.resolveGateway();
102
+ return `${e}://${t}`;
103
+ }
104
+ static setHost(e) {
105
+ let t = g(e);
106
+ _ = t.host, v = t.protocol, y = !0, b = !1;
107
+ }
108
+ static isReadGatewayLocked() {
109
+ return y;
110
+ }
111
+ static resetReadGatewaySelectionStateForTests() {
112
+ b = !1;
113
+ }
114
+ static setPreferredReadGateway(e) {
115
+ let t = g(e);
116
+ _ = t.host, v = t.protocol, y = !1;
117
+ }
118
+ static applyProbedReadGateway(e) {
119
+ let t = g(e);
120
+ _ = t.host, v = t.protocol, y = !1, b = !0;
121
+ }
122
+ static getEndpoint() {
123
+ return `${this.getBaseUrl()}/graphql`;
124
+ }
125
+ static getRawUrl(e) {
126
+ return `${this.getBaseUrl()}/raw/${e}`;
127
+ }
128
+ static getStatusUrl(e) {
129
+ return `${this.getBaseUrl()}/${e}`;
130
+ }
131
+ static getArweaveClient() {
132
+ return e.requireImpl().getArweaveClient();
133
+ }
134
+ static getTransactionStatus(t) {
135
+ return e.requireImpl().getTransactionStatus(t);
136
+ }
137
+ static getTransactionData(t, n) {
138
+ return e.requireImpl().getTransactionData(t, n);
139
+ }
140
+ static getTransactionTags(t) {
141
+ return e.requireImpl().getTransactionTags(t);
142
+ }
143
+ static createTransaction(t, n) {
144
+ return e.requireImpl().createTransaction(t, n);
145
+ }
146
+ static downloadFiles(t) {
147
+ return e.requireImpl().downloadFiles(t);
148
+ }
149
+ }, S = {
150
+ "\n query GetTransactionTags($transactionId: ID!) {\n tags: transaction(id: $transactionId) {\n id\n tags {\n name\n value\n }\n }\n }\n": {
151
+ kind: "Document",
152
+ definitions: [{
153
+ kind: "OperationDefinition",
154
+ operation: "query",
155
+ name: {
156
+ kind: "Name",
157
+ value: "GetTransactionTags"
158
+ },
159
+ variableDefinitions: [{
160
+ kind: "VariableDefinition",
161
+ variable: {
162
+ kind: "Variable",
163
+ name: {
164
+ kind: "Name",
165
+ value: "transactionId"
166
+ }
167
+ },
168
+ type: {
169
+ kind: "NonNullType",
170
+ type: {
171
+ kind: "NamedType",
172
+ name: {
173
+ kind: "Name",
174
+ value: "ID"
175
+ }
176
+ }
177
+ }
178
+ }],
179
+ selectionSet: {
180
+ kind: "SelectionSet",
181
+ selections: [{
182
+ kind: "Field",
183
+ alias: {
184
+ kind: "Name",
185
+ value: "tags"
186
+ },
187
+ name: {
188
+ kind: "Name",
189
+ value: "transaction"
190
+ },
191
+ arguments: [{
192
+ kind: "Argument",
193
+ name: {
194
+ kind: "Name",
195
+ value: "id"
196
+ },
197
+ value: {
198
+ kind: "Variable",
199
+ name: {
200
+ kind: "Name",
201
+ value: "transactionId"
202
+ }
203
+ }
204
+ }],
205
+ selectionSet: {
206
+ kind: "SelectionSet",
207
+ selections: [{
208
+ kind: "Field",
209
+ name: {
210
+ kind: "Name",
211
+ value: "id"
212
+ }
213
+ }, {
214
+ kind: "Field",
215
+ name: {
216
+ kind: "Name",
217
+ value: "tags"
218
+ },
219
+ selectionSet: {
220
+ kind: "SelectionSet",
221
+ selections: [{
222
+ kind: "Field",
223
+ name: {
224
+ kind: "Name",
225
+ value: "name"
226
+ }
227
+ }, {
228
+ kind: "Field",
229
+ name: {
230
+ kind: "Name",
231
+ value: "value"
232
+ }
233
+ }]
234
+ }
235
+ }]
236
+ }
237
+ }]
238
+ }
239
+ }]
240
+ },
241
+ "\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": {
242
+ kind: "Document",
243
+ definitions: [{
244
+ kind: "OperationDefinition",
245
+ operation: "query",
246
+ name: {
247
+ kind: "Name",
248
+ value: "GetArweaveTransactions"
249
+ },
250
+ variableDefinitions: [
251
+ {
252
+ kind: "VariableDefinition",
253
+ variable: {
254
+ kind: "Variable",
255
+ name: {
256
+ kind: "Name",
257
+ value: "owners"
258
+ }
259
+ },
260
+ type: {
261
+ kind: "ListType",
262
+ type: {
263
+ kind: "NonNullType",
264
+ type: {
265
+ kind: "NamedType",
266
+ name: {
267
+ kind: "Name",
268
+ value: "String"
269
+ }
270
+ }
271
+ }
272
+ }
273
+ },
274
+ {
275
+ kind: "VariableDefinition",
276
+ variable: {
277
+ kind: "Variable",
278
+ name: {
279
+ kind: "Name",
280
+ value: "first"
281
+ }
282
+ },
283
+ type: {
284
+ kind: "NamedType",
285
+ name: {
286
+ kind: "Name",
287
+ value: "Int"
288
+ }
289
+ }
290
+ },
291
+ {
292
+ kind: "VariableDefinition",
293
+ variable: {
294
+ kind: "Variable",
295
+ name: {
296
+ kind: "Name",
297
+ value: "after"
298
+ }
299
+ },
300
+ type: {
301
+ kind: "NamedType",
302
+ name: {
303
+ kind: "Name",
304
+ value: "String"
305
+ }
306
+ }
307
+ }
308
+ ],
309
+ selectionSet: {
310
+ kind: "SelectionSet",
311
+ selections: [{
312
+ kind: "Field",
313
+ name: {
314
+ kind: "Name",
315
+ value: "transactions"
316
+ },
317
+ arguments: [
318
+ {
319
+ kind: "Argument",
320
+ name: {
321
+ kind: "Name",
322
+ value: "owners"
323
+ },
324
+ value: {
325
+ kind: "Variable",
326
+ name: {
327
+ kind: "Name",
328
+ value: "owners"
329
+ }
330
+ }
331
+ },
332
+ {
333
+ kind: "Argument",
334
+ name: {
335
+ kind: "Name",
336
+ value: "first"
337
+ },
338
+ value: {
339
+ kind: "Variable",
340
+ name: {
341
+ kind: "Name",
342
+ value: "first"
343
+ }
344
+ }
345
+ },
346
+ {
347
+ kind: "Argument",
348
+ name: {
349
+ kind: "Name",
350
+ value: "after"
351
+ },
352
+ value: {
353
+ kind: "Variable",
354
+ name: {
355
+ kind: "Name",
356
+ value: "after"
357
+ }
358
+ }
359
+ }
360
+ ],
361
+ selectionSet: {
362
+ kind: "SelectionSet",
363
+ selections: [{
364
+ kind: "Field",
365
+ name: {
366
+ kind: "Name",
367
+ value: "edges"
368
+ },
369
+ selectionSet: {
370
+ kind: "SelectionSet",
371
+ selections: [{
372
+ kind: "Field",
373
+ name: {
374
+ kind: "Name",
375
+ value: "cursor"
376
+ }
377
+ }, {
378
+ kind: "Field",
379
+ name: {
380
+ kind: "Name",
381
+ value: "node"
382
+ },
383
+ selectionSet: {
384
+ kind: "SelectionSet",
385
+ selections: [
386
+ {
387
+ kind: "Field",
388
+ name: {
389
+ kind: "Name",
390
+ value: "id"
391
+ }
392
+ },
393
+ {
394
+ kind: "Field",
395
+ name: {
396
+ kind: "Name",
397
+ value: "anchor"
398
+ }
399
+ },
400
+ {
401
+ kind: "Field",
402
+ name: {
403
+ kind: "Name",
404
+ value: "signature"
405
+ }
406
+ },
407
+ {
408
+ kind: "Field",
409
+ name: {
410
+ kind: "Name",
411
+ value: "block"
412
+ },
413
+ selectionSet: {
414
+ kind: "SelectionSet",
415
+ selections: [{
416
+ kind: "Field",
417
+ name: {
418
+ kind: "Name",
419
+ value: "id"
420
+ }
421
+ }, {
422
+ kind: "Field",
423
+ name: {
424
+ kind: "Name",
425
+ value: "height"
426
+ }
427
+ }]
428
+ }
429
+ },
430
+ {
431
+ kind: "Field",
432
+ name: {
433
+ kind: "Name",
434
+ value: "data"
435
+ },
436
+ selectionSet: {
437
+ kind: "SelectionSet",
438
+ selections: [{
439
+ kind: "Field",
440
+ name: {
441
+ kind: "Name",
442
+ value: "size"
443
+ }
444
+ }, {
445
+ kind: "Field",
446
+ name: {
447
+ kind: "Name",
448
+ value: "type"
449
+ }
450
+ }]
451
+ }
452
+ },
453
+ {
454
+ kind: "Field",
455
+ name: {
456
+ kind: "Name",
457
+ value: "tags"
458
+ },
459
+ selectionSet: {
460
+ kind: "SelectionSet",
461
+ selections: [{
462
+ kind: "Field",
463
+ name: {
464
+ kind: "Name",
465
+ value: "name"
466
+ }
467
+ }, {
468
+ kind: "Field",
469
+ name: {
470
+ kind: "Name",
471
+ value: "value"
472
+ }
473
+ }]
474
+ }
475
+ }
476
+ ]
477
+ }
478
+ }]
479
+ }
480
+ }, {
481
+ kind: "Field",
482
+ name: {
483
+ kind: "Name",
484
+ value: "pageInfo"
485
+ },
486
+ selectionSet: {
487
+ kind: "SelectionSet",
488
+ selections: [{
489
+ kind: "Field",
490
+ name: {
491
+ kind: "Name",
492
+ value: "hasNextPage"
493
+ }
494
+ }]
495
+ }
496
+ }]
497
+ }
498
+ }]
499
+ }
500
+ }]
501
+ }
502
+ };
503
+ function C(e) {
504
+ return S[e] ?? {};
505
+ }
506
+ //#endregion
507
+ //#region src/ArweaveClient/queries.ts
508
+ var w = C("\n query GetTransactionTags($transactionId: ID!) {\n tags: transaction(id: $transactionId) {\n id\n tags {\n name\n value\n }\n }\n }\n"), T = C("\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");
509
+ //#endregion
510
+ export { o as a, r as c, n as d, f, u as g, m as h, c as i, i as l, h as m, w as n, a as o, p, x as r, e as s, T as t, t as u };
511
+
512
+ //# sourceMappingURL=queries-DgB0O5RC.js.map