@1sat/actions 0.0.197 → 0.0.199
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/applyIntent.d.ts +7 -15
- package/dist/apply/applyIntent.d.ts.map +1 -1
- package/dist/apply/applyIntent.js +76 -25
- package/dist/apply/applyIntent.js.map +1 -1
- package/dist/apply/index.d.ts +1 -1
- package/dist/apply/index.d.ts.map +1 -1
- package/dist/apply/index.js +1 -1
- package/dist/apply/index.js.map +1 -1
- package/dist/apply/inscribeSigma.d.ts +1 -1
- package/dist/apply/inscribeSigma.d.ts.map +1 -1
- package/dist/apply/inscribeSigma.js +20 -13
- package/dist/apply/inscribeSigma.js.map +1 -1
- package/dist/apply/prepare.d.ts +12 -7
- package/dist/apply/prepare.d.ts.map +1 -1
- package/dist/apply/prepare.js +3 -21
- package/dist/apply/prepare.js.map +1 -1
- package/dist/apply/registry.d.ts +3 -2
- package/dist/apply/registry.d.ts.map +1 -1
- package/dist/apply/registry.js +7 -26
- package/dist/apply/registry.js.map +1 -1
- package/dist/apply/stampScriptTags.d.ts.map +1 -1
- package/dist/apply/stampScriptTags.js +8 -1
- package/dist/apply/stampScriptTags.js.map +1 -1
- package/dist/collections/index.d.ts.map +1 -1
- package/dist/collections/index.js +77 -51
- package/dist/collections/index.js.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +1 -1
- package/dist/constants.js.map +1 -1
- package/dist/cosign/finalize.js +1 -2
- package/dist/cosign/finalize.js.map +1 -1
- package/dist/index.d.ts +11 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/dist/inscriptions/index.d.ts.map +1 -1
- package/dist/inscriptions/index.js +34 -39
- package/dist/inscriptions/index.js.map +1 -1
- package/dist/locks/index.d.ts +1 -1
- package/dist/locks/index.d.ts.map +1 -1
- package/dist/locks/index.js +28 -13
- package/dist/locks/index.js.map +1 -1
- package/dist/opns/index.d.ts.map +1 -1
- package/dist/opns/index.js +60 -50
- package/dist/opns/index.js.map +1 -1
- package/dist/ordinals/index.d.ts +1 -2
- package/dist/ordinals/index.d.ts.map +1 -1
- package/dist/ordinals/index.js +84 -93
- package/dist/ordinals/index.js.map +1 -1
- package/dist/pipeline/index.d.ts +4 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +4 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/pipeline/runPipeline.d.ts +30 -0
- package/dist/pipeline/runPipeline.d.ts.map +1 -0
- package/dist/pipeline/runPipeline.js +82 -0
- package/dist/pipeline/runPipeline.js.map +1 -0
- package/dist/pipeline/spendTargets.d.ts +52 -0
- package/dist/pipeline/spendTargets.d.ts.map +1 -0
- package/dist/pipeline/spendTargets.js +87 -0
- package/dist/pipeline/spendTargets.js.map +1 -0
- package/dist/pipeline/unlockInput.d.ts +49 -0
- package/dist/pipeline/unlockInput.d.ts.map +1 -0
- package/dist/pipeline/unlockInput.js +316 -0
- package/dist/pipeline/unlockInput.js.map +1 -0
- package/dist/signing/index.d.ts +1 -1
- package/dist/signing/index.d.ts.map +1 -1
- package/dist/signing/index.js +1 -1
- package/dist/signing/index.js.map +1 -1
- package/dist/signing/sigma.d.ts +13 -17
- package/dist/signing/sigma.d.ts.map +1 -1
- package/dist/signing/sigma.js +37 -40
- package/dist/signing/sigma.js.map +1 -1
- package/dist/sweep/index.d.ts.map +1 -1
- package/dist/sweep/index.js +20 -17
- package/dist/sweep/index.js.map +1 -1
- package/dist/sync/syncCosignDeliveries.d.ts.map +1 -1
- package/dist/sync/syncCosignDeliveries.js +30 -20
- package/dist/sync/syncCosignDeliveries.js.map +1 -1
- package/dist/tokens/index.d.ts +8 -0
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +246 -174
- package/dist/tokens/index.js.map +1 -1
- package/dist/types.d.ts +16 -5
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/bsv21Remittance.d.ts +63 -0
- package/dist/utils/bsv21Remittance.d.ts.map +1 -0
- package/dist/utils/bsv21Remittance.js +146 -0
- package/dist/utils/bsv21Remittance.js.map +1 -0
- package/dist/utils/bsv21Remittance.test.d.ts +2 -0
- package/dist/utils/bsv21Remittance.test.d.ts.map +1 -0
- package/dist/utils/bsv21Remittance.test.js +115 -0
- package/dist/utils/bsv21Remittance.test.js.map +1 -0
- package/dist/utils/createTrackedAction.d.ts +42 -38
- package/dist/utils/createTrackedAction.d.ts.map +1 -1
- package/dist/utils/createTrackedAction.js +147 -79
- package/dist/utils/createTrackedAction.js.map +1 -1
- package/dist/utils/hasOneSatModule.d.ts +14 -0
- package/dist/utils/hasOneSatModule.d.ts.map +1 -0
- package/dist/utils/hasOneSatModule.js +31 -0
- package/dist/utils/hasOneSatModule.js.map +1 -0
- package/dist/utils/internalizeBeef.d.ts.map +1 -1
- package/dist/utils/internalizeBeef.js +37 -12
- package/dist/utils/internalizeBeef.js.map +1 -1
- package/dist/utils/loadBasketOutput.d.ts +1 -1
- package/dist/utils/loadBasketOutput.d.ts.map +1 -1
- package/dist/utils/loadBasketOutput.js +11 -3
- package/dist/utils/loadBasketOutput.js.map +1 -1
- package/dist/utils/moveBasket.d.ts +37 -0
- package/dist/utils/moveBasket.d.ts.map +1 -0
- package/dist/utils/moveBasket.js +115 -0
- package/dist/utils/moveBasket.js.map +1 -0
- package/dist/utils/ordinalRemittance.d.ts +33 -0
- package/dist/utils/ordinalRemittance.d.ts.map +1 -0
- package/dist/utils/ordinalRemittance.js +70 -0
- package/dist/utils/ordinalRemittance.js.map +1 -0
- package/dist/utils/ordinalSeedTags.d.ts +5 -3
- package/dist/utils/ordinalSeedTags.d.ts.map +1 -1
- package/dist/utils/ordinalSeedTags.js +34 -7
- package/dist/utils/ordinalSeedTags.js.map +1 -1
- package/dist/utils/resolveDestination.d.ts +3 -6
- package/dist/utils/resolveDestination.d.ts.map +1 -1
- package/dist/utils/resolveDestination.js +5 -1
- package/dist/utils/resolveDestination.js.map +1 -1
- package/dist/utils/signOrdinalInput.d.ts +3 -2
- package/dist/utils/signOrdinalInput.d.ts.map +1 -1
- package/dist/utils/signOrdinalInput.js +18 -13
- package/dist/utils/signOrdinalInput.js.map +1 -1
- package/dist/utils/stampBsv21OutputCi.d.ts +16 -0
- package/dist/utils/stampBsv21OutputCi.d.ts.map +1 -0
- package/dist/utils/stampBsv21OutputCi.js +90 -0
- package/dist/utils/stampBsv21OutputCi.js.map +1 -0
- package/dist/utils/stampOrdinalOutputCi.d.ts +15 -0
- package/dist/utils/stampOrdinalOutputCi.d.ts.map +1 -0
- package/dist/utils/stampOrdinalOutputCi.js +103 -0
- package/dist/utils/stampOrdinalOutputCi.js.map +1 -0
- package/dist/utils/walletMetadataCi.d.ts +23 -0
- package/dist/utils/walletMetadataCi.d.ts.map +1 -0
- package/dist/utils/walletMetadataCi.js +70 -0
- package/dist/utils/walletMetadataCi.js.map +1 -0
- package/package.json +7 -7
|
@@ -1,18 +1,10 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type CreateActionArgs, type WalletInterface } from '@bsv/sdk';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* re-exports it, and `prepare.ts` (the base-wallet path) calls it. Reaching for
|
|
7
|
-
* `P1SAT_APPLY_REGISTRY` directly instead skips the stamping — that is exactly
|
|
8
|
-
* the bug this split exists to prevent.
|
|
9
|
-
*
|
|
10
|
-
* Mutates `args` in place (never replace inputs/outputs arrays). Unknown
|
|
11
|
-
* labeled intents fail closed.
|
|
12
|
-
*
|
|
13
|
-
* @param wallet - Base wallet only (field-sig / nested CA must not hit WPM)
|
|
14
|
-
* @param args - createAction args to mutate
|
|
15
|
-
* @param intent - Explicit intent; falls back to `p 1sat intent …` label
|
|
3
|
+
* Authoritative enrich (local pipeline + module embellish):
|
|
4
|
+
* managed `id:` tags, seals, script-derived tags, BSV-21 + ordinal/OpNS CI.
|
|
5
|
+
* Does **not** add module dispatch labels — those are opt-in via prepare.
|
|
16
6
|
*/
|
|
17
|
-
export declare function
|
|
7
|
+
export declare function applyP1SatCreateAction(wallet: WalletInterface, args: CreateActionArgs): Promise<string>;
|
|
8
|
+
/** @deprecated Use {@link applyP1SatCreateAction} */
|
|
9
|
+
export declare function applyP1SatIntent(wallet: WalletInterface, args: CreateActionArgs, _intent?: string): Promise<void>;
|
|
18
10
|
//# sourceMappingURL=applyIntent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyIntent.d.ts","sourceRoot":"","sources":["../../src/apply/applyIntent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"applyIntent.d.ts","sourceRoot":"","sources":["../../src/apply/applyIntent.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,gBAAgB,EAKrB,KAAK,eAAe,EACpB,MAAM,UAAU,CAAA;AAQjB;;;;GAIG;AACH,wBAAsB,sBAAsB,CAC3C,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,gBAAgB,GACpB,OAAO,CAAC,MAAM,CAAC,CAgBjB;AAED,qDAAqD;AACrD,wBAAsB,gBAAgB,CACrC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,gBAAgB,EACtB,OAAO,CAAC,EAAE,MAAM,GACd,OAAO,CAAC,IAAI,CAAC,CAEf"}
|
|
@@ -1,32 +1,83 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { OPNS_BASKET, ORDINALS_BASKET } from '@1sat/types';
|
|
2
|
+
import { LockingScript, PushDrop, Script, Utils, } from '@bsv/sdk';
|
|
3
|
+
import { stampManagedOutputIds } from '../utils/createTrackedAction';
|
|
4
|
+
import { stampBsv21OutputCustomInstructions } from '../utils/stampBsv21OutputCi';
|
|
5
|
+
import { stampOrdinalOutputCustomInstructions } from '../utils/stampOrdinalOutputCi';
|
|
6
|
+
import { applyInscribeSigma } from './inscribeSigma';
|
|
7
|
+
import { applyOpnsRegister } from './opnsRegister';
|
|
3
8
|
import { stampScriptDerivedTags } from './stampScriptTags';
|
|
4
9
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* re-exports it, and `prepare.ts` (the base-wallet path) calls it. Reaching for
|
|
9
|
-
* `P1SAT_APPLY_REGISTRY` directly instead skips the stamping — that is exactly
|
|
10
|
-
* the bug this split exists to prevent.
|
|
11
|
-
*
|
|
12
|
-
* Mutates `args` in place (never replace inputs/outputs arrays). Unknown
|
|
13
|
-
* labeled intents fail closed.
|
|
14
|
-
*
|
|
15
|
-
* @param wallet - Base wallet only (field-sig / nested CA must not hit WPM)
|
|
16
|
-
* @param args - createAction args to mutate
|
|
17
|
-
* @param intent - Explicit intent; falls back to `p 1sat intent …` label
|
|
10
|
+
* Authoritative enrich (local pipeline + module embellish):
|
|
11
|
+
* managed `id:` tags, seals, script-derived tags, BSV-21 + ordinal/OpNS CI.
|
|
12
|
+
* Does **not** add module dispatch labels — those are opt-in via prepare.
|
|
18
13
|
*/
|
|
19
|
-
export async function
|
|
20
|
-
const
|
|
21
|
-
if (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
await fn(wallet, args);
|
|
14
|
+
export async function applyP1SatCreateAction(wallet, args) {
|
|
15
|
+
const actionId = stampManagedOutputIds(args);
|
|
16
|
+
if (hasUnsealedOpnsRegister(args)) {
|
|
17
|
+
await applyOpnsRegister(wallet, args);
|
|
18
|
+
}
|
|
19
|
+
if (hasUnsealedSigmaInscribe(args)) {
|
|
20
|
+
await applyInscribeSigma(wallet, args);
|
|
27
21
|
}
|
|
28
|
-
// After apply, so seals (PushDrop, sigma) are already on the outputs and the
|
|
29
|
-
// tags are stamped from the scripts that will actually be committed.
|
|
30
22
|
stampScriptDerivedTags(args);
|
|
23
|
+
// Tags/script + spent-input carry → CI. Keeps derivation.
|
|
24
|
+
// Same path for local (WPM encrypts after) and module (may re-encrypt).
|
|
25
|
+
await stampBsv21OutputCustomInstructions(wallet, args);
|
|
26
|
+
await stampOrdinalOutputCustomInstructions(wallet, args);
|
|
27
|
+
return actionId;
|
|
28
|
+
}
|
|
29
|
+
/** @deprecated Use {@link applyP1SatCreateAction} */
|
|
30
|
+
export async function applyP1SatIntent(wallet, args, _intent) {
|
|
31
|
+
await applyP1SatCreateAction(wallet, args);
|
|
32
|
+
}
|
|
33
|
+
function hasUnsealedOpnsRegister(args) {
|
|
34
|
+
const outputs = args.outputs;
|
|
35
|
+
if (!outputs?.length || !args.inputs?.[0]?.outpoint)
|
|
36
|
+
return false;
|
|
37
|
+
const out = outputs.find((o) => o.basket === OPNS_BASKET) ??
|
|
38
|
+
outputs.find((o) => o.satoshis === 1);
|
|
39
|
+
if (!out?.lockingScript)
|
|
40
|
+
return false;
|
|
41
|
+
try {
|
|
42
|
+
const fields = PushDrop.decode(LockingScript.fromHex(out.lockingScript)).fields;
|
|
43
|
+
const last = fields[fields.length - 1];
|
|
44
|
+
return !!last?.length && last.every((b) => b === 0);
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function hasUnsealedSigmaInscribe(args) {
|
|
51
|
+
// Already has anchor input — sealed or mid-flight.
|
|
52
|
+
if (args.inputs?.length)
|
|
53
|
+
return false;
|
|
54
|
+
const outputs = args.outputs;
|
|
55
|
+
if (!outputs?.length)
|
|
56
|
+
return false;
|
|
57
|
+
const out = outputs.find((o) => o.basket === ORDINALS_BASKET) ?? outputs[0];
|
|
58
|
+
if (!out?.lockingScript)
|
|
59
|
+
return false;
|
|
60
|
+
try {
|
|
61
|
+
const script = Script.fromHex(out.lockingScript);
|
|
62
|
+
const bin = script.toBinary();
|
|
63
|
+
// SIGMA ascii in script + likely zero-filled compact sig region
|
|
64
|
+
const sigma = Utils.toArray('SIGMA');
|
|
65
|
+
return containsSubarray(bin, sigma);
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
function containsSubarray(hay, needle) {
|
|
72
|
+
if (needle.length === 0 || hay.length < needle.length)
|
|
73
|
+
return false;
|
|
74
|
+
outer: for (let i = 0; i <= hay.length - needle.length; i++) {
|
|
75
|
+
for (let j = 0; j < needle.length; j++) {
|
|
76
|
+
if (hay[i + j] !== needle[j])
|
|
77
|
+
continue outer;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
31
82
|
}
|
|
32
83
|
//# sourceMappingURL=applyIntent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applyIntent.js","sourceRoot":"","sources":["../../src/apply/applyIntent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"applyIntent.js","sourceRoot":"","sources":["../../src/apply/applyIntent.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC1D,OAAO,EAEN,aAAa,EACb,QAAQ,EACR,MAAM,EACN,KAAK,GAEL,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AACpE,OAAO,EAAE,kCAAkC,EAAE,MAAM,6BAA6B,CAAA;AAChF,OAAO,EAAE,oCAAoC,EAAE,MAAM,+BAA+B,CAAA;AACpF,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAE1D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC3C,MAAuB,EACvB,IAAsB;IAEtB,MAAM,QAAQ,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAA;IAE5C,IAA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O,KAAK,CAAA;IACnE,KAAK,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,GAAG,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAC7D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACxC,IAAI,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,MAAM,CAAC,CAAC,CAAC;gBAAE,SAAS,KAAK,CAAA;QAC7C,CAAC;QACD,OAAO,IAAI,CAAA;IACZ,CAAC;IACD,OAAO,KAAK,CAAA;AACb,CAAC"}
|
package/dist/apply/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { applyP1SatIntent } from './applyIntent';
|
|
1
|
+
export { applyP1SatCreateAction, applyP1SatIntent } from './applyIntent';
|
|
2
2
|
export type { ApplyFn } from './registry';
|
|
3
3
|
export { P1SAT_APPLY_REGISTRY } from './registry';
|
|
4
4
|
export { applyInscribeSigma, sigmaAnchorKeyId } from './inscribeSigma';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apply/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/apply/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACxE,YAAY,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
package/dist/apply/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { applyP1SatIntent } from './applyIntent';
|
|
1
|
+
export { applyP1SatCreateAction, applyP1SatIntent } from './applyIntent';
|
|
2
2
|
export { P1SAT_APPLY_REGISTRY } from './registry';
|
|
3
3
|
export { applyInscribeSigma, sigmaAnchorKeyId } from './inscribeSigma';
|
|
4
4
|
export { applyOpnsRegister } from './opnsRegister';
|
package/dist/apply/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apply/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/apply/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AAExE,OAAO,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAA"}
|
|
@@ -7,7 +7,7 @@ import { type CreateActionArgs, type WalletInterface } from '@bsv/sdk';
|
|
|
7
7
|
export declare function sigmaAnchorKeyId(actionId: string): string;
|
|
8
8
|
/**
|
|
9
9
|
* Multi-step sigma inscribe apply on **base** wallet only:
|
|
10
|
-
* 1. Anchor createAction (noSend,
|
|
10
|
+
* 1. Anchor createAction (noSend, signAndProcess default)
|
|
11
11
|
* 2. Sigma-sign inscription script
|
|
12
12
|
* 3. Push anchor input + seal sigma script in place
|
|
13
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inscribeSigma.d.ts","sourceRoot":"","sources":["../../src/apply/inscribeSigma.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,gBAAgB,EAIrB,KAAK,eAAe,EACpB,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"inscribeSigma.d.ts","sourceRoot":"","sources":["../../src/apply/inscribeSigma.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,gBAAgB,EAIrB,KAAK,eAAe,EACpB,MAAM,UAAU,CAAA;AAUjB;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAEzD;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACvC,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,gBAAgB,GACpB,OAAO,CAAC,IAAI,CAAC,CAgGf"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ORDINALS_BASKET, P1SAT_PROTOCOL, SIGMA_BASKET } from '@1sat/types';
|
|
2
2
|
import { P2PKH, PublicKey, Script, } from '@bsv/sdk';
|
|
3
|
+
import { PENDING_RESOLVED_SPENDS_KEY, } from '../pipeline/spendTargets';
|
|
3
4
|
import { sealSigma } from '../signing/sigma';
|
|
4
|
-
import {
|
|
5
|
+
import { stampManagedOutputIds } from '../utils/createTrackedAction';
|
|
5
6
|
/**
|
|
6
7
|
* Anchor keyID for a given action. Derived from the action id so the action's
|
|
7
8
|
* sign callback and apply arrive at the same value independently, and so the
|
|
@@ -12,7 +13,7 @@ export function sigmaAnchorKeyId(actionId) {
|
|
|
12
13
|
}
|
|
13
14
|
/**
|
|
14
15
|
* Multi-step sigma inscribe apply on **base** wallet only:
|
|
15
|
-
* 1. Anchor createAction (noSend,
|
|
16
|
+
* 1. Anchor createAction (noSend, signAndProcess default)
|
|
16
17
|
* 2. Sigma-sign inscription script
|
|
17
18
|
* 3. Push anchor input + seal sigma script in place
|
|
18
19
|
*/
|
|
@@ -34,7 +35,7 @@ export async function applyInscribeSigma(wallet, args) {
|
|
|
34
35
|
chain: 'main',
|
|
35
36
|
isBaseWallet: true,
|
|
36
37
|
};
|
|
37
|
-
const anchorKeyID = sigmaAnchorKeyId(
|
|
38
|
+
const anchorKeyID = sigmaAnchorKeyId(stampManagedOutputIds(args));
|
|
38
39
|
const { publicKey: anchorPubKey } = await wallet.getPublicKey({
|
|
39
40
|
protocolID: P1SAT_PROTOCOL,
|
|
40
41
|
keyID: anchorKeyID,
|
|
@@ -43,7 +44,11 @@ export async function applyInscribeSigma(wallet, args) {
|
|
|
43
44
|
});
|
|
44
45
|
const anchorAddress = PublicKey.fromString(anchorPubKey).toAddress();
|
|
45
46
|
const anchorLockingScript = new P2PKH().lock(anchorAddress);
|
|
46
|
-
const
|
|
47
|
+
const anchorCi = JSON.stringify({
|
|
48
|
+
protocolID: P1SAT_PROTOCOL,
|
|
49
|
+
keyID: anchorKeyID,
|
|
50
|
+
});
|
|
51
|
+
const anchorResult = await wallet.createAction({
|
|
47
52
|
description: 'Sigma anchor output',
|
|
48
53
|
outputs: [
|
|
49
54
|
{
|
|
@@ -51,10 +56,7 @@ export async function applyInscribeSigma(wallet, args) {
|
|
|
51
56
|
satoshis: 2,
|
|
52
57
|
outputDescription: 'Sigma anchor',
|
|
53
58
|
basket: SIGMA_BASKET,
|
|
54
|
-
customInstructions:
|
|
55
|
-
protocolID: P1SAT_PROTOCOL,
|
|
56
|
-
keyID: anchorKeyID,
|
|
57
|
-
}),
|
|
59
|
+
customInstructions: anchorCi,
|
|
58
60
|
},
|
|
59
61
|
],
|
|
60
62
|
options: {
|
|
@@ -62,14 +64,11 @@ export async function applyInscribeSigma(wallet, args) {
|
|
|
62
64
|
randomizeOutputs: false,
|
|
63
65
|
acceptDelayedBroadcast: true,
|
|
64
66
|
},
|
|
65
|
-
}
|
|
67
|
+
});
|
|
66
68
|
if (!anchorResult.txid || !anchorResult.tx) {
|
|
67
69
|
throw new Error('ordinal.inscribe-sigma apply: anchor failed');
|
|
68
70
|
}
|
|
69
71
|
const sigmaScript = await sealSigma(ctx, placeholderScript, { txid: anchorResult.txid, vout: 0 }, 0, 0);
|
|
70
|
-
if (sigmaScript.toHex().length !== out.lockingScript.length) {
|
|
71
|
-
throw new Error('ordinal.inscribe-sigma apply: sealed script size differs from placeholder');
|
|
72
|
-
}
|
|
73
72
|
out.lockingScript = sigmaScript.toHex();
|
|
74
73
|
// Mutate inputs array in place (or initialize then push).
|
|
75
74
|
if (!args.inputs) {
|
|
@@ -81,7 +80,7 @@ export async function applyInscribeSigma(wallet, args) {
|
|
|
81
80
|
inputDescription: 'Sigma anchor',
|
|
82
81
|
unlockingScriptLength: 108,
|
|
83
82
|
});
|
|
84
|
-
args.inputBEEF = anchorResult.tx;
|
|
83
|
+
args.inputBEEF = Array.from(anchorResult.tx);
|
|
85
84
|
args.options = {
|
|
86
85
|
...args.options,
|
|
87
86
|
randomizeOutputs: false,
|
|
@@ -91,5 +90,13 @@ export async function applyInscribeSigma(wallet, args) {
|
|
|
91
90
|
trustSelf: 'known',
|
|
92
91
|
sendWith: [anchorResult.txid],
|
|
93
92
|
};
|
|
93
|
+
// Output record for finalize — we just created it; no DB round-trip.
|
|
94
|
+
const anchorRecord = {
|
|
95
|
+
outpoint: `${anchorResult.txid}.0`,
|
|
96
|
+
customInstructions: anchorCi,
|
|
97
|
+
};
|
|
98
|
+
const stash = args;
|
|
99
|
+
const prev = stash[PENDING_RESOLVED_SPENDS_KEY] ?? [];
|
|
100
|
+
stash[PENDING_RESOLVED_SPENDS_KEY] = [...prev, anchorRecord];
|
|
94
101
|
}
|
|
95
102
|
//# sourceMappingURL=inscribeSigma.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inscribeSigma.js","sourceRoot":"","sources":["../../src/apply/inscribeSigma.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EAEN,KAAK,EACL,SAAS,EACT,MAAM,GAEN,MAAM,UAAU,CAAA;AACjB,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,OAAO,
|
|
1
|
+
{"version":3,"file":"inscribeSigma.js","sourceRoot":"","sources":["../../src/apply/inscribeSigma.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC3E,OAAO,EAEN,KAAK,EACL,SAAS,EACT,MAAM,GAEN,MAAM,UAAU,CAAA;AACjB,OAAO,EAEN,2BAA2B,GAE3B,MAAM,0BAA0B,CAAA;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AAE5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAA;AAEpE;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,QAAgB;IAChD,OAAO,UAAU,QAAQ,EAAE,CAAA;AAC5B,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACvC,MAAuB,EACvB,IAAsB;IAEtB,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAA;IAC5B,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,+CAA+C,CAAC,CAAA;IACjE,CAAC;IACD,MAAM,GAAG,GACR,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,eAAe,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAA;IAChE,IAAI,CAAC,GAAG,EAAE,aAAa,EAAE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M,IAAI,GAAG,KAAK,CAAC,2BAA2B,CAAC,IAAI,EAAE,CAAA;IACrD,KAAK,CAAC,2BAA2B,CAAC,GAAG,CAAC,GAAG,IAAI,EAAE,YAAY,CAAC,CAAA;AAC7D,CAAC"}
|
package/dist/apply/prepare.d.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import type { CreateActionArgs } from '@bsv/sdk';
|
|
2
2
|
import type { OneSatContext } from '../types';
|
|
3
|
+
export interface PrepareP1SatOptions {
|
|
4
|
+
/** @deprecated Dispatch lives on executeTrackedAction. Ignored. */
|
|
5
|
+
usePermissionModule?: boolean;
|
|
6
|
+
/** @deprecated use usePermissionModule */
|
|
7
|
+
useOneSatModule?: boolean;
|
|
8
|
+
/** @deprecated use usePermissionModule */
|
|
9
|
+
useModule?: boolean;
|
|
10
|
+
/** @deprecated Ignored. */
|
|
11
|
+
permissionScheme?: string;
|
|
12
|
+
}
|
|
3
13
|
/**
|
|
4
|
-
*
|
|
5
|
-
* Mutates `args` in place (labels + any apply rewrite).
|
|
6
|
-
*
|
|
7
|
-
* The action id is stamped here, ahead of apply, so both the base-wallet path
|
|
8
|
-
* (apply below) and the gated path (apply inside the module) see the same
|
|
9
|
-
* value and derive identical intermediate keyIDs.
|
|
14
|
+
* @deprecated No-op. Ids/seals run in apply; module labels on executeTrackedAction.
|
|
10
15
|
*/
|
|
11
|
-
export declare function prepareP1SatArgs(ctx: OneSatContext, args: CreateActionArgs,
|
|
16
|
+
export declare function prepareP1SatArgs(ctx: OneSatContext, args: CreateActionArgs, _opts?: PrepareP1SatOptions): Promise<CreateActionArgs>;
|
|
12
17
|
//# sourceMappingURL=prepare.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/apply/prepare.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/apply/prepare.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAChD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAE7C,MAAM,WAAW,mBAAmB;IACnC,mEAAmE;IACnE,mBAAmB,CAAC,EAAE,OAAO,CAAA;IAC7B,0CAA0C;IAC1C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,2BAA2B;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAA;CACzB;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CACrC,GAAG,EAAE,aAAa,EAClB,IAAI,EAAE,gBAAgB,EACtB,KAAK,GAAE,mBAAwB,GAC7B,OAAO,CAAC,gBAAgB,CAAC,CAG3B"}
|
package/dist/apply/prepare.js
CHANGED
|
@@ -1,26 +1,8 @@
|
|
|
1
|
-
import { buildIntentLabel, parseIntentLabel, } from '@1sat/types';
|
|
2
|
-
import { ensureActionId } from '../utils/createTrackedAction';
|
|
3
|
-
import { applyP1SatIntent } from './applyIntent';
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
* Mutates `args` in place (labels + any apply rewrite).
|
|
7
|
-
*
|
|
8
|
-
* The action id is stamped here, ahead of apply, so both the base-wallet path
|
|
9
|
-
* (apply below) and the gated path (apply inside the module) see the same
|
|
10
|
-
* value and derive identical intermediate keyIDs.
|
|
2
|
+
* @deprecated No-op. Ids/seals run in apply; module labels on executeTrackedAction.
|
|
11
3
|
*/
|
|
12
|
-
export async function prepareP1SatArgs(ctx, args,
|
|
13
|
-
|
|
14
|
-
if (!parseIntentLabel(labels)) {
|
|
15
|
-
args.labels = [buildIntentLabel(intent), ...labels];
|
|
16
|
-
}
|
|
17
|
-
ensureActionId(args);
|
|
18
|
-
if (ctx.isBaseWallet) {
|
|
19
|
-
// The shared entrypoint, not the registry directly — it dispatches by
|
|
20
|
-
// intent *and* stamps script-derived tags afterwards. Calling the registry
|
|
21
|
-
// here would skip the stamping on every base-wallet action.
|
|
22
|
-
await applyP1SatIntent(ctx.wallet, args, intent);
|
|
23
|
-
}
|
|
4
|
+
export async function prepareP1SatArgs(ctx, args, _opts = {}) {
|
|
5
|
+
void ctx;
|
|
24
6
|
return args;
|
|
25
7
|
}
|
|
26
8
|
//# sourceMappingURL=prepare.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/apply/prepare.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"prepare.js","sourceRoot":"","sources":["../../src/apply/prepare.ts"],"names":[],"mappings":"AAcA;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACrC,GAAkB,EAClB,IAAsB,EACtB,QAA6B,EAAE;IAE/B,KAAK,GAAG,CAAA;IACR,OAAO,IAAI,CAAA;AACZ,CAAC"}
|
package/dist/apply/registry.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import type { CreateActionArgs, WalletInterface } from '@bsv/sdk';
|
|
2
2
|
export type ApplyFn = (wallet: WalletInterface, args: CreateActionArgs) => Promise<void>;
|
|
3
3
|
/**
|
|
4
|
-
* Intent
|
|
5
|
-
*
|
|
4
|
+
* @deprecated Intent registry retired — apply is script-driven via
|
|
5
|
+
* {@link applyP1SatCreateAction}. Kept as a single default entry for any
|
|
6
|
+
* leftover callers.
|
|
6
7
|
*/
|
|
7
8
|
export declare const P1SAT_APPLY_REGISTRY: Record<string, ApplyFn>;
|
|
8
9
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/apply/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/apply/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAGjE,MAAM,MAAM,OAAO,GAAG,CACrB,MAAM,EAAE,eAAe,EACvB,IAAI,EAAE,gBAAgB,KAClB,OAAO,CAAC,IAAI,CAAC,CAAA;AAElB;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAIxD,CAAA"}
|
package/dist/apply/registry.js
CHANGED
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { applyOpnsRegister } from './opnsRegister';
|
|
3
|
-
import { applyValidateOnly } from './validateOnly';
|
|
1
|
+
import { applyP1SatCreateAction } from './applyIntent';
|
|
4
2
|
/**
|
|
5
|
-
* Intent
|
|
6
|
-
*
|
|
3
|
+
* @deprecated Intent registry retired — apply is script-driven via
|
|
4
|
+
* {@link applyP1SatCreateAction}. Kept as a single default entry for any
|
|
5
|
+
* leftover callers.
|
|
7
6
|
*/
|
|
8
7
|
export const P1SAT_APPLY_REGISTRY = {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
'opns.transfer': applyValidateOnly,
|
|
13
|
-
'opns.cancel-listing': applyValidateOnly,
|
|
14
|
-
'opns.purchase': applyValidateOnly,
|
|
15
|
-
'ordinal.transfer': applyValidateOnly,
|
|
16
|
-
'ordinal.list': applyValidateOnly,
|
|
17
|
-
'ordinal.cancel-listing': applyValidateOnly,
|
|
18
|
-
'ordinal.purchase': applyValidateOnly,
|
|
19
|
-
'ordinal.burn': applyValidateOnly,
|
|
20
|
-
'ordinal.inscribe': applyValidateOnly,
|
|
21
|
-
'ordinal.inscribe-sigma': applyInscribeSigma,
|
|
22
|
-
'ordinal.mint-collection': applyValidateOnly,
|
|
23
|
-
'ordinal.mint-item': applyValidateOnly,
|
|
24
|
-
'lock.lock': applyValidateOnly,
|
|
25
|
-
'lock.unlock': applyValidateOnly,
|
|
26
|
-
'bsv21.transfer': applyValidateOnly,
|
|
27
|
-
'bsv21.purchase': applyValidateOnly,
|
|
28
|
-
'bsv21.mint': applyValidateOnly,
|
|
29
|
-
'bsv21.deploy': applyValidateOnly,
|
|
8
|
+
default: async (wallet, args) => {
|
|
9
|
+
await applyP1SatCreateAction(wallet, args);
|
|
10
|
+
},
|
|
30
11
|
};
|
|
31
12
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/apply/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/apply/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAA;AAOtD;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAA4B;IAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE;QAC/B,MAAM,sBAAsB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAA;IAC3C,CAAC;CACD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stampScriptTags.d.ts","sourceRoot":"","sources":["../../src/apply/stampScriptTags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAU,MAAM,UAAU,CAAA;AAExD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"stampScriptTags.d.ts","sourceRoot":"","sources":["../../src/apply/stampScriptTags.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,gBAAgB,EAAU,MAAM,UAAU,CAAA;AAExD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAsCnE"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Lock, OrdLock } from '@1sat/templates';
|
|
1
|
+
import { Lock, OrdLock, Sigma } from '@1sat/templates';
|
|
2
2
|
import { Script } from '@bsv/sdk';
|
|
3
3
|
/**
|
|
4
4
|
* Rewrite caller-asserted tags from the locking scripts they describe.
|
|
@@ -42,6 +42,13 @@ export function stampScriptDerivedTags(args) {
|
|
|
42
42
|
`until:${lock.until}`,
|
|
43
43
|
];
|
|
44
44
|
}
|
|
45
|
+
const address = Sigma.parseFromScript(script).find((s) => s.address && !/^[\0]+$/.test(s.address))?.address;
|
|
46
|
+
if (address) {
|
|
47
|
+
out.tags = [
|
|
48
|
+
...(out.tags ?? []).filter((t) => !t.startsWith('creator:')),
|
|
49
|
+
`creator:${address}`,
|
|
50
|
+
];
|
|
51
|
+
}
|
|
45
52
|
}
|
|
46
53
|
}
|
|
47
54
|
//# sourceMappingURL=stampScriptTags.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stampScriptTags.js","sourceRoot":"","sources":["../../src/apply/stampScriptTags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"stampScriptTags.js","sourceRoot":"","sources":["../../src/apply/stampScriptTags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAA;AACtD,OAAO,EAAyB,MAAM,EAAE,MAAM,UAAU,CAAA;AAExD;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAAsB;IAC5D,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;QACtC,IAAI,CAAC,GAAG,CAAC,aAAa;YAAE,SAAQ;QAEhC,IAAI,MAAc,CAAA;QAClB,IAAI,CAAC;YACJ,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CA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F,CAAC;AACF,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EACX,wBAAwB,EAExB,mBAAmB,EAEnB,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,MAAM,aAAa,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/collections/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EACX,wBAAwB,EAExB,mBAAmB,EAEnB,gBAAgB,EAChB,YAAY,EACZ,OAAO,EACP,MAAM,aAAa,CAAA;AAUpB,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAiB,MAAM,UAAU,CAAA;AAYpE,MAAM,WAAW,mBAAoB,SAAQ,aAAa;IACzD,qDAAqD;IACrD,aAAa,EAAE,MAAM,CAAA;IACrB,8CAA8C;IAC9C,WAAW,EAAE,MAAM,CAAA;IACnB,sBAAsB;IACtB,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,WAAW,EAAE,MAAM,CAAA;IACnB,8CAA8C;IAC9C,QAAQ,EAAE,MAAM,CAAA;IAChB,iCAAiC;IACjC,MAAM,CAAC,EAAE,gBAAgB,CAAA;IACzB,6BAA6B;IAC7B,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,qCAAqC;IACrC,SAAS,CAAC,EAAE,OAAO,EAAE,CAAA;IACrB,6CAA6C;IAC7C,GAAG,CAAC,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,oBAAoB;IACpC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,oDAAoD;IACpD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,uBAAwB,SAAQ,aAAa;IAC7D,kCAAkC;IACl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