-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create operator data schema, pg table, and aggregate on getUser queries
- Loading branch information
Showing
12 changed files
with
125 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"$id": "https://casimir.co/operator.schema.json", | ||
"$schema": "http://json-schema.org/draft-07/schema#", | ||
"title": "Operator", | ||
"type": "object", | ||
"properties": { | ||
"account_id": { | ||
"type": "integer", | ||
"description": "The ID of the account the operator belongs to (FK)" | ||
}, | ||
"id": { | ||
"type": "serial", | ||
"description": "The operator ID (PK)" | ||
}, | ||
"user_id": { | ||
"type": "integer", | ||
"description": "The ID of the user who is an operator (FK)" | ||
}, | ||
"created_at": { | ||
"type": "string", | ||
"description": "The operator creation date in ISO 8601 format" | ||
}, | ||
"updated_at": { | ||
"type": "string", | ||
"description": "The operator last update date in ISO 8601 format" | ||
} | ||
}, | ||
"required": [ | ||
"account_id", | ||
"id", | ||
"user_id", | ||
"created_at", | ||
"updated_at" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,7 @@ | ||
export interface Operator { | ||
accountId: number | ||
id: number | ||
id_str: string | ||
declared_fee: number | ||
previous_fee: number | ||
fee: number // Todo check if this is bigint | ||
name: string | ||
public_key: string | ||
owner_address: string | ||
address: string | ||
location: string | ||
setup_provider: string | ||
eth1_node_client: string | ||
eth2_node_client: string | ||
description: string | ||
website_url: string | ||
twitter_url: string | ||
linkedin_url: string | ||
logo: string | ||
type: string | ||
performance: { | ||
'24h': number | ||
'30d': number | ||
}, | ||
is_active: number | ||
is_valid: boolean | ||
is_deleted: boolean | ||
status: string // Todo check for enum (i.e., 'Active'...) | ||
validators_count: number | ||
url: string // Todo check if this is usable in DKG | ||
userId: number | ||
createdAt: string | ||
updatedAt: string | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export interface OperatorAddedSuccess { | ||
id: number | ||
account_id: number | ||
created_at: string | ||
updated_at: string | ||
user_id: number | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export interface OperatorDetails { | ||
id_str: string | ||
declared_fee: number | ||
previous_fee: number | ||
fee: number // Todo check if this is bigint | ||
name: string | ||
public_key: string | ||
owner_address: string | ||
address: string | ||
location: string | ||
setup_provider: string | ||
eth1_node_client: string | ||
eth2_node_client: string | ||
description: string | ||
website_url: string | ||
twitter_url: string | ||
linkedin_url: string | ||
logo: string | ||
type: string | ||
performance: { | ||
'24h': number | ||
'30d': number | ||
}, | ||
is_active: number | ||
is_valid: boolean | ||
is_deleted: boolean | ||
status: string // Todo check for enum (i.e., 'Active'...) | ||
validators_count: number | ||
url: string // Todo check if this is usable in DKG | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { AccountWithStakingAndOperatorInfo, Operator, User } from '@casimir/types' | ||
|
||
export interface UserWithAccountsAndOperators extends User { | ||
/** An array of the user's accounts */ | ||
accounts: AccountWithStakingAndOperatorInfo[] | ||
/** An array of the user's operators */ | ||
operators?: Operator[] | ||
} |