@1sat/wallet 0.0.17 → 0.0.19

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.
@@ -1,44 +1,15 @@
1
1
  /**
2
- * AddressManager - Manages yours receive addresses using BRC-29 derivation format.
2
+ * AddressManager - Manages BRC-29 receive addresses.
3
3
  *
4
- * Yours receive addresses are fixed, public addresses that users share publicly.
5
- * They are derived deterministically from the identity key using:
6
- * - derivationPrefix: "yours receive" (fixed)
7
- * - derivationSuffix: "0", "1", "2", ... (sequential counter)
8
- * - senderIdentityKey: our own identity public key (self-referential derivation)
9
- *
10
- * This allows:
11
- * 1. Deterministic regeneration on wallet restore
12
- * 2. Syncing external payments to these addresses
13
- * 3. Auto-signing via BRC-29/ScriptTemplateBRC29 (wallet knows the derivation info)
14
- *
15
- * Address derivation is done externally (in yours-wallet) and passed to this class.
4
+ * Accepts pre-derived addresses and provides lookup/management.
5
+ * Derivation is done externally (via deriveDepositAddresses action or equivalent).
16
6
  */
17
- import { type WalletProtocol } from '@bsv/sdk';
7
+ import { type AddressDerivation, BRC29_PROTOCOL_ID } from '@1sat/types';
18
8
  /** Fixed prefix for yours receive addresses */
19
9
  export declare const YOURS_PREFIX = "yours";
20
- /** BRC-29 protocol ID - used by wallet-toolbox for key derivation and signing */
21
- export declare const BRC29_PROTOCOL_ID: WalletProtocol;
22
- /**
23
- * Derivation info for a yours receive address.
24
- * This is what's needed for internalizeAction's paymentRemittance.
25
- */
26
- export interface AddressDerivation {
27
- /** The Bitcoin address (base58check) */
28
- address: string;
29
- /** The key index (0, 1, 2, etc.) for internal lookups */
30
- index: number;
31
- /** Base64-encoded derivation prefix (e.g., base64("yours receive")) */
32
- derivationPrefix: string;
33
- /** Base64-encoded derivation suffix (e.g., base64("0"), base64("1"), etc.) */
34
- derivationSuffix: string;
35
- /** Our own identity public key (self-referential) */
36
- senderIdentityKey: string;
37
- /** The public key for this address */
38
- publicKey: string;
39
- }
10
+ export { BRC29_PROTOCOL_ID, type AddressDerivation };
40
11
  /**
41
- * AddressManager manages yours receive addresses.
12
+ * AddressManager manages BRC-29 receive addresses.
42
13
  * Accepts pre-derived addresses - derivation is done externally.
43
14
  */
44
15
  export declare class AddressManager {
@@ -1 +1 @@
1
- {"version":3,"file":"AddressManager.d.ts","sourceRoot":"","sources":["../../src/address-sync/AddressManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAS,KAAK,cAAc,EAAE,MAAM,UAAU,CAAA;AAErD,+CAA+C;AAC/C,eAAO,MAAM,YAAY,UAAU,CAAA;AAEnC,iFAAiF;AACjF,eAAO,MAAM,iBAAiB,EAAE,cAAoC,CAAA;AAEpE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IACjC,wCAAwC;IACxC,OAAO,EAAE,MAAM,CAAA;IACf,yDAAyD;IACzD,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,gBAAgB,EAAE,MAAM,CAAA;IACxB,8EAA8E;IAC9E,gBAAgB,EAAE,MAAM,CAAA;IACxB,qDAAqD;IACrD,iBAAiB,EAAE,MAAM,CAAA;IACzB,sCAAsC;IACtC,SAAS,EAAE,MAAM,CAAA;CACjB;AAED;;;GAGG;AACH,qBAAa,cAAc;IAC1B,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,WAAW,CAAK;IAExB;;OAEG;gBACS,WAAW,EAAE,iBAAiB,EAAE;IAS5C;;OAEG;IACH,UAAU,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAO/C;;;OAGG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,YAAY,IAAI,MAAM,EAAE;IAIxB;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAI7D;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAItC;;OAEG;IACH,iBAAiB,IAAI,MAAM,GAAG,SAAS;IASvC;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAS/D;;;OAGG;IACH,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAO1D"}
1
+ {"version":3,"file":"AddressManager.d.ts","sourceRoot":"","sources":["../../src/address-sync/AddressManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AAGvE,+CAA+C;AAC/C,eAAO,MAAM,YAAY,UAAU,CAAA;AAGnC,OAAO,EAAE,iBAAiB,EAAE,KAAK,iBAAiB,EAAE,CAAA;AAEpD;;;GAGG;AACH,qBAAa,cAAc;IAC1B,OAAO,CAAC,UAAU,CAA4C;IAC9D,OAAO,CAAC,WAAW,CAAK;IAExB;;OAEG;gBACS,WAAW,EAAE,iBAAiB,EAAE;IAS5C;;OAEG;IACH,UAAU,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI;IAO/C;;;OAGG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,YAAY,IAAI,MAAM,EAAE;IAIxB;;OAEG;IACH,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAI7D;;OAEG;IACH,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAItC;;OAEG;IACH,iBAAiB,IAAI,MAAM,GAAG,SAAS;IASvC;;OAEG;IACH,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAS/D;;;OAGG;IACH,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS;CAO1D"}
@@ -1,26 +1,17 @@
1
1
  /**
2
- * AddressManager - Manages yours receive addresses using BRC-29 derivation format.
2
+ * AddressManager - Manages BRC-29 receive addresses.
3
3
  *
4
- * Yours receive addresses are fixed, public addresses that users share publicly.
5
- * They are derived deterministically from the identity key using:
6
- * - derivationPrefix: "yours receive" (fixed)
7
- * - derivationSuffix: "0", "1", "2", ... (sequential counter)
8
- * - senderIdentityKey: our own identity public key (self-referential derivation)
9
- *
10
- * This allows:
11
- * 1. Deterministic regeneration on wallet restore
12
- * 2. Syncing external payments to these addresses
13
- * 3. Auto-signing via BRC-29/ScriptTemplateBRC29 (wallet knows the derivation info)
14
- *
15
- * Address derivation is done externally (in yours-wallet) and passed to this class.
4
+ * Accepts pre-derived addresses and provides lookup/management.
5
+ * Derivation is done externally (via deriveDepositAddresses action or equivalent).
16
6
  */
7
+ import { BRC29_PROTOCOL_ID } from '@1sat/types';
17
8
  import { P2PKH } from '@bsv/sdk';
18
9
  /** Fixed prefix for yours receive addresses */
19
10
  export const YOURS_PREFIX = 'yours';
20
- /** BRC-29 protocol ID - used by wallet-toolbox for key derivation and signing */
21
- export const BRC29_PROTOCOL_ID = [2, '3241645161d8'];
11
+ // Re-export from @1sat/types for backwards compatibility
12
+ export { BRC29_PROTOCOL_ID };
22
13
  /**
23
- * AddressManager manages yours receive addresses.
14
+ * AddressManager manages BRC-29 receive addresses.
24
15
  * Accepts pre-derived addresses - derivation is done externally.
25
16
  */
26
17
  export class AddressManager {
@@ -1 +1 @@
1
- {"version":3,"file":"AddressManager.js","sourceRoot":"","sources":["../../src/address-sync/AddressManager.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,KAAK,EAAuB,MAAM,UAAU,CAAA;AAErD,+CAA+C;AAC/C,MAAM,CAAC,MAAM,YAAY,GAAG,OAAO,CAAA;AAEnC,iFAAiF;AACjF,MAAM,CAAC,MAAM,iBAAiB,GAAmB,CAAC,CAAC,EAAE,cAAc,CAAC,CAAA;AAqBpE;;;GAGG;AACH,MAAM,OAAO,cAAc;IAClB,UAAU,GAAmC,IAAI,GAAG,EAAE,CAAA;IACtD,WAAW,GAAG,CAAC,CAAC,CAAA;IAExB;;OAEG;IACH,Y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AC;QACF,CAAC;QACD,OAAO,SAAS,CAAA;IACjB,CAAC;IAED;;;OAGG;IACH,uBAAuB,CAAC,KAAa;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAA;QAChD,IAAI,CAAC,UAAU;YAAE,OAAO,SAAS,CAAA;QAEjC,MAAM,KAAK,GAAG,IAAI,KAAK,EAAE,CAAA;QACzB,OAAO,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,CAAA;IAC9C,CAAC;CACD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@1sat/wallet",
3
- "version": "0.0.17",
3
+ "version": "0.0.19",
4
4
  "description": "BRC-100 wallet engine for 1Sat Ordinals SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -20,8 +20,8 @@
20
20
  "keywords": ["1sat", "bsv", "ordinals", "wallet", "brc-100"],
21
21
  "license": "MIT",
22
22
  "dependencies": {
23
- "@1sat/client": "^0.0.7",
24
- "@1sat/types": "^0.0.6",
23
+ "@1sat/client": "^0.0.8",
24
+ "@1sat/types": "^0.0.10",
25
25
  "@bopen-io/templates": "^1.1.9",
26
26
  "@msgpack/msgpack": "^3.1.3",
27
27
  "fflate": "^0.8.2"