Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
js-sdk
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Odysseus
js-sdk
Commits
b30977b8
Commit
b30977b8
authored
May 30, 2024
by
贾浩@五瓣科技
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
922745c8
Pipeline
#765
failed with stages
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
1 deletion
+36
-1
README.md
README.md
+35
-1
main.js
src/main.js
+1
-0
No files found.
README.md
View file @
b30977b8
# readme
\ No newline at end of file
# readme
## telegram
https://core.telegram.org/bots/webapps#initializing-mini-apps
### 首次登录
- 随机生成密码,将密码保存到cloudstorage,通过随机密码生成keystore,使用私钥对json keystore签名
- 把initData, keystore, 对keystore的签名传入后端
- 获取web3 provider
### 后续登录
- 把initData传入后端,获取keystore
- 从cloudstorage获取密码,使用密码解密keystore
- 获取web3 provider
## h5 email
### 首次登录
- 使用邮件,验证码注册,获取jwt
- 随机生成密码,通过随机密码生成keystore,使用私钥对json keystore签名
- 把随机密码保存到kv存储服务端(待开发)
- 把keystore,对keystore的签名传入后端
- 获取web3 provider
### 后续登录
- 使用邮件,验证码登录,获取jwt
- 从kv存储服务端获取随机密码
- 从后端获取keystore,使用密码解密keystore
- 获取web3 provider
src/main.js
View file @
b30977b8
...
...
@@ -49,6 +49,7 @@ class TelegramClient {
})
}
console
.
log
(
"
load keystore time cost:
"
,
new
Date
().
getTime
()
-
st
)
return
this
.
provider
.
accounts
.
sign
(
JSON
.
stringify
(
this
.
keystore
),
this
.
account
.
privateKey
)
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment