@solana/kit 5.5.0 → 5.5.1-canary-20260128113732
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/dist/index.development.js +143 -108
- package/dist/index.development.js.map +1 -1
- package/dist/index.production.min.js +511 -509
- package/package.json +23 -23
|
@@ -903,6 +903,16 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
903
903
|
function isRpcErrorResponse(value) {
|
|
904
904
|
return typeof value === "object" && value !== null && "code" in value && "message" in value && (typeof value.code === "number" || typeof value.code === "bigint") && typeof value.message === "string";
|
|
905
905
|
}
|
|
906
|
+
function unwrapSimulationError(error) {
|
|
907
|
+
const simulationCodes = [
|
|
908
|
+
SOLANA_ERROR__JSON_RPC__SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE,
|
|
909
|
+
SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT
|
|
910
|
+
];
|
|
911
|
+
if (isSolanaError(error) && !!error.cause && simulationCodes.includes(error.context.__code)) {
|
|
912
|
+
return error.cause;
|
|
913
|
+
}
|
|
914
|
+
return error;
|
|
915
|
+
}
|
|
906
916
|
|
|
907
917
|
// ../codecs-core/dist/index.browser.mjs
|
|
908
918
|
var mergeBytes = (byteArrays) => {
|
|
@@ -5053,6 +5063,136 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5053
5063
|
const instructions = new Array(numberOfInstructions).fill(0).map((_, i) => getInstruction(i === numberOfInstructions - 1 ? lastInstructionSize : REALLOC_LIMIT));
|
|
5054
5064
|
return getMessagePackerInstructionPlanFromInstructions(instructions);
|
|
5055
5065
|
}
|
|
5066
|
+
function appendTransactionMessageInstructionPlan(instructionPlan, transactionMessage) {
|
|
5067
|
+
const leafInstructionPlans = flattenInstructionPlan(instructionPlan);
|
|
5068
|
+
return leafInstructionPlans.reduce(
|
|
5069
|
+
(messageSoFar, plan) => {
|
|
5070
|
+
const kind = plan.kind;
|
|
5071
|
+
if (kind === "single") {
|
|
5072
|
+
return appendTransactionMessageInstruction(plan.instruction, messageSoFar);
|
|
5073
|
+
}
|
|
5074
|
+
if (kind === "messagePacker") {
|
|
5075
|
+
const messagerPacker = plan.getMessagePacker();
|
|
5076
|
+
let nextMessage = messageSoFar;
|
|
5077
|
+
while (!messagerPacker.done()) {
|
|
5078
|
+
nextMessage = messagerPacker.packMessageToCapacity(nextMessage);
|
|
5079
|
+
}
|
|
5080
|
+
return nextMessage;
|
|
5081
|
+
}
|
|
5082
|
+
throw new SolanaError(SOLANA_ERROR__INVARIANT_VIOLATION__INVALID_INSTRUCTION_PLAN_KIND, {
|
|
5083
|
+
kind
|
|
5084
|
+
});
|
|
5085
|
+
},
|
|
5086
|
+
transactionMessage
|
|
5087
|
+
);
|
|
5088
|
+
}
|
|
5089
|
+
function parallelTransactionPlan(plans) {
|
|
5090
|
+
return Object.freeze({ kind: "parallel", plans: parseSingleTransactionPlans(plans) });
|
|
5091
|
+
}
|
|
5092
|
+
function sequentialTransactionPlan(plans) {
|
|
5093
|
+
return Object.freeze({ divisible: true, kind: "sequential", plans: parseSingleTransactionPlans(plans) });
|
|
5094
|
+
}
|
|
5095
|
+
function nonDivisibleSequentialTransactionPlan(plans) {
|
|
5096
|
+
return Object.freeze({ divisible: false, kind: "sequential", plans: parseSingleTransactionPlans(plans) });
|
|
5097
|
+
}
|
|
5098
|
+
function singleTransactionPlan(transactionMessage) {
|
|
5099
|
+
return Object.freeze({ kind: "single", message: transactionMessage });
|
|
5100
|
+
}
|
|
5101
|
+
function parseSingleTransactionPlans(plans) {
|
|
5102
|
+
return plans.map((plan) => "kind" in plan ? plan : singleTransactionPlan(plan));
|
|
5103
|
+
}
|
|
5104
|
+
function isSingleTransactionPlan(plan) {
|
|
5105
|
+
return plan.kind === "single";
|
|
5106
|
+
}
|
|
5107
|
+
function assertIsSingleTransactionPlan(plan) {
|
|
5108
|
+
if (!isSingleTransactionPlan(plan)) {
|
|
5109
|
+
throw new SolanaError(SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN, {
|
|
5110
|
+
actualKind: plan.kind,
|
|
5111
|
+
expectedKind: "single",
|
|
5112
|
+
transactionPlan: plan
|
|
5113
|
+
});
|
|
5114
|
+
}
|
|
5115
|
+
}
|
|
5116
|
+
function isSequentialTransactionPlan(plan) {
|
|
5117
|
+
return plan.kind === "sequential";
|
|
5118
|
+
}
|
|
5119
|
+
function assertIsSequentialTransactionPlan(plan) {
|
|
5120
|
+
if (!isSequentialTransactionPlan(plan)) {
|
|
5121
|
+
throw new SolanaError(SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN, {
|
|
5122
|
+
actualKind: plan.kind,
|
|
5123
|
+
expectedKind: "sequential",
|
|
5124
|
+
transactionPlan: plan
|
|
5125
|
+
});
|
|
5126
|
+
}
|
|
5127
|
+
}
|
|
5128
|
+
function isNonDivisibleSequentialTransactionPlan(plan) {
|
|
5129
|
+
return plan.kind === "sequential" && plan.divisible === false;
|
|
5130
|
+
}
|
|
5131
|
+
function assertIsNonDivisibleSequentialTransactionPlan(plan) {
|
|
5132
|
+
if (!isNonDivisibleSequentialTransactionPlan(plan)) {
|
|
5133
|
+
throw new SolanaError(SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN, {
|
|
5134
|
+
actualKind: plan.kind === "sequential" ? "divisible sequential" : plan.kind,
|
|
5135
|
+
expectedKind: "non-divisible sequential",
|
|
5136
|
+
transactionPlan: plan
|
|
5137
|
+
});
|
|
5138
|
+
}
|
|
5139
|
+
}
|
|
5140
|
+
function isParallelTransactionPlan(plan) {
|
|
5141
|
+
return plan.kind === "parallel";
|
|
5142
|
+
}
|
|
5143
|
+
function assertIsParallelTransactionPlan(plan) {
|
|
5144
|
+
if (!isParallelTransactionPlan(plan)) {
|
|
5145
|
+
throw new SolanaError(SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN, {
|
|
5146
|
+
actualKind: plan.kind,
|
|
5147
|
+
expectedKind: "parallel",
|
|
5148
|
+
transactionPlan: plan
|
|
5149
|
+
});
|
|
5150
|
+
}
|
|
5151
|
+
}
|
|
5152
|
+
var getAllSingleTransactionPlans = flattenTransactionPlan;
|
|
5153
|
+
function flattenTransactionPlan(transactionPlan) {
|
|
5154
|
+
if (transactionPlan.kind === "single") {
|
|
5155
|
+
return [transactionPlan];
|
|
5156
|
+
}
|
|
5157
|
+
return transactionPlan.plans.flatMap(flattenTransactionPlan);
|
|
5158
|
+
}
|
|
5159
|
+
function findTransactionPlan(transactionPlan, predicate) {
|
|
5160
|
+
if (predicate(transactionPlan)) {
|
|
5161
|
+
return transactionPlan;
|
|
5162
|
+
}
|
|
5163
|
+
if (transactionPlan.kind === "single") {
|
|
5164
|
+
return void 0;
|
|
5165
|
+
}
|
|
5166
|
+
for (const subPlan of transactionPlan.plans) {
|
|
5167
|
+
const foundPlan = findTransactionPlan(subPlan, predicate);
|
|
5168
|
+
if (foundPlan) {
|
|
5169
|
+
return foundPlan;
|
|
5170
|
+
}
|
|
5171
|
+
}
|
|
5172
|
+
return void 0;
|
|
5173
|
+
}
|
|
5174
|
+
function everyTransactionPlan(transactionPlan, predicate) {
|
|
5175
|
+
if (!predicate(transactionPlan)) {
|
|
5176
|
+
return false;
|
|
5177
|
+
}
|
|
5178
|
+
if (transactionPlan.kind === "single") {
|
|
5179
|
+
return true;
|
|
5180
|
+
}
|
|
5181
|
+
return transactionPlan.plans.every((p) => everyTransactionPlan(p, predicate));
|
|
5182
|
+
}
|
|
5183
|
+
function transformTransactionPlan(transactionPlan, fn) {
|
|
5184
|
+
if (transactionPlan.kind === "single") {
|
|
5185
|
+
return Object.freeze(fn(transactionPlan));
|
|
5186
|
+
}
|
|
5187
|
+
return Object.freeze(
|
|
5188
|
+
fn(
|
|
5189
|
+
Object.freeze({
|
|
5190
|
+
...transactionPlan,
|
|
5191
|
+
plans: transactionPlan.plans.map((p) => transformTransactionPlan(p, fn))
|
|
5192
|
+
})
|
|
5193
|
+
)
|
|
5194
|
+
);
|
|
5195
|
+
}
|
|
5056
5196
|
function sequentialTransactionPlanResult(plans) {
|
|
5057
5197
|
return Object.freeze({ divisible: true, kind: "sequential", plans });
|
|
5058
5198
|
}
|
|
@@ -5405,113 +5545,6 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5405
5545
|
throw error;
|
|
5406
5546
|
}
|
|
5407
5547
|
}
|
|
5408
|
-
function parallelTransactionPlan(plans) {
|
|
5409
|
-
return Object.freeze({ kind: "parallel", plans: parseSingleTransactionPlans(plans) });
|
|
5410
|
-
}
|
|
5411
|
-
function sequentialTransactionPlan(plans) {
|
|
5412
|
-
return Object.freeze({ divisible: true, kind: "sequential", plans: parseSingleTransactionPlans(plans) });
|
|
5413
|
-
}
|
|
5414
|
-
function nonDivisibleSequentialTransactionPlan(plans) {
|
|
5415
|
-
return Object.freeze({ divisible: false, kind: "sequential", plans: parseSingleTransactionPlans(plans) });
|
|
5416
|
-
}
|
|
5417
|
-
function singleTransactionPlan(transactionMessage) {
|
|
5418
|
-
return Object.freeze({ kind: "single", message: transactionMessage });
|
|
5419
|
-
}
|
|
5420
|
-
function parseSingleTransactionPlans(plans) {
|
|
5421
|
-
return plans.map((plan) => "kind" in plan ? plan : singleTransactionPlan(plan));
|
|
5422
|
-
}
|
|
5423
|
-
function isSingleTransactionPlan(plan) {
|
|
5424
|
-
return plan.kind === "single";
|
|
5425
|
-
}
|
|
5426
|
-
function assertIsSingleTransactionPlan(plan) {
|
|
5427
|
-
if (!isSingleTransactionPlan(plan)) {
|
|
5428
|
-
throw new SolanaError(SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN, {
|
|
5429
|
-
actualKind: plan.kind,
|
|
5430
|
-
expectedKind: "single",
|
|
5431
|
-
transactionPlan: plan
|
|
5432
|
-
});
|
|
5433
|
-
}
|
|
5434
|
-
}
|
|
5435
|
-
function isSequentialTransactionPlan(plan) {
|
|
5436
|
-
return plan.kind === "sequential";
|
|
5437
|
-
}
|
|
5438
|
-
function assertIsSequentialTransactionPlan(plan) {
|
|
5439
|
-
if (!isSequentialTransactionPlan(plan)) {
|
|
5440
|
-
throw new SolanaError(SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN, {
|
|
5441
|
-
actualKind: plan.kind,
|
|
5442
|
-
expectedKind: "sequential",
|
|
5443
|
-
transactionPlan: plan
|
|
5444
|
-
});
|
|
5445
|
-
}
|
|
5446
|
-
}
|
|
5447
|
-
function isNonDivisibleSequentialTransactionPlan(plan) {
|
|
5448
|
-
return plan.kind === "sequential" && plan.divisible === false;
|
|
5449
|
-
}
|
|
5450
|
-
function assertIsNonDivisibleSequentialTransactionPlan(plan) {
|
|
5451
|
-
if (!isNonDivisibleSequentialTransactionPlan(plan)) {
|
|
5452
|
-
throw new SolanaError(SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN, {
|
|
5453
|
-
actualKind: plan.kind === "sequential" ? "divisible sequential" : plan.kind,
|
|
5454
|
-
expectedKind: "non-divisible sequential",
|
|
5455
|
-
transactionPlan: plan
|
|
5456
|
-
});
|
|
5457
|
-
}
|
|
5458
|
-
}
|
|
5459
|
-
function isParallelTransactionPlan(plan) {
|
|
5460
|
-
return plan.kind === "parallel";
|
|
5461
|
-
}
|
|
5462
|
-
function assertIsParallelTransactionPlan(plan) {
|
|
5463
|
-
if (!isParallelTransactionPlan(plan)) {
|
|
5464
|
-
throw new SolanaError(SOLANA_ERROR__INSTRUCTION_PLANS__UNEXPECTED_TRANSACTION_PLAN, {
|
|
5465
|
-
actualKind: plan.kind,
|
|
5466
|
-
expectedKind: "parallel",
|
|
5467
|
-
transactionPlan: plan
|
|
5468
|
-
});
|
|
5469
|
-
}
|
|
5470
|
-
}
|
|
5471
|
-
var getAllSingleTransactionPlans = flattenTransactionPlan;
|
|
5472
|
-
function flattenTransactionPlan(transactionPlan) {
|
|
5473
|
-
if (transactionPlan.kind === "single") {
|
|
5474
|
-
return [transactionPlan];
|
|
5475
|
-
}
|
|
5476
|
-
return transactionPlan.plans.flatMap(flattenTransactionPlan);
|
|
5477
|
-
}
|
|
5478
|
-
function findTransactionPlan(transactionPlan, predicate) {
|
|
5479
|
-
if (predicate(transactionPlan)) {
|
|
5480
|
-
return transactionPlan;
|
|
5481
|
-
}
|
|
5482
|
-
if (transactionPlan.kind === "single") {
|
|
5483
|
-
return void 0;
|
|
5484
|
-
}
|
|
5485
|
-
for (const subPlan of transactionPlan.plans) {
|
|
5486
|
-
const foundPlan = findTransactionPlan(subPlan, predicate);
|
|
5487
|
-
if (foundPlan) {
|
|
5488
|
-
return foundPlan;
|
|
5489
|
-
}
|
|
5490
|
-
}
|
|
5491
|
-
return void 0;
|
|
5492
|
-
}
|
|
5493
|
-
function everyTransactionPlan(transactionPlan, predicate) {
|
|
5494
|
-
if (!predicate(transactionPlan)) {
|
|
5495
|
-
return false;
|
|
5496
|
-
}
|
|
5497
|
-
if (transactionPlan.kind === "single") {
|
|
5498
|
-
return true;
|
|
5499
|
-
}
|
|
5500
|
-
return transactionPlan.plans.every((p) => everyTransactionPlan(p, predicate));
|
|
5501
|
-
}
|
|
5502
|
-
function transformTransactionPlan(transactionPlan, fn) {
|
|
5503
|
-
if (transactionPlan.kind === "single") {
|
|
5504
|
-
return Object.freeze(fn(transactionPlan));
|
|
5505
|
-
}
|
|
5506
|
-
return Object.freeze(
|
|
5507
|
-
fn(
|
|
5508
|
-
Object.freeze({
|
|
5509
|
-
...transactionPlan,
|
|
5510
|
-
plans: transactionPlan.plans.map((p) => transformTransactionPlan(p, fn))
|
|
5511
|
-
})
|
|
5512
|
-
)
|
|
5513
|
-
);
|
|
5514
|
-
}
|
|
5515
5548
|
function createTransactionPlanner(config) {
|
|
5516
5549
|
return async (instructionPlan, { abortSignal } = {}) => {
|
|
5517
5550
|
var _a;
|
|
@@ -7510,7 +7543,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
7510
7543
|
...config.headers ? normalizeHeaders2(config.headers) : void 0,
|
|
7511
7544
|
...{
|
|
7512
7545
|
// Keep these headers lowercase so they will override any user-supplied headers above.
|
|
7513
|
-
"solana-client": `js/${"5.5.
|
|
7546
|
+
"solana-client": `js/${"5.5.1-canary-20260128113732"}`
|
|
7514
7547
|
}
|
|
7515
7548
|
}
|
|
7516
7549
|
}),
|
|
@@ -9799,6 +9832,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
9799
9832
|
exports.address = address;
|
|
9800
9833
|
exports.airdropFactory = airdropFactory;
|
|
9801
9834
|
exports.appendTransactionMessageInstruction = appendTransactionMessageInstruction;
|
|
9835
|
+
exports.appendTransactionMessageInstructionPlan = appendTransactionMessageInstructionPlan;
|
|
9802
9836
|
exports.appendTransactionMessageInstructions = appendTransactionMessageInstructions;
|
|
9803
9837
|
exports.assertAccountDecoded = assertAccountDecoded;
|
|
9804
9838
|
exports.assertAccountExists = assertAccountExists;
|
|
@@ -10269,6 +10303,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
10269
10303
|
exports.unixTimestamp = unixTimestamp;
|
|
10270
10304
|
exports.unwrapOption = unwrapOption;
|
|
10271
10305
|
exports.unwrapOptionRecursively = unwrapOptionRecursively;
|
|
10306
|
+
exports.unwrapSimulationError = unwrapSimulationError;
|
|
10272
10307
|
exports.upgradeRoleToSigner = upgradeRoleToSigner;
|
|
10273
10308
|
exports.upgradeRoleToWritable = upgradeRoleToWritable;
|
|
10274
10309
|
exports.verifyOffchainMessageEnvelope = verifyOffchainMessageEnvelope;
|