Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

portfolio account aggregated statistics #444

Open
3 tasks
rabbitz opened this issue Oct 9, 2023 · 1 comment
Open
3 tasks

portfolio account aggregated statistics #444

rabbitz opened this issue Oct 9, 2023 · 1 comment
Assignees

Comments

@rabbitz
Copy link

rabbitz commented Oct 9, 2023

  • Prd & Design

Magickbase/visual-style-guide#36

  • Sync account between frontend and backend

ckb-js/kuai#464 (comment)

  • Wallet connect

Magickbase/neuron-public-issues#144

  • verify signature

https://github.com/ckb-js/lumos/blob/develop/packages/hd/src/key.ts#L27-L30


@rabbitz
Copy link
Author

rabbitz commented Oct 9, 2023

User sign in

  1. route definition
  • Url: /api/v2/portfolio/sessions
  • Method: POST
  1. request definition
address [string]
message [string]
signature [string]
pub_key [string]
  1. response definition
jwt [string]

Update user name

  1. route definition
  • Url: /api/v2/portfolio/user
  • Method: PUT
  • Response: -
  1. request definition
name [string]

User portfolio statistics

  1. route definition
  • Url: /api/v2/portfolio/statistics
  • Method: GET
  1. request definition
address [string] # latest_address_in_frontend
  1. response definition
capacity [decimal]
deposit_compensation [decimal]
occupied_capacity [decimal]
dao_deposit [decimal]

Sync portfolio addresses

  1. route definition
  • Url: /api/v2/portfolio/sync_addresses
  • Method: POST
  • Response: -
  1. request definition
addresses [][string]  # addresses_diff_between_frontend_and_backend

CREATE TABLE
  `users`(
    `id` BIGINT NOT NULL AUTO_INCREMENT COMMENT 'user id, primary key',
    `uuid` VARCHAR(36) NOT NULL DEFAULT '' COMMENT 'user uuid',
    `identifier` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'user identifier',
    `nonce` INT unsigned NOT NULL DEFAULT 0 COMMENT 'user nonce',
    `name` VARCHAR(255) DEFAULT '' COMMENT 'user name',
    `create_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT 'created at',
    `update_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT 'updated at',
    PRIMARY KEY(`id`),
    CONSTRAINT uc_identifier_on_users UNIQUE(`identifier`),
    CONSTRAINT uc_uuid_on_users UNIQUE(`uuid`)
  );
CREATE TABLE
  `portfolios`(
    `user_id` BIGINT NOT NULL DEFAULT 0 COMMENT 'user id',
    `address_id` BIGINT NOT NULL DEFAULT 0 COMMENT 'address id',
    UNIQUE KEY `uc_user_id_address_id_on_portfolios`(`user_id`, `address_id`)
  );
CREATE TABLE
  `portfolio_statistics`(
    `user_id` BIGINT NOT NULL DEFAULT 0,
    `capacity` DECIMAL(30, 0) UNSIGNED NOT NULL DEFAULT 0,
    `occupied_capacity` DECIMAL(30, 0) UNSIGNED NOT NULL DEFAULT 0,
    `dao_deposit` DECIMAL(30, 0) UNSIGNED NOT NULL DEFAULT 0,
    `interest` DECIMAL(30, 0) UNSIGNED NOT NULL DEFAULT 0,
    `unclaimed_compensation` DECIMAL(30, 0) UNSIGNED NOT NULL DEFAULT 0,
    UNIQUE KEY `uc_user_id_address_id_on_portfolios`(`user_id`, `address_id`)
  );

@rabbitz rabbitz moved this from 🏗 In Progress to 🔎 Code Review in CKB Explorer Nov 6, 2023
@zhangyouxin zhangyouxin mentioned this issue Nov 20, 2023
2 tasks
@zmcNotafraid zmcNotafraid removed their assignment Dec 11, 2023
@poor-defined poor-defined moved this from 🔎 Code Review to 👀 Testing in CKB Explorer Dec 25, 2023
@poor-defined poor-defined moved this from 👀 Testing to 📫Hold On in CKB Explorer Jan 22, 2024
@poor-defined poor-defined moved this from 📫Hold On to 👀 Testing in CKB Explorer Jan 22, 2024
@poor-defined poor-defined assigned FrederLu and unassigned zhangyouxin Jan 22, 2024
@FrederLu FrederLu moved this from 👀 Testing to 🚩Pre Release in CKB Explorer Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🚩Pre Release
Development

No branches or pull requests

4 participants