-
Notifications
You must be signed in to change notification settings - Fork 4
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
feat: token-core support Ton chain[R2D2-13379] #139
base: main
Are you sure you want to change the base?
Conversation
CoinInfo { | ||
chain_id: "".to_string(), | ||
coin: "TON".to_string(), | ||
derivation_path: "m/44'/607'/0'".to_string(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这是不应该是 m/44'/607'/0'/0/0 吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
看了trust wallet的代码,ton的address生成测试是用的slip44路径,但是都是到account级别,没有加后两层。
token-core/tcx-ton/src/address.rs
Outdated
_ => DEFAULT_WALLET_ID, | ||
}; | ||
|
||
let non_production = match coin.network.as_str() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一般我们叫 network 居多。这里是to_base64_url_flags 参数就是叫 no_production吗?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,to_base64_url_flags的参数就叫non_production,我把这个参数名改一下吧,例如is_mainnet,这样便于理解。
if tx.hash.is_empty() { | ||
return Err(anyhow!("invalid_sign_hash")); | ||
} | ||
let hash = Vec::from_hex_auto(&tx.hash)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
哈希值是直接传进来的?我记得我们之前讨论是 Hash 值是需要在 tcx 实现
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为前端是直接调用的库进行序列化的,但是库开发的接口只开放了获取序列化的hash,没有开发获取获取序列化原值的接口,所以就直接传递hash结果直接进行签名了。
Summary of Changes
token-core support Ton chain
Motivation and Context
How Has This Been Tested? (Test Plan)
Other information
Screenshots (if appropriate):
Final checklist
Security checklist (only for leader check)