Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
1d05ec9
feat: add TON blockchain support
NeOMakinG Jan 12, 2026
04b8246
chore: version packages to 1.62.39-ton-chain.0
NeOMakinG Jan 12, 2026
1dd1af1
chore: version packages to 1.62.39-ton-chain.1
NeOMakinG Jan 12, 2026
bc76c37
chore: version packages to 1.62.39-ton-chain.2
NeOMakinG Jan 12, 2026
d380fef
fix: add isMnemonicInterface check for TON in loadDevice
NeOMakinG Jan 12, 2026
727b41b
fix: add toTonSeed to core BIP39 interface and properly check before …
NeOMakinG Jan 12, 2026
a0cada9
fix: use typeof check for toTonSeed method
NeOMakinG Jan 12, 2026
9b7d75b
fix: remove toTonSeed check, just call it
NeOMakinG Jan 12, 2026
a56079f
debug: add TON loadDevice logging
NeOMakinG Jan 12, 2026
6e8816e
fix: make TON initialization graceful - don't block wallet connection…
NeOMakinG Jan 12, 2026
7c3f34c
fix: simplify revocable proxy to properly forward prototype methods l…
NeOMakinG Jan 12, 2026
7870d70
chore: version packages to 1.62.39-ton-chain.10
NeOMakinG Jan 12, 2026
30ec48c
fix: use standard BIP39+SLIP-10 for TON (like Solana) and fix StateIn…
NeOMakinG Jan 12, 2026
fb7842c
fix: add depth to cell repr for correct TON address derivation
NeOMakinG Jan 12, 2026
bb74251
fix(ton): correct V4R2 code cell depth from 1 to 7
NeOMakinG Jan 12, 2026
9e7dde5
chore: version packages to 1.62.39-ton-chain.14
NeOMakinG Jan 13, 2026
4fe7eff
chore: version packages to 1.62.39-ton-chain.15
NeOMakinG Jan 13, 2026
c0058da
chore: version packages to 1.62.39-ton-chain.16 and fix BOC serializa…
NeOMakinG Jan 13, 2026
d9fa99f
fix: BOC deserializer sizeBytes should not add 1
NeOMakinG Jan 13, 2026
805f824
fix: use correct wallet V4R2 code BOC from ton-core
NeOMakinG Jan 13, 2026
d70eb22
feat: use @ton/ton signer interface for proper signing without exposi…
NeOMakinG Jan 13, 2026
351ebee
chore: version packages to 1.62.39-ton-chain.20
NeOMakinG Jan 13, 2026
52c2f8a
fix(ton): use storeMessage for correct external message format
NeOMakinG Jan 13, 2026
6a7a36d
debug: add TON transaction logging
NeOMakinG Jan 13, 2026
a2ef893
fix(ton): set bounce=false, add more debug logging
NeOMakinG Jan 13, 2026
51f1525
fix(ton): use storeMessage for external messages, set bounce=false
NeOMakinG Jan 13, 2026
556c7be
chore: version packages to 1.62.39-ton-chain.25
NeOMakinG Jan 13, 2026
7b5118a
fix: remove unused import and add eslint-disable for ProxyHandler params
NeOMakinG Jan 15, 2026
6778dac
chore: reset package versions to 1.62.38 (remove verdaccio test versi…
NeOMakinG Jan 15, 2026
b1c7805
chore: merge origin/master and update versions to 1.62.39
NeOMakinG Jan 15, 2026
3c97ebe
fix: reset yarn.lock to remove verdaccio references
NeOMakinG Jan 15, 2026
f8747e6
fix: add jest mock for @ton/ton to fix ESM import issues in tests
NeOMakinG Jan 15, 2026
081af70
chore: version packages to 1.62.40-ton-chain.0
NeOMakinG Jan 15, 2026
0252ea6
fix: Apply CodeRabbit feedback for TON chain integration
NeOMakinG Jan 15, 2026
e37daf1
chore: version packages to 1.62.40-coderabbit-fix.0
NeOMakinG Jan 15, 2026
e52367b
feat: revert versions
NeOMakinG Jan 15, 2026
e2c70b8
fix: use TON-specific key derivation for wallet compatibility
NeOMakinG Jan 16, 2026
6669291
revert: restore original revocable.ts proxy implementation
NeOMakinG Jan 16, 2026
853444f
docs: explain why signature field is empty in TON signed transactions
NeOMakinG Jan 16, 2026
9312d92
fix: address CodeRabbit feedback on TON key derivation
NeOMakinG Jan 16, 2026
7a2a5e4
docs: document Trust Wallet compatibility for TON derivation path
NeOMakinG Jan 16, 2026
69ed1dd
chore: version packages to 1.62.40-ton-chain.0
NeOMakinG Jan 16, 2026
fd4d20a
chore: version packages to 1.62.40-ton-chain.1
NeOMakinG Jan 16, 2026
ef9db95
chore: version packages to 1.62.40-ton-chain.2
NeOMakinG Jan 16, 2026
7c29d90
fix: make tonMasterKey optional in LoadDevice type for backward compa…
NeOMakinG Jan 16, 2026
a388523
chore: version packages to 1.62.40-ton-chain.3
NeOMakinG Jan 16, 2026
7acdf46
chore: version packages to 1.62.40-ton-chain.4
NeOMakinG Jan 16, 2026
99ee46a
fix: remove toTonSeed existence check - call directly with non-null a…
NeOMakinG Jan 16, 2026
9c737f6
fix: remove toTonSeed non-null assertion to work with proxy - version…
NeOMakinG Jan 16, 2026
157d57a
fix: use proper error handling for toTonSeed proxy access
NeOMakinG Jan 16, 2026
dd3c7db
fix: use non-null assertion for toTonSeed - proxy exposes method but …
NeOMakinG Jan 16, 2026
4999088
chore: bump version to 1.62.40-ton-chain.6
NeOMakinG Jan 16, 2026
6909a46
chore: version packages to 1.62.40-ton-chain.7 - fix proxy receiver f…
NeOMakinG Jan 16, 2026
a0666c4
chore: version packages to 1.62.40-ton-chain.8 - revert to straightfo…
NeOMakinG Jan 16, 2026
a9cd331
chore: version packages to 1.62.40-ton-chain.9
NeOMakinG Jan 16, 2026
4b1aebb
fix: use standard BIP-39 derivation for TON addresses
NeOMakinG Jan 16, 2026
96493b9
chore: revert version bumps to 1.62.39
NeOMakinG Jan 16, 2026
90bc0fc
chore: remove gitHead fields from package.json files
NeOMakinG Jan 16, 2026
592e2cd
chore: reset yarn.lock to master
NeOMakinG Jan 16, 2026
382e08f
chore(release): publish 1.62.40
NeOMakinG Jan 16, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 20 additions & 20 deletions examples/sandbox/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-sandbox",
"version": "1.62.39",
"version": "1.62.40",
"license": "MIT",
"private": true,
"browserslist": "> 0.5%, last 2 versions, not dead",
Expand All @@ -12,25 +12,25 @@
"dependencies": {
"@esm2cjs/p-queue": "^7.3.0",
"@metamask/eth-sig-util": "^7.0.0",
"@shapeshiftoss/hdwallet-coinbase": "1.62.39",
"@shapeshiftoss/hdwallet-core": "1.62.39",
"@shapeshiftoss/hdwallet-gridplus": "1.62.39",
"@shapeshiftoss/hdwallet-keepkey": "1.62.39",
"@shapeshiftoss/hdwallet-keepkey-tcp": "1.62.39",
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.62.39",
"@shapeshiftoss/hdwallet-keplr": "1.62.39",
"@shapeshiftoss/hdwallet-ledger": "1.62.39",
"@shapeshiftoss/hdwallet-ledger-webhid": "1.62.39",
"@shapeshiftoss/hdwallet-ledger-webusb": "1.62.39",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.39",
"@shapeshiftoss/hdwallet-native": "1.62.39",
"@shapeshiftoss/hdwallet-phantom": "1.62.39",
"@shapeshiftoss/hdwallet-portis": "1.62.39",
"@shapeshiftoss/hdwallet-trezor": "1.62.39",
"@shapeshiftoss/hdwallet-trezor-connect": "1.62.39",
"@shapeshiftoss/hdwallet-vultisig": "1.62.39",
"@shapeshiftoss/hdwallet-walletconnect": "1.62.39",
"@shapeshiftoss/hdwallet-walletconnectv2": "1.62.39",
"@shapeshiftoss/hdwallet-coinbase": "^1.62.40",
"@shapeshiftoss/hdwallet-core": "^1.62.40",
"@shapeshiftoss/hdwallet-gridplus": "^1.62.40",
"@shapeshiftoss/hdwallet-keepkey": "^1.62.40",
"@shapeshiftoss/hdwallet-keepkey-tcp": "^1.62.40",
"@shapeshiftoss/hdwallet-keepkey-webusb": "^1.62.40",
"@shapeshiftoss/hdwallet-keplr": "^1.62.40",
"@shapeshiftoss/hdwallet-ledger": "^1.62.40",
"@shapeshiftoss/hdwallet-ledger-webhid": "^1.62.40",
"@shapeshiftoss/hdwallet-ledger-webusb": "^1.62.40",
"@shapeshiftoss/hdwallet-metamask-multichain": "^1.62.40",
"@shapeshiftoss/hdwallet-native": "^1.62.40",
"@shapeshiftoss/hdwallet-phantom": "^1.62.40",
"@shapeshiftoss/hdwallet-portis": "^1.62.40",
"@shapeshiftoss/hdwallet-trezor": "^1.62.40",
"@shapeshiftoss/hdwallet-trezor-connect": "^1.62.40",
"@shapeshiftoss/hdwallet-vultisig": "^1.62.40",
"@shapeshiftoss/hdwallet-walletconnect": "^1.62.40",
"@shapeshiftoss/hdwallet-walletconnectv2": "^1.62.40",
"bip32": "^2.0.4",
"eip-712": "^1.0.0",
"jquery": "^3.7.1",
Expand Down
22 changes: 11 additions & 11 deletions integration/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/integration",
"version": "1.62.39",
"version": "1.62.40",
"main": "index.js",
"license": "MIT",
"private": true,
Expand All @@ -11,16 +11,16 @@
},
"dependencies": {
"@bitcoinerlab/secp256k1": "^1.1.1",
"@shapeshiftoss/hdwallet-core": "1.62.39",
"@shapeshiftoss/hdwallet-keepkey": "1.62.39",
"@shapeshiftoss/hdwallet-keepkey-nodewebusb": "1.62.39",
"@shapeshiftoss/hdwallet-keepkey-tcp": "1.62.39",
"@shapeshiftoss/hdwallet-ledger": "1.62.39",
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.39",
"@shapeshiftoss/hdwallet-native": "1.62.39",
"@shapeshiftoss/hdwallet-portis": "1.62.39",
"@shapeshiftoss/hdwallet-trezor": "1.62.39",
"@shapeshiftoss/hdwallet-vultisig": "1.62.39",
"@shapeshiftoss/hdwallet-core": "^1.62.40",
"@shapeshiftoss/hdwallet-keepkey": "^1.62.40",
"@shapeshiftoss/hdwallet-keepkey-nodewebusb": "^1.62.40",
"@shapeshiftoss/hdwallet-keepkey-tcp": "^1.62.40",
"@shapeshiftoss/hdwallet-ledger": "^1.62.40",
"@shapeshiftoss/hdwallet-metamask-multichain": "^1.62.40",
"@shapeshiftoss/hdwallet-native": "^1.62.40",
"@shapeshiftoss/hdwallet-portis": "^1.62.40",
"@shapeshiftoss/hdwallet-trezor": "^1.62.40",
"@shapeshiftoss/hdwallet-vultisig": "^1.62.40",
"fast-json-stable-stringify": "^2.1.0",
"msw": "^0.27.1",
"whatwg-fetch": "^3.6.2"
Expand Down
5 changes: 4 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ module.exports = {
reporters: ["default", "jest-junit"],
rootDir: "packages",
testMatch: ["<rootDir>/**/*.test.ts"],
transformIgnorePatterns: ["node_modules/(?!(@shapeshiftoss/bitcoinjs-lib|valibot)/.*)"],
transformIgnorePatterns: [
"node_modules/(?!(@shapeshiftoss/bitcoinjs-lib|valibot|@ton/ton|@ton/core|@ton/crypto|axios)/.*)",
],
moduleNameMapper: {
"^@shapeshiftoss/hdwallet-(.*)": "<rootDir>/hdwallet-$1/src",
"^valibot$": require.resolve("valibot"),
"^@ton/ton$": "<rootDir>/hdwallet-native/__mocks__/@ton/ton.js",
},
globals: {
"ts-jest": {
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"lerna": "5.2.0",
"version": "1.62.39",
"version": "1.62.40",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
Expand Down
4 changes: 2 additions & 2 deletions packages/hdwallet-coinbase/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-coinbase",
"version": "1.62.39",
"version": "1.62.40",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -15,7 +15,7 @@
},
"dependencies": {
"@coinbase/wallet-sdk": "^3.6.6",
"@shapeshiftoss/hdwallet-core": "1.62.39",
"@shapeshiftoss/hdwallet-core": "^1.62.40",
"eth-rpc-errors": "^4.0.3",
"lodash": "^4.17.21"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/hdwallet-core/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-core",
"version": "1.62.39",
"version": "1.62.40",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand Down
1 change: 1 addition & 0 deletions packages/hdwallet-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export * from "./solana";
export * from "./starknet";
export * from "./sui";
export * from "./near";
export * from "./ton";
export * from "./transport";
export * from "./tron";
export * from "./utils";
Expand Down
101 changes: 101 additions & 0 deletions packages/hdwallet-core/src/ton.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
import { addressNListToBIP32, slip44ByCoin } from "./utils";
import { BIP32Path, HDWallet, HDWalletInfo, PathDescription } from "./wallet";

export interface TonGetAddress {
addressNList: BIP32Path;
showDisplay?: boolean;
}

export interface TonRawMessage {
targetAddress: string;
sendAmount: string;
payload: string;
stateInit?: string;
}

export interface TonSignTx {
addressNList: BIP32Path;
/** Raw message bytes to sign (BOC serialized) - used for simple transfers */
message?: Uint8Array;
/** Raw messages from external protocols like Stonfi - used for complex swaps */
rawMessages?: TonRawMessage[];
/** Sequence number for the wallet */
seqno?: number;
/** Transaction expiration timestamp */
expireAt?: number;
}

export interface TonSignedTx {
signature: string;
serialized: string;
}

export interface TonGetAccountPaths {
accountIdx: number;
}

export interface TonAccountPath {
addressNList: BIP32Path;
}

export interface TonWalletInfo extends HDWalletInfo {
readonly _supportsTonInfo: boolean;

/**
* Returns a list of bip32 paths for a given account index in preferred order
* from most to least preferred.
*/
tonGetAccountPaths(msg: TonGetAccountPaths): Array<TonAccountPath>;

/**
* Returns the "next" account path, if any.
*/
tonNextAccountPath(msg: TonAccountPath): TonAccountPath | undefined;
}

export interface TonWallet extends TonWalletInfo, HDWallet {
readonly _supportsTon: boolean;

tonGetAddress(msg: TonGetAddress): Promise<string | null>;
tonSignTx(msg: TonSignTx): Promise<TonSignedTx | null>;
}

export function tonDescribePath(path: BIP32Path): PathDescription {
const pathStr = addressNListToBIP32(path);
const unknown: PathDescription = {
verbose: pathStr,
coin: "Ton",
isKnown: false,
};

// TON uses m/44'/607'/<account>' - a 3-level path compatible with Trust Wallet.
// This differs from some wallets that use m/44'/607'/0' fixed path.
const slip44 = slip44ByCoin("Ton");
if (slip44 === undefined) return unknown;
if (path.length != 3) return unknown;
if (path[0] != 0x80000000 + 44) return unknown;
if (path[1] != 0x80000000 + slip44) return unknown;
if ((path[2] & 0x80000000) >>> 0 !== 0x80000000) return unknown;

const index = path[2] & 0x7fffffff;
return {
verbose: `TON Account #${index}`,
accountIdx: index,
wholeAccount: true,
coin: "Ton",
isKnown: true,
};
}

// TON uses a 3-level hardened derivation path: m/44'/607'/<account>'
// This follows the same pattern as Stellar (SEP-0005) since TON uses Ed25519
// https://github.com/satoshilabs/slips/blob/master/slip-0044.md (607 = TON)
export function tonGetAccountPaths(msg: TonGetAccountPaths): Array<TonAccountPath> {
const slip44 = slip44ByCoin("Ton");
if (slip44 === undefined) return [];
return [
{
addressNList: [0x80000000 + 44, 0x80000000 + slip44, 0x80000000 + msg.accountIdx],
},
];
}
1 change: 1 addition & 0 deletions packages/hdwallet-core/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ export const slip44Table = Object.freeze({
Tron: 195,
Sui: 784,
Near: 397,
Ton: 607,
// EVM chains all use the same SLIP44
Ethereum: 60,
Avalanche: 60,
Expand Down
9 changes: 9 additions & 0 deletions packages/hdwallet-core/src/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { StarknetWallet, StarknetWalletInfo } from "./starknet";
import { SuiWallet, SuiWalletInfo } from "./sui";
import { TerraWallet, TerraWalletInfo } from "./terra";
import { ThorchainWallet, ThorchainWalletInfo } from "./thorchain";
import { TonWallet, TonWalletInfo } from "./ton";
import { Transport } from "./transport";
import { TronWallet, TronWalletInfo } from "./tron";

Expand Down Expand Up @@ -300,6 +301,14 @@ export function infoSui(info: HDWalletInfo): info is SuiWalletInfo {
return isObject(info) && (info as any)._supportsSuiInfo;
}

export function supportsTon(wallet: HDWallet): wallet is TonWallet {
return isObject(wallet) && (wallet as any)._supportsTon;
}

export function infoTon(info: HDWalletInfo): info is TonWalletInfo {
return isObject(info) && (info as any)._supportsTonInfo;
}

export function supportsDebugLink(wallet: HDWallet): wallet is DebugLinkWallet {
return isObject(wallet) && (wallet as any)._supportsDebugLink;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/hdwallet-gridplus/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-gridplus",
"version": "1.62.39",
"version": "1.62.40",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -20,7 +20,7 @@
"@ethereumjs/rlp": "5.0.2",
"@ethereumjs/tx": "5.4.0",
"@metamask/eth-sig-util": "^7.0.0",
"@shapeshiftoss/hdwallet-core": "1.62.39",
"@shapeshiftoss/hdwallet-core": "^1.62.40",
"bech32": "^1.1.4",
"bs58": "^5.0.0",
"bs58check": "^4.0.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/hdwallet-keepkey-chromeusb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-chromeusb",
"version": "1.62.39",
"version": "1.62.40",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -14,7 +14,7 @@
"prepublishOnly": "yarn clean && yarn build"
},
"dependencies": {
"@shapeshiftoss/hdwallet-core": "1.62.39",
"@shapeshiftoss/hdwallet-keepkey": "1.62.39"
"@shapeshiftoss/hdwallet-core": "^1.62.40",
"@shapeshiftoss/hdwallet-keepkey": "^1.62.40"
}
}
4 changes: 2 additions & 2 deletions packages/hdwallet-keepkey-electron/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-electron",
"version": "1.62.39",
"version": "1.62.40",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -14,7 +14,7 @@
"prepublishOnly": "yarn clean && yarn build"
},
"dependencies": {
"@shapeshiftoss/hdwallet-keepkey": "1.62.39",
"@shapeshiftoss/hdwallet-keepkey": "^1.62.40",
"uuid": "^8.3.2"
},
"peerDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/hdwallet-keepkey-nodehid/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-nodehid",
"version": "1.62.39",
"version": "1.62.40",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -14,7 +14,7 @@
"prepublishOnly": "yarn clean && yarn build"
},
"dependencies": {
"@shapeshiftoss/hdwallet-keepkey": "1.62.39"
"@shapeshiftoss/hdwallet-keepkey": "^1.62.40"
},
"peerDependencies": {
"node-hid": "^2.1.1"
Expand Down
6 changes: 3 additions & 3 deletions packages/hdwallet-keepkey-nodewebusb/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-nodewebusb",
"version": "1.62.39",
"version": "1.62.40",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -14,8 +14,8 @@
"prepublishOnly": "yarn clean && yarn build"
},
"dependencies": {
"@shapeshiftoss/hdwallet-core": "1.62.39",
"@shapeshiftoss/hdwallet-keepkey": "1.62.39"
"@shapeshiftoss/hdwallet-core": "^1.62.40",
"@shapeshiftoss/hdwallet-keepkey": "^1.62.40"
},
"peerDependencies": {
"usb": "^2.3.1"
Expand Down
6 changes: 3 additions & 3 deletions packages/hdwallet-keepkey-tcp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@shapeshiftoss/hdwallet-keepkey-tcp",
"version": "1.62.39",
"version": "1.62.40",
"license": "MIT",
"publishConfig": {
"access": "public"
Expand All @@ -14,8 +14,8 @@
"prepublishOnly": "yarn clean && yarn build"
},
"dependencies": {
"@shapeshiftoss/hdwallet-core": "1.62.39",
"@shapeshiftoss/hdwallet-keepkey": "1.62.39",
"@shapeshiftoss/hdwallet-core": "^1.62.40",
"@shapeshiftoss/hdwallet-keepkey": "^1.62.40",
"axios": "^0.21.1"
}
}
Loading