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 connect #447

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

portfolio account connect #447

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

Comments

@rabbitz
Copy link

rabbitz commented Oct 11, 2023

Register or sign in via ckb address

POST /api/v2/portfolio/sessions

Request Parameters

Parameter Required Type Description
address yes String user ckb address
message yes String wallet conenct message
signature yes String wallet conenct signature
pub_key false String user signature public key

Request Example

curl --location --request POST 'http://localhost:3000/api/v2/portfolio/sessions' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: localhost:3000' \
--header 'Connection: keep-alive' \
--data-raw '{
    "message": "0x95e919c41e1ae7593730097e9bb1185787b046ae9f47b4a10ff4e22f9c3e3eab",
    "signature": "0x1e94db61cff452639cf7dd991cf0c856923dcf74af24b6f575b91479ad2c8ef40769812d1cf1fd1a15d2f6cb9ef3d91260ef27e65e1f9be399887e9a5447786301",
    "address": "ckt1qzda0cr08m85hc8jlnfp3zer7xulejywt49kt2rr0vthywaa50xwsqfkcv576ccddnn4quf2ga65xee2m26h7nq4sds0r",
    "pub_key": null
}'

Response Example

{
    "name": "test",
    "jwt": "eyJhbGciOiJIUzI1NiJ9.eyJ1dWlkIjoiZWY0ZTU5ZTAtMGJiMi00N2U5LWE2ZjctOGQxYTQ1NWY3OGZhIiwiZXhwIjoxNjk5ODU4MjY3fQ.r7QyrOPX5_mQsxkzQq86Xi_l4vvCCDZx5jU3MRHSlDY"
}

Update user name

PUT /api/v2/portfolio/user

Request Parameters

Parameter Required Type Description
name yes String user name

Request Example

curl --location --request PUT 'http://localhost:3000/api/v2/portfolio/user' \
--header 'Authorization: eyJhbGciOiJIUzI1NiJ9.eyJ1dWlkIjoiZWY0ZTU5ZTAtMGJiMi00N2U5LWE2ZjctOGQxYTQ1NWY3OGZhIiwiZXhwIjoxNjk5ODU4MjI4fQ.WlHxTpGOaw1fLGTwO-r_Fg1C32xjDu3YsVw_0oBqztA' \
--header 'Content-Type: application/json' \
--header 'Accept: */*' \
--header 'Host: localhost:3000' \
--header 'Connection: keep-alive' \
--data-raw '{
    "name": "nametest"
}'

Response Example

Http Status 204
@rabbitz rabbitz self-assigned this Oct 11, 2023
@rabbitz rabbitz moved this to 🏗 In Progress in CKB Explorer Oct 12, 2023
@rabbitz
Copy link
Author

rabbitz commented Oct 23, 2023

@Danie0918 Danie0918 moved this from 🏗 In Progress to 🔎 Code Review in CKB Explorer Oct 23, 2023
@Sven-TBD Sven-TBD moved this from 🔎 Code Review to 👀 Testing in CKB Explorer Dec 25, 2023
@FrederLu
Copy link

Image
Image
Image
Image
If the type exception is missing, 500 is returned.


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.

@FrederLu FrederLu moved this from 👀 Testing to ✅ Done 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
Archived in project
Development

No branches or pull requests

3 participants