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 sync addresses #448

Closed
rabbitz opened this issue Oct 11, 2023 · 3 comments
Closed

portfolio sync addresses #448

rabbitz opened this issue Oct 11, 2023 · 3 comments
Assignees

Comments

@rabbitz
Copy link

rabbitz commented Oct 11, 2023

User ckb statistic

GET /api/v2/portfolio/statistics

Request Parameters

Parameter Required Type Description
latest_address yes String frontend latest address

Request Example

curl --location --request GET 'http://localhost:3000/api/v2/portfolio/statistics?latest_address=%E5%95%A5%E5%9C%B0%E6%96%B9' \
--header 'Authorization: eyJhbGciOiJIUzI1NiJ9.eyJ1dWlkIjoiYjhjZjkwNjAtYTk5Ni00OWUyLWE5ZjItZTdjZjliYzY1NzU1IiwiZXhwIjoxNzA3ODg3MDg4fQ.gRpZ9crgkDVXsfEDFgCXeIGGz3MfCNjKSs3RtDAkIW8' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Accept: */*' \
--header 'Host: localhost:3000' 
--header 'Connection: keep-alive'

Response Example

{
  "data": {
    "balance": "0",
    "balance_occupied": "0",
    "dao_deposit": "0",
    "interest": "0",
    "dao_compensation": "0"
  }
}

Sync frontend latest addresses

POST /api/v2/portfolio/addresses

Request Parameters

Parameter Required Type Description
addresses yes []String user wallet addresses

Request Example

curl --location --request POST 'http://localhost:3000/api/v2/portfolio/addresses' \
--header 'Authorization: eyJhbGciOiJIUzI1NiJ9.eyJ1dWlkIjoiZWY0ZTU5ZTAtMGJiMi00N2U5LWE2ZjctOGQxYTQ1NWY3OGZhIiwiZXhwIjoxNjk5ODU4MjY3fQ.r7QyrOPX5_mQsxkzQq86Xi_l4vvCCDZx5jU3MRHSlDY' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: localhost:3000' \
--header 'Connection: keep-alive' \
--data-raw '{
    "addresses": [
        "ckt1q3w9q60tppt7l3j7r09qcp7lxnp3vcanvgha8pmvsa3jplykxn323k5v49yzmvm0q0kfqw0hk0kyal6z32nwjvcqqr7qyzq8yqtec2wj"
    ]
}'

Response Example

Http Status 204
@FrederLu
Copy link

Image
Image
Image

The parameters are not filled in or the wrong type is missing validation.

@rabbitz
Copy link
Author

rabbitz commented Jan 30, 2024

@FrederLu
Copy link

nervosnetwork/ckb-explorer#1609

Verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants