@1sat/actions 0.0.115 → 0.0.117
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/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.d.ts +15 -0
- package/dist/cosign/finalize.d.ts.map +1 -0
- package/dist/cosign/finalize.js +123 -0
- package/dist/cosign/finalize.js.map +1 -0
- package/dist/cosign/index.d.ts +15 -0
- package/dist/cosign/index.d.ts.map +1 -0
- package/dist/cosign/index.js +15 -0
- package/dist/cosign/index.js.map +1 -0
- package/dist/cosign/prepare.d.ts +21 -0
- package/dist/cosign/prepare.d.ts.map +1 -0
- package/dist/cosign/prepare.js +282 -0
- package/dist/cosign/prepare.js.map +1 -0
- package/dist/cosign/types.d.ts +171 -0
- package/dist/cosign/types.d.ts.map +1 -0
- package/dist/cosign/types.js +37 -0
- package/dist/cosign/types.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/inscriptions/index.d.ts +3 -0
- package/dist/inscriptions/index.d.ts.map +1 -1
- package/dist/inscriptions/index.js +30 -27
- package/dist/inscriptions/index.js.map +1 -1
- package/dist/tokens/index.d.ts +80 -7
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +585 -41
- package/dist/tokens/index.js.map +1 -1
- package/dist/utils/internalizeBeef.d.ts.map +1 -1
- package/dist/utils/internalizeBeef.js +2 -1
- package/dist/utils/internalizeBeef.js.map +1 -1
- package/dist/utils/resolveDestination.d.ts +39 -0
- package/dist/utils/resolveDestination.d.ts.map +1 -0
- package/dist/utils/resolveDestination.js +43 -0
- package/dist/utils/resolveDestination.js.map +1 -0
- package/package.json +6 -6
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cosigner-validated BSV21 transfer types and session store contract.
|
|
3
|
+
*
|
|
4
|
+
* The flow is split into two requests on the cosigner backend:
|
|
5
|
+
* 1. prepareCosignBsv21Transfer — cosigner constructs the tx (cosign-wrapped
|
|
6
|
+
* transfer outputs + optional burn outputs), allocates sat-funding via
|
|
7
|
+
* its own BRC-100 wallet (createAction with signAndProcess: false),
|
|
8
|
+
* persists the session, and returns the signable BEEF + per-input
|
|
9
|
+
* sighashes for the sender to sign.
|
|
10
|
+
* 2. finalizeCosignBsv21Transfer — sender returns owner-side sigs, cosigner
|
|
11
|
+
* adds its own sig per cosign-wrapped input, calls signAction to broadcast
|
|
12
|
+
* via the wallet, then submits the resulting BEEF to the BSV21 overlay
|
|
13
|
+
* topic. Returns per-recipient customInstructions blobs the caller can
|
|
14
|
+
* drop into messagebox payloads.
|
|
15
|
+
*/
|
|
16
|
+
import type { WalletProtocol } from '@bsv/sdk';
|
|
17
|
+
/**
|
|
18
|
+
* BRC-29 protocol used to derive cosign-locked destination keys.
|
|
19
|
+
* Both cosigner (as constructor) and recipient (when later spending) derive
|
|
20
|
+
* with this protocol, with the cosigner's identityKey as counterparty.
|
|
21
|
+
*/
|
|
22
|
+
export declare const COSIGN_PROTOCOL_ID: WalletProtocol;
|
|
23
|
+
/** Default sighash byte for the cosigner's signature on cosign-wrapped inputs. */
|
|
24
|
+
export declare const COSIGN_DEFAULT_SIGHASH = 65;
|
|
25
|
+
/** A token UTXO being spent in a transfer. */
|
|
26
|
+
export interface CosignTokenInput {
|
|
27
|
+
/** Outpoint in `txid.vout` form. */
|
|
28
|
+
outpoint: string;
|
|
29
|
+
}
|
|
30
|
+
/** A transfer destination — the cosigner derives the recipient address internally. */
|
|
31
|
+
export interface CosignTransferDestination {
|
|
32
|
+
/** Recipient's BRC-100 identity public key (compressed, hex). */
|
|
33
|
+
recipientIdentityKey: string;
|
|
34
|
+
/** Token amount to send (bigint serialized as string for JSON safety). */
|
|
35
|
+
amount: string;
|
|
36
|
+
}
|
|
37
|
+
/** A burn intent — destroys tokens via a BSV21 op=burn output. */
|
|
38
|
+
export interface CosignTransferBurn {
|
|
39
|
+
/** Token amount to burn (bigint serialized as string). */
|
|
40
|
+
amount: string;
|
|
41
|
+
}
|
|
42
|
+
/** Per-cosign-wrapped-input metadata captured at prepare time and reused at finalize. */
|
|
43
|
+
export interface CosignSessionInputMeta {
|
|
44
|
+
inputIndex: number;
|
|
45
|
+
sourceTxid: string;
|
|
46
|
+
sourceVout: number;
|
|
47
|
+
/** Hex of the source output's locking script (the cosign script). */
|
|
48
|
+
sourceLockingScriptHex: string;
|
|
49
|
+
sourceSatoshis: number;
|
|
50
|
+
/** Hex of the SHA-256 (single, pre-double) sighash that the owner is asked to sign. */
|
|
51
|
+
sighashHex: string;
|
|
52
|
+
}
|
|
53
|
+
/** Per-destination metadata captured at prepare time. */
|
|
54
|
+
export interface CosignSessionDestinationMeta {
|
|
55
|
+
vout: number;
|
|
56
|
+
recipientIdentityKey: string;
|
|
57
|
+
amount: string;
|
|
58
|
+
/** Owner address used in the cosign locking script. */
|
|
59
|
+
address: string;
|
|
60
|
+
}
|
|
61
|
+
/** Session record persisted between /transfer/prepare and /transfer/finalize. */
|
|
62
|
+
export interface CosignTransferSession {
|
|
63
|
+
sessionId: string;
|
|
64
|
+
/** Reference returned by wallet.createAction — needed for signAction. */
|
|
65
|
+
reference: string;
|
|
66
|
+
/** Atomic BEEF of the unsigned tx (with funding inputs + change in place). */
|
|
67
|
+
signableBeef: number[];
|
|
68
|
+
tokenId: string;
|
|
69
|
+
senderIdentityKey: string;
|
|
70
|
+
/** Cosigner identityKey at the time of prepare (in case the wallet's identity changes). */
|
|
71
|
+
cosignerIdentityKey: string;
|
|
72
|
+
cosignerInputs: CosignSessionInputMeta[];
|
|
73
|
+
destinations: CosignSessionDestinationMeta[];
|
|
74
|
+
burns: Array<{
|
|
75
|
+
vout: number;
|
|
76
|
+
amount: string;
|
|
77
|
+
}>;
|
|
78
|
+
createdAt: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Pluggable session storage. The cosigner backend supplies an
|
|
82
|
+
* implementation backed by its persistence layer (e.g. Postgres). The
|
|
83
|
+
* in-memory implementation is suitable for tests + ephemeral demo usage.
|
|
84
|
+
*/
|
|
85
|
+
export interface CosignSessionStore {
|
|
86
|
+
save(session: CosignTransferSession): Promise<void>;
|
|
87
|
+
load(sessionId: string): Promise<CosignTransferSession | null>;
|
|
88
|
+
delete(sessionId: string): Promise<void>;
|
|
89
|
+
}
|
|
90
|
+
/** Default in-memory store. Not suitable for multi-process or persistence-across-restart. */
|
|
91
|
+
export declare class InMemoryCosignSessionStore implements CosignSessionStore {
|
|
92
|
+
private store;
|
|
93
|
+
save(session: CosignTransferSession): Promise<void>;
|
|
94
|
+
load(sessionId: string): Promise<CosignTransferSession | null>;
|
|
95
|
+
delete(sessionId: string): Promise<void>;
|
|
96
|
+
}
|
|
97
|
+
import type { OneSatServices } from '@1sat/client';
|
|
98
|
+
import type { WalletInterface } from '@bsv/sdk';
|
|
99
|
+
export interface PrepareCosignBsv21TransferInput {
|
|
100
|
+
/** The cosigner's BRC-100 wallet (e.g. @1sat/wallet-remote pointed at wallet.1sat.app). */
|
|
101
|
+
wallet: WalletInterface;
|
|
102
|
+
/** OneSatServices client for overlay operations. */
|
|
103
|
+
services: OneSatServices;
|
|
104
|
+
/** BSV21 token id this transfer is for. */
|
|
105
|
+
tokenId: string;
|
|
106
|
+
/** Cosign-wrapped UTXOs being spent. */
|
|
107
|
+
tokenInputs: CosignTokenInput[];
|
|
108
|
+
/**
|
|
109
|
+
* Atomic BEEF carrying every input's source tx + dependency chain, in the
|
|
110
|
+
* shape produced by Beef.toBinaryAtomic on the user's wallet.
|
|
111
|
+
*/
|
|
112
|
+
inputBEEF: number[];
|
|
113
|
+
/** Transfer destinations. May be empty if the request is burn-only. */
|
|
114
|
+
destinations: CosignTransferDestination[];
|
|
115
|
+
/** Optional burn outputs. */
|
|
116
|
+
burns?: CosignTransferBurn[];
|
|
117
|
+
/** Sender's identityKey, supplied by the auth middleware. */
|
|
118
|
+
senderIdentityKey: string;
|
|
119
|
+
/** Session store (cosigner backend supplies impl). */
|
|
120
|
+
sessionStore: CosignSessionStore;
|
|
121
|
+
}
|
|
122
|
+
export interface PrepareCosignBsv21TransferResult {
|
|
123
|
+
sessionId: string;
|
|
124
|
+
/** Atomic BEEF of the unsigned tx (with cosigner's funding inputs + change in place). */
|
|
125
|
+
signableBeef: number[];
|
|
126
|
+
/** wallet.createAction reference — opaque to the user. Backend reuses at finalize time. */
|
|
127
|
+
reference: string;
|
|
128
|
+
/**
|
|
129
|
+
* Sighashes the sender's wallet must sign with the owner key for each
|
|
130
|
+
* cosign-wrapped input. SIGHASH = SIGHASH_ALL | SIGHASH_FORKID (0x41).
|
|
131
|
+
* The wallet should sign single-SHA256 of these (the script interpreter
|
|
132
|
+
* applies the second SHA-256 internally during verification).
|
|
133
|
+
*/
|
|
134
|
+
sighashes: Array<{
|
|
135
|
+
inputIndex: number;
|
|
136
|
+
sighashHex: string;
|
|
137
|
+
}>;
|
|
138
|
+
}
|
|
139
|
+
/** Owner signature for one cosign-wrapped input. */
|
|
140
|
+
export interface CosignOwnerSig {
|
|
141
|
+
inputIndex: number;
|
|
142
|
+
/** DER-encoded ECDSA signature, hex. */
|
|
143
|
+
sigHex: string;
|
|
144
|
+
/** Owner's compressed public key, hex. */
|
|
145
|
+
ownerPubkeyHex: string;
|
|
146
|
+
}
|
|
147
|
+
export interface FinalizeCosignBsv21TransferInput {
|
|
148
|
+
wallet: WalletInterface;
|
|
149
|
+
services: OneSatServices;
|
|
150
|
+
sessionId: string;
|
|
151
|
+
ownerSigs: CosignOwnerSig[];
|
|
152
|
+
sessionStore: CosignSessionStore;
|
|
153
|
+
}
|
|
154
|
+
/** Per-recipient delivery payload — backend forwards via messagebox. */
|
|
155
|
+
export interface CosignRecipientPayload {
|
|
156
|
+
identityKey: string;
|
|
157
|
+
vout: number;
|
|
158
|
+
amount: string;
|
|
159
|
+
/** JSON string. Recipient passes this through to internalizeAction. */
|
|
160
|
+
customInstructions: string;
|
|
161
|
+
}
|
|
162
|
+
export interface FinalizeCosignBsv21TransferResult {
|
|
163
|
+
txid: string;
|
|
164
|
+
/** Final atomic BEEF (signed, broadcast, admitted-or-pending). */
|
|
165
|
+
beef: number[];
|
|
166
|
+
/** Status from the overlay submit step. */
|
|
167
|
+
overlayStatus: string;
|
|
168
|
+
/** Per-recipient delivery payloads for messagebox dispatch. */
|
|
169
|
+
recipients: CosignRecipientPayload[];
|
|
170
|
+
}
|
|
171
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/cosign/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAE9C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,cAA8B,CAAA;AAE/D,kFAAkF;AAClF,eAAO,MAAM,sBAAsB,KAAO,CAAA;AAE1C,8CAA8C;AAC9C,MAAM,WAAW,gBAAgB;IAChC,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAA;CAChB;AAED,sFAAsF;AACtF,MAAM,WAAW,yBAAyB;IACzC,iEAAiE;IACjE,oBAAoB,EAAE,MAAM,CAAA;IAC5B,0EAA0E;IAC1E,MAAM,EAAE,MAAM,CAAA;CACd;AAED,kEAAkE;AAClE,MAAM,WAAW,kBAAkB;IAClC,0DAA0D;IAC1D,MAAM,EAAE,MAAM,CAAA;CACd;AAMD,yFAAyF;AACzF,MAAM,WAAW,sBAAsB;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,qEAAqE;IACrE,sBAAsB,EAAE,MAAM,CAAA;IAC9B,cAAc,EAAE,MAAM,CAAA;IACtB,uFAAuF;IACvF,UAAU,E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,cAAc,EAAE,CAAA;IAC3B,YAAY,EAAE,kBAAkB,CAAA;CAChC;AAED,wEAAwE;AACxE,MAAM,WAAW,sBAAsB;IACtC,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,uEAAuE;IACvE,kBAAkB,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,WAAW,iCAAiC;IACjD,IAAI,EAAE,MAAM,CAAA;IACZ,kEAAkE;IAClE,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,2CAA2C;IAC3C,aAAa,EAAE,MAAM,CAAA;IACrB,+DAA+D;IAC/D,UAAU,EAAE,sBAAsB,EAAE,CAAA;CACpC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cosigner-validated BSV21 transfer types and session store contract.
|
|
3
|
+
*
|
|
4
|
+
* The flow is split into two requests on the cosigner backend:
|
|
5
|
+
* 1. prepareCosignBsv21Transfer — cosigner constructs the tx (cosign-wrapped
|
|
6
|
+
* transfer outputs + optional burn outputs), allocates sat-funding via
|
|
7
|
+
* its own BRC-100 wallet (createAction with signAndProcess: false),
|
|
8
|
+
* persists the session, and returns the signable BEEF + per-input
|
|
9
|
+
* sighashes for the sender to sign.
|
|
10
|
+
* 2. finalizeCosignBsv21Transfer — sender returns owner-side sigs, cosigner
|
|
11
|
+
* adds its own sig per cosign-wrapped input, calls signAction to broadcast
|
|
12
|
+
* via the wallet, then submits the resulting BEEF to the BSV21 overlay
|
|
13
|
+
* topic. Returns per-recipient customInstructions blobs the caller can
|
|
14
|
+
* drop into messagebox payloads.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* BRC-29 protocol used to derive cosign-locked destination keys.
|
|
18
|
+
* Both cosigner (as constructor) and recipient (when later spending) derive
|
|
19
|
+
* with this protocol, with the cosigner's identityKey as counterparty.
|
|
20
|
+
*/
|
|
21
|
+
export const COSIGN_PROTOCOL_ID = [2, 'cosign'];
|
|
22
|
+
/** Default sighash byte for the cosigner's signature on cosign-wrapped inputs. */
|
|
23
|
+
export const COSIGN_DEFAULT_SIGHASH = 0x41; // SIGHASH_ALL | SIGHASH_FORKID
|
|
24
|
+
/** Default in-memory store. Not suitable for multi-process or persistence-across-restart. */
|
|
25
|
+
export class InMemoryCosignSessionStore {
|
|
26
|
+
store = new Map();
|
|
27
|
+
async save(session) {
|
|
28
|
+
this.store.set(session.sessionId, session);
|
|
29
|
+
}
|
|
30
|
+
async load(sessionId) {
|
|
31
|
+
return this.store.get(sessionId) ?? null;
|
|
32
|
+
}
|
|
33
|
+
async delete(sessionId) {
|
|
34
|
+
this.store.delete(sessionId);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/cosign/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH;;;;GAIG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAmB,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;AAE/D,kFAAkF;AAClF,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAA,CAAC,+BAA+B;AA+E1E,6FAA6F;AAC7F,MAAM,OAAO,0BAA0B;IAC9B,KAAK,GAAG,IAAI,GAAG,EAAiC,CAAA;IAExD,KAAK,CAAC,IAAI,CAAC,OAA8B;QACxC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC,CAAA;IAC3C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,SAAiB;QAC3B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,IAAI,CAAA;IACzC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,SAAiB;QAC7B,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,SAAS,CAAC,CAAA;IAC7B,CAAC;CACD"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EACN,KAAK,MAAM,EACX,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,EACvB,KAAK,aAAa,EAClB,aAAa,GACb,MAAM,SAAS,CAAA;AAGhB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,KAAK,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAGhF,cAAc,aAAa,CAAA;AAG3B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EACN,oBAAoB,EACpB,KAAK,0BAA0B,EAC/B,KAAK,eAAe,GACpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,GACd,MAAM,6BAA6B,CAAA;AAGpC,YAAY,EACX,eAAe,EACf,aAAa,GACb,MAAM,WAAW,CAAA;AAClB,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EACN,eAAe,EACf,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACrB,MAAM,yBAAyB,CAAA;AAGhC,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cA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,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AAGtB,cAAc,UAAU,CAAA;AAGxB,cAAc,SAAS,CAAA;AAGvB,cAAc,QAAQ,CAAA;AAGtB,cAAc,YAAY,CAAA;AAoC1B,YAAY,EACX,gBAAgB,EAChB,iBAAiB,EACjB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,YAAY,GACZ,MAAM,UAAU,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -30,6 +30,8 @@ export * from './social';
|
|
|
30
30
|
export * from './identity';
|
|
31
31
|
export * from './opns';
|
|
32
32
|
export * from './mnee';
|
|
33
|
+
// Export cosign module (cosigner-validated BSV21 transfer actions)
|
|
34
|
+
export * from './cosign';
|
|
33
35
|
// Export sweep module (uses external signing, not action-based)
|
|
34
36
|
export * from './sweep';
|
|
35
37
|
// Export sync module
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,kCAAkC;AAClC,OAAO,EAQN,aAAa,GACb,MAAM,SAAS,CAAA;AAEhB,yBAAyB;AACzB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAgB,MAAM,mBAAmB,CAAA;AAEhF,mBAAmB;AACnB,cAAc,aAAa,CAAA;AAE3B,0BAA0B;AAC1B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EACN,oBAAoB,GAGpB,MAAM,8BAA8B,CAAA;AACrC,OAAO,EACN,mBAAmB,EACnB,oBAAoB,EACpB,cAAc,GACd,MAAM,6BAA6B,CAAA;AAOp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ACjB,GAAG,aAAa;IAChB,GAAG,YAAY;IACf,GAAG,WAAW;IACd,GAAG,WAAW;IACd,GAAG,WAAW;CACd,CAAC,CAAA"}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Actions for creating inscriptions.
|
|
5
5
|
*/
|
|
6
|
+
import type { Destination } from '@1sat/types';
|
|
6
7
|
import type { Action, ActionOptions } from '../types';
|
|
7
8
|
export interface InscribeRequest extends ActionOptions {
|
|
8
9
|
/** Base64 encoded content */
|
|
@@ -13,6 +14,8 @@ export interface InscribeRequest extends ActionOptions {
|
|
|
13
14
|
map?: Record<string, string>;
|
|
14
15
|
/** Sign with BAP identity (Sigma protocol) */
|
|
15
16
|
signWithBAP?: boolean;
|
|
17
|
+
/** Where to lock the inscription output. Defaults to self. */
|
|
18
|
+
destination?: Destination;
|
|
16
19
|
}
|
|
17
20
|
export interface InscribeResponse {
|
|
18
21
|
txid?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inscriptions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/inscriptions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAS9C,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAiB,MAAM,UAAU,CAAA;AASpE,MAAM,WAAW,eAAgB,SAAQ,aAAa;IACrD,6BAA6B;IAC7B,aAAa,EAAE,MAAM,CAAA;IACrB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,8CAA8C;IAC9C,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,8DAA8D;IAC9D,WAAW,CAAC,EAAE,WAAW,CAAA;CACzB;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,EAAE,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAoKD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,MAAM,CAAC,eAAe,EAAE,gBAAgB,CAmJ9D,CAAA;AAMD,2CAA2C;AAC3C,eAAO,MAAM,mBAAmB,6CAAa,CAAA"}
|
|
@@ -8,16 +8,16 @@ import { P2PKH, PublicKey, Script, Utils } from '@bsv/sdk';
|
|
|
8
8
|
import { MAX_INSCRIPTION_BYTES, ONESAT_PROTOCOL, ORDINALS_BASKET, SIGMA_BASKET, } from '../constants';
|
|
9
9
|
import { applySigma } from '../signing/sigma';
|
|
10
10
|
import { executeTrackedAction } from '../utils/createTrackedAction';
|
|
11
|
+
import { resolveDestination } from '../utils/resolveDestination';
|
|
11
12
|
import { signP2PKHInput } from '../utils/signP2PKH';
|
|
12
13
|
// ============================================================================
|
|
13
14
|
// Internal helpers
|
|
14
15
|
// ============================================================================
|
|
15
|
-
function buildInscriptionScript(
|
|
16
|
+
function buildInscriptionScript(lockingScript, base64Content, contentType, map) {
|
|
16
17
|
const content = Utils.toArray(base64Content, 'base64');
|
|
17
|
-
|
|
18
|
-
// Build suffix: P2PKH + optional MAP
|
|
18
|
+
// Build suffix: caller-provided locking script + optional MAP
|
|
19
19
|
const suffix = new Script();
|
|
20
|
-
for (const chunk of
|
|
20
|
+
for (const chunk of lockingScript.chunks)
|
|
21
21
|
suffix.chunks.push(chunk);
|
|
22
22
|
if (map && Object.keys(map).length > 0) {
|
|
23
23
|
const mapScript = MAPTemplate.set(map);
|
|
@@ -29,8 +29,8 @@ function buildInscriptionScript(address, base64Content, contentType, map) {
|
|
|
29
29
|
});
|
|
30
30
|
return new Script(inscription.lock().chunks);
|
|
31
31
|
}
|
|
32
|
-
async function inscribeWithSigma(ctx, lockingScript,
|
|
33
|
-
const anchorKeyID = `anchor-${
|
|
32
|
+
async function inscribeWithSigma(ctx, lockingScript, tags, input, outputCustomInstructions, outputKeyIDForLog) {
|
|
33
|
+
const anchorKeyID = `anchor-${Date.now()}`;
|
|
34
34
|
const { publicKey: anchorPubKey } = await ctx.wallet.getPublicKey({
|
|
35
35
|
protocolID: ONESAT_PROTOCOL,
|
|
36
36
|
keyID: anchorKeyID,
|
|
@@ -84,11 +84,7 @@ async function inscribeWithSigma(ctx, lockingScript, keyID, tags, input) {
|
|
|
84
84
|
outputDescription: 'Inscription',
|
|
85
85
|
basket: ORDINALS_BASKET,
|
|
86
86
|
tags,
|
|
87
|
-
customInstructions:
|
|
88
|
-
protocolID: ONESAT_PROTOCOL,
|
|
89
|
-
keyID,
|
|
90
|
-
...(input.map?.name && { name: input.map.name.slice(0, 64) }),
|
|
91
|
-
}),
|
|
87
|
+
customInstructions: outputCustomInstructions,
|
|
92
88
|
},
|
|
93
89
|
],
|
|
94
90
|
options: {
|
|
@@ -122,7 +118,7 @@ async function inscribeWithSigma(ctx, lockingScript, keyID, tags, input) {
|
|
|
122
118
|
{
|
|
123
119
|
index: 0,
|
|
124
120
|
protocolID: ONESAT_PROTOCOL,
|
|
125
|
-
keyID,
|
|
121
|
+
keyID: outputKeyIDForLog,
|
|
126
122
|
basket: ORDINALS_BASKET,
|
|
127
123
|
satoshis: 1,
|
|
128
124
|
},
|
|
@@ -162,6 +158,10 @@ export const inscribe = {
|
|
|
162
158
|
type: 'boolean',
|
|
163
159
|
description: 'Sign with BAP identity (Sigma protocol)',
|
|
164
160
|
},
|
|
161
|
+
destination: {
|
|
162
|
+
type: 'object',
|
|
163
|
+
description: 'Where to lock the inscription output. One of lockingScript (hex), counterparty (pubkey), or address. Defaults to self.',
|
|
164
|
+
},
|
|
165
165
|
},
|
|
166
166
|
required: ['base64Content', 'contentType'],
|
|
167
167
|
},
|
|
@@ -174,21 +174,24 @@ export const inscribe = {
|
|
|
174
174
|
error: `Inscription data too large: ${decoded.length} bytes (max ${MAX_INSCRIPTION_BYTES})`,
|
|
175
175
|
};
|
|
176
176
|
}
|
|
177
|
-
const
|
|
178
|
-
const { publicKey } = await ctx.wallet.getPublicKey({
|
|
177
|
+
const resolved = await resolveDestination(ctx, input.destination, {
|
|
179
178
|
protocolID: ONESAT_PROTOCOL,
|
|
180
|
-
|
|
181
|
-
counterparty: 'self',
|
|
182
|
-
forSelf: true,
|
|
179
|
+
keyIDPrefix: 'inscribe',
|
|
183
180
|
});
|
|
184
|
-
const
|
|
185
|
-
const lockingScript = buildInscriptionScript(address, input.base64Content, input.contentType, input.map);
|
|
181
|
+
const lockingScript = buildInscriptionScript(resolved.lockingScript, input.base64Content, input.contentType, input.map);
|
|
186
182
|
const tags = [`type:${input.contentType}`, 'origin'];
|
|
187
183
|
if (input.map?.name) {
|
|
188
184
|
tags.push(`name:${input.map.name}`);
|
|
189
185
|
}
|
|
186
|
+
const customInstructions = resolved.customInstructions
|
|
187
|
+
? JSON.stringify({
|
|
188
|
+
protocolID: resolved.customInstructions.protocolID,
|
|
189
|
+
keyID: resolved.customInstructions.keyID,
|
|
190
|
+
...(input.map?.name && { name: input.map.name.slice(0, 64) }),
|
|
191
|
+
})
|
|
192
|
+
: undefined;
|
|
190
193
|
if (input.signWithBAP) {
|
|
191
|
-
return await inscribeWithSigma(ctx, lockingScript,
|
|
194
|
+
return await inscribeWithSigma(ctx, lockingScript, tags, input, customInstructions, resolved.customInstructions?.keyID);
|
|
192
195
|
}
|
|
193
196
|
const result = await executeTrackedAction(ctx.wallet, {
|
|
194
197
|
description: 'Create inscription',
|
|
@@ -199,11 +202,7 @@ export const inscribe = {
|
|
|
199
202
|
outputDescription: 'Inscription',
|
|
200
203
|
basket: ORDINALS_BASKET,
|
|
201
204
|
tags,
|
|
202
|
-
customInstructions
|
|
203
|
-
protocolID: ONESAT_PROTOCOL,
|
|
204
|
-
keyID,
|
|
205
|
-
...(input.map?.name && { name: input.map.name.slice(0, 64) }),
|
|
206
|
-
}),
|
|
205
|
+
customInstructions,
|
|
207
206
|
},
|
|
208
207
|
],
|
|
209
208
|
options: {
|
|
@@ -218,14 +217,18 @@ export const inscribe = {
|
|
|
218
217
|
ctx.log({
|
|
219
218
|
timestamp: new Date().toISOString(),
|
|
220
219
|
action: 'inscribe',
|
|
221
|
-
input: {
|
|
220
|
+
input: {
|
|
221
|
+
contentType: input.contentType,
|
|
222
|
+
map: input.map,
|
|
223
|
+
destination: input.destination,
|
|
224
|
+
},
|
|
222
225
|
txid: result.txid,
|
|
223
226
|
rawtx: result.tx ? Utils.toHex(result.tx) : undefined,
|
|
224
227
|
outputs: [
|
|
225
228
|
{
|
|
226
229
|
index: 0,
|
|
227
230
|
protocolID: ONESAT_PROTOCOL,
|
|
228
|
-
keyID,
|
|
231
|
+
keyID: resolved.customInstructions?.keyID,
|
|
229
232
|
basket: ORDINALS_BASKET,
|
|
230
233
|
satoshis: 1,
|
|
231
234
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inscriptions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/inscriptions/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,GAAG,IAAI,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAEjE,OAAO,EAAsB,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAC9E,OAAO,EACN,qBAAqB,EACrB,eAAe,EACf,eAAe,EACf,YAAY,GACZ,MAAM,cAAc,CAAA;AACrB,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,k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U,EAAE,eAAe;4BAC3B,KAAK,EAAE,QAAQ,CAAC,kBAAkB,EAAE,KAAK;4BACzC,MAAM,EAAE,eAAe;4BACvB,QAAQ,EAAE,CAAC;yBACX;qBACD;iBACD,CAAC,CAAA;YACH,CAAC;YAED,OAAO;gBACN,IAAI,EAAE,MAAM,CAAC,IAAI;gBACjB,EAAE,EAAE,MAAM,CAAC,EAAE;aACb,CAAA;QACF,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,OAAO,CAAC,KAAK,CAAC,YAAY,EAAE,KAAK,CAAC,CAAA;YAClC,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;gBAC1B,GAAG,CAAC,GAAG,CAAC;oBACP,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;oBACnC,MAAM,EAAE,UAAU;oBAClB,KAAK,EAAE,EAAE,WAAW,EAAE,KAAK,CAAC,WAAW,EAAE,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE;oBACzD,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;iBAC/D,CAAC,CAAA;YACH,CAAC;YACD,OAAO;gBACN,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe;aAC/D,CAAA;QACF,CAAC;IACF,CAAC;CACD,CAAA;AAED,+EAA+E;AAC/E,iBAAiB;AACjB,+EAA+E;AAE/E,2CAA2C;AAC3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,QAAQ,CAAC,CAAA"}
|
package/dist/tokens/index.d.ts
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Actions for managing BSV21 tokens.
|
|
5
5
|
*/
|
|
6
|
+
import type { Destination } from '@1sat/types';
|
|
6
7
|
import { type WalletOutput } from '@bsv/sdk';
|
|
7
8
|
import type { Action, ActionOptions } from '../types';
|
|
8
|
-
type PubKeyHex = string;
|
|
9
9
|
export interface Bsv21Balance {
|
|
10
10
|
/** Token protocol (bsv-20) */
|
|
11
11
|
p: string;
|
|
@@ -33,10 +33,8 @@ export interface Bsv21Balance {
|
|
|
33
33
|
export interface SendBsv21Recipient {
|
|
34
34
|
/** Amount to send (as bigint or string) */
|
|
35
35
|
amount: bigint | string;
|
|
36
|
-
/**
|
|
37
|
-
|
|
38
|
-
/** Legacy: raw P2PKH address */
|
|
39
|
-
address?: string;
|
|
36
|
+
/** Where to lock the output. */
|
|
37
|
+
destination: Destination;
|
|
40
38
|
}
|
|
41
39
|
export interface SendBsv21Input extends ActionOptions {
|
|
42
40
|
/** Token ID (txid_vout format) */
|
|
@@ -61,6 +59,58 @@ export interface TokenOperationResponse {
|
|
|
61
59
|
tx?: number[];
|
|
62
60
|
error?: string;
|
|
63
61
|
}
|
|
62
|
+
export interface DeployBsv21MintInput extends ActionOptions {
|
|
63
|
+
/** Token symbol/ticker (max 32 chars) */
|
|
64
|
+
symbol: string;
|
|
65
|
+
/** Total fixed supply (as bigint or string) */
|
|
66
|
+
amount: bigint | string;
|
|
67
|
+
/** Decimal places (0-18) */
|
|
68
|
+
decimals?: number;
|
|
69
|
+
/** Optional icon URL or data URI */
|
|
70
|
+
icon?: string;
|
|
71
|
+
/** Recipient of the supply. Defaults to self. */
|
|
72
|
+
destination?: Destination;
|
|
73
|
+
}
|
|
74
|
+
export interface DeployBsv21AuthInput extends ActionOptions {
|
|
75
|
+
/** Token symbol/ticker (max 32 chars) */
|
|
76
|
+
symbol: string;
|
|
77
|
+
/** Decimal places (0-18) */
|
|
78
|
+
decimals?: number;
|
|
79
|
+
/** Optional icon URL or data URI */
|
|
80
|
+
icon?: string;
|
|
81
|
+
/** Auth-holder for the deploy+auth UTXO (= the first auth). Defaults to self. */
|
|
82
|
+
destination?: Destination;
|
|
83
|
+
}
|
|
84
|
+
export interface DeployBsv21Response extends TokenOperationResponse {
|
|
85
|
+
/** New token ID = `${txid}_${deployVout}` */
|
|
86
|
+
tokenId?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface DeployBsv21AuthResponse extends DeployBsv21Response {
|
|
89
|
+
/** Outpoint of the auth UTXO needed for future mints */
|
|
90
|
+
authOutpoint?: string;
|
|
91
|
+
}
|
|
92
|
+
export interface MintBsv21Input extends ActionOptions {
|
|
93
|
+
/** Token ID (txid_vout of the deploy+auth) */
|
|
94
|
+
tokenId: string;
|
|
95
|
+
/** Optional mint output. Omit to skip minting (auth-only operation). */
|
|
96
|
+
mint?: {
|
|
97
|
+
amount: bigint | string;
|
|
98
|
+
destination: Destination;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* Optional continuing/transferred auth output. Omit to permanently end
|
|
102
|
+
* minting; in that case `endMinting: true` is required as confirmation.
|
|
103
|
+
*/
|
|
104
|
+
auth?: {
|
|
105
|
+
destination: Destination;
|
|
106
|
+
};
|
|
107
|
+
/** Required when `auth` is omitted — explicit confirmation that minting ends. */
|
|
108
|
+
endMinting?: boolean;
|
|
109
|
+
}
|
|
110
|
+
export interface MintBsv21Response extends TokenOperationResponse {
|
|
111
|
+
/** Outpoint of the new auth UTXO, if one was emitted. */
|
|
112
|
+
authOutpoint?: string;
|
|
113
|
+
}
|
|
64
114
|
/** Input for listTokens action */
|
|
65
115
|
export interface ListTokensInput {
|
|
66
116
|
/** Max number of tokens to return */
|
|
@@ -84,7 +134,30 @@ export declare const sendBsv21: Action<SendBsv21Input, TokenOperationResponse>;
|
|
|
84
134
|
* Purchase BSV21 tokens from marketplace.
|
|
85
135
|
*/
|
|
86
136
|
export declare const purchaseBsv21: Action<PurchaseBsv21Request, TokenOperationResponse>;
|
|
137
|
+
/**
|
|
138
|
+
* Deploy a new BSV21 token with a fixed supply (deploy+mint).
|
|
139
|
+
*
|
|
140
|
+
* The entire supply is minted in this transaction and sent to the destination.
|
|
141
|
+
* No further minting is possible — total supply is locked at deploy time.
|
|
142
|
+
*/
|
|
143
|
+
export declare const deployBsv21Mint: Action<DeployBsv21MintInput, DeployBsv21Response>;
|
|
144
|
+
/**
|
|
145
|
+
* Deploy a new BSV21 token with mintable supply (deploy+auth).
|
|
146
|
+
*
|
|
147
|
+
* Emits a single `deploy+auth` output that doubles as the genesis auth UTXO.
|
|
148
|
+
* Initial supply is zero — the auth holder must spend this output via a
|
|
149
|
+
* separate mint transaction to create supply. Authority can be split,
|
|
150
|
+
* combined, transferred, or burned via subsequent auth operations.
|
|
151
|
+
*/
|
|
152
|
+
export declare const deployBsv21Auth: Action<DeployBsv21AuthInput, DeployBsv21AuthResponse>;
|
|
153
|
+
/**
|
|
154
|
+
* Spend an auth UTXO to mint new supply, transfer authority, or burn it.
|
|
155
|
+
*
|
|
156
|
+
* Both `mint` and `auth` are optional, but at least one must be present.
|
|
157
|
+
* Omitting `auth` ends minting permanently and requires `endMinting: true`
|
|
158
|
+
* as explicit confirmation.
|
|
159
|
+
*/
|
|
160
|
+
export declare const mintBsv21: Action<MintBsv21Input, MintBsv21Response>;
|
|
87
161
|
/** All token actions for registry */
|
|
88
|
-
export declare const tokensActions: (Action<ListTokensInput, WalletOutput[]> | Action<GetBsv21BalancesInput, Bsv21Balance[]> | Action<SendBsv21Input, TokenOperationResponse> | Action<PurchaseBsv21Request, TokenOperationResponse>)[];
|
|
89
|
-
export {};
|
|
162
|
+
export declare const tokensActions: (Action<ListTokensInput, WalletOutput[]> | Action<GetBsv21BalancesInput, Bsv21Balance[]> | Action<SendBsv21Input, TokenOperationResponse> | Action<PurchaseBsv21Request, TokenOperationResponse> | Action<DeployBsv21MintInput, DeployBsv21Response> | Action<MintBsv21Input, MintBsv21Response>)[];
|
|
90
163
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tokens/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"index.d.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