@depay/web3-wallets-evm 15.8.0 → 15.9.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.
- package/README.md +39 -2
- package/dist/esm/index.evm.js +3 -4
- package/dist/esm/index.js +3 -4
- package/dist/esm/index.solana.js +3 -4
- package/dist/umd/index.evm.js +3 -4
- package/dist/umd/index.js +3 -4
- package/dist/umd/index.solana.js +3 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -375,7 +375,7 @@ let sentTransaction = await wallet.sendTransaction({
|
|
|
375
375
|
|
|
376
376
|
If you need to sign an instruction (e.g. creating "throw away" accounts)
|
|
377
377
|
|
|
378
|
-
you can
|
|
378
|
+
you can pass `signers` as part of the transaction passed to `sendTransaction`:
|
|
379
379
|
|
|
380
380
|
```javascript
|
|
381
381
|
import { getProvider } from '@depay/web3-client'
|
|
@@ -398,11 +398,48 @@ let instruction = SystemProgram.createAccount({
|
|
|
398
398
|
lamports: rent
|
|
399
399
|
})
|
|
400
400
|
|
|
401
|
-
|
|
401
|
+
let sentTransaction = await wallet.sendTransaction({
|
|
402
|
+
blockchain: 'solana',
|
|
403
|
+
instructions: [instruction],
|
|
404
|
+
signers: [keypair],
|
|
405
|
+
sent: function(transaction){},
|
|
406
|
+
succeeded: function(transaction){},
|
|
407
|
+
failed: function(transaction, error){}
|
|
408
|
+
})
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
###### Solana: Address Lookup Tables
|
|
412
|
+
|
|
413
|
+
If you need to pass address lookup tables in order to reduce transaction size,
|
|
414
|
+
|
|
415
|
+
you can pass `alts` as part of the transaction passed to `sendTransaction`:
|
|
416
|
+
|
|
417
|
+
```javascript
|
|
418
|
+
import { getProvider } from '@depay/web3-client'
|
|
419
|
+
import { Token } from '@depay/web3-tokens'
|
|
420
|
+
import { PublicKey, SystemProgram, Keypair } from '@depay/solana-web3.js'
|
|
421
|
+
|
|
422
|
+
const wallets = await getWallets()
|
|
423
|
+
const wallet = wallets[0]
|
|
424
|
+
const fromAddress = await wallet.account()
|
|
425
|
+
const provider = await getProvider('solana')
|
|
426
|
+
const keypair = Keypair.generate()
|
|
427
|
+
const account = keypair.publicKey.toString()
|
|
428
|
+
const rent = await provider.getMinimumBalanceForRentExemption(Token.solana.TOKEN_LAYOUT.span)
|
|
429
|
+
|
|
430
|
+
let instruction = SystemProgram.createAccount({
|
|
431
|
+
fromPubkey: new SolanaWeb3js.PublicKey(fromAddress),
|
|
432
|
+
newAccountPubkey: new SolanaWeb3js.PublicKey(wrappedAccount),
|
|
433
|
+
programId: new SolanaWeb3js.PublicKey(Web3Tokens.Token.solana.TOKEN_PROGRAM),
|
|
434
|
+
space: Web3Tokens.Token.solana.TOKEN_LAYOUT.span,
|
|
435
|
+
lamports: rent
|
|
436
|
+
})
|
|
402
437
|
|
|
403
438
|
let sentTransaction = await wallet.sendTransaction({
|
|
404
439
|
blockchain: 'solana',
|
|
405
440
|
instructions: [instruction],
|
|
441
|
+
signers: [keypair],
|
|
442
|
+
alts: ['3sEm5YYxgLnP1Z11WXHSgScWqFMrATSNDgZcXAcB1w9A'],
|
|
406
443
|
sent: function(transaction){},
|
|
407
444
|
succeeded: function(transaction){},
|
|
408
445
|
failed: function(transaction, error){}
|
package/dist/esm/index.evm.js
CHANGED
|
@@ -41934,11 +41934,10 @@ const submitInstructions = async ({ transaction, wallet })=> {
|
|
|
41934
41934
|
payerKey: fromPubkey,
|
|
41935
41935
|
recentBlockhash,
|
|
41936
41936
|
instructions: transaction.instructions,
|
|
41937
|
-
}).compileToV0Message();
|
|
41937
|
+
}).compileToV0Message(transaction.alts ? transaction.alts : undefined);
|
|
41938
41938
|
const transactionV0 = new VersionedTransaction(messageV0);
|
|
41939
|
-
|
|
41940
|
-
|
|
41941
|
-
transactionV0.sign(Array.from(new Set(signers)));
|
|
41939
|
+
if(transaction.signers && transaction.signers.length) {
|
|
41940
|
+
transactionV0.sign(Array.from(new Set(transaction.signers)));
|
|
41942
41941
|
}
|
|
41943
41942
|
return window.solana.signAndSendTransaction(transactionV0)
|
|
41944
41943
|
};
|
package/dist/esm/index.js
CHANGED
|
@@ -502,11 +502,10 @@ const submitInstructions = async ({ transaction, wallet })=> {
|
|
|
502
502
|
payerKey: fromPubkey,
|
|
503
503
|
recentBlockhash,
|
|
504
504
|
instructions: transaction.instructions,
|
|
505
|
-
}).compileToV0Message();
|
|
505
|
+
}).compileToV0Message(transaction.alts ? transaction.alts : undefined);
|
|
506
506
|
const transactionV0 = new VersionedTransaction(messageV0);
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
transactionV0.sign(Array.from(new Set(signers)));
|
|
507
|
+
if(transaction.signers && transaction.signers.length) {
|
|
508
|
+
transactionV0.sign(Array.from(new Set(transaction.signers)));
|
|
510
509
|
}
|
|
511
510
|
return window.solana.signAndSendTransaction(transactionV0)
|
|
512
511
|
};
|
package/dist/esm/index.solana.js
CHANGED
|
@@ -1243,11 +1243,10 @@ const submitInstructions = async ({ transaction, wallet })=> {
|
|
|
1243
1243
|
payerKey: fromPubkey,
|
|
1244
1244
|
recentBlockhash,
|
|
1245
1245
|
instructions: transaction.instructions,
|
|
1246
|
-
}).compileToV0Message();
|
|
1246
|
+
}).compileToV0Message(transaction.alts ? transaction.alts : undefined);
|
|
1247
1247
|
const transactionV0 = new VersionedTransaction(messageV0);
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
transactionV0.sign(Array.from(new Set(signers)));
|
|
1248
|
+
if(transaction.signers && transaction.signers.length) {
|
|
1249
|
+
transactionV0.sign(Array.from(new Set(transaction.signers)));
|
|
1251
1250
|
}
|
|
1252
1251
|
return window.solana.signAndSendTransaction(transactionV0)
|
|
1253
1252
|
};
|
package/dist/umd/index.evm.js
CHANGED
|
@@ -41938,11 +41938,10 @@
|
|
|
41938
41938
|
payerKey: fromPubkey,
|
|
41939
41939
|
recentBlockhash,
|
|
41940
41940
|
instructions: transaction.instructions,
|
|
41941
|
-
}).compileToV0Message();
|
|
41941
|
+
}).compileToV0Message(transaction.alts ? transaction.alts : undefined);
|
|
41942
41942
|
const transactionV0 = new VersionedTransaction(messageV0);
|
|
41943
|
-
|
|
41944
|
-
|
|
41945
|
-
transactionV0.sign(Array.from(new Set(signers)));
|
|
41943
|
+
if(transaction.signers && transaction.signers.length) {
|
|
41944
|
+
transactionV0.sign(Array.from(new Set(transaction.signers)));
|
|
41946
41945
|
}
|
|
41947
41946
|
return window.solana.signAndSendTransaction(transactionV0)
|
|
41948
41947
|
};
|
package/dist/umd/index.js
CHANGED
|
@@ -505,11 +505,10 @@
|
|
|
505
505
|
payerKey: fromPubkey,
|
|
506
506
|
recentBlockhash,
|
|
507
507
|
instructions: transaction.instructions,
|
|
508
|
-
}).compileToV0Message();
|
|
508
|
+
}).compileToV0Message(transaction.alts ? transaction.alts : undefined);
|
|
509
509
|
const transactionV0 = new solanaWeb3_js.VersionedTransaction(messageV0);
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
transactionV0.sign(Array.from(new Set(signers)));
|
|
510
|
+
if(transaction.signers && transaction.signers.length) {
|
|
511
|
+
transactionV0.sign(Array.from(new Set(transaction.signers)));
|
|
513
512
|
}
|
|
514
513
|
return window.solana.signAndSendTransaction(transactionV0)
|
|
515
514
|
};
|
package/dist/umd/index.solana.js
CHANGED
|
@@ -1246,11 +1246,10 @@
|
|
|
1246
1246
|
payerKey: fromPubkey,
|
|
1247
1247
|
recentBlockhash,
|
|
1248
1248
|
instructions: transaction.instructions,
|
|
1249
|
-
}).compileToV0Message();
|
|
1249
|
+
}).compileToV0Message(transaction.alts ? transaction.alts : undefined);
|
|
1250
1250
|
const transactionV0 = new solanaWeb3_js.VersionedTransaction(messageV0);
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
transactionV0.sign(Array.from(new Set(signers)));
|
|
1251
|
+
if(transaction.signers && transaction.signers.length) {
|
|
1252
|
+
transactionV0.sign(Array.from(new Set(transaction.signers)));
|
|
1254
1253
|
}
|
|
1255
1254
|
return window.solana.signAndSendTransaction(transactionV0)
|
|
1256
1255
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depay/web3-wallets-evm",
|
|
3
3
|
"moduleName": "Web3Wallets",
|
|
4
|
-
"version": "15.
|
|
4
|
+
"version": "15.9.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",
|