Skip to content

Commit

Permalink
chore: validations for inerting address in book
Browse files Browse the repository at this point in the history
  • Loading branch information
shawakash committed Apr 23, 2024
1 parent 82273bc commit 4cc2344
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion packages/common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -278,4 +278,13 @@ export interface Settings {
clientId?: string,
}

export type ChainNet = EthCluster | SolCluster | BitcoinCluster
export type ChainNet = EthCluster | SolCluster | BitcoinCluster

export interface AddressBook {
id: string,
clientId: string,
name: string,
publicKey: string,
chain: string,
tag?: string,
}
8 changes: 8 additions & 0 deletions packages/common/src/validations/address_book.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { z } from "zod";

export const InsertAddressBook = z.object({
name: z.string(),
publicKey: z.string(),
chain: z.string(),
tag: z.string().optional(),
});
3 changes: 2 additions & 1 deletion packages/common/src/validations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ export * from "./friendship";
export * from "./notification";
export * from "./buy";
export * from "./locale";
export * from "./settings";
export * from "./settings";
export * from "./address_book";

0 comments on commit 4cc2344

Please sign in to comment.