@depay/web3-wallets-evm 12.3.10 → 12.3.11

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.
@@ -55,8 +55,6 @@ class Transaction {
55
55
  return fragment.inputs.map((input) => {
56
56
  return this.params[input.name]
57
57
  })
58
- } else {
59
- throw 'Contract params have wrong type!'
60
58
  }
61
59
  }
62
60
 
@@ -65,9 +63,16 @@ class Transaction {
65
63
  }
66
64
 
67
65
  async getData() {
68
- let populatedTransaction = await this.getContract().populateTransaction[this.method].apply(
69
- null, this.getContractArguments()
70
- );
66
+ let contractArguments = this.getContractArguments();
67
+ let populatedTransaction;
68
+ if(contractArguments) {
69
+ populatedTransaction = await this.getContract().populateTransaction[this.method].apply(
70
+ null, contractArguments
71
+ );
72
+ } else {
73
+ populatedTransaction = await this.getContract().populateTransaction[this.method].apply(null);
74
+ }
75
+
71
76
  return populatedTransaction.data
72
77
  }
73
78
 
@@ -150,11 +155,17 @@ const submit$2 = ({ transaction, provider, signer }) => {
150
155
 
151
156
  const submitContractInteraction$2 = ({ transaction, signer, provider })=>{
152
157
  let contract = new ethers.Contract(transaction.to, transaction.api, provider);
153
- return contract
154
- .connect(signer)
155
- [transaction.method](...transaction.getContractArguments({ contract }), {
158
+ let contractArguments = transaction.getContractArguments({ contract });
159
+ let method = contract.connect(signer)[transaction.method];
160
+ if(contractArguments) {
161
+ return method(...contractArguments, {
162
+ value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
163
+ })
164
+ } else {
165
+ return method({
156
166
  value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
157
167
  })
168
+ }
158
169
  };
159
170
 
160
171
  const submitSimpleTransfer$2 = ({ transaction, signer })=>{
@@ -611,11 +622,17 @@ const submit = ({ transaction, provider, signer }) => {
611
622
 
612
623
  const submitContractInteraction = ({ transaction, signer, provider })=>{
613
624
  let contract = new ethers.Contract(transaction.to, transaction.api, provider);
614
- return contract
615
- .connect(signer)
616
- [transaction.method](...transaction.getContractArguments({ contract }), {
625
+ let contractArguments = transaction.getContractArguments({ contract });
626
+ let method = contract.connect(signer)[transaction.method];
627
+ if(contractArguments) {
628
+ return method(...contractArguments, {
617
629
  value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
618
630
  })
631
+ } else {
632
+ return method({
633
+ value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
634
+ })
635
+ }
619
636
  };
620
637
 
621
638
  const submitSimpleTransfer = ({ transaction, signer })=>{
package/dist/esm/index.js CHANGED
@@ -56,8 +56,6 @@ class Transaction {
56
56
  return fragment.inputs.map((input) => {
57
57
  return this.params[input.name]
58
58
  })
59
- } else {
60
- throw 'Contract params have wrong type!'
61
59
  }
62
60
  }
63
61
 
@@ -66,9 +64,16 @@ class Transaction {
66
64
  }
67
65
 
68
66
  async getData() {
69
- let populatedTransaction = await this.getContract().populateTransaction[this.method].apply(
70
- null, this.getContractArguments()
71
- );
67
+ let contractArguments = this.getContractArguments();
68
+ let populatedTransaction;
69
+ if(contractArguments) {
70
+ populatedTransaction = await this.getContract().populateTransaction[this.method].apply(
71
+ null, contractArguments
72
+ );
73
+ } else {
74
+ populatedTransaction = await this.getContract().populateTransaction[this.method].apply(null);
75
+ }
76
+
72
77
  return populatedTransaction.data
73
78
  }
74
79
 
@@ -151,11 +156,17 @@ const submit$3 = ({ transaction, provider, signer }) => {
151
156
 
152
157
  const submitContractInteraction$2 = ({ transaction, signer, provider })=>{
153
158
  let contract = new ethers.Contract(transaction.to, transaction.api, provider);
154
- return contract
155
- .connect(signer)
156
- [transaction.method](...transaction.getContractArguments({ contract }), {
159
+ let contractArguments = transaction.getContractArguments({ contract });
160
+ let method = contract.connect(signer)[transaction.method];
161
+ if(contractArguments) {
162
+ return method(...contractArguments, {
163
+ value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
164
+ })
165
+ } else {
166
+ return method({
157
167
  value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
158
168
  })
169
+ }
159
170
  };
160
171
 
161
172
  const submitSimpleTransfer$3 = ({ transaction, signer })=>{
@@ -799,11 +810,17 @@ const submit = ({ transaction, provider, signer }) => {
799
810
 
800
811
  const submitContractInteraction = ({ transaction, signer, provider })=>{
801
812
  let contract = new ethers.Contract(transaction.to, transaction.api, provider);
802
- return contract
803
- .connect(signer)
804
- [transaction.method](...transaction.getContractArguments({ contract }), {
813
+ let contractArguments = transaction.getContractArguments({ contract });
814
+ let method = contract.connect(signer)[transaction.method];
815
+ if(contractArguments) {
816
+ return method(...contractArguments, {
805
817
  value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
806
818
  })
819
+ } else {
820
+ return method({
821
+ value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
822
+ })
823
+ }
807
824
  };
808
825
 
809
826
  const submitSimpleTransfer = ({ transaction, signer })=>{
@@ -54,8 +54,6 @@
54
54
  return fragment.inputs.map((input) => {
55
55
  return this.params[input.name]
56
56
  })
57
- } else {
58
- throw 'Contract params have wrong type!'
59
57
  }
60
58
  }
61
59
 
@@ -64,9 +62,16 @@
64
62
  }
65
63
 
66
64
  async getData() {
67
- let populatedTransaction = await this.getContract().populateTransaction[this.method].apply(
68
- null, this.getContractArguments()
69
- );
65
+ let contractArguments = this.getContractArguments();
66
+ let populatedTransaction;
67
+ if(contractArguments) {
68
+ populatedTransaction = await this.getContract().populateTransaction[this.method].apply(
69
+ null, contractArguments
70
+ );
71
+ } else {
72
+ populatedTransaction = await this.getContract().populateTransaction[this.method].apply(null);
73
+ }
74
+
70
75
  return populatedTransaction.data
71
76
  }
72
77
 
@@ -149,11 +154,17 @@
149
154
 
150
155
  const submitContractInteraction$2 = ({ transaction, signer, provider })=>{
151
156
  let contract = new ethers.ethers.Contract(transaction.to, transaction.api, provider);
152
- return contract
153
- .connect(signer)
154
- [transaction.method](...transaction.getContractArguments({ contract }), {
157
+ let contractArguments = transaction.getContractArguments({ contract });
158
+ let method = contract.connect(signer)[transaction.method];
159
+ if(contractArguments) {
160
+ return method(...contractArguments, {
161
+ value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
162
+ })
163
+ } else {
164
+ return method({
155
165
  value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
156
166
  })
167
+ }
157
168
  };
158
169
 
159
170
  const submitSimpleTransfer$2 = ({ transaction, signer })=>{
@@ -610,11 +621,17 @@
610
621
 
611
622
  const submitContractInteraction = ({ transaction, signer, provider })=>{
612
623
  let contract = new ethers.ethers.Contract(transaction.to, transaction.api, provider);
613
- return contract
614
- .connect(signer)
615
- [transaction.method](...transaction.getContractArguments({ contract }), {
624
+ let contractArguments = transaction.getContractArguments({ contract });
625
+ let method = contract.connect(signer)[transaction.method];
626
+ if(contractArguments) {
627
+ return method(...contractArguments, {
616
628
  value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
617
629
  })
630
+ } else {
631
+ return method({
632
+ value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
633
+ })
634
+ }
618
635
  };
619
636
 
620
637
  const submitSimpleTransfer = ({ transaction, signer })=>{
package/dist/umd/index.js CHANGED
@@ -54,8 +54,6 @@
54
54
  return fragment.inputs.map((input) => {
55
55
  return this.params[input.name]
56
56
  })
57
- } else {
58
- throw 'Contract params have wrong type!'
59
57
  }
60
58
  }
61
59
 
@@ -64,9 +62,16 @@
64
62
  }
65
63
 
66
64
  async getData() {
67
- let populatedTransaction = await this.getContract().populateTransaction[this.method].apply(
68
- null, this.getContractArguments()
69
- );
65
+ let contractArguments = this.getContractArguments();
66
+ let populatedTransaction;
67
+ if(contractArguments) {
68
+ populatedTransaction = await this.getContract().populateTransaction[this.method].apply(
69
+ null, contractArguments
70
+ );
71
+ } else {
72
+ populatedTransaction = await this.getContract().populateTransaction[this.method].apply(null);
73
+ }
74
+
70
75
  return populatedTransaction.data
71
76
  }
72
77
 
@@ -149,11 +154,17 @@
149
154
 
150
155
  const submitContractInteraction$2 = ({ transaction, signer, provider })=>{
151
156
  let contract = new ethers.ethers.Contract(transaction.to, transaction.api, provider);
152
- return contract
153
- .connect(signer)
154
- [transaction.method](...transaction.getContractArguments({ contract }), {
157
+ let contractArguments = transaction.getContractArguments({ contract });
158
+ let method = contract.connect(signer)[transaction.method];
159
+ if(contractArguments) {
160
+ return method(...contractArguments, {
161
+ value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
162
+ })
163
+ } else {
164
+ return method({
155
165
  value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
156
166
  })
167
+ }
157
168
  };
158
169
 
159
170
  const submitSimpleTransfer$3 = ({ transaction, signer })=>{
@@ -797,11 +808,17 @@
797
808
 
798
809
  const submitContractInteraction = ({ transaction, signer, provider })=>{
799
810
  let contract = new ethers.ethers.Contract(transaction.to, transaction.api, provider);
800
- return contract
801
- .connect(signer)
802
- [transaction.method](...transaction.getContractArguments({ contract }), {
811
+ let contractArguments = transaction.getContractArguments({ contract });
812
+ let method = contract.connect(signer)[transaction.method];
813
+ if(contractArguments) {
814
+ return method(...contractArguments, {
803
815
  value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
804
816
  })
817
+ } else {
818
+ return method({
819
+ value: Transaction.bigNumberify(transaction.value, transaction.blockchain)
820
+ })
821
+ }
805
822
  };
806
823
 
807
824
  const submitSimpleTransfer = ({ transaction, signer })=>{
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depay/web3-wallets-evm",
3
3
  "moduleName": "Web3Wallets",
4
- "version": "12.3.10",
4
+ "version": "12.3.11",
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",
@@ -28,7 +28,7 @@
28
28
  "@depay/coinbase-wallet-sdk": "^1.1.0",
29
29
  "@depay/walletconnect-v1": "^1.7.10",
30
30
  "@depay/web3-blockchains": "^6.2.3",
31
- "@depay/web3-client-evm": "^10.1.23",
31
+ "@depay/web3-client-evm": "^10.2.1",
32
32
  "@depay/web3-constants": "^6.3.2",
33
33
  "ethers": "^5.7.1"
34
34
  },