@artblocks/abx-storage 0.1.0-alpha.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Art Blocks, Inc.
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,25 @@
1
+ /**
2
+ * An Arweave wallet key (RSA JWK). For the Turbo provider the **same key signs uploads
3
+ * AND owns the prepaid upload credits** — so it's a (low-stakes) asset to back up: lose it
4
+ * and any leftover credits are stranded on an address no one holds.
5
+ *
6
+ * Arweave keys are RSA-4096 with `e = 65537`, which is exactly what Node's `crypto` emits —
7
+ * so we can **generate an identity and derive its address with zero dependencies**, and only
8
+ * reach for the optional Turbo SDK at actual upload / top-up time.
9
+ */
10
+ export interface ArweaveJwk {
11
+ kty: string;
12
+ n: string;
13
+ e: string;
14
+ d?: string;
15
+ p?: string;
16
+ q?: string;
17
+ dp?: string;
18
+ dq?: string;
19
+ qi?: string;
20
+ }
21
+ /** Mint a fresh Arweave identity (RSA-4096, e=65537) — dep-free, via Node crypto. */
22
+ export declare function generateArweaveJwk(): ArweaveJwk;
23
+ /** The Arweave address for a key: `base64url(sha256(modulus))`. Pure derivation — no network. */
24
+ export declare function arweaveAddress(jwk: Pick<ArweaveJwk, 'n'>): string;
25
+ //# sourceMappingURL=arweave-identity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arweave-identity.d.ts","sourceRoot":"","sources":["../src/arweave-identity.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,CAAC,CAAC,EAAE,MAAM,CAAC;IACX,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED,qFAAqF;AACrF,wBAAgB,kBAAkB,IAAI,UAAU,CAG/C;AAED,iGAAiG;AACjG,wBAAgB,cAAc,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,EAAE,GAAG,CAAC,GAAG,MAAM,CAIjE"}
@@ -0,0 +1,14 @@
1
+ import { createHash, generateKeyPairSync } from 'node:crypto';
2
+ /** Mint a fresh Arweave identity (RSA-4096, e=65537) — dep-free, via Node crypto. */
3
+ export function generateArweaveJwk() {
4
+ const { privateKey } = generateKeyPairSync('rsa', { modulusLength: 4096, publicExponent: 0x10001 });
5
+ return privateKey.export({ format: 'jwk' });
6
+ }
7
+ /** The Arweave address for a key: `base64url(sha256(modulus))`. Pure derivation — no network. */
8
+ export function arweaveAddress(jwk) {
9
+ if (!jwk?.n)
10
+ throw new Error('not an Arweave JWK (missing modulus `n`).');
11
+ const modulus = Buffer.from(jwk.n, 'base64url');
12
+ return createHash('sha256').update(modulus).digest('base64url');
13
+ }
14
+ //# sourceMappingURL=arweave-identity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arweave-identity.js","sourceRoot":"","sources":["../src/arweave-identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAuB5D,qFAAqF;AACrF,MAAM,UAAU,kBAAkB;IAChC,MAAM,EAAC,UAAU,EAAC,GAAG,mBAAmB,CAAC,KAAK,EAAE,EAAC,aAAa,EAAE,IAAI,EAAE,cAAc,EAAE,OAAO,EAAC,CAAC,CAAC;IAChG,OAAO,UAAU,CAAC,MAAM,CAAC,EAAC,MAAM,EAAE,KAAK,EAAC,CAAe,CAAC;AAC1D,CAAC;AAED,iGAAiG;AACjG,MAAM,UAAU,cAAc,CAAC,GAA0B;IACvD,IAAI,CAAC,GAAG,EAAE,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;IAChD,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AAClE,CAAC"}
@@ -0,0 +1,259 @@
1
+ import type { Hex } from 'viem';
2
+ import type { DirEntry, StorageBackend, StoredContent } from './backend.js';
3
+ import { type ArweaveJwk } from './arweave-identity.js';
4
+ /**
5
+ * Arweave byte custody — **pay-once permanent** storage, the strongest fit for "custody never
6
+ * lapsable": a single upfront payment, then the bytes are kept for centuries by Arweave's
7
+ * storage endowment — no recurring fee, nothing to re-pin. Retrieval is dep-free: any gateway
8
+ * serves the bytes at `{gateway}/{txid}`.
9
+ *
10
+ * Upload must go through a bundler that signs an ANS-104 data item, so the uploader is a
11
+ * **swappable provider** behind {@link ArweaveUploader}:
12
+ *
13
+ * - **`turbo`** (default, recommended) — {@link TurboUploader}, backed by ArDrive Turbo. Uploads
14
+ * under 100 KiB are **free with no setup**; larger uploads draw on prepaid credits you top up
15
+ * with a card (or crypto). Lazy-loads the optional `@ardrive/turbo-sdk` only when an upload or
16
+ * top-up actually runs, so the retrieve-only resolver path stays dependency-free.
17
+ * - **`http-bundler`** — {@link HttpBundlerUploader}, a dep-free token-authenticated POST to a
18
+ * managed endpoint you run/point at (the escape hatch / bring-your-own-bundler).
19
+ *
20
+ * Funding is an **optional capability** ({@link ArweaveFunding}) a provider may expose — Turbo does
21
+ * (prepaid credits); a provider funded another way omits it and the CLI says so, rather than
22
+ * pretending every provider tops up the same way.
23
+ *
24
+ * Like IPFS, Arweave addresses by its own id (the txid), so it keeps an off-chain `keccak → txid`
25
+ * index until a pointer commitment lives on-chain. The on-chain keccak256 stays the integrity
26
+ * anchor — verify any gateway's bytes against it; the txid is just the locator.
27
+ */
28
+ export interface ArweaveUploader {
29
+ upload(bytes: Uint8Array, contentType: string): Promise<{
30
+ id: string;
31
+ }>;
32
+ /** Optional: providers backed by PREPAID CREDITS (e.g. Turbo) expose balance + fiat top-up. */
33
+ readonly funding?: ArweaveFunding;
34
+ }
35
+ /** Funding capability for a credits-backed Arweave provider. */
36
+ export interface ArweaveFunding {
37
+ /** The wallet that HOLDS the credits (an Arweave address) — what a top-up funds. */
38
+ address(): Promise<string>;
39
+ /** Remaining prepaid balance: raw `winc` (Winston credits) + a `credits` ≈ winc/1e12 display. */
40
+ balance(): Promise<{
41
+ winc: string;
42
+ credits: string;
43
+ }>;
44
+ /**
45
+ * Open a fiat (card, via Stripe) top-up of `usd` dollars onto {@link address}; returns the
46
+ * checkout URL to hand the user. One-time payment — Arweave storage has no recurring fee, and
47
+ * leftover credits persist on the address for future uploads.
48
+ */
49
+ topup(opts: {
50
+ usd: number;
51
+ }): Promise<{
52
+ url: string;
53
+ winc: string;
54
+ }>;
55
+ }
56
+ export type ArweaveProvider = 'turbo' | 'http-bundler';
57
+ /**
58
+ * Best-effort USD estimate for a Turbo (Arweave) upload of `bytes`, from Turbo's PUBLIC price API
59
+ * (no key, no SDK). Returns null on ANY failure (offline, timeout, API change) — callers treat it
60
+ * as a bonus and carry on. Rough by design: linear in bytes, current rates.
61
+ */
62
+ export declare function turboUploadCostUsd(bytes: number): Promise<number | null>;
63
+ /**
64
+ * The Winston-credit (winc) cost of a Turbo upload of `bytes`, from the PUBLIC price API (no key,
65
+ * no SDK). Returns null on any failure — callers treat null as "couldn't check". For the pre-upload
66
+ * funds guard: compare against the identity's balance winc. 1 credit = 1e12 winc.
67
+ */
68
+ export declare function turboUploadWinc(bytes: number): Promise<number | null>;
69
+ /**
70
+ * The Turbo credit balance of ANY address, from the PUBLIC payment API — **no key, no signature**.
71
+ * So the CLI can check whether a creator's *Ethereum wallet* holds Turbo credits (to recommend
72
+ * `--storage-signer eth`) before ever suggesting a top-up. `token` is the address's chain
73
+ * (`ethereum` for an EVM wallet, `arweave` for a JWK address). Returns null on any failure
74
+ * (offline, unknown address) — callers treat it as "couldn't check". 1 credit = 1e12 winc.
75
+ */
76
+ export declare function turboBalanceForAddress(address: string, token?: 'ethereum' | 'arweave' | 'solana'): Promise<{
77
+ winc: string;
78
+ credits: string;
79
+ } | null>;
80
+ /** Turbo's free-upload ceiling: data items under 100 KiB upload for free — no credits, no prior
81
+ * top-up, no setup. Most single 1/1 SVGs/PNGs fall under it. */
82
+ export declare const ARWEAVE_FREE_UPLOAD_LIMIT: number;
83
+ export interface ArweaveConfig {
84
+ /** Gateway base for retrieval. Default `https://arweave.net`. */
85
+ gateway: string;
86
+ /** Upload route. Default `turbo` (or `http-bundler` when an `uploadUrl` is set). */
87
+ provider?: ArweaveProvider;
88
+ /** Managed bundler upload endpoint — the `http-bundler` provider only. */
89
+ uploadUrl?: string;
90
+ /** `http-bundler` auth token — secret, from env, never persisted to config. */
91
+ token?: string;
92
+ /**
93
+ * `turbo` identity (Arweave JWK) — signs uploads AND holds the prepaid credits. Secret, from a
94
+ * key file or env, never persisted to a tool-written config file. The CLI manages one at
95
+ * `.abx-self-host/arweave-key.json`.
96
+ */
97
+ jwk?: ArweaveJwk;
98
+ /**
99
+ * Alternative `turbo` identity: an **Ethereum** private key (hex). Turbo is multi-chain, so an
100
+ * EVM key is a first-class Turbo identity — its **ETH address** holds the prepaid credits and
101
+ * signs uploads. This is the ".env hot lane" for storage: a user who funded their wallet's Turbo
102
+ * balance reuses it here. Secret, env/flag only, never persisted. Takes precedence over `jwk`.
103
+ */
104
+ ethSignerKey?: string;
105
+ /**
106
+ * Alternative `turbo` identity: a **remote** Ethereum wallet (the browser `--sign` lane). The key
107
+ * never leaves the wallet; `signMessage` round-trips each EIP-191 signature to it and returns the
108
+ * `0x`-prefixed 65-byte signature hex (what `personal_sign` yields). `address` is the ETH address
109
+ * (for funding/display). Takes precedence over `ethSignerKey`/`jwk`. Not representable in env —
110
+ * the CLI injects it when driving a wallet session.
111
+ */
112
+ remoteEth?: {
113
+ address: string;
114
+ signMessage: (message: Uint8Array) => Promise<string>;
115
+ };
116
+ /**
117
+ * Mint-on-first-write hook for the **managed** Turbo identity. When Turbo is selected and no
118
+ * identity is otherwise available (no `jwk`/eth/remote), the backend calls this — but ONLY on an
119
+ * actual upload (`put`/`putDirectory`), never on a read/probe — to lazily create + persist the
120
+ * managed key. The CLI injects `() => ensureArweaveJwk().jwk` (it owns the key file location);
121
+ * a bare library consumer omits it and gets the "needs an identity" error instead. Creating an
122
+ * RSA keypair is free + local, and Turbo's <100 KiB free tier means the upload then just works.
123
+ */
124
+ ensureJwk?: () => ArweaveJwk;
125
+ }
126
+ /**
127
+ * A Turbo signing identity: what signs uploads AND (for the prepaid Turbo path) whose credits pay.
128
+ * Turbo is multi-chain, so an identity is one of:
129
+ * - **arweave** — the CLI-managed JWK (default); address = `base64url(sha256(n))`.
130
+ * - **ethereum** — an EVM private key (the `.env` hot lane); address = the `0x…` account.
131
+ * - **ethereum-remote** — a browser wallet reached via a `signMessage` callback (the `--sign`
132
+ * lane); same ETH identity, key never leaves the wallet.
133
+ */
134
+ export type TurboIdentity = {
135
+ kind: 'arweave';
136
+ jwk: ArweaveJwk;
137
+ } | {
138
+ kind: 'ethereum';
139
+ privateKey: string;
140
+ } | {
141
+ kind: 'ethereum-remote';
142
+ address: string;
143
+ signMessage: (message: Uint8Array) => Promise<string>;
144
+ };
145
+ /** The Turbo identity a config selects (precedence: remote → eth key → arweave jwk), or null if
146
+ * none is available yet (e.g. Turbo before its managed key is created). */
147
+ export declare function turboIdentity(cfg: ArweaveConfig): TurboIdentity | null;
148
+ /**
149
+ * The Turbo identity for an operation — {@link turboIdentity}, but when it would be null and this is
150
+ * a WRITE (`opts.mint`), lazily mint the managed key via `cfg.ensureJwk` (creating + persisting it).
151
+ * This is the ONLY implicit key-creation path, and it's gated on `mint` so reads/probes never mint.
152
+ * Pure aside from the injected `ensureJwk` side effect — the write/read distinction is the caller's.
153
+ */
154
+ export declare function resolveTurboIdentity(cfg: ArweaveConfig, opts?: {
155
+ mint?: boolean;
156
+ }): TurboIdentity | null;
157
+ /** Whether an identity is an Ethereum one (local key or remote wallet) — its address is `0x…`. */
158
+ export declare function isEthIdentity(id: TurboIdentity): id is Extract<TurboIdentity, {
159
+ kind: `ethereum${string}`;
160
+ }>;
161
+ /** The credit-holding / signing address for an identity — Arweave `base64url(sha256(n))` or an
162
+ * EVM `0x…`. Pure derivation, no network. Its balance is what `abx storage balance` reports. */
163
+ export declare function turboIdentityAddress(id: TurboIdentity): string;
164
+ /**
165
+ * The Arweave data-item id from a Turbo `uploadFile` response. Normally `res.id`; but Turbo
166
+ * **deduplicates identical bytes** — a re-upload of the same data item (same signer + tags + bytes →
167
+ * same deterministic id) returns a plain-text `"Data item with ID <id> has already been uploaded to
168
+ * this service!"` instead of the usual JSON. Both are success: the bytes ARE on Turbo. We extract
169
+ * the 43-char base64url txid so idempotent re-uploads (retries, redeploys, duplicate images in a
170
+ * series) resolve to the real locator instead of throwing. Returns null if no id is present.
171
+ */
172
+ export declare function turboUploadId(res: unknown): string | null;
173
+ /** Dep-free uploader for token-authenticated managed Arweave upload endpoints. */
174
+ export declare class HttpBundlerUploader implements ArweaveUploader {
175
+ private readonly cfg;
176
+ constructor(cfg: {
177
+ uploadUrl?: string;
178
+ token?: string;
179
+ });
180
+ upload(bytes: Uint8Array, contentType: string): Promise<{
181
+ id: string;
182
+ }>;
183
+ }
184
+ /**
185
+ * ArDrive Turbo uploader — the recommended Arweave path. Lazy-loads the optional
186
+ * `@ardrive/turbo-sdk` only when an upload / balance / top-up actually runs (the retrieve-only
187
+ * resolver never touches it). The signing {@link TurboIdentity} is multi-chain: the CLI-managed
188
+ * Arweave JWK (default), an `.env` EVM key, or a remote browser wallet — each both signs uploads
189
+ * and holds the prepaid credits at its own address.
190
+ */
191
+ export declare class TurboUploader implements ArweaveUploader {
192
+ private readonly identity;
193
+ constructor(identity: TurboIdentity);
194
+ private sdk;
195
+ /** arbundles (the signing lib Turbo uses) — for `InjectedEthereumSigner`, which turbo-sdk does NOT
196
+ * re-export. Optional dep, loaded only on the remote-wallet upload path. */
197
+ private arbundles;
198
+ private clientPromise?;
199
+ private client;
200
+ /** Authenticate a Turbo client for the selected identity. Arweave uses the JWK directly; an EVM
201
+ * identity uses an arbundles `EthereumSigner` (local key) or `InjectedEthereumSigner` (remote
202
+ * wallet) — the SDK re-exports both, so no direct arbundles dependency. */
203
+ private buildClient;
204
+ upload(bytes: Uint8Array, contentType: string): Promise<{
205
+ id: string;
206
+ }>;
207
+ readonly funding: ArweaveFunding;
208
+ }
209
+ /** The upload route for a config: explicit `provider`, else `http-bundler` when an `uploadUrl`
210
+ * is set, else the recommended `turbo`. */
211
+ export declare function arweaveProvider(cfg: ArweaveConfig): ArweaveProvider;
212
+ /**
213
+ * The funding capability for a config's provider, or throw a clear reason if that provider has
214
+ * none — capability negotiation, so `abx storage topup`/`balance` dispatch through one verb and
215
+ * a crypto-only provider says "fund the wallet directly" rather than pretending.
216
+ */
217
+ export declare function arweaveFunding(cfg: ArweaveConfig): ArweaveFunding;
218
+ export declare class ArweaveBackend implements StorageBackend {
219
+ private readonly cfg;
220
+ readonly id = "arweave";
221
+ private readonly index;
222
+ private uploaderInstance?;
223
+ private readonly injectedUploader?;
224
+ constructor(cfg: ArweaveConfig, dataDir?: string, uploader?: ArweaveUploader);
225
+ /** Built lazily on first use — retrieval (get/locator/health, the resolver path) needs only the
226
+ * gateway, never an upload identity or the Turbo SDK. `mint` (passed by the write ops) lets a
227
+ * managed default create its key here; reads/probes pass false so they never mint. */
228
+ private uploader;
229
+ /** Funding capability of the active provider, or null if it has none (e.g. http-bundler) or
230
+ * can't yet be built (e.g. Turbo without an identity key). The CLI uses {@link arweaveFunding}
231
+ * directly for an actionable error; this accessor is the safe boolean-ish capability probe. */
232
+ funding(): ArweaveFunding | null;
233
+ put(hash: Hex, content: StoredContent): Promise<void>;
234
+ get(hash: Hex): Promise<StoredContent | null>;
235
+ has(hash: Hex): Promise<boolean>;
236
+ /** The gateway HTTPS URL for the bytes (`<gateway>/<txid>`) — the production-safe form an NFT
237
+ * `image` needs (a raw `ar://` doesn't render in browsers/most wallets). The txid is permanent,
238
+ * so the bytes resolve through any Arweave gateway and verify against the on-chain keccak256;
239
+ * we serve a concrete reachable one. Null until the bytes are uploaded. */
240
+ locator(hash: Hex): Promise<string | null>;
241
+ /**
242
+ * Upload a directory of files as an Arweave **path manifest**: each file is uploaded to its own
243
+ * txid, then a manifest (`arweave/paths`) mapping `name → txid` is uploaded, and its txid is the
244
+ * directory root. `<gateway>/<manifestTxid>/0.png` then resolves. The manifest txid is a
245
+ * permanent, content-addressed root → integrity for the whole set, no per-file keccak needed.
246
+ */
247
+ putDirectory(entries: DirEntry[]): Promise<{
248
+ base: string;
249
+ }>;
250
+ health(): Promise<{
251
+ ok: boolean;
252
+ detail?: string;
253
+ }>;
254
+ }
255
+ /** Build an Arweave config from the environment (non-secret values; the token/JWK/eth-key are
256
+ * secrets). `ABX_ARWEAVE_ETH_SIGNER_KEY` selects an EVM Turbo identity (the CLI usually sets this
257
+ * from the resolved signing key instead). */
258
+ export declare function arweaveConfigFromEnv(): ArweaveConfig;
259
+ //# sourceMappingURL=arweave.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"arweave.d.ts","sourceRoot":"","sources":["../src/arweave.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,MAAM,CAAC;AAE9B,OAAO,KAAK,EAAC,QAAQ,EAAE,cAAc,EAAE,aAAa,EAAC,MAAM,cAAc,CAAC;AAE1E,OAAO,EAAiB,KAAK,UAAU,EAAC,MAAM,uBAAuB,CAAC;AAEtE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,WAAW,eAAe;IAC9B,MAAM,CAAC,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IACtE,+FAA+F;IAC/F,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,CAAC;CACnC;AAED,gEAAgE;AAChE,MAAM,WAAW,cAAc;IAC7B,oFAAoF;IACpF,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IAC3B,iGAAiG;IACjG,OAAO,IAAI,OAAO,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;IACpD;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE;QAAC,GAAG,EAAE,MAAM,CAAA;KAAC,GAAG,OAAO,CAAC;QAAC,GAAG,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAAC;CAClE;AAED,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,cAAc,CAAC;AAEvD;;;;GAIG;AACH,wBAAsB,kBAAkB,CAAC,KA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