@solana/web3.js 1.42.0 → 1.43.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/lib/index.browser.cjs.js +59 -3
- package/lib/index.browser.cjs.js.map +1 -1
- package/lib/index.browser.esm.js +59 -3
- package/lib/index.browser.esm.js.map +1 -1
- package/lib/index.cjs.js +59 -3
- package/lib/index.cjs.js.map +1 -1
- package/lib/index.d.ts +40 -6
- package/lib/index.esm.js +59 -3
- package/lib/index.esm.js.map +1 -1
- package/lib/index.iife.js +59 -3
- 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/package.json +1 -1
- package/src/compute-budget.ts +92 -3
- package/src/connection.ts +7 -5
- package/src/transaction.ts +0 -1
- package/src/util/send-and-confirm-raw-transaction.ts +6 -6
package/lib/index.browser.esm.js
CHANGED
|
@@ -2796,8 +2796,6 @@ class Transaction {
|
|
|
2796
2796
|
const message = this._compile();
|
|
2797
2797
|
|
|
2798
2798
|
this._partialSign(message, ...uniqueSigners);
|
|
2799
|
-
|
|
2800
|
-
this._verifySignatures(message.serialize(), true);
|
|
2801
2799
|
}
|
|
2802
2800
|
/**
|
|
2803
2801
|
* Partially sign a transaction with the specified accounts. All accounts must
|
|
@@ -4155,6 +4153,34 @@ class ComputeBudgetInstruction {
|
|
|
4155
4153
|
bytes
|
|
4156
4154
|
};
|
|
4157
4155
|
}
|
|
4156
|
+
/**
|
|
4157
|
+
* Decode set compute unit limit compute budget instruction and retrieve the instruction params.
|
|
4158
|
+
*/
|
|
4159
|
+
|
|
4160
|
+
|
|
4161
|
+
static decodeSetComputeUnitLimit(instruction) {
|
|
4162
|
+
this.checkProgramId(instruction.programId);
|
|
4163
|
+
const {
|
|
4164
|
+
units
|
|
4165
|
+
} = decodeData(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit, instruction.data);
|
|
4166
|
+
return {
|
|
4167
|
+
units
|
|
4168
|
+
};
|
|
4169
|
+
}
|
|
4170
|
+
/**
|
|
4171
|
+
* Decode set compute unit price compute budget instruction and retrieve the instruction params.
|
|
4172
|
+
*/
|
|
4173
|
+
|
|
4174
|
+
|
|
4175
|
+
static decodeSetComputeUnitPrice(instruction) {
|
|
4176
|
+
this.checkProgramId(instruction.programId);
|
|
4177
|
+
const {
|
|
4178
|
+
microLamports
|
|
4179
|
+
} = decodeData(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice, instruction.data);
|
|
4180
|
+
return {
|
|
4181
|
+
microLamports
|
|
4182
|
+
};
|
|
4183
|
+
}
|
|
4158
4184
|
/**
|
|
4159
4185
|
* @internal
|
|
4160
4186
|
*/
|
|
@@ -4183,6 +4209,14 @@ const COMPUTE_BUDGET_INSTRUCTION_LAYOUTS = Object.freeze({
|
|
|
4183
4209
|
RequestHeapFrame: {
|
|
4184
4210
|
index: 1,
|
|
4185
4211
|
layout: BufferLayout.struct([BufferLayout.u8('instruction'), BufferLayout.u32('bytes')])
|
|
4212
|
+
},
|
|
4213
|
+
SetComputeUnitLimit: {
|
|
4214
|
+
index: 2,
|
|
4215
|
+
layout: BufferLayout.struct([BufferLayout.u8('instruction'), BufferLayout.u32('units')])
|
|
4216
|
+
},
|
|
4217
|
+
SetComputeUnitPrice: {
|
|
4218
|
+
index: 3,
|
|
4219
|
+
layout: BufferLayout.struct([BufferLayout.u8('instruction'), u64('microLamports')])
|
|
4186
4220
|
}
|
|
4187
4221
|
});
|
|
4188
4222
|
/**
|
|
@@ -4219,6 +4253,28 @@ class ComputeBudgetProgram {
|
|
|
4219
4253
|
});
|
|
4220
4254
|
}
|
|
4221
4255
|
|
|
4256
|
+
static setComputeUnitLimit(params) {
|
|
4257
|
+
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit;
|
|
4258
|
+
const data = encodeData(type, params);
|
|
4259
|
+
return new TransactionInstruction({
|
|
4260
|
+
keys: [],
|
|
4261
|
+
programId: this.programId,
|
|
4262
|
+
data
|
|
4263
|
+
});
|
|
4264
|
+
}
|
|
4265
|
+
|
|
4266
|
+
static setComputeUnitPrice(params) {
|
|
4267
|
+
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice;
|
|
4268
|
+
const data = encodeData(type, {
|
|
4269
|
+
microLamports: BigInt(params.microLamports)
|
|
4270
|
+
});
|
|
4271
|
+
return new TransactionInstruction({
|
|
4272
|
+
keys: [],
|
|
4273
|
+
programId: this.programId,
|
|
4274
|
+
data
|
|
4275
|
+
});
|
|
4276
|
+
}
|
|
4277
|
+
|
|
4222
4278
|
}
|
|
4223
4279
|
ComputeBudgetProgram.programId = new PublicKey('ComputeBudget111111111111111111111111111111');
|
|
4224
4280
|
|
|
@@ -10166,7 +10222,7 @@ VoteProgram.space = 3731;
|
|
|
10166
10222
|
*
|
|
10167
10223
|
* @param {Connection} connection
|
|
10168
10224
|
* @param {Buffer} rawTransaction
|
|
10169
|
-
* @param {
|
|
10225
|
+
* @param {BlockheightBasedTransactionConfirmationStrategy} confirmationStrategy
|
|
10170
10226
|
* @param {ConfirmOptions} [options]
|
|
10171
10227
|
* @returns {Promise<TransactionSignature>}
|
|
10172
10228
|
*/
|