@@ -46,6 +46,14 @@ import type {
4646 * })
4747 * console.log(ethWallet.address) // Ethereum-format address (0x...)
4848 *
49+ * // Setup ethereum wallet with BIP44 derivation path
50+ * const ethBip44 = setupWallet({
51+ * mnemonic: 'abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about',
52+ * type: 'ethereum',
53+ * derivationPath: "m/44'/60'/0'/0/0",
54+ * })
55+ * console.log(ethBip44.address) // Matches MetaMask default derivation
56+ *
4957 * // Setup development wallet from URI
5058 * const aliceWallet = setupWallet({ uri: '//Alice' })
5159 * console.log(aliceWallet.address) // Alice's development address
@@ -67,7 +75,9 @@ export const setupWallet = (params: SetupWalletParams): Wallet => {
6775 keyringPair = keyring . addFromUri ( ( params as URI ) . uri )
6876 } else if ( ( params as Mnemonic ) . mnemonic ) {
6977 // Treat as mnemonic
70- keyringPair = keyring . addFromUri ( ( params as Mnemonic ) . mnemonic )
78+ const base = ( params as Mnemonic ) . mnemonic
79+ const withPath = params . derivationPath ? `${ base } /${ params . derivationPath } ` : base
80+ keyringPair = keyring . addFromUri ( withPath )
7181 } else throw new Error ( 'Invalid mnemonic or private key' )
7282
7383 return {
@@ -140,22 +150,22 @@ export const generateWallet = (type: KeypairType = 'sr25519'): GeneratedWallet =
140150 * console.log('Account address:', accounts[0].address)
141151 *
142152 * // Activate on specific network
143- * const { api: taurusApi , accounts: taurusAccounts } = await activateWallet({
153+ * const { api: mainnetApi , accounts: mainnetAccounts } = await activateWallet({
144154 * mnemonic: 'your mnemonic here',
145- * networkId: 'taurus '
155+ * networkId: 'mainnet '
146156 * })
147157 *
148158 * // Activate on domain
149159 * const { api: domainApi, accounts: domainAccounts } = await activateWallet({
150160 * uri: '//Alice',
151- * networkId: 'taurus ',
161+ * networkId: 'mainnet ',
152162 * domainId: '0' // Auto-EVM domain
153163 * })
154164 *
155165 * // Activate with ethereum key type
156166 * const { api: ethApi, accounts: ethAccounts } = await activateWallet({
157167 * mnemonic: 'your mnemonic here',
158- * networkId: 'taurus ',
168+ * networkId: 'mainnet ',
159169 * type: 'ethereum'
160170 * })
161171 *
@@ -229,15 +239,15 @@ export const activateWallet = async (params: ActivateWalletParams): Promise<Wall
229239 * console.log('Created', wallets.length, 'mock wallets')
230240 *
231241 * // Create mock wallets for testnet
232- * const testWallets = await mockWallets({ networkId: 'taurus ' })
242+ * const testWallets = await mockWallets({ networkId: 'mainnet ' })
233243 *
234244 * // Create mock wallets with existing API
235245 * const api = await activate({ networkId: 'localhost' })
236246 * const localWallets = await mockWallets({ networkId: 'localhost' }, api)
237247 *
238248 * // Create ethereum-type mock wallets
239249 * const ethWallets = await mockWallets(
240- * { networkId: 'taurus ' },
250+ * { networkId: 'mainnet ' },
241251 * undefined,
242252 * 'ethereum'
243253 * )
0 commit comments