shogun-core 3.3.5 → 3.3.6

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 (149) hide show
  1. package/dist/browser/shogun-core.js +79919 -190726
  2. package/dist/browser/shogun-core.js.map +1 -1
  3. package/dist/{src/index.js → index.js} +0 -1
  4. package/dist/{src/managers → managers}/CoreInitializer.js +0 -6
  5. package/dist/{src/storage → storage}/storage.js +0 -16
  6. package/dist/types/{src/index.d.ts → index.d.ts} +0 -1
  7. package/package.json +10 -26
  8. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_axios_index_js.shogun-core.js +0 -4078
  9. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_axios_index_js.shogun-core.js.map +0 -1
  10. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_is-ipfs_dist_src_index_js.shogun-core.js +0 -4908
  11. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_is-ipfs_dist_src_index_js.shogun-core.js.map +0 -1
  12. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_uint8-varint_dist_src_index_js-node_modu-0db5ba.shogun-core.js +0 -2109
  13. package/dist/browser/defaultVendors-node_modules_shogun-ipfs_node_modules_uint8-varint_dist_src_index_js-node_modu-0db5ba.shogun-core.js.map +0 -1
  14. package/dist/ship/examples/identity-cli.js +0 -511
  15. package/dist/ship/examples/messenger-cli.js +0 -745
  16. package/dist/ship/examples/stealth-cli.js +0 -433
  17. package/dist/ship/examples/storage-cli.js +0 -615
  18. package/dist/ship/examples/vault-cli.js +0 -444
  19. package/dist/ship/examples/wallet-cli.js +0 -767
  20. package/dist/ship/implementation/SHIP_00.js +0 -478
  21. package/dist/ship/implementation/SHIP_01.js +0 -433
  22. package/dist/ship/implementation/SHIP_02.js +0 -1366
  23. package/dist/ship/implementation/SHIP_03.js +0 -855
  24. package/dist/ship/implementation/SHIP_04.js +0 -589
  25. package/dist/ship/implementation/SHIP_05.js +0 -1064
  26. package/dist/ship/implementation/SHIP_06.js +0 -635
  27. package/dist/ship/index.js +0 -17
  28. package/dist/ship/interfaces/ISHIP_00.js +0 -135
  29. package/dist/ship/interfaces/ISHIP_01.js +0 -128
  30. package/dist/ship/interfaces/ISHIP_02.js +0 -57
  31. package/dist/ship/interfaces/ISHIP_03.js +0 -61
  32. package/dist/ship/interfaces/ISHIP_04.js +0 -62
  33. package/dist/ship/interfaces/ISHIP_05.js +0 -59
  34. package/dist/ship/interfaces/ISHIP_06.js +0 -194
  35. package/dist/types/ship/examples/identity-cli.d.ts +0 -40
  36. package/dist/types/ship/examples/messenger-cli.d.ts +0 -37
  37. package/dist/types/ship/examples/stealth-cli.d.ts +0 -31
  38. package/dist/types/ship/examples/storage-cli.d.ts +0 -48
  39. package/dist/types/ship/examples/vault-cli.d.ts +0 -13
  40. package/dist/types/ship/examples/wallet-cli.d.ts +0 -131
  41. package/dist/types/ship/implementation/SHIP_00.d.ts +0 -113
  42. package/dist/types/ship/implementation/SHIP_01.d.ts +0 -80
  43. package/dist/types/ship/implementation/SHIP_02.d.ts +0 -297
  44. package/dist/types/ship/implementation/SHIP_03.d.ts +0 -127
  45. package/dist/types/ship/implementation/SHIP_04.d.ts +0 -76
  46. package/dist/types/ship/implementation/SHIP_05.d.ts +0 -70
  47. package/dist/types/ship/implementation/SHIP_06.d.ts +0 -101
  48. package/dist/types/ship/index.d.ts +0 -14
  49. package/dist/types/ship/interfaces/ISHIP_00.d.ts +0 -410
  50. package/dist/types/ship/interfaces/ISHIP_01.d.ts +0 -343
  51. package/dist/types/ship/interfaces/ISHIP_02.d.ts +0 -470
  52. package/dist/types/ship/interfaces/ISHIP_03.d.ts +0 -295
  53. package/dist/types/ship/interfaces/ISHIP_04.d.ts +0 -245
  54. package/dist/types/ship/interfaces/ISHIP_05.d.ts +0 -234
  55. package/dist/types/ship/interfaces/ISHIP_06.d.ts +0 -522
  56. /package/dist/{src/config → config}/simplified-config.js +0 -0
  57. /package/dist/{src/core.js → core.js} +0 -0
  58. /package/dist/{src/examples → examples}/api-test.js +0 -0
  59. /package/dist/{src/examples → examples}/simple-api-test.js +0 -0
  60. /package/dist/{src/gundb → gundb}/api.js +0 -0
  61. /package/dist/{src/gundb → gundb}/crypto.js +0 -0
  62. /package/dist/{src/gundb → gundb}/db.js +0 -0
  63. /package/dist/{src/gundb → gundb}/derive.js +0 -0
  64. /package/dist/{src/gundb → gundb}/errors.js +0 -0
  65. /package/dist/{src/gundb → gundb}/index.js +0 -0
  66. /package/dist/{src/gundb → gundb}/rxjs.js +0 -0
  67. /package/dist/{src/gundb → gundb}/types.js +0 -0
  68. /package/dist/{src/interfaces → interfaces}/common.js +0 -0
  69. /package/dist/{src/interfaces → interfaces}/events.js +0 -0
  70. /package/dist/{src/interfaces → interfaces}/plugin.js +0 -0
  71. /package/dist/{src/interfaces → interfaces}/shogun.js +0 -0
  72. /package/dist/{src/managers → managers}/AuthManager.js +0 -0
  73. /package/dist/{src/managers → managers}/EventManager.js +0 -0
  74. /package/dist/{src/managers → managers}/PluginManager.js +0 -0
  75. /package/dist/{src/migration-test.js → migration-test.js} +0 -0
  76. /package/dist/{src/plugins → plugins}/base.js +0 -0
  77. /package/dist/{src/plugins → plugins}/index.js +0 -0
  78. /package/dist/{src/plugins → plugins}/nostr/index.js +0 -0
  79. /package/dist/{src/plugins → plugins}/nostr/nostrConnector.js +0 -0
  80. /package/dist/{src/plugins → plugins}/nostr/nostrConnectorPlugin.js +0 -0
  81. /package/dist/{src/plugins → plugins}/nostr/nostrSigner.js +0 -0
  82. /package/dist/{src/plugins → plugins}/nostr/types.js +0 -0
  83. /package/dist/{src/plugins → plugins}/oauth/index.js +0 -0
  84. /package/dist/{src/plugins → plugins}/oauth/oauthConnector.js +0 -0
  85. /package/dist/{src/plugins → plugins}/oauth/oauthPlugin.js +0 -0
  86. /package/dist/{src/plugins → plugins}/oauth/types.js +0 -0
  87. /package/dist/{src/plugins → plugins}/web3/index.js +0 -0
  88. /package/dist/{src/plugins → plugins}/web3/types.js +0 -0
  89. /package/dist/{src/plugins → plugins}/web3/web3Connector.js +0 -0
  90. /package/dist/{src/plugins → plugins}/web3/web3ConnectorPlugin.js +0 -0
  91. /package/dist/{src/plugins → plugins}/web3/web3Signer.js +0 -0
  92. /package/dist/{src/plugins → plugins}/webauthn/index.js +0 -0
  93. /package/dist/{src/plugins → plugins}/webauthn/types.js +0 -0
  94. /package/dist/{src/plugins → plugins}/webauthn/webauthn.js +0 -0
  95. /package/dist/{src/plugins → plugins}/webauthn/webauthnPlugin.js +0 -0
  96. /package/dist/{src/plugins → plugins}/webauthn/webauthnSigner.js +0 -0
  97. /package/dist/types/{src/config → config}/simplified-config.d.ts +0 -0
  98. /package/dist/types/{src/core.d.ts → core.d.ts} +0 -0
  99. /package/dist/{src/types → types}/events.js +0 -0
  100. /package/dist/types/{src/examples → examples}/api-test.d.ts +0 -0
  101. /package/dist/types/{src/examples → examples}/simple-api-test.d.ts +0 -0
  102. /package/dist/types/{src/gundb → gundb}/api.d.ts +0 -0
  103. /package/dist/types/{src/gundb → gundb}/crypto.d.ts +0 -0
  104. /package/dist/types/{src/gundb → gundb}/db.d.ts +0 -0
  105. /package/dist/types/{src/gundb → gundb}/derive.d.ts +0 -0
  106. /package/dist/types/{src/gundb → gundb}/errors.d.ts +0 -0
  107. /package/dist/types/{src/gundb → gundb}/index.d.ts +0 -0
  108. /package/dist/types/{src/gundb → gundb}/rxjs.d.ts +0 -0
  109. /package/dist/types/{src/gundb → gundb}/types.d.ts +0 -0
  110. /package/dist/types/{src/interfaces → interfaces}/common.d.ts +0 -0
  111. /package/dist/types/{src/interfaces → interfaces}/events.d.ts +0 -0
  112. /package/dist/types/{src/interfaces → interfaces}/plugin.d.ts +0 -0
  113. /package/dist/types/{src/interfaces → interfaces}/shogun.d.ts +0 -0
  114. /package/dist/types/{src/managers → managers}/AuthManager.d.ts +0 -0
  115. /package/dist/types/{src/managers → managers}/CoreInitializer.d.ts +0 -0
  116. /package/dist/types/{src/managers → managers}/EventManager.d.ts +0 -0
  117. /package/dist/types/{src/managers → managers}/PluginManager.d.ts +0 -0
  118. /package/dist/types/{src/migration-test.d.ts → migration-test.d.ts} +0 -0
  119. /package/dist/types/{src/plugins → plugins}/base.d.ts +0 -0
  120. /package/dist/types/{src/plugins → plugins}/index.d.ts +0 -0
  121. /package/dist/types/{src/plugins → plugins}/nostr/index.d.ts +0 -0
  122. /package/dist/types/{src/plugins → plugins}/nostr/nostrConnector.d.ts +0 -0
  123. /package/dist/types/{src/plugins → plugins}/nostr/nostrConnectorPlugin.d.ts +0 -0
  124. /package/dist/types/{src/plugins → plugins}/nostr/nostrSigner.d.ts +0 -0
  125. /package/dist/types/{src/plugins → plugins}/nostr/types.d.ts +0 -0
  126. /package/dist/types/{src/plugins → plugins}/oauth/index.d.ts +0 -0
  127. /package/dist/types/{src/plugins → plugins}/oauth/oauthConnector.d.ts +0 -0
  128. /package/dist/types/{src/plugins → plugins}/oauth/oauthPlugin.d.ts +0 -0
  129. /package/dist/types/{src/plugins → plugins}/oauth/types.d.ts +0 -0
  130. /package/dist/types/{src/plugins → plugins}/web3/index.d.ts +0 -0
  131. /package/dist/types/{src/plugins → plugins}/web3/types.d.ts +0 -0
  132. /package/dist/types/{src/plugins → plugins}/web3/web3Connector.d.ts +0 -0
  133. /package/dist/types/{src/plugins → plugins}/web3/web3ConnectorPlugin.d.ts +0 -0
  134. /package/dist/types/{src/plugins → plugins}/web3/web3Signer.d.ts +0 -0
  135. /package/dist/types/{src/plugins → plugins}/webauthn/index.d.ts +0 -0
  136. /package/dist/types/{src/plugins → plugins}/webauthn/types.d.ts +0 -0
  137. /package/dist/types/{src/plugins → plugins}/webauthn/webauthn.d.ts +0 -0
  138. /package/dist/types/{src/plugins → plugins}/webauthn/webauthnPlugin.d.ts +0 -0
  139. /package/dist/types/{src/plugins → plugins}/webauthn/webauthnSigner.d.ts +0 -0
  140. /package/dist/{src/types → types}/shogun.js +0 -0
  141. /package/dist/types/{src/storage → storage}/storage.d.ts +0 -0
  142. /package/dist/types/{src/types → types}/events.d.ts +0 -0
  143. /package/dist/types/{src/types → types}/shogun.d.ts +0 -0
  144. /package/dist/types/{src/utils → utils}/errorHandler.d.ts +0 -0
  145. /package/dist/types/{src/utils → utils}/eventEmitter.d.ts +0 -0
  146. /package/dist/types/{src/utils → utils}/validation.d.ts +0 -0
  147. /package/dist/{src/utils → utils}/errorHandler.js +0 -0
  148. /package/dist/{src/utils → utils}/eventEmitter.js +0 -0
  149. /package/dist/{src/utils → utils}/validation.js +0 -0
@@ -1,470 +0,0 @@
1
- /**
2
- * SHIP-02: Ethereum Address Derivation Interface
3
- *
4
- * @title ISHIP_02 - Deterministic Address Derivation
5
- * @notice Interface for deriving Ethereum addresses from SHIP-00 identity
6
- *
7
- * ## Abstract
8
- *
9
- * This standard extends SHIP-00 to enable:
10
- * - Deterministic Ethereum address derivation from identity keys
11
- * - BIP-32/BIP-44 hierarchical deterministic (HD) wallet support
12
- * - Stealth address generation for enhanced privacy
13
- * - Multiple address management from single identity
14
- * - Transaction signing with derived keys
15
- *
16
- * ## Specification
17
- *
18
- * Based on:
19
- * - SHIP-00 for identity foundation
20
- * - BIP-32 for hierarchical deterministic wallets
21
- * - BIP-44 for multi-account hierarchy
22
- * - Ethers.js for Ethereum operations
23
- * - ECDH for stealth address generation
24
- *
25
- * ## Dependencies
26
- *
27
- * - SHIP-00: Identity and authentication foundation
28
- * - ethers: Ethereum wallet and signing operations
29
- *
30
- * ## Usage
31
- *
32
- * SHIP-02 enables wallet functionality on top of SHIP-00 identity:
33
- * ```typescript
34
- * const identity = new SHIP_00({ gunOptions: { peers: ['...'] } });
35
- * await identity.login('alice', 'password123');
36
- *
37
- * const addressDerivation = new SHIP_02(identity);
38
- * await addressDerivation.initialize();
39
- *
40
- * const ethAddress = await addressDerivation.deriveEthereumAddress();
41
- * ```
42
- */
43
- /**
44
- * @notice Result of address derivation operation
45
- */
46
- export interface DerivationResult {
47
- success: boolean;
48
- address?: string;
49
- path?: string;
50
- publicKey?: string;
51
- error?: string;
52
- }
53
- /**
54
- * @notice Stealth address generation result
55
- */
56
- export interface StealthAddressResult {
57
- success: boolean;
58
- address?: string;
59
- ephemeralPublicKey?: string;
60
- viewTag?: string;
61
- sharedSecret?: string;
62
- error?: string;
63
- }
64
- /**
65
- * @notice Transaction signing result
66
- */
67
- export interface SignatureResult {
68
- success: boolean;
69
- signature?: string;
70
- signedTransaction?: string;
71
- txHash?: string;
72
- error?: string;
73
- }
74
- /**
75
- * @notice Address book entry
76
- */
77
- export interface AddressEntry {
78
- address: string;
79
- path: string;
80
- publicKey: string;
81
- index: number;
82
- label?: string;
83
- createdAt: number;
84
- }
85
- /**
86
- * @notice Exported address book
87
- */
88
- export interface AddressBook {
89
- addresses: AddressEntry[];
90
- masterPublicKey: string;
91
- derivationMethod: 'bip44' | 'simple' | 'stealth';
92
- }
93
- /**
94
- * @notice Wallet info with ready-to-use wallet object (frontend-friendly)
95
- */
96
- export interface WalletInfo {
97
- wallet: any;
98
- path: string;
99
- address: string;
100
- publicKey?: string;
101
- index?: number;
102
- }
103
- /**
104
- * @notice Wallet path metadata
105
- */
106
- export interface WalletPath {
107
- path: string;
108
- created: number;
109
- }
110
- /**
111
- * @notice Event types for SHIP-02 wallet operations
112
- */
113
- export declare enum SHIP_02_EventType {
114
- WALLET_CREATED = "walletCreated",
115
- ADDRESS_DERIVED = "addressDerived",
116
- TRANSACTION_SIGNED = "transactionSigned",
117
- MNEMONIC_GENERATED = "mnemonicGenerated",
118
- SYNC_COMPLETED = "syncCompleted",
119
- ERROR = "error"
120
- }
121
- /**
122
- * @notice Event data for SHIP-02 operations
123
- */
124
- export interface SHIP_02_Event {
125
- type: SHIP_02_EventType;
126
- data?: any;
127
- timestamp: number;
128
- }
129
- /**
130
- * @notice Transaction object for signing
131
- */
132
- export interface Transaction {
133
- to: string;
134
- value?: string | bigint;
135
- data?: string;
136
- gasLimit?: string | bigint;
137
- gasPrice?: string | bigint;
138
- maxFeePerGas?: string | bigint;
139
- maxPriorityFeePerGas?: string | bigint;
140
- nonce?: number;
141
- chainId?: number;
142
- type?: number;
143
- }
144
- /**
145
- * @notice Signed transaction
146
- */
147
- export interface SignedTransaction {
148
- raw: string;
149
- hash: string;
150
- from: string;
151
- to: string;
152
- value: string;
153
- data: string;
154
- chainId: number;
155
- nonce: number;
156
- gasLimit: string;
157
- signature: {
158
- r: string;
159
- s: string;
160
- v: number;
161
- };
162
- }
163
- /**
164
- * @notice Configuration options for SHIP-02
165
- */
166
- export interface SHIP_02_Config {
167
- /** Default coin type (60 for Ethereum) */
168
- defaultCoinType?: number;
169
- /** Default account index */
170
- defaultAccount?: number;
171
- /** Enable stealth address support */
172
- enableStealth?: boolean;
173
- /** Custom derivation path prefix */
174
- customPathPrefix?: string;
175
- }
176
- /**
177
- * @title ISHIP_02 - Ethereum Address Derivation
178
- * @notice Main interface for deterministic address derivation from SHIP-00 identity
179
- */
180
- export interface ISHIP_02 {
181
- /**
182
- * @notice Initialize the address derivation system
183
- * @dev Must be called before using any derivation methods
184
- * @returns Promise that resolves when initialization is complete
185
- */
186
- initialize(): Promise<void>;
187
- /**
188
- * @notice Check if system is initialized
189
- * @returns True if initialized, false otherwise
190
- */
191
- isInitialized(): boolean;
192
- /**
193
- * @notice Derive a single Ethereum address from identity
194
- * @param path Optional BIP-32 derivation path (default: m/44'/60'/0'/0/0)
195
- * @returns Promise resolving to DerivationResult
196
- */
197
- deriveEthereumAddress(path?: string): Promise<DerivationResult>;
198
- /**
199
- * @notice Derive multiple Ethereum addresses sequentially
200
- * @param count Number of addresses to derive
201
- * @param startIndex Starting index (default: 0)
202
- * @returns Promise resolving to array of DerivationResults
203
- */
204
- deriveMultipleAddresses(count: number, startIndex?: number): Promise<DerivationResult[]>;
205
- /**
206
- * @notice Get the primary (default) Ethereum address
207
- * @returns Promise resolving to primary address string
208
- */
209
- getPrimaryAddress(): Promise<string>;
210
- /**
211
- * @notice Derive address using BIP-44 standard path
212
- * @param coinType Coin type (default: 60 for Ethereum)
213
- * @param account Account index (default: 0)
214
- * @param change Change chain (0 = external, 1 = internal)
215
- * @param index Address index
216
- * @returns Promise resolving to DerivationResult
217
- */
218
- deriveBIP44Address(coinType?: number, account?: number, change?: number, index?: number): Promise<DerivationResult>;
219
- /**
220
- * @notice Derive multiple accounts following BIP-44
221
- * @param accountCount Number of accounts to derive
222
- * @returns Promise resolving to array of DerivationResults
223
- */
224
- deriveMultipleAccounts(accountCount: number): Promise<DerivationResult[]>;
225
- /**
226
- * @notice Generate a stealth address for private transactions
227
- * @param recipientPublicKey Optional recipient public key for dual-key stealth
228
- * @returns Promise resolving to StealthAddressResult
229
- */
230
- generateStealthAddress(recipientPublicKey?: string): Promise<StealthAddressResult>;
231
- /**
232
- * @notice Derive shared secret for stealth address
233
- * @param publicKey Public key to derive shared secret with
234
- * @returns Promise resolving to shared secret hex string
235
- */
236
- deriveSharedSecret(publicKey: string): Promise<string>;
237
- /**
238
- * @notice Check if an address is a stealth address
239
- * @param address Address to check
240
- * @returns Promise resolving to boolean
241
- */
242
- isStealthAddress(address: string): Promise<boolean>;
243
- /**
244
- * @notice Get private key for a specific derived address
245
- * @param address The Ethereum address
246
- * @returns Promise resolving to private key hex string
247
- * @dev SECURITY: Handle with extreme care!
248
- */
249
- getPrivateKeyForAddress(address: string): Promise<string>;
250
- /**
251
- * @notice Get public key for a specific derived address
252
- * @param address The Ethereum address
253
- * @returns Promise resolving to public key hex string
254
- */
255
- getPublicKeyForAddress(address: string): Promise<string>;
256
- /**
257
- * @notice Get derivation path for a specific address
258
- * @param address The Ethereum address
259
- * @returns Promise resolving to derivation path string or undefined
260
- */
261
- getPathForAddress(address: string): Promise<string | undefined>;
262
- /**
263
- * @notice Sign a transaction with a derived address
264
- * @param tx Transaction object to sign
265
- * @param address Address to sign with
266
- * @returns Promise resolving to SignatureResult
267
- */
268
- signTransaction(tx: Transaction, address: string): Promise<SignatureResult>;
269
- /**
270
- * @notice Send transaction to Ethereum network
271
- * @param tx Transaction object to send
272
- * @param address Address to send from
273
- * @param waitForConfirmation Wait for transaction to be mined (default: false)
274
- * @returns Promise resolving to transaction hash and optional receipt
275
- *
276
- * Prerequisites:
277
- * - RPC provider must be configured via setRpcUrl()
278
- * - Address must be in the wallet (derived or cached)
279
- * - Sufficient ETH balance for gas
280
- */
281
- sendTransaction(tx: Transaction, address: string, waitForConfirmation?: boolean): Promise<{
282
- success: boolean;
283
- txHash?: string;
284
- receipt?: any;
285
- error?: string;
286
- }>;
287
- /**
288
- * @notice Sign arbitrary message with a derived address
289
- * @param message Message to sign (string or bytes)
290
- * @param address Address to sign with
291
- * @returns Promise resolving to signature hex string
292
- */
293
- signMessage(message: string | Uint8Array, address: string): Promise<string>;
294
- /**
295
- * @notice Verify signature for a message
296
- * @param message Original message
297
- * @param signature Signature to verify
298
- * @param address Expected signer address
299
- * @returns Promise resolving to boolean (true if valid)
300
- */
301
- verifySignature(message: string | Uint8Array, signature: string, address: string): Promise<boolean>;
302
- /**
303
- * @notice Get all derived addresses
304
- * @returns Promise resolving to array of AddressEntry
305
- */
306
- getAllAddresses(): Promise<AddressEntry[]>;
307
- /**
308
- * @notice Get address by index
309
- * @param index Address index
310
- * @returns Promise resolving to AddressEntry or undefined
311
- */
312
- getAddressByIndex(index: number): Promise<AddressEntry | undefined>;
313
- /**
314
- * @notice Set label for an address
315
- * @param address Address to label
316
- * @param label Human-readable label
317
- * @returns Promise that resolves when label is set
318
- */
319
- setAddressLabel(address: string, label: string): Promise<void>;
320
- /**
321
- * @notice Export address book
322
- * @returns Promise resolving to AddressBook
323
- */
324
- exportAddressBook(): Promise<AddressBook>;
325
- /**
326
- * @notice Import address book (for recovery)
327
- * @param addressBook AddressBook to import
328
- * @returns Promise that resolves when import is complete
329
- */
330
- importAddressBook(addressBook: AddressBook): Promise<void>;
331
- /**
332
- * @notice Verify ownership of an address
333
- * @param address Address to verify
334
- * @returns Promise resolving to boolean (true if owned)
335
- */
336
- ownsAddress(address: string): Promise<boolean>;
337
- /**
338
- * @notice Get the master public key (xpub)
339
- * @returns Promise resolving to extended public key string
340
- */
341
- getMasterPublicKey(): Promise<string>;
342
- /**
343
- * @notice Clear all cached keys and addresses
344
- * @dev Use with caution - requires re-initialization
345
- * @returns Promise that resolves when cache is cleared
346
- */
347
- clearCache(): Promise<void>;
348
- /**
349
- * @notice Set RPC provider URL for network operations
350
- * @param rpcUrl The RPC endpoint URL
351
- * @returns Promise that resolves when provider is configured
352
- */
353
- setRpcUrl(rpcUrl: string): Promise<void>;
354
- /**
355
- * @notice Get current RPC provider
356
- * @returns RPC provider instance or null
357
- */
358
- getProvider(): any;
359
- /**
360
- * @notice Get signer connected to provider
361
- * @returns Signer instance for transactions
362
- */
363
- getSigner(): any;
364
- /**
365
- * @notice Set custom signer
366
- * @param signer Custom wallet to use as signer
367
- * @returns Promise that resolves when signer is set
368
- */
369
- setSigner(signer: any): Promise<void>;
370
- /**
371
- * @notice Create a new wallet with auto-incremented index
372
- * @returns Promise resolving to WalletInfo with ready-to-use wallet object
373
- */
374
- createWallet(): Promise<WalletInfo>;
375
- /**
376
- * @notice Load all wallets from stored paths
377
- * @returns Promise resolving to array of WalletInfo objects
378
- */
379
- loadWallets(): Promise<WalletInfo[]>;
380
- /**
381
- * @notice Get main wallet derived from Gun user keys
382
- * @dev This is different from BIP-44 derivation - uses Gun SEA keys directly
383
- * @returns Main wallet instance
384
- */
385
- getMainWallet(): any;
386
- /**
387
- * @notice Get main wallet credentials (address + private key)
388
- * @returns Object with address and private key
389
- */
390
- getMainWalletCredentials(): {
391
- address: string;
392
- priv: string;
393
- };
394
- /**
395
- * @notice Export wallet keys for all derived addresses
396
- * @returns Promise resolving to JSON string with all wallet keys
397
- */
398
- exportWalletKeys(): Promise<string>;
399
- /**
400
- * @notice Export Gun SEA keypair
401
- * @returns Promise resolving to JSON string with Gun pair
402
- */
403
- exportGunPair(): Promise<string>;
404
- /**
405
- * @notice Export all user data (mnemonic, wallets, Gun pair)
406
- * @returns Promise resolving to encrypted backup string
407
- */
408
- exportAllUserData(): Promise<string>;
409
- /**
410
- * @notice Import wallet keys and restore multiple wallets
411
- * @param walletsData JSON string with wallet keys
412
- * @returns Promise resolving to number of wallets imported
413
- */
414
- importWalletKeys(walletsData: string): Promise<number>;
415
- /**
416
- * @notice Import Gun SEA keypair
417
- * @param pairData JSON string with Gun pair
418
- * @returns Promise resolving to boolean success status
419
- */
420
- importGunPair(pairData: string): Promise<boolean>;
421
- /**
422
- * @notice Import all user data from backup
423
- * @param backupData Encrypted backup string
424
- * @param options Import options (which data to import)
425
- * @returns Promise resolving to import results
426
- */
427
- importAllUserData(backupData: string, options?: {
428
- importMnemonic?: boolean;
429
- importWallets?: boolean;
430
- importGunPair?: boolean;
431
- }): Promise<{
432
- success: boolean;
433
- mnemonicImported?: boolean;
434
- walletsImported?: number;
435
- gunPairImported?: boolean;
436
- }>;
437
- /**
438
- * @notice Initialize wallet paths from Gun storage
439
- * @returns Promise that resolves when paths are loaded
440
- */
441
- initializeWalletPaths(): Promise<void>;
442
- /**
443
- * @notice Save wallet paths to localStorage backup
444
- * @returns Promise that resolves when saved
445
- */
446
- saveWalletPathsToLocalStorage(): Promise<void>;
447
- /**
448
- * @notice Load wallet paths from localStorage
449
- * @returns Promise that resolves when loaded
450
- */
451
- loadWalletPathsFromLocalStorage(): Promise<void>;
452
- /**
453
- * @notice Initialize wallet paths and test encryption system
454
- * @dev Convenience method that combines initialization and testing
455
- * @returns Promise that resolves when initialization and testing complete
456
- */
457
- initializeWalletPathsAndTestEncryption(): Promise<void>;
458
- /**
459
- * @notice Cleanup resources and timers
460
- * @dev Call before destroying instance
461
- * @returns Promise that resolves when cleanup is complete
462
- */
463
- cleanup(): Promise<void>;
464
- }
465
- export type SHIP_02_Events = {
466
- addressDerived: (result: DerivationResult) => void;
467
- stealthGenerated: (result: StealthAddressResult) => void;
468
- transactionSigned: (result: SignatureResult) => void;
469
- error: (error: Error) => void;
470
- };