@1sat/actions 0.0.230 → 0.0.231
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/apply/opnsRegister.d.ts +12 -5
- package/dist/apply/opnsRegister.d.ts.map +1 -1
- package/dist/apply/opnsRegister.js +68 -10
- package/dist/apply/opnsRegister.js.map +1 -1
- package/dist/funding/index.d.ts +1 -0
- package/dist/funding/index.d.ts.map +1 -1
- package/dist/funding/index.js +1 -1
- package/dist/funding/index.js.map +1 -1
- package/dist/funding/walletFunding.d.ts +47 -0
- package/dist/funding/walletFunding.d.ts.map +1 -0
- package/dist/funding/walletFunding.js +162 -0
- package/dist/funding/walletFunding.js.map +1 -0
- package/dist/funding/walletFunding.test.d.ts +2 -0
- package/dist/funding/walletFunding.test.d.ts.map +1 -0
- package/dist/funding/walletFunding.test.js +225 -0
- package/dist/funding/walletFunding.test.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/mandala/brc78.d.ts +29 -0
- package/dist/mandala/brc78.d.ts.map +1 -0
- package/dist/mandala/brc78.js +60 -0
- package/dist/mandala/brc78.js.map +1 -0
- package/dist/mandala/deploy.d.ts +89 -0
- package/dist/mandala/deploy.d.ts.map +1 -0
- package/dist/mandala/deploy.js +226 -0
- package/dist/mandala/deploy.js.map +1 -0
- package/dist/mandala/deploy.test.d.ts +2 -0
- package/dist/mandala/deploy.test.d.ts.map +1 -0
- package/dist/mandala/deploy.test.js +281 -0
- package/dist/mandala/deploy.test.js.map +1 -0
- package/dist/mandala/envelope.d.ts +69 -0
- package/dist/mandala/envelope.d.ts.map +1 -0
- package/dist/mandala/envelope.js +86 -0
- package/dist/mandala/envelope.js.map +1 -0
- package/dist/mandala/envelope.test.d.ts +2 -0
- package/dist/mandala/envelope.test.d.ts.map +1 -0
- package/dist/mandala/envelope.test.js +106 -0
- package/dist/mandala/envelope.test.js.map +1 -0
- package/dist/mandala/index.d.ts +10 -0
- package/dist/mandala/index.d.ts.map +1 -0
- package/dist/mandala/index.js +18 -0
- package/dist/mandala/index.js.map +1 -0
- package/dist/mandala/receive.d.ts +46 -0
- package/dist/mandala/receive.d.ts.map +1 -0
- package/dist/mandala/receive.js +218 -0
- package/dist/mandala/receive.js.map +1 -0
- package/dist/mandala/relay.d.ts +36 -0
- package/dist/mandala/relay.d.ts.map +1 -0
- package/dist/mandala/relay.js +50 -0
- package/dist/mandala/relay.js.map +1 -0
- package/dist/mandala/send.d.ts +74 -0
- package/dist/mandala/send.d.ts.map +1 -0
- package/dist/mandala/send.js +327 -0
- package/dist/mandala/send.js.map +1 -0
- package/dist/mandala/send.test.d.ts +2 -0
- package/dist/mandala/send.test.d.ts.map +1 -0
- package/dist/mandala/send.test.js +515 -0
- package/dist/mandala/send.test.js.map +1 -0
- package/dist/mandala/tokenId.d.ts +21 -0
- package/dist/mandala/tokenId.d.ts.map +1 -0
- package/dist/mandala/tokenId.js +29 -0
- package/dist/mandala/tokenId.js.map +1 -0
- package/dist/opns/index.d.ts +65 -4
- package/dist/opns/index.d.ts.map +1 -1
- package/dist/opns/index.js +93 -34
- package/dist/opns/index.js.map +1 -1
- package/dist/opns/registerOpns.test.d.ts +2 -0
- package/dist/opns/registerOpns.test.d.ts.map +1 -0
- package/dist/opns/registerOpns.test.js +186 -0
- package/dist/opns/registerOpns.test.js.map +1 -0
- package/package.json +8 -7
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mandala (BRC-162) send to a BRC-169 handle, delivered per BRC-232.
|
|
3
|
+
*
|
|
4
|
+
* 1. Resolve the handle (`resolveHandle`): identity key + messagebox.
|
|
5
|
+
* 2. When no single token output in `mandala <txid> <vout>` holds exactly `amount`,
|
|
6
|
+
* split first: an ordinary, broadcast action spending token outputs into
|
|
7
|
+
* an exact-`amount` output and a remainder, both back to the wallet under
|
|
8
|
+
* `mandalaProtocol(tokenId)` in the token's basket.
|
|
9
|
+
* 3. The protected send: one `createAction` spending only the exact output,
|
|
10
|
+
* with one output, the recipient's token output, locked to the key
|
|
11
|
+
* derived under `mandalaProtocol(tokenId)` with keyID
|
|
12
|
+
* `<derivationPrefix> <derivationSuffix>` (fresh random base64) and
|
|
13
|
+
* counterparty = the recipient. `noSend`, labels `mandala`,
|
|
14
|
+
* `mandala <txid> <vout>` and `p nosend expiry seconds <n>` (BRC-177; the wallet
|
|
15
|
+
* funds it). It is not broadcast: the recipient broadcasts by
|
|
16
|
+
* internalizing (BRC-169 §6.1, BRC-232 rule 4).
|
|
17
|
+
* 4. Delivery: a signed BRC-169 §7.3 envelope (DAG-CBOR, BRC-231 body over
|
|
18
|
+
* BRC-104) to the resolved messagebox, box `mandala_inbox`, `payment:
|
|
19
|
+
* null`. `content` is BRC-78 encryption (via `wallet.encrypt`) of a MIME
|
|
20
|
+
* entity of type `application/vnd.metanet.transaction+cbor` whose DAG-CBOR
|
|
21
|
+
* body is the BRC-232 delivery `{ txid, beef, outputs: [ basket insertion
|
|
22
|
+
* ] }`; `contentHash` is the SHA-256 of the MIME bytes.
|
|
23
|
+
*
|
|
24
|
+
* When delivery fails the result carries the error with `txid` and `tx`, so
|
|
25
|
+
* the caller can retry delivery or `abortAction` the send.
|
|
26
|
+
*/
|
|
27
|
+
import { resolveHandle } from '@1sat/client';
|
|
28
|
+
import { Mandala } from '@1sat/templates';
|
|
29
|
+
import { MANDALA_INBOX, MANDALA_LABEL, MANDALA_SEND_EXPIRY_SECONDS, mandalaProtocol, mandalaTokenBasket, mandalaTokenLabel, } from '@1sat/types';
|
|
30
|
+
import { TRANSACTION_CBOR_CONTENT_TYPE, encodeMimeEntity } from '@1sat/utils';
|
|
31
|
+
import { Beef, Hash, P2PKH, PublicKey, Utils, } from '@bsv/sdk';
|
|
32
|
+
import { encode as dagCborEncode } from '@ipld/dag-cbor';
|
|
33
|
+
import { executeTrackedAction } from '../utils/createTrackedAction.js';
|
|
34
|
+
import { resolveDestination } from '../utils/resolveDestination.js';
|
|
35
|
+
import { encryptBrc78 } from './brc78.js';
|
|
36
|
+
import { signEnvelope } from './envelope.js';
|
|
37
|
+
import { messageRelay } from './relay.js';
|
|
38
|
+
import { mandalaTokenOf, mandalaTokenOutpoint, mandalaWireId, } from './tokenId.js';
|
|
39
|
+
function randomBase64() {
|
|
40
|
+
return Utils.toBase64(Array.from(crypto.getRandomValues(new Uint8Array(16))));
|
|
41
|
+
}
|
|
42
|
+
/** Token amount a wallet output carries for `tokenId`, read from its locking script. */
|
|
43
|
+
function tokenAmount(beef, output, tokenId) {
|
|
44
|
+
const [txid, vout] = output.outpoint.split('.');
|
|
45
|
+
const script = beef.findTxid(txid)?.tx?.outputs[Number(vout)]?.lockingScript;
|
|
46
|
+
if (!script)
|
|
47
|
+
return undefined;
|
|
48
|
+
const token = Mandala.decode(script);
|
|
49
|
+
// Authority outputs (amount 0) are not spent by a send.
|
|
50
|
+
if (!token || token.amount === 0n)
|
|
51
|
+
return undefined;
|
|
52
|
+
return mandalaTokenOf(token, txid, Number(vout)) === tokenId
|
|
53
|
+
? token.amount
|
|
54
|
+
: undefined;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A token value output back to the wallet, in the token's basket, with a
|
|
58
|
+
* fresh self-derived key; customInstructions carry only the derivation.
|
|
59
|
+
*/
|
|
60
|
+
async function selfTokenOutput(ctx, tokenId, amount, outputDescription) {
|
|
61
|
+
const self = await resolveDestination(ctx, { counterparty: 'self' }, { protocolID: mandalaProtocol(tokenId), keyIDPrefix: 'mandala' });
|
|
62
|
+
return {
|
|
63
|
+
lockingScript: Mandala.value(mandalaWireId(tokenId), amount, {
|
|
64
|
+
lock: self.lockingScript,
|
|
65
|
+
})
|
|
66
|
+
.lock()
|
|
67
|
+
.toHex(),
|
|
68
|
+
satoshis: 1,
|
|
69
|
+
outputDescription,
|
|
70
|
+
basket: mandalaTokenBasket(tokenId),
|
|
71
|
+
customInstructions: JSON.stringify(self.customInstructions),
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
/** Spend wallet token outputs through the shared pipeline. */
|
|
75
|
+
function spendTokens(ctx, p) {
|
|
76
|
+
return executeTrackedAction(ctx.wallet, {
|
|
77
|
+
description: p.description,
|
|
78
|
+
labels: [...p.labels],
|
|
79
|
+
inputBEEF: p.inputBEEF,
|
|
80
|
+
inputs: p.inputs.map((i) => ({
|
|
81
|
+
outpoint: i.outpoint,
|
|
82
|
+
inputDescription: 'Mandala token input',
|
|
83
|
+
unlockingScriptLength: 108,
|
|
84
|
+
})),
|
|
85
|
+
outputs: p.outputs,
|
|
86
|
+
options: p.noSend
|
|
87
|
+
? { noSend: true, randomizeOutputs: false }
|
|
88
|
+
: { randomizeOutputs: false },
|
|
89
|
+
}, undefined, p.inputBEEF, undefined, {
|
|
90
|
+
spends: p.inputs.map((i) => ({
|
|
91
|
+
outpoint: i.outpoint,
|
|
92
|
+
customInstructions: i.customInstructions,
|
|
93
|
+
})),
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Split token inputs into an exact `amount` output (vout 0) and a remainder,
|
|
98
|
+
* both back to the wallet in the token's basket, broadcast normally. Returns
|
|
99
|
+
* the exact output as the next input, with BEEF that carries it.
|
|
100
|
+
*/
|
|
101
|
+
async function splitExact(ctx, p) {
|
|
102
|
+
const exactOut = await selfTokenOutput(ctx, p.tokenId, p.amount, 'Mandala exact amount');
|
|
103
|
+
// No remainder when the inputs sum to `amount` (an amount-0 Mandala
|
|
104
|
+
// output would be an authority).
|
|
105
|
+
const rest = p.change > 0n
|
|
106
|
+
? [await selfTokenOutput(ctx, p.tokenId, p.change, 'Mandala remainder')]
|
|
107
|
+
: [];
|
|
108
|
+
const result = await spendTokens(ctx, {
|
|
109
|
+
description: `Split ${p.amount} Mandala tokens`,
|
|
110
|
+
labels: p.labels,
|
|
111
|
+
inputs: p.inputs,
|
|
112
|
+
inputBEEF: p.inputBEEF,
|
|
113
|
+
outputs: [exactOut, ...rest],
|
|
114
|
+
noSend: false,
|
|
115
|
+
});
|
|
116
|
+
if (result.error)
|
|
117
|
+
return { error: `split-failed: ${result.error}` };
|
|
118
|
+
if (!result.txid || !result.tx)
|
|
119
|
+
return { error: 'split-failed: no-transaction' };
|
|
120
|
+
return {
|
|
121
|
+
input: {
|
|
122
|
+
outpoint: `${result.txid}.0`,
|
|
123
|
+
customInstructions: exactOut.customInstructions,
|
|
124
|
+
amount: p.amount,
|
|
125
|
+
},
|
|
126
|
+
beef: Beef.fromBinary(result.tx).toBinary(),
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Build, sign and send the BRC-169 §7.3 envelope carrying a BRC-232 delivery
|
|
131
|
+
* in its encrypted `content`.
|
|
132
|
+
*/
|
|
133
|
+
async function deliverEnvelope(ctx, resolution, p) {
|
|
134
|
+
const { memo, ...rest } = p.body;
|
|
135
|
+
const body = memo === undefined ? rest : { memo, ...rest };
|
|
136
|
+
const plaintext = Array.from(encodeMimeEntity(TRANSACTION_CBOR_CONTENT_TYPE, dagCborEncode(body)));
|
|
137
|
+
const content = await encryptBrc78(ctx.wallet, plaintext, resolution.identityKey);
|
|
138
|
+
const bytes = (a) => Uint8Array.from(a);
|
|
139
|
+
const { envelope } = await signEnvelope(ctx.wallet, {
|
|
140
|
+
metanetHandles: '1.0',
|
|
141
|
+
recipient: {
|
|
142
|
+
handle: resolution.handle,
|
|
143
|
+
tag: resolution.tag,
|
|
144
|
+
domain: resolution.domain,
|
|
145
|
+
},
|
|
146
|
+
sender: { identityKey: bytes(Utils.toArray(p.senderIdentityKey, 'hex')) },
|
|
147
|
+
created: new Date().toISOString().replace(/\.\d{3}Z$/, 'Z'),
|
|
148
|
+
payment: null,
|
|
149
|
+
contentHash: bytes(Hash.sha256(plaintext)),
|
|
150
|
+
}, bytes(content));
|
|
151
|
+
return messageRelay.sendCborMessage(ctx.wallet, resolution.messagebox, resolution.identityKey, MANDALA_INBOX, envelope);
|
|
152
|
+
}
|
|
153
|
+
export const sendMandala = {
|
|
154
|
+
meta: {
|
|
155
|
+
name: 'sendMandala',
|
|
156
|
+
description: "Send Mandala (BRC-162) tokens to a BRC-169 handle: a protected noSend transaction delivered (BRC-232) in a signed envelope to the handle's mandala_inbox; the recipient broadcasts",
|
|
157
|
+
category: 'tokens',
|
|
158
|
+
inputSchema: {
|
|
159
|
+
type: 'object',
|
|
160
|
+
properties: {
|
|
161
|
+
tokenId: {
|
|
162
|
+
type: 'string',
|
|
163
|
+
description: 'Token: the deploy outpoint, BRC-36 <txid>.<vout> (<txid>_<vout> accepted)',
|
|
164
|
+
},
|
|
165
|
+
amount: {
|
|
166
|
+
type: 'string',
|
|
167
|
+
description: 'Amount in raw units (string for bigint)',
|
|
168
|
+
},
|
|
169
|
+
destination: {
|
|
170
|
+
type: 'object',
|
|
171
|
+
description: '{ handle } — a BRC-169 handle (@handle@domain)',
|
|
172
|
+
},
|
|
173
|
+
expirySeconds: {
|
|
174
|
+
type: 'integer',
|
|
175
|
+
description: 'BRC-177 nosend expiry in seconds (default 31536000, one year)',
|
|
176
|
+
},
|
|
177
|
+
memo: {
|
|
178
|
+
type: 'string',
|
|
179
|
+
description: 'Optional memo carried in the delivery',
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
|
+
required: ['tokenId', 'amount', 'destination'],
|
|
183
|
+
},
|
|
184
|
+
},
|
|
185
|
+
async execute(ctx, input) {
|
|
186
|
+
try {
|
|
187
|
+
let tokenId;
|
|
188
|
+
try {
|
|
189
|
+
tokenId = mandalaTokenOutpoint(input.tokenId);
|
|
190
|
+
}
|
|
191
|
+
catch {
|
|
192
|
+
return { error: 'invalid-token: expected <txid>.<vout>' };
|
|
193
|
+
}
|
|
194
|
+
const amount = BigInt(input.amount);
|
|
195
|
+
if (amount <= 0n)
|
|
196
|
+
return { error: 'amount-must-be-positive' };
|
|
197
|
+
const basket = mandalaTokenBasket(tokenId);
|
|
198
|
+
// 1. Resolve the handle; the recipient key is derived from it.
|
|
199
|
+
const resolution = await resolveHandle(input.destination.handle);
|
|
200
|
+
const listed = await ctx.wallet.listOutputs({
|
|
201
|
+
basket,
|
|
202
|
+
include: 'entire transactions',
|
|
203
|
+
includeTags: true,
|
|
204
|
+
includeCustomInstructions: true,
|
|
205
|
+
limit: 10000,
|
|
206
|
+
});
|
|
207
|
+
if (!listed.BEEF)
|
|
208
|
+
return { error: 'no-beef-available' };
|
|
209
|
+
const beef = Beef.fromBinary(Array.from(listed.BEEF));
|
|
210
|
+
// Spendable token outputs, amounts read from the script.
|
|
211
|
+
const candidates = [];
|
|
212
|
+
for (const o of listed.outputs) {
|
|
213
|
+
const amt = tokenAmount(beef, o, tokenId);
|
|
214
|
+
if (amt === undefined)
|
|
215
|
+
continue;
|
|
216
|
+
candidates.push({
|
|
217
|
+
outpoint: o.outpoint,
|
|
218
|
+
customInstructions: o.customInstructions,
|
|
219
|
+
amount: amt,
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
const labels = [MANDALA_LABEL, mandalaTokenLabel(tokenId)];
|
|
223
|
+
// 2. The protected send spends exactly one output of exactly `amount`.
|
|
224
|
+
let exact = candidates.find((c) => c.amount === amount);
|
|
225
|
+
let inputBEEF = Array.from(listed.BEEF);
|
|
226
|
+
if (!exact) {
|
|
227
|
+
const inputs = [];
|
|
228
|
+
let totalIn = 0n;
|
|
229
|
+
for (const c of candidates) {
|
|
230
|
+
if (totalIn >= amount)
|
|
231
|
+
break;
|
|
232
|
+
inputs.push(c);
|
|
233
|
+
totalIn += c.amount;
|
|
234
|
+
}
|
|
235
|
+
if (totalIn < amount)
|
|
236
|
+
return { error: 'insufficient-tokens' };
|
|
237
|
+
const split = await splitExact(ctx, {
|
|
238
|
+
tokenId,
|
|
239
|
+
labels,
|
|
240
|
+
inputs,
|
|
241
|
+
inputBEEF,
|
|
242
|
+
amount,
|
|
243
|
+
change: totalIn - amount,
|
|
244
|
+
});
|
|
245
|
+
if ('error' in split)
|
|
246
|
+
return { error: split.error };
|
|
247
|
+
exact = split.input;
|
|
248
|
+
inputBEEF = split.beef;
|
|
249
|
+
}
|
|
250
|
+
// 3. The recipient's output, BRC-29-style derivation under the token's protocol.
|
|
251
|
+
const protocolID = mandalaProtocol(tokenId);
|
|
252
|
+
const keyID = `${randomBase64()} ${randomBase64()}`;
|
|
253
|
+
const { publicKey } = await ctx.wallet.getPublicKey({
|
|
254
|
+
protocolID,
|
|
255
|
+
keyID,
|
|
256
|
+
counterparty: resolution.identityKey,
|
|
257
|
+
});
|
|
258
|
+
const recipientOutput = {
|
|
259
|
+
lockingScript: Mandala.value(mandalaWireId(tokenId), amount, {
|
|
260
|
+
lock: new P2PKH().lock(PublicKey.fromString(publicKey).toAddress()),
|
|
261
|
+
})
|
|
262
|
+
.lock()
|
|
263
|
+
.toHex(),
|
|
264
|
+
satoshis: 1,
|
|
265
|
+
outputDescription: 'Mandala tokens',
|
|
266
|
+
};
|
|
267
|
+
const expiry = input.expirySeconds ?? MANDALA_SEND_EXPIRY_SECONDS;
|
|
268
|
+
const result = await spendTokens(ctx, {
|
|
269
|
+
description: `Send ${amount} Mandala tokens`,
|
|
270
|
+
labels: [...labels, `p nosend expiry seconds ${expiry}`],
|
|
271
|
+
inputs: [exact],
|
|
272
|
+
inputBEEF,
|
|
273
|
+
outputs: [recipientOutput],
|
|
274
|
+
noSend: true,
|
|
275
|
+
});
|
|
276
|
+
if (result.error)
|
|
277
|
+
return { error: result.error };
|
|
278
|
+
if (!result.txid || !result.tx)
|
|
279
|
+
return { error: 'no-transaction' };
|
|
280
|
+
// 4. Deliver.
|
|
281
|
+
const { publicKey: senderIdentityKey } = await ctx.wallet.getPublicKey({
|
|
282
|
+
identityKey: true,
|
|
283
|
+
});
|
|
284
|
+
let sent;
|
|
285
|
+
try {
|
|
286
|
+
sent = await deliverEnvelope(ctx, resolution, {
|
|
287
|
+
senderIdentityKey,
|
|
288
|
+
body: {
|
|
289
|
+
memo: input.memo,
|
|
290
|
+
txid: Uint8Array.from(Utils.toArray(result.txid, 'hex')),
|
|
291
|
+
beef: Uint8Array.from(result.tx),
|
|
292
|
+
outputs: [
|
|
293
|
+
{
|
|
294
|
+
outputIndex: 0,
|
|
295
|
+
protocol: 'basket insertion',
|
|
296
|
+
protocolID,
|
|
297
|
+
keyID,
|
|
298
|
+
counterparty: Uint8Array.from(Utils.toArray(senderIdentityKey, 'hex')),
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
},
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
catch (error) {
|
|
305
|
+
// The send exists as a noSend action: return it so the caller can
|
|
306
|
+
// retry delivery or abortAction it.
|
|
307
|
+
return {
|
|
308
|
+
txid: result.txid,
|
|
309
|
+
tx: result.tx,
|
|
310
|
+
error: `delivery-failed: ${error instanceof Error ? error.message : String(error)}`,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
return {
|
|
314
|
+
txid: result.txid,
|
|
315
|
+
tx: result.tx,
|
|
316
|
+
delivered: 'envelope',
|
|
317
|
+
messageId: sent.messageId,
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
catch (error) {
|
|
321
|
+
return {
|
|
322
|
+
error: error instanceof Error ? error.message : String(error),
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
};
|
|
327
|
+
//# sourceMappingURL=send.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../src/mandala/send.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAyB,aAAa,EAAE,MAAM,cAAc,CAAA;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;AACzC,OAAO,EACN,aAAa,EACb,aAAa,EACb,2BAA2B,EAC3B,eAAe,EACf,kBAAkB,EAClB,iBAAiB,GACjB,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,6BAA6B,EAAE,gB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