Skip to content

Commit

Permalink
Add enabledWalletIds to wallet creation
Browse files Browse the repository at this point in the history
  • Loading branch information
swansontec committed Feb 12, 2024
1 parent 85839d6 commit b1b9910
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Unreleased

- added: Accept an `enabledTokens` parameter to the `createCurrencyWallets` method.

## 2.1.1 (2024-02-02)

- fixed: Token activation causing error and insufficient funds when used with core 1.x plugins
Expand Down
5 changes: 4 additions & 1 deletion src/core/login/keys.ts
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ export async function finishWalletCreation(
walletId: string,
opts: EdgeCreateCurrencyWalletOptions
): Promise<EdgeCurrencyWallet> {
const { migratedFromWalletId, name, fiatCurrencyCode } = opts
const { enabledTokenIds, fiatCurrencyCode, migratedFromWalletId, name } = opts
const wallet = await waitForCurrencyWallet(ai, walletId)

// Write ancillary files to disk:
Expand All @@ -302,6 +302,9 @@ export async function finishWalletCreation(
if (fiatCurrencyCode != null) {
await wallet.setFiatCurrencyCode(fiatCurrencyCode)
}
if (enabledTokenIds != null) {
await wallet.changeEnabledTokenIds(enabledTokenIds)
}

return wallet
}
1 change: 1 addition & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,7 @@ export interface ChangeUsernameOptions {
// currencies ----------------------------------------------------------

export interface EdgeCreateCurrencyWalletOptions {
enabledTokenIds?: string[]
fiatCurrencyCode?: string
name?: string

Expand Down

0 comments on commit b1b9910

Please sign in to comment.