@1sat/permission-module 0.0.27 → 0.0.29
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/handlers.d.ts +2 -3
- package/dist/handlers.d.ts.map +1 -1
- package/dist/handlers.js +4 -20
- package/dist/handlers.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/package.json +4 -4
- package/dist/placeholder.d.ts +0 -50
- package/dist/placeholder.d.ts.map +0 -1
- package/dist/placeholder.js +0 -108
- package/dist/placeholder.js.map +0 -1
package/dist/handlers.d.ts
CHANGED
|
@@ -12,10 +12,9 @@ interface HandlerDeps {
|
|
|
12
12
|
/**
|
|
13
13
|
* createAction onRequest:
|
|
14
14
|
* 1. Admin originator → return args unchanged.
|
|
15
|
-
* 2.
|
|
16
|
-
* 3. Enrich the intent — look up input assets in the wallet by their
|
|
15
|
+
* 2. Enrich the intent — look up input assets in the wallet by their
|
|
17
16
|
* `'p 1sat input <basket> <id>'` labels (trusted records, not dApp-supplied).
|
|
18
|
-
*
|
|
17
|
+
* 3. Prompt user with the structured intent. Reject throws.
|
|
19
18
|
*/
|
|
20
19
|
export declare function handleCreateActionRequest(deps: HandlerDeps, args: CreateActionArgs, originator: string): Promise<CreateActionArgs>;
|
|
21
20
|
/**
|
package/dist/handlers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,gBAAgB,EAGhB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,MAAM,UAAU,CAAA;AAGjB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,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;;;;;GAeG;AACH,wBAAsB,kBAAkB,CACvC,IAAI,EAAE,WAAW,EACjB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,GACvB,OAAO,CAAC,IAAI,CAAC,CAsDf;AAOD;;GAEG;AACH,wBAAsB,wBAAwB,CAC7C,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,MAAM,GAChB,OAAO,CAAC,eAAe,CAAC,CAG1B;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CACnD,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,qBAAqB,EAC3B,UAAU,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC,CAShC"}
|
package/dist/handlers.js
CHANGED
|
@@ -2,24 +2,18 @@ import { Transaction } from '@bsv/sdk';
|
|
|
2
2
|
import { P1SAT_BASKET_PREFIX } from '@1sat/types';
|
|
3
3
|
import { enrichIntent } from './enrichIntent';
|
|
4
4
|
import { computeHashOutputs } from './hashOutputs';
|
|
5
|
-
import { substitutePlaceholders } from './placeholder';
|
|
6
5
|
import { MIN_BIP143_PREIMAGE_BYTES, parsePreimage } from './sighashParser';
|
|
7
6
|
/**
|
|
8
7
|
* createAction onRequest:
|
|
9
8
|
* 1. Admin originator → return args unchanged.
|
|
10
|
-
* 2.
|
|
11
|
-
* 3. Enrich the intent — look up input assets in the wallet by their
|
|
9
|
+
* 2. Enrich the intent — look up input assets in the wallet by their
|
|
12
10
|
* `'p 1sat input <basket> <id>'` labels (trusted records, not dApp-supplied).
|
|
13
|
-
*
|
|
11
|
+
* 3. Prompt user with the structured intent. Reject throws.
|
|
14
12
|
*/
|
|
15
13
|
export async function handleCreateActionRequest(deps, args, originator) {
|
|
16
14
|
if (isAdmin(deps, originator))
|
|
17
15
|
return args;
|
|
18
|
-
|
|
19
|
-
if (outputs.length > 0) {
|
|
20
|
-
outputs = await substitutePlaceholders(outputs, deps.wallet, (refVin) => resolveInputOutpoint(args.inputs ?? [], refVin));
|
|
21
|
-
}
|
|
22
|
-
const enriched = await enrichIntent(deps.wallet, { ...args, outputs });
|
|
16
|
+
const enriched = await enrichIntent(deps.wallet, args);
|
|
23
17
|
const approved = await deps.promptHandler({
|
|
24
18
|
kind: 'transaction',
|
|
25
19
|
originator,
|
|
@@ -41,7 +35,7 @@ export async function handleCreateActionRequest(deps, args, originator) {
|
|
|
41
35
|
if (!approved) {
|
|
42
36
|
throw new Error('1Sat permission module: user rejected the transaction.');
|
|
43
37
|
}
|
|
44
|
-
return
|
|
38
|
+
return args;
|
|
45
39
|
}
|
|
46
40
|
/**
|
|
47
41
|
* Pre-resolve content URLs for each asset that carries an `origin:` tag,
|
|
@@ -162,16 +156,6 @@ export async function handleGetPublicKeyRequest(_deps, args, _originator) {
|
|
|
162
156
|
function isAdmin(deps, originator) {
|
|
163
157
|
return !!deps.adminOriginator && originator === deps.adminOriginator;
|
|
164
158
|
}
|
|
165
|
-
function resolveInputOutpoint(inputs, refVin) {
|
|
166
|
-
const inp = inputs[refVin];
|
|
167
|
-
if (!inp?.outpoint)
|
|
168
|
-
return null;
|
|
169
|
-
const [txid, voutStr] = inp.outpoint.split('.');
|
|
170
|
-
const vout = Number.parseInt(voutStr, 10);
|
|
171
|
-
if (!txid || Number.isNaN(vout))
|
|
172
|
-
return null;
|
|
173
|
-
return { txid, vout };
|
|
174
|
-
}
|
|
175
159
|
function stripInputForPrompt(input) {
|
|
176
160
|
return {
|
|
177
161
|
outpoint: input.outpoint,
|
package/dist/handlers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":"AAWA,OAAO,
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../src/handlers.ts"],"names":[],"mappings":"AAWA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aA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M,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAA;AAC9C,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,wBAAwB,CAC7C,IAAiB,EACjB,IAAqB,EACrB,UAAkB;IAElB,MAAM,kBAAkB,CAAC,IAAI,EAAE,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;IAC5E,OAAO,IAAI,CAAA;AACZ,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,8BAA8B,CACnD,IAAiB,EACjB,IAA2B,EAC3B,UAAkB;IAElB,MAAM,OAAO,GAAa,EAAE,CAAA;IAC5B,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,OAAO,IAAI,EAAE,EAAE,CAAC;QACtC,IAAI,GAAG,CAAC,QAAQ,KAAK,kBAAkB,IAAI,GAAG,CAAC,mBAAmB,EAAE,MAAM,EAAE,CAAC;YAC5E,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAA;QAC7C,CAAC;IACF,CAAC;IACD,MAAM,kBAAkB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IACnD,OAAO,IAAI,CAAA;AACZ,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { createOneSatPermissionModule, type OneSatPermissionModule, type PermissionsModule, } from './createOneSatPermissionModule';
|
|
2
2
|
export { CommitmentCache } from './commitmentCache';
|
|
3
3
|
export { computeHashOutputs } from './hashOutputs';
|
|
4
|
-
export { aipPlaceholderBytes, sigmaPlaceholderBytes, substitutePlaceholders, } from './placeholder';
|
|
5
4
|
export { MIN_BIP143_PREIMAGE_BYTES, parsePreimage, type ParsedPreimage, } from './sighashParser';
|
|
6
5
|
export { DEFAULT_COMMITMENT_TTL_SECONDS, type BasketAccessRequest, type CapturedCommitment, type CreateOneSatPermissionModuleArgs, type PromptHandler, type PromptKind, type PromptRequest, } from './types';
|
|
7
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,4BAA4B,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,GACtB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,4BAA4B,EAC5B,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,GACtB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EACN,yBAAyB,EACzB,aAAa,EACb,KAAK,cAAc,GACnB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,8BAA8B,EAC9B,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gCAAgC,EACrC,KAAK,aAAa,EAClB,KAAK,UAAU,EACf,KAAK,aAAa,GAClB,MAAM,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export { createOneSatPermissionModule, } from './createOneSatPermissionModule';
|
|
2
2
|
export { CommitmentCache } from './commitmentCache';
|
|
3
3
|
export { computeHashOutputs } from './hashOutputs';
|
|
4
|
-
export { aipPlaceholderBytes, sigmaPlaceholderBytes, substitutePlaceholders, } from './placeholder';
|
|
5
4
|
export { MIN_BIP143_PREIMAGE_BYTES, parsePreimage, } from './sighashParser';
|
|
6
5
|
export { DEFAULT_COMMITMENT_TTL_SECONDS, } from './types';
|
|
7
6
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,4BAA4B,GAG5B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EACN,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,4BAA4B,GAG5B,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAA;AAClD,OAAO,EACN,yBAAyB,EACzB,aAAa,GAEb,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,8BAA8B,GAO9B,MAAM,SAAS,CAAA"}
|
package/dist/types.d.ts
CHANGED
|
@@ -60,8 +60,8 @@ export type PromptHandler = (request: PromptRequest) => Promise<boolean>;
|
|
|
60
60
|
export interface CreateOneSatPermissionModuleArgs {
|
|
61
61
|
/**
|
|
62
62
|
* The underlying wallet (NOT the WalletPermissionsManager wrapper).
|
|
63
|
-
* The module uses this for
|
|
64
|
-
*
|
|
63
|
+
* The module uses this for any internal derivations that should bypass
|
|
64
|
+
* the permission flow.
|
|
65
65
|
*/
|
|
66
66
|
wallet: WalletInterface;
|
|
67
67
|
/** UI callback for prompting the user. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1sat/permission-module",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
4
|
"description": "1Sat permission module for WalletPermissionsManager — gates createSignature with hashOutputs commitments captured at createAction time",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
],
|
|
30
30
|
"license": "MIT",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@1sat/types": "0.0.
|
|
33
|
-
"@1sat/actions": "0.0.
|
|
34
|
-
"@1sat/wallet": "0.0.
|
|
32
|
+
"@1sat/types": "0.0.31",
|
|
33
|
+
"@1sat/actions": "0.0.166",
|
|
34
|
+
"@1sat/wallet": "0.0.85"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@bsv/sdk": "^2.0.13",
|
package/dist/placeholder.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Placeholder substitution: SDK actions that need an AIP or Sigma signature
|
|
3
|
-
* embedded in an output script append a marker push at the script tail.
|
|
4
|
-
* The module detects the marker, strips it, and runs the appropriate
|
|
5
|
-
* signing helper to produce the real trailing pushes — using the underlying
|
|
6
|
-
* wallet directly so the inner signature call doesn't re-prompt.
|
|
7
|
-
*
|
|
8
|
-
* Marker format (UTF-8 bytes pushed as a single data push at the script tail):
|
|
9
|
-
*
|
|
10
|
-
* 1SATPM:AIP — needs BAP-AIP signature
|
|
11
|
-
* 1SATPM:SIGMA:<targetVout>:<refVin> — needs Sigma signature
|
|
12
|
-
*
|
|
13
|
-
* Example: a BSocial post action constructs the OP_RETURN with all data
|
|
14
|
-
* pushes, then appends a single push of `'1SATPM:AIP'`. The module sees
|
|
15
|
-
* this trailing push, removes it, calls `applyBapAip` on the resulting
|
|
16
|
-
* script, and writes the modified locking script back to the createAction
|
|
17
|
-
* args before passing them to the underlying wallet.
|
|
18
|
-
*/
|
|
19
|
-
import type { CreateActionOutput, WalletInterface } from '@bsv/sdk';
|
|
20
|
-
/**
|
|
21
|
-
* Build the AIP placeholder bytes the SDK should append.
|
|
22
|
-
*
|
|
23
|
-
* @param keyID - Optional explicit BAP keyID to sign with. Omit to use
|
|
24
|
-
* the current rotated signing key (resolved by the module
|
|
25
|
-
* via `resolveCurrentKeyId`).
|
|
26
|
-
*/
|
|
27
|
-
export declare const aipPlaceholderBytes: (keyID?: string) => number[];
|
|
28
|
-
/**
|
|
29
|
-
* Build the Sigma placeholder bytes the SDK should append.
|
|
30
|
-
*
|
|
31
|
-
* @param targetVout - which output of the new tx the signature covers
|
|
32
|
-
* @param refVin - which input of the new tx anchors the input hash
|
|
33
|
-
*/
|
|
34
|
-
export declare const sigmaPlaceholderBytes: (targetVout: number, refVin: number) => number[];
|
|
35
|
-
/**
|
|
36
|
-
* Inspect every output in `outputs` and substitute placeholder markers with
|
|
37
|
-
* real signatures. Mutation is returned via a fresh array; the caller writes
|
|
38
|
-
* it back into the createAction args before forwarding to the underlying
|
|
39
|
-
* wallet.
|
|
40
|
-
*
|
|
41
|
-
* For Sigma placeholders, the source-input outpoint is needed to compute
|
|
42
|
-
* the input hash. The caller supplies a `resolveSigmaInputOutpoint(refVin)`
|
|
43
|
-
* function that maps a vin index to `{ txid, vout }` (typically by reading
|
|
44
|
-
* `args.inputs[refVin].outpoint`).
|
|
45
|
-
*/
|
|
46
|
-
export declare function substitutePlaceholders(outputs: CreateActionOutput[], wallet: WalletInterface, resolveSigmaInputOutpoint: (refVin: number) => {
|
|
47
|
-
txid: string;
|
|
48
|
-
vout: number;
|
|
49
|
-
} | null): Promise<CreateActionOutput[]>;
|
|
50
|
-
//# sourceMappingURL=placeholder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"placeholder.d.ts","sourceRoot":"","sources":["../src/placeholder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAUH,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAGnE;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,QAAQ,MAAM,KAAG,MAAM,EAIzD,CAAA;AAEF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GACjC,YAAY,MAAM,EAClB,QAAQ,MAAM,KACZ,MAAM,EAIP,CAAA;AA0CF;;;;;;;;;;GAUG;AACH,wBAAsB,sBAAsB,CAC3C,OAAO,EAAE,kBAAkB,EAAE,EAC7B,MAAM,EAAE,eAAe,EACvB,yBAAyB,EAAE,CAC1B,MAAM,EAAE,MAAM,KACV;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,GACxC,OAAO,CAAC,kBAAkB,EAAE,CAAC,CA2B/B"}
|
package/dist/placeholder.js
DELETED
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Placeholder substitution: SDK actions that need an AIP or Sigma signature
|
|
3
|
-
* embedded in an output script append a marker push at the script tail.
|
|
4
|
-
* The module detects the marker, strips it, and runs the appropriate
|
|
5
|
-
* signing helper to produce the real trailing pushes — using the underlying
|
|
6
|
-
* wallet directly so the inner signature call doesn't re-prompt.
|
|
7
|
-
*
|
|
8
|
-
* Marker format (UTF-8 bytes pushed as a single data push at the script tail):
|
|
9
|
-
*
|
|
10
|
-
* 1SATPM:AIP — needs BAP-AIP signature
|
|
11
|
-
* 1SATPM:SIGMA:<targetVout>:<refVin> — needs Sigma signature
|
|
12
|
-
*
|
|
13
|
-
* Example: a BSocial post action constructs the OP_RETURN with all data
|
|
14
|
-
* pushes, then appends a single push of `'1SATPM:AIP'`. The module sees
|
|
15
|
-
* this trailing push, removes it, calls `applyBapAip` on the resulting
|
|
16
|
-
* script, and writes the modified locking script back to the createAction
|
|
17
|
-
* args before passing them to the underlying wallet.
|
|
18
|
-
*/
|
|
19
|
-
import { applyBapAip, applySigma } from '@1sat/actions';
|
|
20
|
-
import { P1SAT_AIP_PLACEHOLDER, P1SAT_AIP_PLACEHOLDER_PREFIX, P1SAT_PLACEHOLDER_PREFIX, P1SAT_SIGMA_PLACEHOLDER_PREFIX, } from '@1sat/types';
|
|
21
|
-
import { Script, Utils } from '@bsv/sdk';
|
|
22
|
-
/**
|
|
23
|
-
* Build the AIP placeholder bytes the SDK should append.
|
|
24
|
-
*
|
|
25
|
-
* @param keyID - Optional explicit BAP keyID to sign with. Omit to use
|
|
26
|
-
* the current rotated signing key (resolved by the module
|
|
27
|
-
* via `resolveCurrentKeyId`).
|
|
28
|
-
*/
|
|
29
|
-
export const aipPlaceholderBytes = (keyID) => Utils.toArray(keyID ? `${P1SAT_AIP_PLACEHOLDER_PREFIX}${keyID}` : P1SAT_AIP_PLACEHOLDER, 'utf8');
|
|
30
|
-
/**
|
|
31
|
-
* Build the Sigma placeholder bytes the SDK should append.
|
|
32
|
-
*
|
|
33
|
-
* @param targetVout - which output of the new tx the signature covers
|
|
34
|
-
* @param refVin - which input of the new tx anchors the input hash
|
|
35
|
-
*/
|
|
36
|
-
export const sigmaPlaceholderBytes = (targetVout, refVin) => Utils.toArray(`${P1SAT_SIGMA_PLACEHOLDER_PREFIX}${targetVout}:${refVin}`, 'utf8');
|
|
37
|
-
/** Read the trailing placeholder marker (if any) from a locking script. */
|
|
38
|
-
function readPlaceholder(scriptHex) {
|
|
39
|
-
const script = Script.fromHex(scriptHex);
|
|
40
|
-
const lastChunk = script.chunks[script.chunks.length - 1];
|
|
41
|
-
if (!lastChunk?.data || lastChunk.data.length === 0)
|
|
42
|
-
return null;
|
|
43
|
-
const text = Utils.toUTF8(Array.from(lastChunk.data));
|
|
44
|
-
if (!text.startsWith(P1SAT_PLACEHOLDER_PREFIX))
|
|
45
|
-
return null;
|
|
46
|
-
if (text === P1SAT_AIP_PLACEHOLDER)
|
|
47
|
-
return { kind: 'aip' };
|
|
48
|
-
if (text.startsWith(P1SAT_AIP_PLACEHOLDER_PREFIX)) {
|
|
49
|
-
const keyID = text.slice(P1SAT_AIP_PLACEHOLDER_PREFIX.length);
|
|
50
|
-
if (!keyID)
|
|
51
|
-
return { kind: 'aip' };
|
|
52
|
-
return { kind: 'aip', keyID };
|
|
53
|
-
}
|
|
54
|
-
if (text.startsWith(P1SAT_SIGMA_PLACEHOLDER_PREFIX)) {
|
|
55
|
-
const rest = text.slice(P1SAT_SIGMA_PLACEHOLDER_PREFIX.length);
|
|
56
|
-
const [voutStr, vinStr] = rest.split(':');
|
|
57
|
-
const targetVout = Number.parseInt(voutStr, 10);
|
|
58
|
-
const refVin = Number.parseInt(vinStr, 10);
|
|
59
|
-
if (Number.isNaN(targetVout) || Number.isNaN(refVin))
|
|
60
|
-
return null;
|
|
61
|
-
return { kind: 'sigma', targetVout, refVin };
|
|
62
|
-
}
|
|
63
|
-
return null;
|
|
64
|
-
}
|
|
65
|
-
/** Strip the trailing placeholder push from a script. */
|
|
66
|
-
function stripPlaceholder(scriptHex) {
|
|
67
|
-
const script = Script.fromHex(scriptHex);
|
|
68
|
-
return new Script(script.chunks.slice(0, -1));
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Inspect every output in `outputs` and substitute placeholder markers with
|
|
72
|
-
* real signatures. Mutation is returned via a fresh array; the caller writes
|
|
73
|
-
* it back into the createAction args before forwarding to the underlying
|
|
74
|
-
* wallet.
|
|
75
|
-
*
|
|
76
|
-
* For Sigma placeholders, the source-input outpoint is needed to compute
|
|
77
|
-
* the input hash. The caller supplies a `resolveSigmaInputOutpoint(refVin)`
|
|
78
|
-
* function that maps a vin index to `{ txid, vout }` (typically by reading
|
|
79
|
-
* `args.inputs[refVin].outpoint`).
|
|
80
|
-
*/
|
|
81
|
-
export async function substitutePlaceholders(outputs, wallet, resolveSigmaInputOutpoint) {
|
|
82
|
-
const ctx = { wallet, chain: 'main' };
|
|
83
|
-
const next = [];
|
|
84
|
-
for (const out of outputs) {
|
|
85
|
-
const info = readPlaceholder(out.lockingScript);
|
|
86
|
-
if (!info) {
|
|
87
|
-
next.push(out);
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
const stripped = stripPlaceholder(out.lockingScript);
|
|
91
|
-
let signed;
|
|
92
|
-
if (info.kind === 'aip') {
|
|
93
|
-
signed = await applyBapAip(ctx, stripped, info.keyID);
|
|
94
|
-
}
|
|
95
|
-
else {
|
|
96
|
-
const refVin = info.refVin ?? 0;
|
|
97
|
-
const targetVout = info.targetVout ?? next.length;
|
|
98
|
-
const outpoint = resolveSigmaInputOutpoint(refVin);
|
|
99
|
-
if (!outpoint) {
|
|
100
|
-
throw new Error(`1Sat permission module: cannot resolve input outpoint for Sigma placeholder (refVin=${refVin})`);
|
|
101
|
-
}
|
|
102
|
-
signed = await applySigma(ctx, stripped, outpoint, targetVout, refVin);
|
|
103
|
-
}
|
|
104
|
-
next.push({ ...out, lockingScript: signed.toHex() });
|
|
105
|
-
}
|
|
106
|
-
return next;
|
|
107
|
-
}
|
|
108
|
-
//# sourceMappingURL=placeholder.js.map
|
package/dist/placeholder.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"placeholder.js","sourceRoot":"","sources":["../src/placeholder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAEvD,OAAO,EACN,qBAAqB,EACrB,4BAA4B,EAC5B,wBAAwB,EACxB,8BAA8B,GAC9B,MAAM,aAAa,CAAA;AAEpB,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAExC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAc,EAAY,EAAE,CAC/D,KAAK,CAAC,OAAO,CACZ,KAAK,CAAC,CAAC,CAAC,GAAG,4BAA4B,GAAG,KAAK,EAAE,CAAC,CAAC,CAAC,qBAAqB,EACzE,MAAM,CACN,CAAA;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACpC,UAAkB,EAClB,MAAc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