@depay/web3-wallets-evm 18.1.1 → 18.1.3

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.
@@ -425,10 +425,11 @@ class WindowEthereum {
425
425
  if(typeof message === 'object') {
426
426
  let provider = this.getProvider();
427
427
  let account = await this.account();
428
- if((await wallet.connectedTo(transaction.blockchain)) == false) {
429
- await wallet.switchTo(transaction.blockchain);
428
+ let blockchain = Blockchains.findByNetworkId(message.domain.chainId);
429
+ if((await this.connectedTo(blockchain.name)) == false) {
430
+ await this.switchTo(blockchain.name);
430
431
  }
431
- if((await wallet.connectedTo(transaction.blockchain)) == false) {
432
+ if((await this.connectedTo(blockchain.name)) == false) {
432
433
  throw({ code: 'WRONG_NETWORK' })
433
434
  }
434
435
  let signature = await provider.request({
@@ -1306,7 +1307,7 @@ class WalletConnectV2 {
1306
1307
  let account = await this.account();
1307
1308
  let signature = await this.signClient.request({
1308
1309
  topic: this.session.topic,
1309
- chainId: message.domain.chainId,
1310
+ chainId: `eip155:${message.domain.chainId}`,
1310
1311
  request:{
1311
1312
  method: 'eth_signTypedData_v4',
1312
1313
  params: [account, JSON.stringify(message)],
package/dist/esm/index.js CHANGED
@@ -698,10 +698,11 @@ class WindowEthereum {
698
698
  if(typeof message === 'object') {
699
699
  let provider = this.getProvider();
700
700
  let account = await this.account();
701
- if((await wallet.connectedTo(transaction.blockchain)) == false) {
702
- await wallet.switchTo(transaction.blockchain);
701
+ let blockchain = Blockchains.findByNetworkId(message.domain.chainId);
702
+ if((await this.connectedTo(blockchain.name)) == false) {
703
+ await this.switchTo(blockchain.name);
703
704
  }
704
- if((await wallet.connectedTo(transaction.blockchain)) == false) {
705
+ if((await this.connectedTo(blockchain.name)) == false) {
705
706
  throw({ code: 'WRONG_NETWORK' })
706
707
  }
707
708
  let signature = await provider.request({
@@ -1907,7 +1908,7 @@ class WalletConnectV2 {
1907
1908
  let account = await this.account();
1908
1909
  let signature = await this.signClient.request({
1909
1910
  topic: this.session.topic,
1910
- chainId: message.domain.chainId,
1911
+ chainId: `eip155:${message.domain.chainId}`,
1911
1912
  request:{
1912
1913
  method: 'eth_signTypedData_v4',
1913
1914
  params: [account, JSON.stringify(message)],
@@ -429,10 +429,11 @@
429
429
  if(typeof message === 'object') {
430
430
  let provider = this.getProvider();
431
431
  let account = await this.account();
432
- if((await wallet.connectedTo(transaction.blockchain)) == false) {
433
- await wallet.switchTo(transaction.blockchain);
432
+ let blockchain = Blockchains__default['default'].findByNetworkId(message.domain.chainId);
433
+ if((await this.connectedTo(blockchain.name)) == false) {
434
+ await this.switchTo(blockchain.name);
434
435
  }
435
- if((await wallet.connectedTo(transaction.blockchain)) == false) {
436
+ if((await this.connectedTo(blockchain.name)) == false) {
436
437
  throw({ code: 'WRONG_NETWORK' })
437
438
  }
438
439
  let signature = await provider.request({
@@ -1310,7 +1311,7 @@
1310
1311
  let account = await this.account();
1311
1312
  let signature = await this.signClient.request({
1312
1313
  topic: this.session.topic,
1313
- chainId: message.domain.chainId,
1314
+ chainId: `eip155:${message.domain.chainId}`,
1314
1315
  request:{
1315
1316
  method: 'eth_signTypedData_v4',
1316
1317
  params: [account, JSON.stringify(message)],
package/dist/umd/index.js CHANGED
@@ -701,10 +701,11 @@
701
701
  if(typeof message === 'object') {
702
702
  let provider = this.getProvider();
703
703
  let account = await this.account();
704
- if((await wallet.connectedTo(transaction.blockchain)) == false) {
705
- await wallet.switchTo(transaction.blockchain);
704
+ let blockchain = Blockchains__default['default'].findByNetworkId(message.domain.chainId);
705
+ if((await this.connectedTo(blockchain.name)) == false) {
706
+ await this.switchTo(blockchain.name);
706
707
  }
707
- if((await wallet.connectedTo(transaction.blockchain)) == false) {
708
+ if((await this.connectedTo(blockchain.name)) == false) {
708
709
  throw({ code: 'WRONG_NETWORK' })
709
710
  }
710
711
  let signature = await provider.request({
@@ -1910,7 +1911,7 @@
1910
1911
  let account = await this.account();
1911
1912
  let signature = await this.signClient.request({
1912
1913
  topic: this.session.topic,
1913
- chainId: message.domain.chainId,
1914
+ chainId: `eip155:${message.domain.chainId}`,
1914
1915
  request:{
1915
1916
  method: 'eth_signTypedData_v4',
1916
1917
  params: [account, JSON.stringify(message)],
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depay/web3-wallets-evm",
3
3
  "moduleName": "Web3Wallets",
4
- "version": "18.1.1",
4
+ "version": "18.1.3",
5
5
  "description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.",
6
6
  "main": "dist/umd/index.evm.js",
7
7
  "module": "dist/esm/index.evm.js",