Skip to content

Commit 8ada8f7

Browse files
authored
[0.5.1][hotfix] Add arbitrum to network list coinbase#242
[0.5.1][hotfix] Add arbitrum to network list
2 parents f9fb973 + 06e29b1 commit 8ada8f7

File tree

5 files changed

+9
-25
lines changed

5 files changed

+9
-25
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## Unreleased
44

5+
## [0.5.1] - 2024-09-12
6+
7+
### Fixed
8+
- Fixed a bug that blocked arbitrum mainnet wallets from being created
9+
510
## [0.5.0] - 2024-09-11
611

712
- Add Arbitrum-Mainnet support for Native transfers.

jest.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ module.exports = {
1010
maxWorkers: 1,
1111
coverageThreshold: {
1212
"./src/coinbase/**": {
13-
branches: 78,
13+
branches: 77,
1414
functions: 90,
1515
statements: 85,
16-
lines: 88,
16+
lines: 87,
1717
},
1818
},
1919
};

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"license": "ISC",
55
"description": "Coinbase Platform SDK",
66
"repository": "https://github.com/coinbase/coinbase-sdk-nodejs",
7-
"version": "0.5.0",
7+
"version": "0.5.1",
88
"main": "dist/index.js",
99
"types": "dist/index.d.ts",
1010
"scripts": {

src/coinbase/wallet.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -913,14 +913,7 @@ export class Wallet {
913913
if (!this.master) {
914914
throw new Error("Cannot derive key for Wallet without seed loaded");
915915
}
916-
const [networkPrefix] = this.model.network_id.split("-");
917-
/**
918-
* TODO: Push this logic to the backend.
919-
* TODO: Add unit tests for `#createAddress`.
920-
*/
921-
if (!["base", "ethereum", "polygon"].includes(networkPrefix)) {
922-
throw new Error(`Unsupported network ID: ${this.model.network_id}`);
923-
}
916+
924917
const derivedKey = this.master?.derive(this.addressPathPrefix + `/${index}`);
925918
if (!derivedKey?.privateKey) {
926919
throw new Error("Failed to derive key");

src/tests/wallet_test.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -870,20 +870,6 @@ describe("Wallet Class", () => {
870870
expect(() => newWallet.setSeed(``)).toThrow(ArgumentError);
871871
expect(() => newWallet.setSeed(`invalid-seed`)).toThrow(ArgumentError);
872872
});
873-
874-
it("should raise an error when creating a wallet with an invalid network", async () => {
875-
const newWallet = Wallet.init(
876-
{
877-
...walletModel,
878-
network_id: "invalid_network_id",
879-
},
880-
"",
881-
);
882-
newWallet.setSeed(existingSeed);
883-
await expect(newWallet.createAddress()).rejects.toThrow(
884-
"Unsupported network ID: invalid_network_id",
885-
);
886-
});
887873
});
888874

889875
describe("#export", () => {

0 commit comments

Comments
 (0)