diff --git a/packages/core/src/v1-helpers.ts b/packages/core/src/v1-helpers.ts index 9034de76..552ece06 100644 --- a/packages/core/src/v1-helpers.ts +++ b/packages/core/src/v1-helpers.ts @@ -92,6 +92,7 @@ export function toV1WalletService(wallet: IWallet) { mnemonic?: string; type?: KeypairType; derivePath?: string; + hasBackup?: boolean; }) => { walletServiceConfigs.validation.createAccountDocuments(params); @@ -102,6 +103,7 @@ export function toV1WalletService(wallet: IWallet) { mnemonic, json, password, + hasBackup } = params; const keyringJson = json @@ -144,6 +146,7 @@ export function toV1WalletService(wallet: IWallet) { value: keyringJson.address, address: keyringJson.address, name, + hasBackup, correlation: correlations.map(doc => doc.id), }); diff --git a/packages/wasm/src/modules/accounts.ts b/packages/wasm/src/modules/accounts.ts index 50e37b9a..47ebea5c 100644 --- a/packages/wasm/src/modules/accounts.ts +++ b/packages/wasm/src/modules/accounts.ts @@ -32,6 +32,7 @@ export type CreateAccountParams = { json: string, password: string, getIfExists: boolean, + hasBackup: boolean, }; export class Accounts { @@ -166,7 +167,7 @@ export class Accounts { } async create(params: CreateAccountParams): Promise { - let {name, json, password, type = 'sr25519', getIfExists} = params; + let {name, json, password, type = 'sr25519', getIfExists, hasBackup} = params; assert(!!name, 'name is required'); assert(!!type, 'keypair type is required'); @@ -228,6 +229,7 @@ export class Accounts { mnemonic, json, password, + hasBackup, }); documents.forEach(doc => { diff --git a/packages/wasm/src/services/wallet/service.ts b/packages/wasm/src/services/wallet/service.ts index 42a17e3a..73e8d35a 100644 --- a/packages/wasm/src/services/wallet/service.ts +++ b/packages/wasm/src/services/wallet/service.ts @@ -100,7 +100,7 @@ export class WalletService { return this.wallet.add(content); } - remove(id: sring) { + remove(id: string) { this._assertWallet(); validation.remove(id); return this.wallet.remove(id); @@ -191,6 +191,7 @@ export class WalletService { mnemonic, json, password, + hasBackup } = params; const keyringPair = json @@ -233,6 +234,7 @@ export class WalletService { address: keyringPair.address, name, correlation: correlationDocs.map(doc => doc.id), + hasBackup, }; await this.wallet.add(addressDocument);