Skip to content

Commit 7e9b6ae

Browse files
author
cpl121
committed
fix: selected wallet id
1 parent f35309e commit 7e9b6ae

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

packages/shared/lib/core/profile/actions/createWallet.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { IWallet } from '../interfaces'
55
import { activeProfile as activeProfileStore } from '../stores'
66
import { getSecretManagerFromProfileType, getStorageDirectoryOfProfile } from '../utils'
77
import { WalletOptions } from '@iota/sdk'
8+
import { selectedWalletId } from '../../wallet'
89

910
// TODO(2.0): Fix and finish this method
1011
/* - __storage__/
@@ -28,9 +29,15 @@ export async function createWallet(activeProfile = get(activeProfileStore)): Pro
2829
},
2930
coinType: activeProfile.network.coinType
3031
}
32+
console.log("walletOptions", walletOptions);
33+
3134
const wallet = await api.createWallet(id, {
3235
...walletOptions,
3336
storagePath,
3437
})
38+
39+
// TODO(2.0): Fix
40+
selectedWalletId.set(id)
41+
console.log("wallet in createWallet", wallet);
3542
return wallet
3643
}

packages/shared/lib/core/wallet/actions/getClient.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ import { getSelectedWallet } from '@core/wallet/stores'
33

44
export function getClient(): Promise<Client> {
55
const wallet = getSelectedWallet();
6+
console.log("wallet in getClient", wallet);
7+
68
return wallet!.getClient()
79
}

packages/shared/lib/core/wallet/actions/setClientOptions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,7 @@ import { getSelectedWallet } from '../stores'
33

44
export async function setClientOptions(clientOptions: Partial<ClientOptions>): Promise<void> {
55
const wallet = getSelectedWallet();
6+
console.log("wallet in setClientOptions", wallet);
7+
68
await wallet.setClientOptions(clientOptions)
79
}

0 commit comments

Comments
 (0)