Skip to content
This repository has been archived by the owner on Apr 15, 2022. It is now read-only.

Commit

Permalink
Merge pull request #59 from cosmostation/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Booyoun authored Jul 20, 2020
2 parents 1621e9a + 4685e2b commit 1fb80ac
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const cosmosjs = require("@cosmostation/cosmosjs");
- You can see example file at [/example/browser-example.html](https://github.com/cosmostation/cosmosjs/tree/master/example/browser-example.html)

```js
<script src="https://cdn.jsdelivr.net/npm/@cosmostation/cosmosjs@0.6.4/dist/cosmos.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@cosmostation/cosmosjs@0.6.5/dist/cosmos.min.js"></script>
```

## Usage
Expand Down
2 changes: 1 addition & 1 deletion example/browser-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<title>CosmosJS Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.jsdelivr.net/npm/@cosmostation/cosmosjs@0.6.4/dist/cosmos.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@cosmostation/cosmosjs@0.6.5/dist/cosmos.min.js"></script>
<script>
function send() {
const mnemonic = "swear buyer security impulse public stereo peasant correct cross tornado bid discover anchor float venture deal patch property cool wreck eight dwarf december surface";
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@cosmostation/cosmosjs",
"version": "0.6.4",
"version": "0.6.5",
"description": "A JavasSript Open Source Library for Cosmos Network, IRISnet, Kava and Band Protocol. (HTML developers can use /dist/cosmos.js)",
"main": "./src/index.js",
"repository": {
Expand Down
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,12 +87,12 @@ Cosmos.prototype.getAccounts = function(address) {
.then(response => response.json())
}

Cosmos.prototype.getAddress = function(mnemonic) {
Cosmos.prototype.getAddress = function(mnemonic, checkSum = true) {
if (typeof mnemonic !== "string") {
throw new Error("mnemonic expects a string")
}
if (!bip39.validateMnemonic(mnemonic)) {
throw new Error("mnemonic phrases have invalid checksums")
if (checkSum) {
if (!bip39.validateMnemonic(mnemonic)) throw new Error("mnemonic phrases have invalid checksums");
}
const seed = bip39.mnemonicToSeed(mnemonic);
const node = bip32.fromSeed(seed);
Expand Down

0 comments on commit 1fb80ac

Please sign in to comment.