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

[stacked] add ledger ton support #24

Merged
merged 2 commits into from
Feb 24, 2025
Merged

Conversation

mkaczanowski
Copy link
Contributor

@mkaczanowski mkaczanowski commented Feb 22, 2025

TL;DR

This PR adds support for signing TON transaction via ledger device. Unfortunately there is a limitation that a transaction with one message can be signed, but that's fine for most of the things we want to execute.

Test plan

This transaction is signed via ledger app

$ npm run staking-cli -- ton tx delegate-pool 0.1 -c ./config.tonpool.testnet.json -s ledger -b
https://testnet.tonviewer.com/transaction/86ecfbcb1c009c8d0a40f7e48727df23d2ee8c207aa97a31a89dc25f4bf8f917

Config

{
  "delegatorAddress": "0QBDG13T98PFkLCpnXzkSPlrDp39aUUhQXTqFaad5cJU4uaz",
  "validatorAddress": "kQAHBakDk_E7qLlNQZxJDsqj_ruyAFpqarw85tO-c03fK26F",
  "validatorAddress2": "kQCltujow9Sq3ZVPPU6CYGfqwDxYwjlmFGZ1Wt0bAYebio4o",

  "ledger": {
    "bounceable": false,
    "accounts": [
      {
        "hdPath": "m/44'/607'/1'/0'/0'/0'"
      }
    ]
  },

  "networkType": "ton",

  "ton": {
    "rpcUrl": "https://testnet.toncenter.com/api/v2/jsonRPC",
    "allowSeamlessWalletDeployment": true,
    "allowTransferToInactiveAccount": false,
    "minimumExistentialBalance": "0",
    "addressDerivationConfig": {
      "walletContractVersion": 4,
      "workchain": 0,
      "bounceable": false,
      "testOnly": true,
      "urlSafe": true,
      "isBIP39": true
    },
    "blockExplorerUrl": "https://testnet.tonviewer.com"
  }
}

@mkaczanowski mkaczanowski changed the title add ledger ton support [stacked] add ledger ton support Feb 22, 2025
@mkaczanowski mkaczanowski marked this pull request as ready for review February 22, 2025 21:01
Copy link

@mikalsande mikalsande left a comment

Choose a reason for hiding this comment

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

Looks good 👍 , but there are some things I think we should change when it comes to bounce able messages.

@mkaczanowski mkaczanowski changed the base branch from ton_support_bip39_keys to main February 24, 2025 11:06
@mkaczanowski mkaczanowski force-pushed the add_ledger_ton_support branch from a7cd459 to 0ed2724 Compare February 24, 2025 11:51
@mikalsande mikalsande self-requested a review February 24, 2025 11:57
Copy link

@mikalsande mikalsande left a comment

Choose a reason for hiding this comment

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

LGTM!

@mkaczanowski mkaczanowski merged commit 7f66e10 into main Feb 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants