Skip to content

Commit

Permalink
add createdAt field in wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchit-b committed Feb 9, 2025
1 parent 1b33cc4 commit ba13d07
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/keychain/keychain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export class KeyChain {
walletType: type === 'create' ? WALLETTYPE.SEED_PHRASE : WALLETTYPE.SEED_PHRASE_IMPORTED,
id: walletId,
colorIndex: colorIndex,
createdAt: new Date().toISOString(),
};

await KeyChain.updateKeyChain<T>({
Expand Down Expand Up @@ -98,6 +99,7 @@ export class KeyChain {
walletType: WALLETTYPE.SEED_PHRASE,
id: walletId,
colorIndex: colorIndex ?? addressIndex,
createdAt: new Date().toISOString(),
} as Key<T>;

const keystoreEntry: { [id: string]: Key<T> } = {
Expand Down Expand Up @@ -154,6 +156,7 @@ export class KeyChain {
walletType: WALLETTYPE.PRIVATE_KEY,
id: walletId,
colorIndex: lastIndex,
createdAt: new Date().toISOString(),
},
};

Expand Down
1 change: 1 addition & 0 deletions src/types/keychain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export type Key<T extends string> = {
walletType: WALLETTYPE;
id: string;
colorIndex: number;
createdAt?: string;
};

export type Keystore<T extends string> = Record<string, Key<T>>;
Expand Down

0 comments on commit ba13d07

Please sign in to comment.