@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.cjs.js
CHANGED
|
@@ -2840,8 +2840,6 @@ class Transaction {
|
|
|
2840
2840
|
const message = this._compile();
|
|
2841
2841
|
|
|
2842
2842
|
this._partialSign(message, ...uniqueSigners);
|
|
2843
|
-
|
|
2844
|
-
this._verifySignatures(message.serialize(), true);
|
|
2845
2843
|
}
|
|
2846
2844
|
/**
|
|
2847
2845
|
* Partially sign a transaction with the specified accounts. All accounts must
|
|
@@ -4199,6 +4197,34 @@ class ComputeBudgetInstruction {
|
|
|
4199
4197
|
bytes
|
|
4200
4198
|
};
|
|
4201
4199
|
}
|
|
4200
|
+
/**
|
|
4201
|
+
* Decode set compute unit limit compute budget instruction and retrieve the instruction params.
|
|
4202
|
+
*/
|
|
4203
|
+
|
|
4204
|
+
|
|
4205
|
+
static decodeSetComputeUnitLimit(instruction) {
|
|
4206
|
+
this.checkProgramId(instruction.programId);
|
|
4207
|
+
const {
|
|
4208
|
+
units
|
|
4209
|
+
} = decodeData(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit, instruction.data);
|
|
4210
|
+
return {
|
|
4211
|
+
units
|
|
4212
|
+
};
|
|
4213
|
+
}
|
|
4214
|
+
/**
|
|
4215
|
+
* Decode set compute unit price compute budget instruction and retrieve the instruction params.
|
|
4216
|
+
*/
|
|
4217
|
+
|
|
4218
|
+
|
|
4219
|
+
static decodeSetComputeUnitPrice(instruction) {
|
|
4220
|
+
this.checkProgramId(instruction.programId);
|
|
4221
|
+
const {
|
|
4222
|
+
microLamports
|
|
4223
|
+
} = decodeData(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice, instruction.data);
|
|
4224
|
+
return {
|
|
4225
|
+
microLamports
|
|
4226
|
+
};
|
|
4227
|
+
}
|
|
4202
4228
|
/**
|
|
4203
4229
|
* @internal
|
|
4204
4230
|
*/
|
|
@@ -4227,6 +4253,14 @@ const COMPUTE_BUDGET_INSTRUCTION_LAYOUTS = Object.freeze({
|
|
|
4227
4253
|
RequestHeapFrame: {
|
|
4228
4254
|
index: 1,
|
|
4229
4255
|
layout: BufferLayout__namespace.struct([BufferLayout__namespace.u8('instruction'), BufferLayout__namespace.u32('bytes')])
|
|
4256
|
+
},
|
|
4257
|
+
SetComputeUnitLimit: {
|
|
4258
|
+
index: 2,
|
|
4259
|
+
layout: BufferLayout__namespace.struct([BufferLayout__namespace.u8('instruction'), BufferLayout__namespace.u32('units')])
|
|
4260
|
+
},
|
|
4261
|
+
SetComputeUnitPrice: {
|
|
4262
|
+
index: 3,
|
|
4263
|
+
layout: BufferLayout__namespace.struct([BufferLayout__namespace.u8('instruction'), bufferLayoutUtils.u64('microLamports')])
|
|
4230
4264
|
}
|
|
4231
4265
|
});
|
|
4232
4266
|
/**
|
|
@@ -4263,6 +4297,28 @@ class ComputeBudgetProgram {
|
|
|
4263
4297
|
});
|
|
4264
4298
|
}
|
|
4265
4299
|
|
|
4300
|
+
static setComputeUnitLimit(params) {
|
|
4301
|
+
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit;
|
|
4302
|
+
const data = encodeData(type, params);
|
|
4303
|
+
return new TransactionInstruction({
|
|
4304
|
+
keys: [],
|
|
4305
|
+
programId: this.programId,
|
|
4306
|
+
data
|
|
4307
|
+
});
|
|
4308
|
+
}
|
|
4309
|
+
|
|
4310
|
+
static setComputeUnitPrice(params) {
|
|
4311
|
+
const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice;
|
|
4312
|
+
const data = encodeData(type, {
|
|
4313
|
+
microLamports: BigInt(params.microLamports)
|
|
4314
|
+
});
|
|
4315
|
+
return new TransactionInstruction({
|
|
4316
|
+
keys: [],
|
|
4317
|
+
programId: this.programId,
|
|
4318
|
+
data
|
|
4319
|
+
});
|
|
4320
|
+
}
|
|
4321
|
+
|
|
4266
4322
|
}
|
|
4267
4323
|
ComputeBudgetProgram.programId = new PublicKey('ComputeBudget111111111111111111111111111111');
|
|
4268
4324
|
|
|
@@ -9704,7 +9760,7 @@ VoteProgram.space = 3731;
|
|
|
9704
9760
|
*
|
|
9705
9761
|
* @param {Connection} connection
|
|
9706
9762
|
* @param {Buffer} rawTransaction
|
|
9707
|
-
* @param {
|
|
9763
|
+
* @param {BlockheightBasedTransactionConfirmationStrategy} confirmationStrategy
|
|
9708
9764
|
* @param {ConfirmOptions} [options]
|
|
9709
9765
|
* @returns {Promise<TransactionSignature>}
|
|
9710
9766
|
*/
|