@keplr-wallet/common
Advanced tools
Comparing version 0.12.73 to 0.12.74-rc.0
@@ -21,9 +21,12 @@ "use strict"; | ||
this._denom = _denom; | ||
// Remember that the coin's actual denom should start with "type:contractAddress:denom" if it is for the token based on contract. | ||
const split = this.denom.split(/(\w+):(\w+):(.+)/).filter(Boolean); | ||
if (split.length !== 1 && split.length !== 3) { | ||
throw new Error(`Invalid denom: ${this.denom}`); | ||
// Remember that the coin's actual denom should start with "type:contractAddress" or "type:contractAddress:symbol" if it is for the token based on contract. | ||
let split = this.denom.split(/^(\w+):(\w+)$/).filter(Boolean); | ||
if (split.length !== 2) { | ||
split = this.denom.split(/^(\w+):(\w+):(.+)$/).filter(Boolean); | ||
if (split.length !== 1 && split.length !== 3) { | ||
throw new Error(`Invalid denom: ${this.denom}`); | ||
} | ||
} | ||
this._type = split.length === 3 ? split[0] : ""; | ||
this._contractAddress = split.length === 3 ? split[1] : ""; | ||
this._type = split.length >= 2 ? split[0] : ""; | ||
this._contractAddress = split.length >= 2 ? split[1] : ""; | ||
} | ||
@@ -30,0 +33,0 @@ get denom() { |
@@ -10,1 +10,2 @@ export * from "./kv-store"; | ||
export * from "./sleep"; | ||
export * from "./mnemonic"; |
@@ -26,2 +26,3 @@ "use strict"; | ||
__exportStar(require("./sleep"), exports); | ||
__exportStar(require("./mnemonic"), exports); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@keplr-wallet/common", | ||
"version": "0.12.73", | ||
"version": "0.12.74-rc.0", | ||
"main": "build/index.js", | ||
@@ -19,4 +19,4 @@ "author": "chainapsis", | ||
"dependencies": { | ||
"@keplr-wallet/crypto": "0.12.73", | ||
"@keplr-wallet/types": "0.12.73", | ||
"@keplr-wallet/crypto": "0.12.74-rc.0", | ||
"@keplr-wallet/types": "0.12.74-rc.0", | ||
"buffer": "^6.0.3", | ||
@@ -26,3 +26,3 @@ "delay": "^4.4.0", | ||
}, | ||
"gitHead": "47f4e5a707c42a6acd2f14f907856394defc0d7e" | ||
"gitHead": "0c51234ac4592890617042ac5416548e9fe54920" | ||
} |
@@ -32,10 +32,13 @@ import { Buffer } from "buffer/"; | ||
constructor(protected readonly _denom: string) { | ||
// Remember that the coin's actual denom should start with "type:contractAddress:denom" if it is for the token based on contract. | ||
const split = this.denom.split(/(\w+):(\w+):(.+)/).filter(Boolean); | ||
if (split.length !== 1 && split.length !== 3) { | ||
throw new Error(`Invalid denom: ${this.denom}`); | ||
// Remember that the coin's actual denom should start with "type:contractAddress" or "type:contractAddress:symbol" if it is for the token based on contract. | ||
let split = this.denom.split(/^(\w+):(\w+)$/).filter(Boolean); | ||
if (split.length !== 2) { | ||
split = this.denom.split(/^(\w+):(\w+):(.+)$/).filter(Boolean); | ||
if (split.length !== 1 && split.length !== 3) { | ||
throw new Error(`Invalid denom: ${this.denom}`); | ||
} | ||
} | ||
this._type = split.length === 3 ? split[0] : ""; | ||
this._contractAddress = split.length === 3 ? split[1] : ""; | ||
this._type = split.length >= 2 ? split[0] : ""; | ||
this._contractAddress = split.length >= 2 ? split[1] : ""; | ||
} | ||
@@ -42,0 +45,0 @@ |
@@ -10,1 +10,2 @@ export * from "./kv-store"; | ||
export * from "./sleep"; | ||
export * from "./mnemonic"; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
213656
118
5886
1
+ Added@keplr-wallet/crypto@0.12.74-rc.0(transitive)
+ Added@keplr-wallet/types@0.12.74-rc.0(transitive)
- Removed@keplr-wallet/crypto@0.12.73(transitive)
- Removed@keplr-wallet/types@0.12.73(transitive)