@bloks/constants
Advanced tools
Comparing version 3.4.3 to 3.4.4
{ | ||
"name": "@bloks/constants", | ||
"version": "3.4.3", | ||
"version": "3.4.4", | ||
"description": "", | ||
@@ -12,3 +12,3 @@ "publishConfig": { | ||
"license": "UNLICENSED", | ||
"gitHead": "85872ce34dcb2f0eaa756cbf9c46b9733309a14c" | ||
"gitHead": "d90b70e481755295dd325d509effd98da106c40b" | ||
} |
@@ -22,10 +22,13 @@ import { contractAccounts } from '../contractAccounts' | ||
constructor () { | ||
if (Constants.instance) { | ||
if (!!Constants.instance) { | ||
return Constants.instance | ||
} | ||
} | ||
this.changeChain() | ||
initialize (chain = 'eos') { | ||
this.changeChainCallbacks = [] | ||
this.changeChain(chain) | ||
} | ||
changeChain (chain = 'eos') { | ||
changeChain (chain) { | ||
const constants = chainToNetworkConstantsMap[chain] | ||
@@ -40,4 +43,14 @@ for (const [key, value] of Object.entries(constants)) { | ||
} | ||
// Callbacks | ||
for (const cb of this.changeChainCallbacks) { | ||
console.log(cb) | ||
cb.apply(null) | ||
} | ||
} | ||
addChainChangeCallback (cb) { | ||
this.changeChainCallbacks.push(cb) | ||
} | ||
setConstants (newConstants) { | ||
@@ -44,0 +57,0 @@ for (const [key, value] of Object.entries(newConstants)) { |
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
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
55825
1851