@depay/web3-wallets-evm 18.0.9 → 18.1.0

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,9 +425,6 @@ class WindowEthereum {
425
425
  if(typeof message === 'object') {
426
426
  let provider = this.getProvider();
427
427
  let account = await this.account();
428
- if((await this.connectedTo(Blockchains.findByNetworkId(message.domain.chainId).name)) === false) {
429
- throw({ code: 'WRONG_NETWORK' })
430
- }
431
428
  let signature = await provider.request({
432
429
  method: 'eth_signTypedData_v4',
433
430
  params: [account, message],
@@ -1601,9 +1598,6 @@ class WalletLink {
1601
1598
  if(typeof message === 'object') {
1602
1599
  let provider = this.connector;
1603
1600
  let account = await this.account();
1604
- if((await this.connectedTo(Blockchains.findByNetworkId(message.domain.chainId).name)) === false) {
1605
- throw({ code: 'WRONG_NETWORK' })
1606
- }
1607
1601
  let signature = await provider.request({
1608
1602
  method: 'eth_signTypedData_v4',
1609
1603
  params: [account, message],
package/dist/esm/index.js CHANGED
@@ -224,7 +224,7 @@ const submitSimpleTransfer$3 = async ({ transaction, wallet })=> {
224
224
  let fromPubkey = new PublicKey(await wallet.account());
225
225
  let toPubkey = new PublicKey(transaction.to);
226
226
  const provider = await getProvider(transaction.blockchain);
227
- let recentBlockhash = (await provider.getLatestBlockhash()).blockhash;
227
+ let { blockhash, lastValidBlockHeight } = await provider.getLatestBlockhash();
228
228
  const instructions = [
229
229
  SystemProgram.transfer({
230
230
  fromPubkey,
@@ -234,20 +234,21 @@ const submitSimpleTransfer$3 = async ({ transaction, wallet })=> {
234
234
  ];
235
235
  const messageV0 = new TransactionMessage({
236
236
  payerKey: fromPubkey,
237
- recentBlockhash,
237
+ recentBlockhash: blockhash,
238
238
  instructions,
239
239
  }).compileToV0Message();
240
240
  const transactionV0 = new VersionedTransaction(messageV0);
241
+ transaction._lastValidBlockHeight = lastValidBlockHeight;
241
242
  return wallet._sendTransaction(transactionV0)
242
243
  };
243
244
 
244
245
  const submitInstructions = async ({ transaction, wallet })=> {
245
246
  let fromPubkey = new PublicKey(await wallet.account());
246
247
  const provider = await getProvider(transaction.blockchain);
247
- let recentBlockhash = (await provider.getLatestBlockhash()).blockhash;
248
+ let { blockhash, lastValidBlockHeight } = await provider.getLatestBlockhash();
248
249
  const messageV0 = new TransactionMessage({
249
250
  payerKey: fromPubkey,
250
- recentBlockhash,
251
+ recentBlockhash: blockhash,
251
252
  instructions: transaction.instructions,
252
253
  }).compileToV0Message(
253
254
  transaction.alts ? await Promise.all(transaction.alts.map(async(alt)=>{
@@ -257,6 +258,7 @@ const submitInstructions = async ({ transaction, wallet })=> {
257
258
  if(transaction.signers && transaction.signers.length) {
258
259
  transactionV0.sign(Array.from(new Set(transaction.signers)));
259
260
  }
261
+ transaction._lastValidBlockHeight = lastValidBlockHeight;
260
262
  return wallet._sendTransaction(transactionV0)
261
263
  };
262
264
 
@@ -696,9 +698,6 @@ class WindowEthereum {
696
698
  if(typeof message === 'object') {
697
699
  let provider = this.getProvider();
698
700
  let account = await this.account();
699
- if((await this.connectedTo(Blockchains.findByNetworkId(message.domain.chainId).name)) === false) {
700
- throw({ code: 'WRONG_NETWORK' })
701
- }
702
701
  let signature = await provider.request({
703
702
  method: 'eth_signTypedData_v4',
704
703
  params: [account, message],
@@ -2200,9 +2199,6 @@ class WalletLink {
2200
2199
  if(typeof message === 'object') {
2201
2200
  let provider = this.connector;
2202
2201
  let account = await this.account();
2203
- if((await this.connectedTo(Blockchains.findByNetworkId(message.domain.chainId).name)) === false) {
2204
- throw({ code: 'WRONG_NETWORK' })
2205
- }
2206
2202
  let signature = await provider.request({
2207
2203
  method: 'eth_signTypedData_v4',
2208
2204
  params: [account, message],
@@ -222,7 +222,7 @@ const submitSimpleTransfer = async ({ transaction, wallet })=> {
222
222
  let fromPubkey = new PublicKey(await wallet.account());
223
223
  let toPubkey = new PublicKey(transaction.to);
224
224
  const provider = await getProvider(transaction.blockchain);
225
- let recentBlockhash = (await provider.getLatestBlockhash()).blockhash;
225
+ let { blockhash, lastValidBlockHeight } = await provider.getLatestBlockhash();
226
226
  const instructions = [
227
227
  SystemProgram.transfer({
228
228
  fromPubkey,
@@ -232,20 +232,21 @@ const submitSimpleTransfer = async ({ transaction, wallet })=> {
232
232
  ];
233
233
  const messageV0 = new TransactionMessage({
234
234
  payerKey: fromPubkey,
235
- recentBlockhash,
235
+ recentBlockhash: blockhash,
236
236
  instructions,
237
237
  }).compileToV0Message();
238
238
  const transactionV0 = new VersionedTransaction(messageV0);
239
+ transaction._lastValidBlockHeight = lastValidBlockHeight;
239
240
  return wallet._sendTransaction(transactionV0)
240
241
  };
241
242
 
242
243
  const submitInstructions = async ({ transaction, wallet })=> {
243
244
  let fromPubkey = new PublicKey(await wallet.account());
244
245
  const provider = await getProvider(transaction.blockchain);
245
- let recentBlockhash = (await provider.getLatestBlockhash()).blockhash;
246
+ let { blockhash, lastValidBlockHeight } = await provider.getLatestBlockhash();
246
247
  const messageV0 = new TransactionMessage({
247
248
  payerKey: fromPubkey,
248
- recentBlockhash,
249
+ recentBlockhash: blockhash,
249
250
  instructions: transaction.instructions,
250
251
  }).compileToV0Message(
251
252
  transaction.alts ? await Promise.all(transaction.alts.map(async(alt)=>{
@@ -255,6 +256,7 @@ const submitInstructions = async ({ transaction, wallet })=> {
255
256
  if(transaction.signers && transaction.signers.length) {
256
257
  transactionV0.sign(Array.from(new Set(transaction.signers)));
257
258
  }
259
+ transaction._lastValidBlockHeight = lastValidBlockHeight;
258
260
  return wallet._sendTransaction(transactionV0)
259
261
  };
260
262
 
@@ -429,9 +429,6 @@
429
429
  if(typeof message === 'object') {
430
430
  let provider = this.getProvider();
431
431
  let account = await this.account();
432
- if((await this.connectedTo(Blockchains__default['default'].findByNetworkId(message.domain.chainId).name)) === false) {
433
- throw({ code: 'WRONG_NETWORK' })
434
- }
435
432
  let signature = await provider.request({
436
433
  method: 'eth_signTypedData_v4',
437
434
  params: [account, message],
@@ -1605,9 +1602,6 @@
1605
1602
  if(typeof message === 'object') {
1606
1603
  let provider = this.connector;
1607
1604
  let account = await this.account();
1608
- if((await this.connectedTo(Blockchains__default['default'].findByNetworkId(message.domain.chainId).name)) === false) {
1609
- throw({ code: 'WRONG_NETWORK' })
1610
- }
1611
1605
  let signature = await provider.request({
1612
1606
  method: 'eth_signTypedData_v4',
1613
1607
  params: [account, message],
package/dist/umd/index.js CHANGED
@@ -227,7 +227,7 @@
227
227
  let fromPubkey = new solanaWeb3_js.PublicKey(await wallet.account());
228
228
  let toPubkey = new solanaWeb3_js.PublicKey(transaction.to);
229
229
  const provider = await web3Client.getProvider(transaction.blockchain);
230
- let recentBlockhash = (await provider.getLatestBlockhash()).blockhash;
230
+ let { blockhash, lastValidBlockHeight } = await provider.getLatestBlockhash();
231
231
  const instructions = [
232
232
  solanaWeb3_js.SystemProgram.transfer({
233
233
  fromPubkey,
@@ -237,20 +237,21 @@
237
237
  ];
238
238
  const messageV0 = new solanaWeb3_js.TransactionMessage({
239
239
  payerKey: fromPubkey,
240
- recentBlockhash,
240
+ recentBlockhash: blockhash,
241
241
  instructions,
242
242
  }).compileToV0Message();
243
243
  const transactionV0 = new solanaWeb3_js.VersionedTransaction(messageV0);
244
+ transaction._lastValidBlockHeight = lastValidBlockHeight;
244
245
  return wallet._sendTransaction(transactionV0)
245
246
  };
246
247
 
247
248
  const submitInstructions = async ({ transaction, wallet })=> {
248
249
  let fromPubkey = new solanaWeb3_js.PublicKey(await wallet.account());
249
250
  const provider = await web3Client.getProvider(transaction.blockchain);
250
- let recentBlockhash = (await provider.getLatestBlockhash()).blockhash;
251
+ let { blockhash, lastValidBlockHeight } = await provider.getLatestBlockhash();
251
252
  const messageV0 = new solanaWeb3_js.TransactionMessage({
252
253
  payerKey: fromPubkey,
253
- recentBlockhash,
254
+ recentBlockhash: blockhash,
254
255
  instructions: transaction.instructions,
255
256
  }).compileToV0Message(
256
257
  transaction.alts ? await Promise.all(transaction.alts.map(async(alt)=>{
@@ -260,6 +261,7 @@
260
261
  if(transaction.signers && transaction.signers.length) {
261
262
  transactionV0.sign(Array.from(new Set(transaction.signers)));
262
263
  }
264
+ transaction._lastValidBlockHeight = lastValidBlockHeight;
263
265
  return wallet._sendTransaction(transactionV0)
264
266
  };
265
267
 
@@ -699,9 +701,6 @@
699
701
  if(typeof message === 'object') {
700
702
  let provider = this.getProvider();
701
703
  let account = await this.account();
702
- if((await this.connectedTo(Blockchains__default['default'].findByNetworkId(message.domain.chainId).name)) === false) {
703
- throw({ code: 'WRONG_NETWORK' })
704
- }
705
704
  let signature = await provider.request({
706
705
  method: 'eth_signTypedData_v4',
707
706
  params: [account, message],
@@ -2203,9 +2202,6 @@
2203
2202
  if(typeof message === 'object') {
2204
2203
  let provider = this.connector;
2205
2204
  let account = await this.account();
2206
- if((await this.connectedTo(Blockchains__default['default'].findByNetworkId(message.domain.chainId).name)) === false) {
2207
- throw({ code: 'WRONG_NETWORK' })
2208
- }
2209
2205
  let signature = await provider.request({
2210
2206
  method: 'eth_signTypedData_v4',
2211
2207
  params: [account, message],
@@ -227,7 +227,7 @@
227
227
  let fromPubkey = new solanaWeb3_js.PublicKey(await wallet.account());
228
228
  let toPubkey = new solanaWeb3_js.PublicKey(transaction.to);
229
229
  const provider = await web3ClientSvm.getProvider(transaction.blockchain);
230
- let recentBlockhash = (await provider.getLatestBlockhash()).blockhash;
230
+ let { blockhash, lastValidBlockHeight } = await provider.getLatestBlockhash();
231
231
  const instructions = [
232
232
  solanaWeb3_js.SystemProgram.transfer({
233
233
  fromPubkey,
@@ -237,20 +237,21 @@
237
237
  ];
238
238
  const messageV0 = new solanaWeb3_js.TransactionMessage({
239
239
  payerKey: fromPubkey,
240
- recentBlockhash,
240
+ recentBlockhash: blockhash,
241
241
  instructions,
242
242
  }).compileToV0Message();
243
243
  const transactionV0 = new solanaWeb3_js.VersionedTransaction(messageV0);
244
+ transaction._lastValidBlockHeight = lastValidBlockHeight;
244
245
  return wallet._sendTransaction(transactionV0)
245
246
  };
246
247
 
247
248
  const submitInstructions = async ({ transaction, wallet })=> {
248
249
  let fromPubkey = new solanaWeb3_js.PublicKey(await wallet.account());
249
250
  const provider = await web3ClientSvm.getProvider(transaction.blockchain);
250
- let recentBlockhash = (await provider.getLatestBlockhash()).blockhash;
251
+ let { blockhash, lastValidBlockHeight } = await provider.getLatestBlockhash();
251
252
  const messageV0 = new solanaWeb3_js.TransactionMessage({
252
253
  payerKey: fromPubkey,
253
- recentBlockhash,
254
+ recentBlockhash: blockhash,
254
255
  instructions: transaction.instructions,
255
256
  }).compileToV0Message(
256
257
  transaction.alts ? await Promise.all(transaction.alts.map(async(alt)=>{
@@ -260,6 +261,7 @@
260
261
  if(transaction.signers && transaction.signers.length) {
261
262
  transactionV0.sign(Array.from(new Set(transaction.signers)));
262
263
  }
264
+ transaction._lastValidBlockHeight = lastValidBlockHeight;
263
265
  return wallet._sendTransaction(transactionV0)
264
266
  };
265
267
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@depay/web3-wallets-evm",
3
3
  "moduleName": "Web3Wallets",
4
- "version": "18.0.9",
4
+ "version": "18.1.0",
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",