@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.cjs.js
CHANGED
|
@@ -1978,10 +1978,10 @@ class Transaction {
|
|
|
1978
1978
|
|
|
1979
1979
|
class TransactionMessage {
|
|
1980
1980
|
constructor(args) {
|
|
1981
|
-
this.
|
|
1981
|
+
this.payerKey = void 0;
|
|
1982
1982
|
this.instructions = void 0;
|
|
1983
1983
|
this.recentBlockhash = void 0;
|
|
1984
|
-
this.
|
|
1984
|
+
this.payerKey = args.payerKey;
|
|
1985
1985
|
this.instructions = args.instructions;
|
|
1986
1986
|
this.recentBlockhash = args.recentBlockhash;
|
|
1987
1987
|
}
|
|
@@ -2002,6 +2002,12 @@ class TransactionMessage {
|
|
|
2002
2002
|
const numWritableUnsignedAccounts = message.staticAccountKeys.length - numReadonlyUnsignedAccounts;
|
|
2003
2003
|
assert(numWritableUnsignedAccounts >= 0, 'Message header is invalid');
|
|
2004
2004
|
const accountKeys = message.getAccountKeys(args);
|
|
2005
|
+
const payerKey = accountKeys.get(0);
|
|
2006
|
+
|
|
2007
|
+
if (payerKey === undefined) {
|
|
2008
|
+
throw new Error('Failed to decompile message because no account keys were found');
|
|
2009
|
+
}
|
|
2010
|
+
|
|
2005
2011
|
const instructions = [];
|
|
2006
2012
|
|
|
2007
2013
|
for (const compiledIx of compiledInstructions) {
|
|
@@ -2047,35 +2053,23 @@ class TransactionMessage {
|
|
|
2047
2053
|
}
|
|
2048
2054
|
|
|
2049
2055
|
return new TransactionMessage({
|
|
2050
|
-
|
|
2056
|
+
payerKey,
|
|
2051
2057
|
instructions,
|
|
2052
2058
|
recentBlockhash
|
|
2053
2059
|
});
|
|
2054
2060
|
}
|
|
2055
2061
|
|
|
2056
2062
|
compileToLegacyMessage() {
|
|
2057
|
-
const payerKey = this.accountKeys.get(0);
|
|
2058
|
-
|
|
2059
|
-
if (payerKey === undefined) {
|
|
2060
|
-
throw new Error('Failed to compile message because no account keys were found');
|
|
2061
|
-
}
|
|
2062
|
-
|
|
2063
2063
|
return Message.compile({
|
|
2064
|
-
payerKey,
|
|
2064
|
+
payerKey: this.payerKey,
|
|
2065
2065
|
recentBlockhash: this.recentBlockhash,
|
|
2066
2066
|
instructions: this.instructions
|
|
2067
2067
|
});
|
|
2068
2068
|
}
|
|
2069
2069
|
|
|
2070
2070
|
compileToV0Message(addressLookupTableAccounts) {
|
|
2071
|
-
const payerKey = this.accountKeys.get(0);
|
|
2072
|
-
|
|
2073
|
-
if (payerKey === undefined) {
|
|
2074
|
-
throw new Error('Failed to compile message because no account keys were found');
|
|
2075
|
-
}
|
|
2076
|
-
|
|
2077
2071
|
return MessageV0.compile({
|
|
2078
|
-
payerKey,
|
|
2072
|
+
payerKey: this.payerKey,
|
|
2079
2073
|
recentBlockhash: this.recentBlockhash,
|
|
2080
2074
|
instructions: this.instructions,
|
|
2081
2075
|
addressLookupTableAccounts
|
|
@@ -2088,6 +2082,10 @@ class TransactionMessage {
|
|
|
2088
2082
|
* Versioned transaction class
|
|
2089
2083
|
*/
|
|
2090
2084
|
class VersionedTransaction {
|
|
2085
|
+
get version() {
|
|
2086
|
+
return this.message.version;
|
|
2087
|
+
}
|
|
2088
|
+
|
|
2091
2089
|
constructor(message, signatures) {
|
|
2092
2090
|
this.signatures = void 0;
|
|
2093
2091
|
this.message = void 0;
|
|
@@ -4371,7 +4369,8 @@ const ParsedConfirmedTransactionResult = superstruct.type({
|
|
|
4371
4369
|
accountKeys: superstruct.array(superstruct.type({
|
|
4372
4370
|
pubkey: PublicKeyFromString,
|
|
4373
4371
|
signer: superstruct.boolean(),
|
|
4374
|
-
writable: superstruct.boolean()
|
|
4372
|
+
writable: superstruct.boolean(),
|
|
4373
|
+
source: superstruct.optional(superstruct.union([superstruct.literal('transaction'), superstruct.literal('lookupTable')]))
|
|
4375
4374
|
})),
|
|
4376
4375
|
instructions: superstruct.array(ParsedOrRawInstruction),
|
|
4377
4376
|
recentBlockhash: superstruct.string(),
|
|
@@ -6599,7 +6598,7 @@ class Connection {
|
|
|
6599
6598
|
*/
|
|
6600
6599
|
// eslint-disable-next-line no-dupe-class-members
|
|
6601
6600
|
async sendTransaction(transaction, signersOrOptions, options) {
|
|
6602
|
-
if ('
|
|
6601
|
+
if ('version' in transaction) {
|
|
6603
6602
|
if (signersOrOptions && Array.isArray(signersOrOptions)) {
|
|
6604
6603
|
throw new Error('Invalid arguments');
|
|
6605
6604
|
}
|
|
@@ -7547,7 +7546,7 @@ class Keypair {
|
|
|
7547
7546
|
|
|
7548
7547
|
|
|
7549
7548
|
get secretKey() {
|
|
7550
|
-
return this._keypair.secretKey;
|
|
7549
|
+
return new Uint8Array(this._keypair.secretKey);
|
|
7551
7550
|
}
|
|
7552
7551
|
|
|
7553
7552
|
}
|
|
@@ -7962,6 +7961,9 @@ class ComputeBudgetProgram {
|
|
|
7962
7961
|
*/
|
|
7963
7962
|
|
|
7964
7963
|
|
|
7964
|
+
/**
|
|
7965
|
+
* @deprecated Instead, call {@link setComputeUnitLimit} and/or {@link setComputeUnitPrice}
|
|
7966
|
+
*/
|
|
7965
7967
|
static requestUnits(params) {
|
|
7966
7968
|
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits;
|
|
7967
7969
|
const data = encodeData(type, params);
|