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

feat: token-core support Ton chain[R2D2-13379] #139

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

xiaoguang1010
Copy link
Contributor

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

  • Did you test both iOS and Android(if applicable)?
  • Is a security review needed(consenlabs/security)?

Security checklist (only for leader check)

  • No backdoor risk
    • Check for unknown network request urls, and script/shell files with unclear purposes,
    • The backend service cannot expose leaked data interfaces for various reasons (even for testing purposes)
  • No network communication protocol risk
    • Check whether to introduce unsafe network calls such as http/ws
  • No import potentially risk 3rd library
    • Check whether 3rd dependent library is import
    • Don't use an unknown third-party library
    • Check the 3rd library sources are fetched from normal sources, such as npm, gomodule, maven, cocoapod, Do not use unknown sources
    • Check github Dependabot alerts, Whether to add new issues
  • Private data not exposed
    • Check whether there are exclusive ApiKey, privatekey and other private information uploaded to git
    • Check if the packaged keystore has been uploaded to git

@xiaoguang1010 xiaoguang1010 requested a review from XuNeal December 23, 2024 11:08
CoinInfo {
chain_id: "".to_string(),
coin: "TON".to_string(),
derivation_path: "m/44'/607'/0'".to_string(),
Copy link
Collaborator

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 吗?

Copy link
Contributor Author

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级别,没有加后两层。

_ => DEFAULT_WALLET_ID,
};

let non_production = match coin.network.as_str() {
Copy link
Collaborator

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吗?

Copy link
Contributor Author

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)?;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哈希值是直接传进来的?我记得我们之前讨论是 Hash 值是需要在 tcx 实现

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为前端是直接调用的库进行序列化的,但是库开发的接口只开放了获取序列化的hash,没有开发获取获取序列化原值的接口,所以就直接传递hash结果直接进行签名了。

@xiaoguang1010 xiaoguang1010 changed the base branch from dev to main January 2, 2025 01:18
@xiaoguang1010 xiaoguang1010 changed the base branch from main to dev January 2, 2025 01:18
@xiaoguang1010 xiaoguang1010 changed the base branch from dev to main January 2, 2025 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants