Comparing version 0.0.20 to 0.0.21
@@ -8,2 +8,4 @@ const SuiCommonMethods = require('./SuiCommonMethods.js'); | ||
const DEFAULT_CHAIN = 'sui:devnet'; | ||
class SuiInBrowser extends SuiCommonMethods { | ||
@@ -15,3 +17,3 @@ constructor(params = {}) { | ||
this._defaultChain = params.defaultChain || 'sui:devnet'; | ||
this._defaultChain = params.defaultChain || DEFAULT_CHAIN; | ||
@@ -70,10 +72,12 @@ this._activeAdapter = null; | ||
static _singleInstance = null; | ||
static _singleInstances = {}; | ||
static getSingleton(params = {}) { | ||
if (SuiInBrowser._singleInstance) { | ||
return SuiInBrowser._singleInstance; | ||
let defaultChainKey = params.defaultChain || DEFAULT_CHAIN; | ||
if (SuiInBrowser._singleInstances[defaultChainKey]) { | ||
return SuiInBrowser._singleInstances[defaultChainKey]; | ||
} | ||
SuiInBrowser._singleInstance = new SuiInBrowser(params); | ||
return SuiInBrowser._singleInstance; | ||
SuiInBrowser._singleInstances[defaultChainKey] = new SuiInBrowser(params); | ||
return SuiInBrowser._singleInstances[defaultChainKey]; | ||
} | ||
@@ -80,0 +84,0 @@ |
{ | ||
"name": "suidouble", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"description": "Set of provider, package and object classes for javascript representation of Sui Move smart contracts. Use same code for publishing, upgrading, integration testing, interaction with smart contracts and integration in browser web3 dapps", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
179159
2544