@solana/web3.js 1.44.0 → 1.44.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.
- package/lib/index.browser.cjs.js +29 -18
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +28 -19
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +29 -18
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +9 -0
- package/lib/index.esm.js +28 -19
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +29 -18
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +3 -3
- package/lib/index.iife.min.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +12 -3
- package/src/index.ts +1 -0
- package/src/transaction.ts +19 -12
package/lib/index.browser.esm.js
CHANGED
|
@@ -2510,24 +2510,27 @@ class Transaction {
|
|
|
2510
2510
|
return this._message;
|
|
2511
2511
|
}
|
|
2512
2512
|
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
} = this;
|
|
2513
|
+
let recentBlockhash;
|
|
2514
|
+
let instructions;
|
|
2516
2515
|
|
|
2517
|
-
if (
|
|
2518
|
-
|
|
2519
|
-
this.instructions.unshift(nonceInfo.nonceInstruction);
|
|
2520
|
-
}
|
|
2516
|
+
if (this.nonceInfo) {
|
|
2517
|
+
recentBlockhash = this.nonceInfo.nonce;
|
|
2521
2518
|
|
|
2522
|
-
|
|
2523
|
-
|
|
2524
|
-
|
|
2519
|
+
if (this.instructions[0] != this.nonceInfo.nonceInstruction) {
|
|
2520
|
+
instructions = [this.nonceInfo.nonceInstruction, ...this.instructions];
|
|
2521
|
+
} else {
|
|
2522
|
+
instructions = this.instructions;
|
|
2523
|
+
}
|
|
2524
|
+
} else {
|
|
2525
|
+
recentBlockhash = this.recentBlockhash;
|
|
2526
|
+
instructions = this.instructions;
|
|
2527
|
+
}
|
|
2525
2528
|
|
|
2526
2529
|
if (!recentBlockhash) {
|
|
2527
2530
|
throw new Error('Transaction recentBlockhash required');
|
|
2528
2531
|
}
|
|
2529
2532
|
|
|
2530
|
-
if (
|
|
2533
|
+
if (instructions.length < 1) {
|
|
2531
2534
|
console.warn('No instructions provided');
|
|
2532
2535
|
}
|
|
2533
2536
|
|
|
@@ -2542,15 +2545,15 @@ class Transaction {
|
|
|
2542
2545
|
throw new Error('Transaction fee payer required');
|
|
2543
2546
|
}
|
|
2544
2547
|
|
|
2545
|
-
for (let i = 0; i <
|
|
2546
|
-
if (
|
|
2548
|
+
for (let i = 0; i < instructions.length; i++) {
|
|
2549
|
+
if (instructions[i].programId === undefined) {
|
|
2547
2550
|
throw new Error(`Transaction instruction index ${i} has undefined program id`);
|
|
2548
2551
|
}
|
|
2549
2552
|
}
|
|
2550
2553
|
|
|
2551
2554
|
const programIds = [];
|
|
2552
2555
|
const accountMetas = [];
|
|
2553
|
-
|
|
2556
|
+
instructions.forEach(instruction => {
|
|
2554
2557
|
instruction.keys.forEach(accountMeta => {
|
|
2555
2558
|
accountMetas.push({ ...accountMeta
|
|
2556
2559
|
});
|
|
@@ -2660,7 +2663,7 @@ class Transaction {
|
|
|
2660
2663
|
}
|
|
2661
2664
|
});
|
|
2662
2665
|
const accountKeys = signedKeys.concat(unsignedKeys);
|
|
2663
|
-
const
|
|
2666
|
+
const compiledInstructions = instructions.map(instruction => {
|
|
2664
2667
|
const {
|
|
2665
2668
|
data,
|
|
2666
2669
|
programId
|
|
@@ -2671,7 +2674,7 @@ class Transaction {
|
|
|
2671
2674
|
data: bs58.encode(data)
|
|
2672
2675
|
};
|
|
2673
2676
|
});
|
|
2674
|
-
|
|
2677
|
+
compiledInstructions.forEach(instruction => {
|
|
2675
2678
|
assert(instruction.programIdIndex >= 0);
|
|
2676
2679
|
instruction.accounts.forEach(keyIndex => assert(keyIndex >= 0));
|
|
2677
2680
|
});
|
|
@@ -2683,7 +2686,7 @@ class Transaction {
|
|
|
2683
2686
|
},
|
|
2684
2687
|
accountKeys,
|
|
2685
2688
|
recentBlockhash,
|
|
2686
|
-
instructions
|
|
2689
|
+
instructions: compiledInstructions
|
|
2687
2690
|
});
|
|
2688
2691
|
}
|
|
2689
2692
|
/**
|
|
@@ -6726,7 +6729,13 @@ class Connection {
|
|
|
6726
6729
|
throw new Error('failed to get transactions: ' + res.error.message);
|
|
6727
6730
|
}
|
|
6728
6731
|
|
|
6729
|
-
|
|
6732
|
+
const result = res.result;
|
|
6733
|
+
if (!result) return result;
|
|
6734
|
+
return { ...result,
|
|
6735
|
+
transaction: { ...result.transaction,
|
|
6736
|
+
message: new Message(result.transaction.message)
|
|
6737
|
+
}
|
|
6738
|
+
};
|
|
6730
6739
|
});
|
|
6731
6740
|
return res;
|
|
6732
6741
|
}
|
|
@@ -9779,5 +9788,5 @@ function clusterApiUrl(cluster, tls) {
|
|
|
9779
9788
|
|
|
9780
9789
|
const LAMPORTS_PER_SOL = 1000000000;
|
|
9781
9790
|
|
|
9782
|
-
export { Account, Authorized, BLOCKHASH_CACHE_TIMEOUT_MS, BPF_LOADER_DEPRECATED_PROGRAM_ID, BPF_LOADER_PROGRAM_ID, BpfLoader, COMPUTE_BUDGET_INSTRUCTION_LAYOUTS, ComputeBudgetInstruction, ComputeBudgetProgram, Connection, Ed25519Program, Enum, EpochSchedule, FeeCalculatorLayout, Keypair, LAMPORTS_PER_SOL, Loader, Lockup, MAX_SEED_LENGTH, Message, NONCE_ACCOUNT_LENGTH, NonceAccount, PACKET_DATA_SIZE, PublicKey, SIGNATURE_LENGTH_IN_BYTES, SOLANA_SCHEMA, STAKE_CONFIG_ID, STAKE_INSTRUCTION_LAYOUTS, SYSTEM_INSTRUCTION_LAYOUTS, SYSVAR_CLOCK_PUBKEY, SYSVAR_EPOCH_SCHEDULE_PUBKEY, SYSVAR_INSTRUCTIONS_PUBKEY, SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY, SYSVAR_REWARDS_PUBKEY, SYSVAR_SLOT_HASHES_PUBKEY, SYSVAR_SLOT_HISTORY_PUBKEY, SYSVAR_STAKE_HISTORY_PUBKEY, Secp256k1Program, SendTransactionError, StakeAuthorizationLayout, StakeInstruction, StakeProgram, Struct, SystemInstruction, SystemProgram, Transaction, TransactionInstruction, TransactionStatus, VALIDATOR_INFO_KEY, VOTE_PROGRAM_ID, ValidatorInfo, VoteAccount, VoteAuthorizationLayout, VoteInit, VoteInstruction, VoteProgram, clusterApiUrl, sendAndConfirmRawTransaction, sendAndConfirmTransaction };
|
|
9791
|
+
export { Account, Authorized, BLOCKHASH_CACHE_TIMEOUT_MS, BPF_LOADER_DEPRECATED_PROGRAM_ID, BPF_LOADER_PROGRAM_ID, BpfLoader, COMPUTE_BUDGET_INSTRUCTION_LAYOUTS, ComputeBudgetInstruction, ComputeBudgetProgram, Connection, Ed25519Program, Enum, EpochSchedule, FeeCalculatorLayout, Keypair, LAMPORTS_PER_SOL, Loader, Lockup, MAX_SEED_LENGTH, Message, NONCE_ACCOUNT_LENGTH, NonceAccount, PACKET_DATA_SIZE, PublicKey, SIGNATURE_LENGTH_IN_BYTES, SOLANA_SCHEMA, STAKE_CONFIG_ID, STAKE_INSTRUCTION_LAYOUTS, SYSTEM_INSTRUCTION_LAYOUTS, SYSVAR_CLOCK_PUBKEY, SYSVAR_EPOCH_SCHEDULE_PUBKEY, SYSVAR_INSTRUCTIONS_PUBKEY, SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY, SYSVAR_REWARDS_PUBKEY, SYSVAR_SLOT_HASHES_PUBKEY, SYSVAR_SLOT_HISTORY_PUBKEY, SYSVAR_STAKE_HISTORY_PUBKEY, Secp256k1Program, SendTransactionError, StakeAuthorizationLayout, StakeInstruction, StakeProgram, Struct, SystemInstruction, SystemProgram, Transaction, TransactionExpiredBlockheightExceededError, TransactionExpiredTimeoutError, TransactionInstruction, TransactionStatus, VALIDATOR_INFO_KEY, VOTE_PROGRAM_ID, ValidatorInfo, VoteAccount, VoteAuthorizationLayout, VoteInit, VoteInstruction, VoteProgram, clusterApiUrl, sendAndConfirmRawTransaction, sendAndConfirmTransaction };
|
|
9783
9792
|
//# sourceMappingURL=index.browser.esm.js.map
|