Skip to content

Commit

Permalink
fix legacy credentials test
Browse files Browse the repository at this point in the history
  • Loading branch information
leolambo committed May 3, 2024
1 parent 08f4871 commit 5546c80
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/bitcore-wallet-client/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2983,6 +2983,7 @@ export class API extends EventEmitter {
let opt = opts[i];
let optsObj = {
chain: opt[0],
coin: opt[0],
network: opt[1],
account: 0,
n: opt[2] ? 2 : 1,
Expand Down
4 changes: 2 additions & 2 deletions packages/bitcore-wallet-client/src/lib/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export class Credentials {
// checking in chains for simplicity
if (
this.network != 'livenet' &&
Constants.UTXO_CHAINS.includes(this.chain)
Constants.UTXO_CHAINS.includes(chain)
) {
chainPath = '1';
} else if (chain == 'bch') {
Expand Down Expand Up @@ -232,7 +232,7 @@ export class Credentials {
} else if (chain == 'ltc') {
chainPath = '2';
} else {
throw new Error('unknown chain: ' + this.chain);
throw new Error('unknown chain: ' + chain);
}
return 'm/' + purpose + "'/" + chainPath + "'/" + this.account + "'";
};
Expand Down
6 changes: 6 additions & 0 deletions packages/bitcore-wallet-client/src/lib/key.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,12 @@ export class Key {
coinCode = '60';
} else if (chain == 'matic') {
coinCode = '60'; // the official matic derivation path is 966 but users will expect address to be same as ETH
} else if (chain == 'arb') {
coinCode = '60';
} else if (chain == 'op') {
coinCode = '60';
} else if (chain == 'base') {
coinCode = '60';
} else if (chain == 'xrp') {
coinCode = '144';
} else if (chain == 'doge') {
Expand Down

0 comments on commit 5546c80

Please sign in to comment.