@1sat/actions 0.0.49 → 0.0.51
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/funding/index.d.ts +25 -0
- package/dist/funding/index.d.ts.map +1 -0
- package/dist/funding/index.js +2 -0
- package/dist/funding/index.js.map +1 -0
- package/dist/identity/index.d.ts +39 -29
- package/dist/identity/index.d.ts.map +1 -1
- package/dist/identity/index.js +199 -169
- package/dist/identity/index.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/inscriptions/index.d.ts +2 -2
- package/dist/inscriptions/index.d.ts.map +1 -1
- package/dist/inscriptions/index.js +7 -7
- package/dist/inscriptions/index.js.map +1 -1
- package/dist/locks/index.d.ts +3 -3
- package/dist/locks/index.d.ts.map +1 -1
- package/dist/locks/index.js +4 -4
- package/dist/locks/index.js.map +1 -1
- package/dist/opns/index.d.ts +3 -3
- package/dist/opns/index.d.ts.map +1 -1
- package/dist/opns/index.js +5 -5
- package/dist/opns/index.js.map +1 -1
- package/dist/ordinals/index.d.ts +5 -5
- package/dist/ordinals/index.d.ts.map +1 -1
- package/dist/ordinals/index.js +9 -9
- package/dist/ordinals/index.js.map +1 -1
- package/dist/payments/index.d.ts +4 -4
- package/dist/payments/index.d.ts.map +1 -1
- package/dist/payments/index.js +5 -5
- package/dist/payments/index.js.map +1 -1
- package/dist/signing/aip.d.ts +21 -6
- package/dist/signing/aip.d.ts.map +1 -1
- package/dist/signing/aip.js +48 -8
- package/dist/signing/aip.js.map +1 -1
- 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/social/index.d.ts +2 -2
- package/dist/social/index.d.ts.map +1 -1
- package/dist/social/index.js +3 -2
- package/dist/social/index.js.map +1 -1
- package/dist/sweep/index.js +5 -5
- package/dist/sweep/index.js.map +1 -1
- package/dist/tokens/index.d.ts +3 -3
- package/dist/tokens/index.d.ts.map +1 -1
- package/dist/tokens/index.js +5 -5
- package/dist/tokens/index.js.map +1 -1
- package/dist/types.d.ts +10 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/createTrackedAction.d.ts +17 -0
- package/dist/utils/createTrackedAction.d.ts.map +1 -1
- package/dist/utils/createTrackedAction.js +51 -8
- package/dist/utils/createTrackedAction.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { AtomicBEEF, CreateActionArgs } from '@bsv/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* External funding provider for actions where a third party pays
|
|
4
|
+
* for the transaction instead of the wallet.
|
|
5
|
+
*
|
|
6
|
+
* Receives the full CreateActionArgs so it can build the exact transaction
|
|
7
|
+
* the caller described (inputs, outputs, ordering), adding its own funding.
|
|
8
|
+
*
|
|
9
|
+
* Implementations handle funding strategy (free tier, metered, paid plans, etc.)
|
|
10
|
+
* and return the broadcasted transaction as BEEF for wallet internalization.
|
|
11
|
+
*/
|
|
12
|
+
export interface FundingProvider {
|
|
13
|
+
/**
|
|
14
|
+
* Build, fund, and broadcast a transaction from the given action args.
|
|
15
|
+
*
|
|
16
|
+
* @param args - Full CreateActionArgs (inputs, outputs, options)
|
|
17
|
+
* @returns txid and BEEF of the broadcasted transaction
|
|
18
|
+
*/
|
|
19
|
+
fund(args: CreateActionArgs): Promise<FundingResult>;
|
|
20
|
+
}
|
|
21
|
+
export interface FundingResult {
|
|
22
|
+
txid: string;
|
|
23
|
+
tx: AtomicBEEF;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/funding/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAE5D;;;;;;;;;GASG;AACH,MAAM,WAAW,eAAe;IAC/B;;;;;OAKG;IACH,IAAI,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,aAAa,CAAC,CAAA;CACpD;AAED,MAAM,WAAW,aAAa;IAC7B,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,UAAU,CAAA;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/funding/index.ts"],"names":[],"mappings":""}
|
package/dist/identity/index.d.ts
CHANGED
|
@@ -1,39 +1,44 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Identity Module
|
|
3
3
|
*
|
|
4
|
-
* BAP identity actions
|
|
5
|
-
* Uses the wallet's BAP signing key ([1, "sigma"] / "identity") via applyAip.
|
|
4
|
+
* BAP identity actions using the wallet's identity-{N} key derivation scheme.
|
|
6
5
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Key hierarchy:
|
|
7
|
+
* identity-0 = root key (BAP ID source, signs initial publish)
|
|
8
|
+
* identity-{N} = current signing key (N tracked via seq tags on outputs)
|
|
9
|
+
*
|
|
10
|
+
* All keys derived at protocolID=[1,"sigma"], keyID="identity-{N}".
|
|
11
|
+
*/
|
|
12
|
+
import type { Action, ActionOptions, OneSatContext } from '../types';
|
|
13
|
+
/**
|
|
14
|
+
* Compute the BAP ID deterministically from the wallet's identity-0 key.
|
|
15
|
+
*
|
|
16
|
+
* BAP ID = base58(ripemd160(sha256(identity-0.address)))
|
|
17
|
+
*
|
|
18
|
+
* This always returns a value — every wallet can derive identity-0.
|
|
10
19
|
*/
|
|
11
|
-
|
|
20
|
+
export declare function computeBapId(ctx: OneSatContext): Promise<string>;
|
|
12
21
|
/**
|
|
13
|
-
* Resolve the BAP
|
|
22
|
+
* Resolve the BAP ID if the identity has been published.
|
|
14
23
|
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
* the wallet yet).
|
|
24
|
+
* Returns the BAP ID if a `type:id` output exists in the BAP basket,
|
|
25
|
+
* null if the identity hasn't been published yet.
|
|
18
26
|
*/
|
|
19
27
|
export declare function resolveBapId(ctx: OneSatContext): Promise<string | null>;
|
|
20
|
-
export interface
|
|
21
|
-
/** Pre-signed BAP ID locking script hex (AIP-signed with root key) */
|
|
22
|
-
signedScript: string;
|
|
23
|
-
}
|
|
24
|
-
export interface AttestRequest {
|
|
28
|
+
export interface AttestRequest extends ActionOptions {
|
|
25
29
|
/** SHA-256 hash of the attestation URN (urn:bap:id:attribute:value:nonce) */
|
|
26
30
|
attestationHash: string;
|
|
27
31
|
/** Attestation sequence number (default "0") */
|
|
28
32
|
counter?: string;
|
|
29
33
|
}
|
|
30
|
-
export interface UpdateProfileRequest {
|
|
34
|
+
export interface UpdateProfileRequest extends ActionOptions {
|
|
31
35
|
/** Schema.org profile data (e.g. { "@type": "Person", "name": "Alice" }) */
|
|
32
36
|
profile: Record<string, unknown>;
|
|
33
37
|
}
|
|
34
38
|
export interface IdentityResponse {
|
|
35
39
|
txid?: string;
|
|
36
40
|
rawtx?: string;
|
|
41
|
+
bapId?: string;
|
|
37
42
|
error?: string;
|
|
38
43
|
}
|
|
39
44
|
export interface ProfileResponse {
|
|
@@ -42,31 +47,36 @@ export interface ProfileResponse {
|
|
|
42
47
|
error?: string;
|
|
43
48
|
}
|
|
44
49
|
/**
|
|
45
|
-
* Publish
|
|
50
|
+
* Publish the initial BAP ID record.
|
|
46
51
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* the
|
|
50
|
-
* then funds the transaction via the BRC-100 wallet. The output lands
|
|
51
|
-
* in the `bap` basket so that resolveBapId() can find it.
|
|
52
|
+
* Derives identity-0 (root key), computes the BAP ID, and publishes
|
|
53
|
+
* the ID record signed by identity-0 via AIP. The output lands in
|
|
54
|
+
* the `bap` basket tagged with seq:1.
|
|
52
55
|
*
|
|
53
|
-
*
|
|
56
|
+
* Returns an error if an identity has already been published.
|
|
54
57
|
*/
|
|
55
|
-
export declare const publishIdentity: Action<
|
|
58
|
+
export declare const publishIdentity: Action<ActionOptions, IdentityResponse>;
|
|
59
|
+
/**
|
|
60
|
+
* Rotate the BAP signing key.
|
|
61
|
+
*
|
|
62
|
+
* Finds the current signing key (highest sequence), derives the next
|
|
63
|
+
* key (identity-{N+1}), builds a new BAP ID record declaring the new
|
|
64
|
+
* currentAddress, signs it with the outgoing key, and publishes.
|
|
65
|
+
* The previous ID output is relinquished.
|
|
66
|
+
*/
|
|
67
|
+
export declare const rotateIdentity: Action<ActionOptions, IdentityResponse>;
|
|
56
68
|
/**
|
|
57
69
|
* Publish a BAP ATTEST transaction.
|
|
58
70
|
*
|
|
59
71
|
* OP_RETURN: BAP_PREFIX | "ATTEST" | attestation_hash | counter
|
|
60
|
-
* Signed with AIP via the
|
|
72
|
+
* Signed with AIP via the current signing key.
|
|
61
73
|
*/
|
|
62
74
|
export declare const attest: Action<AttestRequest, IdentityResponse>;
|
|
63
75
|
/**
|
|
64
76
|
* Publish a BAP ALIAS transaction to update the identity's profile.
|
|
65
77
|
*
|
|
66
78
|
* OP_RETURN: BAP_PREFIX | "ALIAS" | bap_id | profile_json
|
|
67
|
-
* Signed with AIP via the
|
|
68
|
-
*
|
|
69
|
-
* The BAP ID is resolved from the wallet's `bap` basket (seeded by Sigma Identity).
|
|
79
|
+
* Signed with AIP via the current signing key.
|
|
70
80
|
*/
|
|
71
81
|
export declare const updateProfile: Action<UpdateProfileRequest, IdentityResponse>;
|
|
72
82
|
/**
|
|
@@ -77,5 +87,5 @@ export declare const updateProfile: Action<UpdateProfileRequest, IdentityRespons
|
|
|
77
87
|
*/
|
|
78
88
|
export declare const getProfile: Action<Record<string, never>, ProfileResponse>;
|
|
79
89
|
/** All identity actions for registry */
|
|
80
|
-
export declare const identityActions: (Action<
|
|
90
|
+
export declare const identityActions: (Action<AttestRequest, IdentityResponse> | Action<UpdateProfileRequest, IdentityResponse> | Action<Record<string, never>, ProfileResponse>)[];
|
|
81
91
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/identity/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAUH,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AA6BpE;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAGtE;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CACjC,GAAG,EAAE,aAAa,GAChB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAQxB;AAiCD,MAAM,WAAW,aAAc,SAAQ,aAAa;IACnD,6EAA6E;IAC7E,eAAe,EAAE,MAAM,CAAA;IACvB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,oBAAqB,SAAQ,aAAa;IAC1D,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAChC;AAED,MAAM,WAAW,gBAAgB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,eAAe;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACjC,KAAK,CAAC,EAAE,MAAM,CAAA;CACd;AAMD;;;;;;;;GAQG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAwElE,CAAA;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAmFlE,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAqE1D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,oBAAoB,EAAE,gBAAgB,CA8ExE,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,eAAe,CAqDrE,CAAA;AAED,wCAAwC;AACxC,eAAO,MAAM,eAAe,+IAM3B,CAAA"}
|