@1sat/wallet-toolbox 0.0.6 → 0.0.7

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.
Files changed (37) hide show
  1. package/dist/OneSatWallet.d.ts +40 -17
  2. package/dist/OneSatWallet.js +956 -0
  3. package/dist/errors.js +11 -0
  4. package/dist/index.d.ts +0 -2
  5. package/dist/index.js +12 -93764
  6. package/dist/indexers/Bsv21Indexer.js +232 -0
  7. package/dist/indexers/CosignIndexer.js +25 -0
  8. package/dist/indexers/FundIndexer.js +64 -0
  9. package/dist/indexers/InscriptionIndexer.js +115 -0
  10. package/dist/indexers/LockIndexer.js +42 -0
  11. package/dist/indexers/MapIndexer.js +62 -0
  12. package/dist/indexers/OpNSIndexer.js +38 -0
  13. package/dist/indexers/OrdLockIndexer.js +63 -0
  14. package/dist/indexers/OriginIndexer.js +240 -0
  15. package/dist/indexers/Outpoint.js +53 -0
  16. package/dist/indexers/SigmaIndexer.js +133 -0
  17. package/dist/indexers/index.js +13 -0
  18. package/dist/indexers/parseAddress.js +24 -0
  19. package/dist/indexers/types.js +18 -0
  20. package/dist/services/OneSatServices.d.ts +12 -4
  21. package/dist/services/OneSatServices.js +231 -0
  22. package/dist/services/client/ArcadeClient.js +107 -0
  23. package/dist/services/client/BaseClient.js +125 -0
  24. package/dist/services/client/BeefClient.js +33 -0
  25. package/dist/services/client/Bsv21Client.js +65 -0
  26. package/dist/services/client/ChaintracksClient.js +175 -0
  27. package/dist/services/client/OrdfsClient.js +122 -0
  28. package/dist/services/client/OwnerClient.js +123 -0
  29. package/dist/services/client/TxoClient.js +85 -0
  30. package/dist/services/client/index.js +8 -0
  31. package/dist/services/types.js +5 -0
  32. package/dist/signers/ReadOnlySigner.js +47 -0
  33. package/dist/sync/IndexedDbSyncQueue.js +355 -0
  34. package/dist/sync/SqliteSyncQueue.js +197 -0
  35. package/dist/sync/index.js +3 -0
  36. package/dist/sync/types.js +4 -0
  37. package/package.json +5 -5
@@ -1,6 +1,6 @@
1
- import { type PrivateKey, Transaction } from "@bsv/sdk";
2
- import { Wallet, type WalletStorageManager } from "@bsv/wallet-toolbox/mobile";
3
- import type { Chain } from "@bsv/wallet-toolbox/mobile/out/src/sdk/types";
1
+ import { Transaction, type WalletInterface } from "@bsv/sdk";
2
+ import type { WalletStorageManager, sdk as toolboxSdk } from "@bsv/wallet-toolbox";
3
+ type Chain = toolboxSdk.Chain;
4
4
  import { Outpoint } from "./indexers/Outpoint";
5
5
  import type { Indexer, ParseContext, Txo } from "./indexers/types";
6
6
  import { OneSatServices } from "./services/OneSatServices";
@@ -36,11 +36,11 @@ export interface OneSatWalletEvents {
36
36
  type EventCallback<T> = (event: T) => void;
37
37
  export interface OneSatWalletArgs {
38
38
  /**
39
- * Either a public key hex string (read-only mode) or a PrivateKey (full signing).
39
+ * The underlying BRC-100 wallet to wrap.
40
40
  */
41
- rootKey: string | PrivateKey;
41
+ wallet: WalletInterface;
42
42
  /**
43
- * The storage manager for the wallet.
43
+ * The storage manager from the wallet (needed for direct storage access).
44
44
  */
45
45
  storage: WalletStorageManager;
46
46
  /**
@@ -75,14 +75,14 @@ export interface OneSatWalletArgs {
75
75
  syncBatchSize?: number;
76
76
  }
77
77
  /**
78
- * OneSatWallet extends the BRC-100 Wallet with 1Sat-specific indexing and services.
78
+ * OneSatWallet wraps a BRC-100 Wallet with 1Sat-specific indexing and services.
79
79
  *
80
- * Can be instantiated with either:
81
- * - A public key (read-only mode for queries)
82
- * - A private key (full signing capability)
80
+ * The consumer is responsible for constructing the underlying Wallet with
81
+ * the appropriate storage and key derivation for their environment.
83
82
  */
84
- export declare class OneSatWallet extends Wallet {
85
- private readonly isReadOnly;
83
+ export declare class OneSatWallet implements WalletInterface {
84
+ private readonly wallet;
85
+ private readonly storage;
86
86
  private readonly indexers;
87
87
  readonly services: OneSatServices;
88
88
  private owners;
@@ -98,11 +98,34 @@ export declare class OneSatWallet extends Wallet {
98
98
  private processorStopRequested;
99
99
  private streamDone;
100
100
  constructor(args: OneSatWalletArgs);
101
- /**
102
- * Returns true if this wallet was created with only a public key.
103
- * Read-only wallets can query but not sign transactions.
104
- */
105
- get readOnly(): boolean;
101
+ getPublicKey: WalletInterface["getPublicKey"];
102
+ revealCounterpartyKeyLinkage: WalletInterface["revealCounterpartyKeyLinkage"];
103
+ revealSpecificKeyLinkage: WalletInterface["revealSpecificKeyLinkage"];
104
+ encrypt: WalletInterface["encrypt"];
105
+ decrypt: WalletInterface["decrypt"];
106
+ createHmac: WalletInterface["createHmac"];
107
+ verifyHmac: WalletInterface["verifyHmac"];
108
+ createSignature: WalletInterface["createSignature"];
109
+ verifySignature: WalletInterface["verifySignature"];
110
+ createAction: WalletInterface["createAction"];
111
+ signAction: WalletInterface["signAction"];
112
+ abortAction: WalletInterface["abortAction"];
113
+ listActions: WalletInterface["listActions"];
114
+ internalizeAction: WalletInterface["internalizeAction"];
115
+ listOutputs: WalletInterface["listOutputs"];
116
+ relinquishOutput: WalletInterface["relinquishOutput"];
117
+ acquireCertificate: WalletInterface["acquireCertificate"];
118
+ listCertificates: WalletInterface["listCertificates"];
119
+ proveCertificate: WalletInterface["proveCertificate"];
120
+ relinquishCertificate: WalletInterface["relinquishCertificate"];
121
+ discoverByIdentityKey: WalletInterface["discoverByIdentityKey"];
122
+ discoverByAttributes: WalletInterface["discoverByAttributes"];
123
+ isAuthenticated: WalletInterface["isAuthenticated"];
124
+ waitForAuthentication: WalletInterface["waitForAuthentication"];
125
+ getHeight: WalletInterface["getHeight"];
126
+ getHeaderForHeight: WalletInterface["getHeaderForHeight"];
127
+ getNetwork: WalletInterface["getNetwork"];
128
+ getVersion: WalletInterface["getVersion"];
106
129
  /**
107
130
  * Subscribe to wallet events
108
131
  */