@depay/widgets 6.16.3 → 6.16.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48841,10 +48841,12 @@ const submitSimpleTransfer = ({ transaction, wallet })=>{
48841
48841
  };
48842
48842
 
48843
48843
  function _optionalChain$6(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
48844
- let connectedInstance;
48844
+ const setConnectedInstance = (value)=>{
48845
+ window._connectedWalletConnectInstance = value;
48846
+ };
48845
48847
 
48846
48848
  const getConnectedInstance = ()=>{
48847
- return connectedInstance
48849
+ return window._connectedWalletConnectInstance
48848
48850
  };
48849
48851
 
48850
48852
  class WalletConnectWallet {
@@ -48895,12 +48897,12 @@ class WalletConnectWallet {
48895
48897
  });
48896
48898
 
48897
48899
  instance.on("disconnect", (error, payload) => {
48898
- connectedInstance = undefined;
48900
+ setConnectedInstance(undefined);
48899
48901
  if (error) { throw error }
48900
48902
  });
48901
48903
 
48902
48904
  instance.on("modal_closed", ()=>{
48903
- connectedInstance = undefined;
48905
+ setConnectedInstance(undefined);
48904
48906
  this.connector = undefined;
48905
48907
  });
48906
48908
 
@@ -48925,14 +48927,14 @@ class WalletConnectWallet {
48925
48927
 
48926
48928
  if(this.connector.connected) {
48927
48929
  await this.connector.killSession();
48928
- connectedInstance = undefined;
48930
+ setConnectedInstance(undefined);
48929
48931
  this.connector = this.newWalletConnectInstance();
48930
48932
  }
48931
48933
 
48932
48934
  const { accounts, chainId } = await this.connector.connect({ chainId: _optionalChain$6([options, 'optionalAccess', _ => _.chainId]) });
48933
48935
 
48934
48936
  if(accounts instanceof Array && accounts.length) {
48935
- connectedInstance = this;
48937
+ setConnectedInstance(this);
48936
48938
  }
48937
48939
 
48938
48940
  this.connectedAccounts = accounts;
@@ -48847,10 +48847,12 @@
48847
48847
  };
48848
48848
 
48849
48849
  function _optionalChain$6(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
48850
- let connectedInstance;
48850
+ const setConnectedInstance = (value)=>{
48851
+ window._connectedWalletConnectInstance = value;
48852
+ };
48851
48853
 
48852
48854
  const getConnectedInstance = ()=>{
48853
- return connectedInstance
48855
+ return window._connectedWalletConnectInstance
48854
48856
  };
48855
48857
 
48856
48858
  class WalletConnectWallet {
@@ -48901,12 +48903,12 @@
48901
48903
  });
48902
48904
 
48903
48905
  instance.on("disconnect", (error, payload) => {
48904
- connectedInstance = undefined;
48906
+ setConnectedInstance(undefined);
48905
48907
  if (error) { throw error }
48906
48908
  });
48907
48909
 
48908
48910
  instance.on("modal_closed", ()=>{
48909
- connectedInstance = undefined;
48911
+ setConnectedInstance(undefined);
48910
48912
  this.connector = undefined;
48911
48913
  });
48912
48914
 
@@ -48931,14 +48933,14 @@
48931
48933
 
48932
48934
  if(this.connector.connected) {
48933
48935
  await this.connector.killSession();
48934
- connectedInstance = undefined;
48936
+ setConnectedInstance(undefined);
48935
48937
  this.connector = this.newWalletConnectInstance();
48936
48938
  }
48937
48939
 
48938
48940
  const { accounts, chainId } = await this.connector.connect({ chainId: _optionalChain$6([options, 'optionalAccess', _ => _.chainId]) });
48939
48941
 
48940
48942
  if(accounts instanceof Array && accounts.length) {
48941
- connectedInstance = this;
48943
+ setConnectedInstance(this);
48942
48944
  }
48943
48945
 
48944
48946
  this.connectedAccounts = accounts;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depay/widgets",
3
3
  "moduleName": "DePayWidgets",
4
- "version": "6.16.3",
4
+ "version": "6.16.4",
5
5
  "description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.",
6
6
  "main": "./dist/umd/index.js",
7
7
  "module": "./dist/esm/index.js",
@@ -45,7 +45,7 @@
45
45
  "@depay/web3-exchanges": "^8.1.0",
46
46
  "@depay/web3-payments": "^9.3.3",
47
47
  "@depay/web3-tokens": "^8.0.1",
48
- "@depay/web3-wallets": "^9.0.2",
48
+ "@depay/web3-wallets": "^9.0.3",
49
49
  "decimal.js": "^10.3.1",
50
50
  "react-rangeslider": "^2.2.0"
51
51
  },