Closed happyJ2024 closed 1 year ago
signin api:
//request
{
"identityNetwork": "polkadot"
}
//response { "identityNetwork": "polkadot", "callbackEndpoint": "/web3_challenge", "scope": [ "address" ], "challenge": "challenge message to signin at 2022-01-19T13:08:21.864Z", "nonce": "web3-signin-1642597701864-2d679b" }
2. POST https://web3go.xyz/portal/user/web3_challenge
//request { "identityNetwork": "polkadot", "scope": ["address","balance"], "challenge": "challenge message to signin at 2022-01-19T13:08:21.864Z", "signature": "0x1ea2596a8e675e5c00c1088bcdeb95c1db3e75152d31cce6d120a5892eb39b0d112da3c6069715bcac6ac212bad4d9da048517161ad9240ddedd817553f6af8e", "address": "5GsNYEXtBfGBN4buJEqRtGtonJkgq8Uo2dex3zqLcnwwfy3n", "nonce": "web3-signin-1642597701864-2d679b" }
//response { "identityNetwork": "polkadot", "scope": [ "address", "balance" ], "challenge": "challenge message to signin at 2022-01-19T13:08:21.864Z", "signature": "0x1ea2596a8e675e5c00c1088bcdeb95c1db3e75152d31cce6d120a5892eb39b0d112da3c6069715bcac6ac212bad4d9da048517161ad9240ddedd817553f6af8e", "address": "5GsNYEXtBfGBN4buJEqRtGtonJkgq8Uo2dex3zqLcnwwfy3n", "nonce": "web3-signin-1642597701864-2d679b", "verified": true, "extra": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6IjVHc05ZRVh0QmZHQk40YnVKRXFSdEd0b25Ka2dxOFVvMmRleDN6cUxjbnd3ZnkzbiIsInN1YiI6IjI4IiwiaWF0IjoxNjQyNjAyNzU2LCJleHAiOjE2NDMyMDc1NTZ9.JdVPTvoHtxhx_osEKSJJUMrvY78fdFquqANL33R2XDs" }
-- extra 即是token, 接下来就可以调用 getUserInfo接口获取当前用户信息
3. POST https://web3go.xyz/portal/user/web3_sign_out
//request
//response true
-- 这个接口目前没什么实际作用, 可省略调用
user address bundle api:
//request
//response
[
{
"address_type": "ethereum",
"address": "0x87DB37bbD0cE0A94119B212bC76BCdD6588800",
"id": "1",
"user_id": 28,
"bundle_created_time": "2022-01-19T14:14:17.000Z"
}
]
2. POST https://web3go.xyz/portal/user/addAddressBundle
//request { "id": 0, "user_id": 28, "address_type": "ethereum", "address": "0x87DB37bbD0cE0A94119B212bC76BCdD6588800", "bundle_created_time": "2022-01-19T14:14:16.957Z" } //response { "id": 5, "user_id": 28, "address_type": "ethereum", "address": "0x87DB37bbD0cE0A94119B212bC76BCdD6588800", "bundle_created_time": "2022-01-19T14:14:16.957Z" }
3. POST https://web3go.xyz/portal/user/removeAddressBundle
//request { "id": 5, "user_id": 28, "address_type": "ethereum", "address": "0x87DB37bbD0cE0A94119B212bC76BCdD6588800", "bundle_created_time": "2022-01-19T14:14:16.957Z" } //response true
PolkaSignIn https://github.com/litentry/PolkaSignIn --- 这只是一个示例, 如何做钱包登录的.
[x] prototype design https://app.mockplus.cn/s/Z-KX58CAtg34
[x] api dev
[ ] UI dev
[ ] 1. 使用钱包登录 Polkadot.js
账户系统升级, 把邮箱注册的去掉, 登陆页可能不再需要.
[ ] 2.关联更多Web2账户:
绑定邮箱, 绑定社交媒体 twitter, github. 未来可以作为KYC数据, 后面用在badge里面
[ ] 3. 关联钱包地址来支持更多链的地址
比如 以太坊地址, 输入以太坊地址, 通过 Metamask 验证该地址, 成功后, 将以太坊地址与 Polkadot地址形成关联关系.