@solana/web3.js 1.59.0 → 1.61.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 +18 -0
- package/lib/index.browser.cjs.js +22 -20
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +22 -20
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +22 -20
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +8 -2
- package/lib/index.esm.js +22 -20
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +22 -20
- package/lib/index.iife.js.map +1 -1
- package/lib/index.iife.min.js +2 -2
- package/lib/index.iife.min.js.map +1 -1
- package/lib/index.native.js +22 -20
- package/lib/index.native.js.map +1 -1
- package/package.json +1 -1
- package/src/connection.ts +6 -1
- package/src/keypair.ts +1 -1
- package/src/programs/compute-budget.ts +3 -0
- package/src/transaction/message.ts +15 -24
- package/src/transaction/versioned.ts +4 -0
package/lib/index.iife.js
CHANGED
|
@@ -12430,10 +12430,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
12430
12430
|
|
|
12431
12431
|
class TransactionMessage {
|
|
12432
12432
|
constructor(args) {
|
|
12433
|
-
this.
|
|
12433
|
+
this.payerKey = void 0;
|
|
12434
12434
|
this.instructions = void 0;
|
|
12435
12435
|
this.recentBlockhash = void 0;
|
|
12436
|
-
this.
|
|
12436
|
+
this.payerKey = args.payerKey;
|
|
12437
12437
|
this.instructions = args.instructions;
|
|
12438
12438
|
this.recentBlockhash = args.recentBlockhash;
|
|
12439
12439
|
}
|
|
@@ -12454,6 +12454,12 @@ var solanaWeb3 = (function (exports) {
|
|
|
12454
12454
|
const numWritableUnsignedAccounts = message.staticAccountKeys.length - numReadonlyUnsignedAccounts;
|
|
12455
12455
|
assert$1(numWritableUnsignedAccounts >= 0, 'Message header is invalid');
|
|
12456
12456
|
const accountKeys = message.getAccountKeys(args);
|
|
12457
|
+
const payerKey = accountKeys.get(0);
|
|
12458
|
+
|
|
12459
|
+
if (payerKey === undefined) {
|
|
12460
|
+
throw new Error('Failed to decompile message because no account keys were found');
|
|
12461
|
+
}
|
|
12462
|
+
|
|
12457
12463
|
const instructions = [];
|
|
12458
12464
|
|
|
12459
12465
|
for (const compiledIx of compiledInstructions) {
|
|
@@ -12499,35 +12505,23 @@ var solanaWeb3 = (function (exports) {
|
|
|
12499
12505
|
}
|
|
12500
12506
|
|
|
12501
12507
|
return new TransactionMessage({
|
|
12502
|
-
|
|
12508
|
+
payerKey,
|
|
12503
12509
|
instructions,
|
|
12504
12510
|
recentBlockhash
|
|
12505
12511
|
});
|
|
12506
12512
|
}
|
|
12507
12513
|
|
|
12508
12514
|
compileToLegacyMessage() {
|
|
12509
|
-
const payerKey = this.accountKeys.get(0);
|
|
12510
|
-
|
|
12511
|
-
if (payerKey === undefined) {
|
|
12512
|
-
throw new Error('Failed to compile message because no account keys were found');
|
|
12513
|
-
}
|
|
12514
|
-
|
|
12515
12515
|
return Message.compile({
|
|
12516
|
-
payerKey,
|
|
12516
|
+
payerKey: this.payerKey,
|
|
12517
12517
|
recentBlockhash: this.recentBlockhash,
|
|
12518
12518
|
instructions: this.instructions
|
|
12519
12519
|
});
|
|
12520
12520
|
}
|
|
12521
12521
|
|
|
12522
12522
|
compileToV0Message(addressLookupTableAccounts) {
|
|
12523
|
-
const payerKey = this.accountKeys.get(0);
|
|
12524
|
-
|
|
12525
|
-
if (payerKey === undefined) {
|
|
12526
|
-
throw new Error('Failed to compile message because no account keys were found');
|
|
12527
|
-
}
|
|
12528
|
-
|
|
12529
12523
|
return MessageV0.compile({
|
|
12530
|
-
payerKey,
|
|
12524
|
+
payerKey: this.payerKey,
|
|
12531
12525
|
recentBlockhash: this.recentBlockhash,
|
|
12532
12526
|
instructions: this.instructions,
|
|
12533
12527
|
addressLookupTableAccounts
|
|
@@ -12540,6 +12534,10 @@ var solanaWeb3 = (function (exports) {
|
|
|
12540
12534
|
* Versioned transaction class
|
|
12541
12535
|
*/
|
|
12542
12536
|
class VersionedTransaction {
|
|
12537
|
+
get version() {
|
|
12538
|
+
return this.message.version;
|
|
12539
|
+
}
|
|
12540
|
+
|
|
12543
12541
|
constructor(message, signatures) {
|
|
12544
12542
|
this.signatures = void 0;
|
|
12545
12543
|
this.message = void 0;
|
|
@@ -17928,7 +17926,8 @@ var solanaWeb3 = (function (exports) {
|
|
|
17928
17926
|
accountKeys: array(type({
|
|
17929
17927
|
pubkey: PublicKeyFromString,
|
|
17930
17928
|
signer: boolean(),
|
|
17931
|
-
writable: boolean()
|
|
17929
|
+
writable: boolean(),
|
|
17930
|
+
source: optional(union([literal('transaction'), literal('lookupTable')]))
|
|
17932
17931
|
})),
|
|
17933
17932
|
instructions: array(ParsedOrRawInstruction),
|
|
17934
17933
|
recentBlockhash: string(),
|
|
@@ -20156,7 +20155,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
20156
20155
|
*/
|
|
20157
20156
|
// eslint-disable-next-line no-dupe-class-members
|
|
20158
20157
|
async sendTransaction(transaction, signersOrOptions, options) {
|
|
20159
|
-
if ('
|
|
20158
|
+
if ('version' in transaction) {
|
|
20160
20159
|
if (signersOrOptions && Array.isArray(signersOrOptions)) {
|
|
20161
20160
|
throw new Error('Invalid arguments');
|
|
20162
20161
|
}
|
|
@@ -21104,7 +21103,7 @@ var solanaWeb3 = (function (exports) {
|
|
|
21104
21103
|
|
|
21105
21104
|
|
|
21106
21105
|
get secretKey() {
|
|
21107
|
-
return this._keypair.secretKey;
|
|
21106
|
+
return new Uint8Array(this._keypair.secretKey);
|
|
21108
21107
|
}
|
|
21109
21108
|
|
|
21110
21109
|
}
|
|
@@ -21519,6 +21518,9 @@ var solanaWeb3 = (function (exports) {
|
|
|
21519
21518
|
*/
|
|
21520
21519
|
|
|
21521
21520
|
|
|
21521
|
+
/**
|
|
21522
|
+
* @deprecated Instead, call {@link setComputeUnitLimit} and/or {@link setComputeUnitPrice}
|
|
21523
|
+
*/
|
|
21522
21524
|
static requestUnits(params) {
|
|
21523
21525
|
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits;
|
|
21524
21526
|
const data = encodeData(type, params);
|