Skip to content

Commit a86b599

Browse files
committed
fix: derivation path and update hdwallet
1 parent 70e7e15 commit a86b599

File tree

5 files changed

+151
-322
lines changed

5 files changed

+151
-322
lines changed

package.json

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@
9191
"@metaplex-foundation/js": "^0.20.1",
9292
"@moralisweb3/common-evm-utils": "2.27.2",
9393
"@mysten/sui": "1.45.0",
94+
"@near-js/crypto": "^2.5.1",
95+
"@near-js/transactions": "^2.5.1",
96+
"@near-js/types": "^2.5.1",
97+
"@near-js/utils": "^2.5.1",
9498
"@react-spring/web": "^9.7.4",
9599
"@reduxjs/toolkit": "^2.6.1",
96100
"@reown/walletkit": "^1.2.6",
@@ -100,24 +104,24 @@
100104
"@shapeshiftoss/chain-adapters": "workspace:^",
101105
"@shapeshiftoss/contracts": "workspace:^",
102106
"@shapeshiftoss/errors": "workspace:^",
103-
"@shapeshiftoss/hdwallet-coinbase": "1.62.33",
104-
"@shapeshiftoss/hdwallet-core": "1.62.33",
105-
"@shapeshiftoss/hdwallet-gridplus": "1.62.33",
106-
"@shapeshiftoss/hdwallet-keepkey": "1.62.33",
107-
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.62.33",
108-
"@shapeshiftoss/hdwallet-keplr": "1.62.33",
109-
"@shapeshiftoss/hdwallet-ledger": "1.62.33",
110-
"@shapeshiftoss/hdwallet-ledger-webhid": "1.62.33",
111-
"@shapeshiftoss/hdwallet-ledger-webusb": "1.62.33",
112-
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.33",
113-
"@shapeshiftoss/hdwallet-native": "1.62.33",
114-
"@shapeshiftoss/hdwallet-native-vault": "1.62.33",
115-
"@shapeshiftoss/hdwallet-phantom": "1.62.33",
116-
"@shapeshiftoss/hdwallet-trezor": "1.62.33",
117-
"@shapeshiftoss/hdwallet-trezor-connect": "1.62.33",
118-
"@shapeshiftoss/hdwallet-vultisig": "1.62.33",
119-
"@shapeshiftoss/hdwallet-walletconnect": "1.62.33",
120-
"@shapeshiftoss/hdwallet-walletconnectv2": "1.62.33",
107+
"@shapeshiftoss/hdwallet-coinbase": "1.62.36",
108+
"@shapeshiftoss/hdwallet-core": "1.62.36",
109+
"@shapeshiftoss/hdwallet-gridplus": "1.62.36",
110+
"@shapeshiftoss/hdwallet-keepkey": "1.62.36",
111+
"@shapeshiftoss/hdwallet-keepkey-webusb": "1.62.36",
112+
"@shapeshiftoss/hdwallet-keplr": "1.62.36",
113+
"@shapeshiftoss/hdwallet-ledger": "1.62.36",
114+
"@shapeshiftoss/hdwallet-ledger-webhid": "1.62.36",
115+
"@shapeshiftoss/hdwallet-ledger-webusb": "1.62.36",
116+
"@shapeshiftoss/hdwallet-metamask-multichain": "1.62.36",
117+
"@shapeshiftoss/hdwallet-native": "1.62.36",
118+
"@shapeshiftoss/hdwallet-native-vault": "1.62.36",
119+
"@shapeshiftoss/hdwallet-phantom": "1.62.36",
120+
"@shapeshiftoss/hdwallet-trezor": "1.62.36",
121+
"@shapeshiftoss/hdwallet-trezor-connect": "1.62.36",
122+
"@shapeshiftoss/hdwallet-vultisig": "1.62.36",
123+
"@shapeshiftoss/hdwallet-walletconnect": "1.62.36",
124+
"@shapeshiftoss/hdwallet-walletconnectv2": "1.62.36",
121125
"@shapeshiftoss/swapper": "workspace:^",
122126
"@shapeshiftoss/types": "workspace:^",
123127
"@shapeshiftoss/unchained-client": "workspace:^",

packages/chain-adapters/package.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@
3030
},
3131
"dependencies": {
3232
"@mysten/sui": "1.45.0",
33+
"@near-js/crypto": "^2.5.1",
34+
"@near-js/providers": "^2.5.1",
35+
"@near-js/transactions": "^2.5.1",
36+
"@near-js/utils": "^2.5.1",
3337
"@shapeshiftoss/caip": "workspace:^",
34-
"@shapeshiftoss/hdwallet-core": "1.62.33",
35-
"@shapeshiftoss/hdwallet-ledger": "1.62.33",
38+
"@shapeshiftoss/hdwallet-core": "1.62.36",
39+
"@shapeshiftoss/hdwallet-ledger": "1.62.36",
3640
"@shapeshiftoss/types": "workspace:^",
3741
"@shapeshiftoss/unchained-client": "workspace:^",
3842
"@shapeshiftoss/utils": "workspace:^",

packages/chain-adapters/src/near/NearChainAdapter.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,13 @@ export class ChainAdapter implements IChainAdapter<KnownChainIds.NearMainnet> {
157157

158158
getBip44Params({ accountNumber }: GetBip44ParamsInput): Bip44Params {
159159
if (accountNumber < 0) throw new Error('accountNumber must be >= 0')
160+
// NEAR uses 3-level derivation path: m/44'/397'/0'
161+
// Set isChange and addressIndex to undefined to create 3-level path
160162
return {
161163
...ChainAdapter.rootBip44Params,
162164
accountNumber,
163-
isChange: false,
164-
addressIndex: 0,
165+
isChange: undefined,
166+
addressIndex: undefined,
165167
}
166168
}
167169

packages/swapper/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"@shapeshiftoss/caip": "workspace:^",
4040
"@shapeshiftoss/chain-adapters": "workspace:^",
4141
"@shapeshiftoss/contracts": "workspace:^",
42-
"@shapeshiftoss/hdwallet-core": "1.62.33",
42+
"@shapeshiftoss/hdwallet-core": "1.62.36",
4343
"@shapeshiftoss/types": "workspace:^",
4444
"@shapeshiftoss/unchained-client": "workspace:^",
4545
"@shapeshiftoss/utils": "workspace:^",

0 commit comments

Comments
 (0)