@chainvue/verus-sdk 0.11.0 → 0.13.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/README.md +4 -2
- package/dist/VerusSDK.d.ts +16 -1
- package/dist/VerusSDK.d.ts.map +1 -1
- package/dist/VerusSDK.js +21 -0
- package/dist/VerusSDK.js.map +1 -1
- package/dist/bundle.js +261 -18
- package/dist/identity/index.js +3 -3
- package/dist/identity/index.js.map +1 -1
- package/dist/identity/multisig.d.ts +101 -0
- package/dist/identity/multisig.d.ts.map +1 -0
- package/dist/identity/multisig.js +176 -0
- package/dist/identity/multisig.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/offers/identity.d.ts.map +1 -1
- package/dist/offers/identity.js +7 -4
- package/dist/offers/identity.js.map +1 -1
- package/dist/offers/public.d.ts +2 -0
- package/dist/offers/public.d.ts.map +1 -1
- package/dist/offers/public.js +4 -1
- package/dist/offers/public.js.map +1 -1
- package/dist/offers/reclaim.d.ts +39 -0
- package/dist/offers/reclaim.d.ts.map +1 -0
- package/dist/offers/reclaim.js +112 -0
- package/dist/offers/reclaim.js.map +1 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/offers/public.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAEL,iBAAiB,EACjB,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC3E,YAAY,EACV,4BAA4B,EAC5B,+BAA+B,EAC/B,+BAA+B,EAC/B,2BAA2B,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../../src/offers/public.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,EAEL,iBAAiB,EACjB,UAAU,GACX,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,aAAa,GACd,MAAM,YAAY,CAAC;AACpB,OAAO,EAEL,iBAAiB,GAClB,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,sBAAsB,EACtB,yBAAyB,EACzB,qBAAqB,EACrB,wBAAwB,EACxB,sBAAsB,EACtB,yBAAyB,GAC1B,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,cAAc,EACd,uBAAuB,EACvB,uBAAuB,EACvB,SAAS,EACT,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,YAAY,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAC3E,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAC3E,YAAY,EACV,4BAA4B,EAC5B,+BAA+B,EAC/B,+BAA+B,EAC/B,2BAA2B,EAC3B,8BAA8B,EAC9B,8BAA8B,EAC9B,4BAA4B,EAC5B,+BAA+B,EAC/B,+BAA+B,GAChC,MAAM,eAAe,CAAC"}
|
package/dist/offers/public.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.completeSwapIdentityOffer = exports.buildSwapIdentityOffer = exports.completeBuyIdentityOffer = exports.buildBuyIdentityOffer = exports.completeSellIdentityOffer = exports.buildSellIdentityOffer = exports.completeOffer = exports.buildOffer = exports.buildOfferFunding = void 0;
|
|
3
|
+
exports.completeSwapIdentityOffer = exports.buildSwapIdentityOffer = exports.completeBuyIdentityOffer = exports.buildBuyIdentityOffer = exports.completeSellIdentityOffer = exports.buildSellIdentityOffer = exports.buildReclaimOffer = exports.completeOffer = exports.buildOffer = exports.buildOfferFunding = void 0;
|
|
4
4
|
/**
|
|
5
5
|
* The curated public surface of the offers module — Verus marketplace offers
|
|
6
6
|
* (fully on-chain atomic swaps), built and signed offline.
|
|
@@ -31,6 +31,9 @@ Object.defineProperty(exports, "buildOffer", { enumerable: true, get: function (
|
|
|
31
31
|
var taker_js_1 = require("./taker.js");
|
|
32
32
|
// Currency-offer taker: complete and sign the swap.
|
|
33
33
|
Object.defineProperty(exports, "completeOffer", { enumerable: true, get: function () { return taker_js_1.completeOffer; } });
|
|
34
|
+
var reclaim_js_1 = require("./reclaim.js");
|
|
35
|
+
// Maker cancel: reclaim an unaccepted offer's funding commitment.
|
|
36
|
+
Object.defineProperty(exports, "buildReclaimOffer", { enumerable: true, get: function () { return reclaim_js_1.buildReclaimOffer; } });
|
|
34
37
|
var identity_js_1 = require("./identity.js");
|
|
35
38
|
// Identity-offer flows (sell / buy / swap), maker + taker halves.
|
|
36
39
|
Object.defineProperty(exports, "buildSellIdentityOffer", { enumerable: true, get: function () { return identity_js_1.buildSellIdentityOffer; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/offers/public.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,uCAIoB;AAHlB,kFAAkF;AAClF,6GAAA,iBAAiB,OAAA;AACjB,sGAAA,UAAU,OAAA;AAEZ,uCAGoB;AAFlB,oDAAoD;AACpD,yGAAA,aAAa,OAAA;AAEf,6CAQuB;AAPrB,kEAAkE;AAClE,qHAAA,sBAAsB,OAAA;AACtB,wHAAA,yBAAyB,OAAA;AACzB,oHAAA,qBAAqB,OAAA;AACrB,uHAAA,wBAAwB,OAAA;AACxB,qHAAA,sBAAsB,OAAA;AACtB,wHAAA,yBAAyB,OAAA"}
|
|
1
|
+
{"version":3,"file":"public.js","sourceRoot":"","sources":["../../src/offers/public.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,uCAIoB;AAHlB,kFAAkF;AAClF,6GAAA,iBAAiB,OAAA;AACjB,sGAAA,UAAU,OAAA;AAEZ,uCAGoB;AAFlB,oDAAoD;AACpD,yGAAA,aAAa,OAAA;AAEf,2CAGsB;AAFpB,kEAAkE;AAClE,+GAAA,iBAAiB,OAAA;AAEnB,6CAQuB;AAPrB,kEAAkE;AAClE,qHAAA,sBAAsB,OAAA;AACtB,wHAAA,yBAAyB,OAAA;AACzB,oHAAA,qBAAqB,OAAA;AACrB,uHAAA,wBAAwB,OAAA;AACxB,qHAAA,sBAAsB,OAAA;AACtB,wHAAA,yBAAyB,OAAA"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { FundedOutpoint } from './maker.js';
|
|
2
|
+
import type { Network } from '../constants/index.js';
|
|
3
|
+
import type { Utxo } from '../types/index.js';
|
|
4
|
+
export interface ReclaimOfferParams {
|
|
5
|
+
wif: string;
|
|
6
|
+
/** The funding commitment to reclaim (the `commitment` from buildOfferFunding). */
|
|
7
|
+
commitment: FundedOutpoint;
|
|
8
|
+
/**
|
|
9
|
+
* What the commitment holds: the native coin (currency = chain id) or a token.
|
|
10
|
+
* `amount` MUST equal the amount originally funded into the commitment — it is
|
|
11
|
+
* the value being reclaimed, and nothing in the outpoint independently carries
|
|
12
|
+
* a token amount. A mismatch produces a value-imbalanced tx the daemon rejects.
|
|
13
|
+
*/
|
|
14
|
+
offered: {
|
|
15
|
+
currency: string;
|
|
16
|
+
amount: bigint;
|
|
17
|
+
};
|
|
18
|
+
/** Where the reclaimed asset is returned (an address the `wif` controls). */
|
|
19
|
+
makerAddress: string;
|
|
20
|
+
/**
|
|
21
|
+
* Native UTXOs controlled by `wif` to fund the miner fee. REQUIRED when
|
|
22
|
+
* reclaiming a token (the token commitment carries 0 native); ignored for a
|
|
23
|
+
* native reclaim, where the fee comes out of the reclaimed value.
|
|
24
|
+
*/
|
|
25
|
+
feeUtxos?: Utxo[];
|
|
26
|
+
/** Native change destination for a token reclaim (defaults to makerAddress). */
|
|
27
|
+
changeAddress?: string;
|
|
28
|
+
expiryHeight: number;
|
|
29
|
+
}
|
|
30
|
+
export interface ReclaimOfferResult {
|
|
31
|
+
reclaimTx: string;
|
|
32
|
+
txid: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Reclaim (cancel) an unaccepted offer: spend the funding commitment back to the
|
|
36
|
+
* maker, signed SIGHASH_ALL. Returns the signed transaction to broadcast.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildReclaimOffer(params: ReclaimOfferParams, network: Network): ReclaimOfferResult;
|
|
39
|
+
//# sourceMappingURL=reclaim.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reclaim.d.ts","sourceRoot":"","sources":["../../src/offers/reclaim.ts"],"names":[],"mappings":"AAyBA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAKjD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAC;IACZ,mFAAmF;IACnF,UAAU,EAAE,cAAc,CAAC;IAC3B;;;;;OAKG;IACH,OAAO,EAAE;QAAE,QAAQ,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC9C,6EAA6E;IAC7E,YAAY,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;IAClB,gFAAgF;IAChF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AASD;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,EAAE,OAAO,EAAE,OAAO,GAAG,kBAAkB,CAkGlG"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildReclaimOffer = buildReclaimOffer;
|
|
4
|
+
/**
|
|
5
|
+
* Reclaiming (cancelling) an unaccepted offer, offline.
|
|
6
|
+
*
|
|
7
|
+
* The SDK's maker flow funds the OFFERED asset into a commitment output — a
|
|
8
|
+
* single-key EVAL_IDENTITY_COMMITMENT CryptoCondition the maker controls (see
|
|
9
|
+
* buildOfferFunding) — and then signs a SIGHASH_SINGLE|ANYONECANPAY partial over
|
|
10
|
+
* it (buildOffer). If no taker ever completes that partial, the offered value is
|
|
11
|
+
* still sitting in the maker's own commitment output. `buildReclaimOffer` spends
|
|
12
|
+
* it back to the maker: the same CryptoCondition, now signed SIGHASH_ALL.
|
|
13
|
+
*
|
|
14
|
+
* This is the maker's unilateral cancel — it needs nothing but the maker's key
|
|
15
|
+
* and the commitment outpoint. (It is distinct from the daemon's `closeoffers`,
|
|
16
|
+
* which cancels the daemon's on-chain *posted* offers — a different, two-condition
|
|
17
|
+
* commitment the SDK does not create.)
|
|
18
|
+
*
|
|
19
|
+
* The offered asset may be the native coin or a token:
|
|
20
|
+
* - native: the fee comes out of the reclaimed value (no extra inputs);
|
|
21
|
+
* - token: the commitment carries 0 native, so `feeUtxos` (native, controlled
|
|
22
|
+
* by `wif`) fund the miner fee; the token returns in full.
|
|
23
|
+
*/
|
|
24
|
+
const boundary_js_1 = require("../fork/boundary.js");
|
|
25
|
+
const index_js_1 = require("../utxo/index.js");
|
|
26
|
+
const index_js_2 = require("../signing/index.js");
|
|
27
|
+
const index_js_3 = require("../identity/index.js");
|
|
28
|
+
const sign_js_1 = require("./sign.js");
|
|
29
|
+
const index_js_4 = require("../utils/index.js");
|
|
30
|
+
const brands_js_1 = require("../core/brands.js");
|
|
31
|
+
const index_js_5 = require("../constants/index.js");
|
|
32
|
+
const errors_js_1 = require("../errors.js");
|
|
33
|
+
/** A native payment script to an R-address (P2PKH) or i-address (pay-to-identity). */
|
|
34
|
+
function nativePaymentScript(address) {
|
|
35
|
+
return address.startsWith('i')
|
|
36
|
+
? (0, index_js_3.identityPaymentScript)((0, brands_js_1.parseIAddress)(address, 'address'))
|
|
37
|
+
: (0, index_js_4.addressToScriptPubKey)(address);
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Reclaim (cancel) an unaccepted offer: spend the funding commitment back to the
|
|
41
|
+
* maker, signed SIGHASH_ALL. Returns the signed transaction to broadcast.
|
|
42
|
+
*/
|
|
43
|
+
function buildReclaimOffer(params, network) {
|
|
44
|
+
const verusNetwork = (0, index_js_2.getNetwork)(network === 'testnet');
|
|
45
|
+
const systemId = index_js_5.NETWORK_CONFIG[network].chainId;
|
|
46
|
+
const offeringNative = params.offered.currency === systemId;
|
|
47
|
+
if (params.offered.amount <= 0n) {
|
|
48
|
+
throw new errors_js_1.TransactionBuildError('buildReclaimOffer: offered.amount must be positive');
|
|
49
|
+
}
|
|
50
|
+
if (!Number.isInteger(params.expiryHeight) || params.expiryHeight <= 0) {
|
|
51
|
+
throw new errors_js_1.TransactionBuildError('buildReclaimOffer: expiryHeight must be a positive block height');
|
|
52
|
+
}
|
|
53
|
+
const commitmentScript = Buffer.from(params.commitment.script, 'hex');
|
|
54
|
+
const txb = new boundary_js_1.TransactionBuilder(verusNetwork);
|
|
55
|
+
txb.setVersion(4);
|
|
56
|
+
txb.setExpiryHeight((0, index_js_2.resolveExpiryHeight)(params.expiryHeight));
|
|
57
|
+
txb.setVersionGroupId(index_js_5.VERSION_GROUP_ID);
|
|
58
|
+
txb.addInput(Buffer.from(params.commitment.txid, 'hex').reverse(), params.commitment.vout, 0xffffffff, commitmentScript);
|
|
59
|
+
if (offeringNative) {
|
|
60
|
+
// The fee comes out of the reclaimed native value; one CC input, one output.
|
|
61
|
+
const fee = (0, index_js_1.estimateFee)(1, 1, index_js_5.DEFAULT_FEE_PER_KB, false, 100);
|
|
62
|
+
const outAmount = params.offered.amount - fee;
|
|
63
|
+
if (outAmount <= index_js_5.DUST_THRESHOLD) {
|
|
64
|
+
throw new errors_js_1.TransactionBuildError(`buildReclaimOffer: reclaimed native value ${params.offered.amount} is too small to cover the fee ${fee} above dust`);
|
|
65
|
+
}
|
|
66
|
+
txb.addOutput(nativePaymentScript(params.makerAddress), (0, index_js_4.toSafeNumber)(outAmount));
|
|
67
|
+
const tx = boundary_js_1.Transaction.fromHex(txb.buildIncomplete().toHex(), verusNetwork);
|
|
68
|
+
const takerInputs = [
|
|
69
|
+
{ index: 0, prevOutScript: commitmentScript, value: params.commitment.value },
|
|
70
|
+
];
|
|
71
|
+
(0, index_js_2.assertNativeConservation)([{ satoshis: params.commitment.value }], tx.outs, fee, 'reclaimOffer');
|
|
72
|
+
const { signedTx, txid } = (0, sign_js_1.signTakerInputs)(tx.toHex(), takerInputs, params.wif, network);
|
|
73
|
+
return { reclaimTx: signedTx, txid };
|
|
74
|
+
}
|
|
75
|
+
// Token reclaim: the commitment carries 0 native and the token returns in full;
|
|
76
|
+
// native fee UTXOs (controlled by wif) pay the miner fee.
|
|
77
|
+
const feeUtxos = params.feeUtxos ?? [];
|
|
78
|
+
if (feeUtxos.length === 0) {
|
|
79
|
+
throw new errors_js_1.TransactionBuildError('buildReclaimOffer: reclaiming a token requires feeUtxos (native UTXOs) — the token commitment carries no native coin for the fee');
|
|
80
|
+
}
|
|
81
|
+
// Output 0: the offered token returned to the maker (a reserve output, 0 native).
|
|
82
|
+
const tokenOut = (0, index_js_3.buildTokenChangeOutput)((0, brands_js_1.parseAddress)(params.makerAddress, 'makerAddress'), new Map([[params.offered.currency, params.offered.amount]]));
|
|
83
|
+
txb.addOutput(tokenOut.script, 0);
|
|
84
|
+
const tx = boundary_js_1.Transaction.fromHex(txb.buildIncomplete().toHex(), verusNetwork);
|
|
85
|
+
const takerInputs = [
|
|
86
|
+
{ index: 0, prevOutScript: commitmentScript, value: 0n },
|
|
87
|
+
];
|
|
88
|
+
// Select native-only fee UTXOs (numOutputs = token out + native change).
|
|
89
|
+
const selection = (0, index_js_1.selectUtxos)(feeUtxos, 0n, new Map(), 2, systemId, undefined, true, 200);
|
|
90
|
+
if (selection.currencyChanges.size > 0) {
|
|
91
|
+
throw new errors_js_1.TransactionBuildError('buildReclaimOffer: feeUtxos must carry only the native coin; a token-bearing UTXO was selected and its reserve value would be lost.');
|
|
92
|
+
}
|
|
93
|
+
// Fee UTXOs must be native P2PKH controlled by `wif`. Rejecting anything else
|
|
94
|
+
// (including CryptoCondition outputs, whose control can't be verified offline)
|
|
95
|
+
// fails closed with a typed error instead of a doomed, daemon-rejected tx.
|
|
96
|
+
const expectedFeeScript = (0, index_js_4.addressToScriptPubKey)(boundary_js_1.ECPair.fromWIF(params.wif, verusNetwork).getAddress()).toString('hex');
|
|
97
|
+
for (const u of selection.selected) {
|
|
98
|
+
if (u.script !== expectedFeeScript) {
|
|
99
|
+
throw new errors_js_1.TransactionBuildError(`buildReclaimOffer: fee UTXO ${u.txid}:${u.outputIndex} must be a native P2PKH output controlled by the provided wif.`);
|
|
100
|
+
}
|
|
101
|
+
const idx = tx.addInput(Buffer.from(u.txid, 'hex').reverse(), u.outputIndex, 0xffffffff);
|
|
102
|
+
takerInputs.push({ index: idx, prevOutScript: Buffer.from(u.script, 'hex'), value: u.satoshis });
|
|
103
|
+
}
|
|
104
|
+
if (selection.nativeChange > 0n) {
|
|
105
|
+
tx.addOutput(nativePaymentScript(params.changeAddress ?? params.makerAddress), (0, index_js_4.toSafeNumber)(selection.nativeChange));
|
|
106
|
+
}
|
|
107
|
+
const feeNativeIn = selection.selected.reduce((s, u) => s + u.satoshis, 0n);
|
|
108
|
+
(0, index_js_2.assertNativeConservation)([{ satoshis: feeNativeIn }], tx.outs, selection.fee, 'reclaimOffer');
|
|
109
|
+
const { signedTx, txid } = (0, sign_js_1.signTakerInputs)(tx.toHex(), takerInputs, params.wif, network);
|
|
110
|
+
return { reclaimTx: signedTx, txid };
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=reclaim.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reclaim.js","sourceRoot":"","sources":["../../src/offers/reclaim.ts"],"names":[],"mappings":";;AAyEA,8CAkGC;AA3KD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qDAA8E;AAC9E,+CAA4D;AAC5D,kDAAgG;AAChG,mDAAqF;AACrF,uCAA6D;AAE7D,gDAAwE;AACxE,iDAAgE;AAChE,oDAA6G;AAC7G,4CAAqD;AAiCrD,sFAAsF;AACtF,SAAS,mBAAmB,CAAC,OAAe;IAC1C,OAAO,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;QAC5B,CAAC,CAAC,IAAA,gCAAqB,EAAC,IAAA,yBAAa,EAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAC1D,CAAC,CAAC,IAAA,gCAAqB,EAAC,OAAO,CAAC,CAAC;AACrC,CAAC;AAED;;;GAGG;AACH,SAAgB,iBAAiB,CAAC,MAA0B,EAAE,OAAgB;IAC5E,MAAM,YAAY,GAAG,IAAA,qBAAU,EAAC,OAAO,KAAK,SAAS,CAAC,CAAC;IACvD,MAAM,QAAQ,GAAG,yBAAc,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;IACjD,MAAM,cAAc,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,KAAK,QAA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