feat: add commitment param to JSON RPC API requests (#549)
* feat: add commitment param to json rpc requests * fix: tests and examples * fix: docs * fix: epoch info test * fix: budget example * fix: test timeout * fix: remove MAX_COMMITMENT and RECENT_COMMITMENT types
This commit is contained in:
committed by
Michael Vines
parent
d0c89f7fa3
commit
189807f5a5
@ -13,7 +13,7 @@ const contractState = new solanaWeb3.Account();
|
||||
|
||||
let url;
|
||||
url = 'http://localhost:8899';
|
||||
const connection = new solanaWeb3.Connection(url);
|
||||
const connection = new solanaWeb3.Connection(url, 'recent');
|
||||
|
||||
function showBalance() {
|
||||
console.log(`\n== Account State`);
|
||||
@ -50,9 +50,9 @@ function confirmTransaction(signature) {
|
||||
}
|
||||
|
||||
function airDrop() {
|
||||
console.log(`\n== Requesting airdrop of 100 to ${account1.publicKey}`);
|
||||
console.log(`\n== Requesting airdrop of 100000 to ${account1.publicKey}`);
|
||||
return connection
|
||||
.requestAirdrop(account1.publicKey, 100)
|
||||
.requestAirdrop(account1.publicKey, 100000)
|
||||
.then(confirmTransaction);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ const approver2 = new solanaWeb3.Account();
|
||||
let url;
|
||||
url = 'http://localhost:8899';
|
||||
//url = 'http://testnet.solana.com:8899';
|
||||
const connection = new solanaWeb3.Connection(url);
|
||||
const connection = new solanaWeb3.Connection(url, 'recent');
|
||||
|
||||
function getTransactionFee() {
|
||||
return connection.getRecentBlockhash().then(response => {
|
||||
@ -59,7 +59,7 @@ function confirmTransaction(signature) {
|
||||
}
|
||||
|
||||
function airDrop(feeCalculator) {
|
||||
const airdrop = 100 + 3 * feeCalculator.targetLamportsPerSignature;
|
||||
const airdrop = 100 + 5 * feeCalculator.targetLamportsPerSignature;
|
||||
console.log(`\n== Requesting airdrop of ${airdrop} to ${account1.publicKey}`);
|
||||
return connection
|
||||
.requestAirdrop(account1.publicKey, airdrop)
|
||||
|
Reference in New Issue
Block a user