@solana/kit 6.2.0 → 6.3.0-canary-20260310152357
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 +65 -23
- package/dist/index.development.js.map +1 -1
- package/dist/index.production.min.js +611 -610
- package/package.json +25 -25
|
@@ -191,6 +191,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
191
191
|
var SOLANA_ERROR__TRANSACTION__VERSION_ZERO_MUST_BE_ENCODED_WITH_SIGNATURES_FIRST = 5663026;
|
|
192
192
|
var SOLANA_ERROR__TRANSACTION__SIGNATURE_COUNT_TOO_HIGH_FOR_TRANSACTION_BYTES = 5663027;
|
|
193
193
|
var SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_MASK_PRIORITY_FEE_BITS = 5663028;
|
|
194
|
+
var SOLANA_ERROR__TRANSACTION__INVALID_NONCE_ACCOUNT_INDEX = 5663029;
|
|
194
195
|
var SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN = 705e4;
|
|
195
196
|
var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE = 7050001;
|
|
196
197
|
var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE = 7050002;
|
|
@@ -567,7 +568,8 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
567
568
|
[SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_MESSAGE_BYTES]: "Transaction message bytes are empty, so the transaction cannot be encoded",
|
|
568
569
|
[SOLANA_ERROR__TRANSACTION__CANNOT_DECODE_EMPTY_TRANSACTION_BYTES]: "Transaction bytes are empty, so no transaction can be decoded",
|
|
569
570
|
[SOLANA_ERROR__TRANSACTION__VERSION_ZERO_MUST_BE_ENCODED_WITH_SIGNATURES_FIRST]: "Transaction version 0 must be encoded with signatures first. This transaction was encoded with first byte $firstByte, which is expected to be a signature count for v0 transactions.",
|
|
570
|
-
[SOLANA_ERROR__TRANSACTION__SIGNATURE_COUNT_TOO_HIGH_FOR_TRANSACTION_BYTES]: "The provided transaction bytes expect that there should be $numExpectedSignatures signatures, but the bytes are not long enough to contain a transaction message with this many signatures. The provided bytes are $transactionBytesLength bytes long."
|
|
571
|
+
[SOLANA_ERROR__TRANSACTION__SIGNATURE_COUNT_TOO_HIGH_FOR_TRANSACTION_BYTES]: "The provided transaction bytes expect that there should be $numExpectedSignatures signatures, but the bytes are not long enough to contain a transaction message with this many signatures. The provided bytes are $transactionBytesLength bytes long.",
|
|
572
|
+
[SOLANA_ERROR__TRANSACTION__INVALID_NONCE_ACCOUNT_INDEX]: "The transaction has a durable nonce lifetime, but the nonce account index is invalid. Expected a nonce account index less than $numberOfStaticAccounts, got $nonceAccountIndex."
|
|
571
573
|
};
|
|
572
574
|
var INSTRUCTION_ERROR_RANGE_SIZE = 1e3;
|
|
573
575
|
var START_INDEX = "i";
|
|
@@ -5015,7 +5017,12 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5015
5017
|
return Object.freeze(signaturesMap);
|
|
5016
5018
|
}
|
|
5017
5019
|
var SYSTEM_PROGRAM_ADDRESS2 = "11111111111111111111111111111111";
|
|
5018
|
-
function
|
|
5020
|
+
function compiledV1InstructionIsAdvanceNonceInstruction(instructionHeader, instructionPayload, staticAddresses) {
|
|
5021
|
+
return staticAddresses[instructionHeader.programAccountIndex] === SYSTEM_PROGRAM_ADDRESS2 && // Test for `AdvanceNonceAccount` instruction data
|
|
5022
|
+
isAdvanceNonceAccountInstructionData2(instructionPayload.instructionData) && // Test for exactly 3 accounts
|
|
5023
|
+
instructionHeader.numInstructionAccounts === 3;
|
|
5024
|
+
}
|
|
5025
|
+
function compiledLegacyInstructionIsAdvanceNonceInstruction(instruction, staticAddresses) {
|
|
5019
5026
|
var _a;
|
|
5020
5027
|
return staticAddresses[instruction.programAddressIndex] === SYSTEM_PROGRAM_ADDRESS2 && // Test for `AdvanceNonceAccount` instruction data
|
|
5021
5028
|
instruction.data != null && isAdvanceNonceAccountInstructionData2(instruction.data) && // Test for exactly 3 accounts
|
|
@@ -5025,26 +5032,61 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5025
5032
|
return data.byteLength === 4 && data[0] === 4 && data[1] === 0 && data[2] === 0 && data[3] === 0;
|
|
5026
5033
|
}
|
|
5027
5034
|
async function getTransactionLifetimeConstraintFromCompiledTransactionMessage(compiledTransactionMessage) {
|
|
5028
|
-
const
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
const
|
|
5032
|
-
if (
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5035
|
+
const { version } = compiledTransactionMessage;
|
|
5036
|
+
if (version === "legacy" || version === 0) {
|
|
5037
|
+
const firstInstruction = compiledTransactionMessage.instructions[0];
|
|
5038
|
+
const { staticAccounts } = compiledTransactionMessage;
|
|
5039
|
+
if (firstInstruction && compiledLegacyInstructionIsAdvanceNonceInstruction(firstInstruction, staticAccounts)) {
|
|
5040
|
+
const nonceAccountAddress = staticAccounts[firstInstruction.accountIndices[0]];
|
|
5041
|
+
if (!nonceAccountAddress) {
|
|
5042
|
+
throw new SolanaError(SOLANA_ERROR__TRANSACTION__NONCE_ACCOUNT_CANNOT_BE_IN_LOOKUP_TABLE, {
|
|
5043
|
+
nonce: compiledTransactionMessage.lifetimeToken
|
|
5044
|
+
});
|
|
5045
|
+
}
|
|
5046
|
+
return {
|
|
5047
|
+
nonce: compiledTransactionMessage.lifetimeToken,
|
|
5048
|
+
nonceAccountAddress
|
|
5049
|
+
};
|
|
5050
|
+
} else {
|
|
5051
|
+
return {
|
|
5052
|
+
blockhash: compiledTransactionMessage.lifetimeToken,
|
|
5053
|
+
// This is not known from the compiled message, so we set it to the maximum possible value
|
|
5054
|
+
lastValidBlockHeight: 0xffffffffffffffffn
|
|
5055
|
+
};
|
|
5036
5056
|
}
|
|
5037
|
-
return {
|
|
5038
|
-
nonce: compiledTransactionMessage.lifetimeToken,
|
|
5039
|
-
nonceAccountAddress
|
|
5040
|
-
};
|
|
5041
|
-
} else {
|
|
5042
|
-
return {
|
|
5043
|
-
blockhash: compiledTransactionMessage.lifetimeToken,
|
|
5044
|
-
// This is not known from the compiled message, so we set it to the maximum possible value
|
|
5045
|
-
lastValidBlockHeight: 0xffffffffffffffffn
|
|
5046
|
-
};
|
|
5047
5057
|
}
|
|
5058
|
+
if (version === 1) {
|
|
5059
|
+
const firstInstructionHeader = compiledTransactionMessage.instructionHeaders[0];
|
|
5060
|
+
const firstInstructionPayload = compiledTransactionMessage.instructionPayloads[0];
|
|
5061
|
+
const { staticAccounts } = compiledTransactionMessage;
|
|
5062
|
+
if (firstInstructionHeader && firstInstructionPayload && compiledV1InstructionIsAdvanceNonceInstruction(
|
|
5063
|
+
firstInstructionHeader,
|
|
5064
|
+
firstInstructionPayload,
|
|
5065
|
+
staticAccounts
|
|
5066
|
+
)) {
|
|
5067
|
+
const nonceAccountAddress = staticAccounts[firstInstructionPayload.instructionAccountIndices[0]];
|
|
5068
|
+
if (!nonceAccountAddress) {
|
|
5069
|
+
throw new SolanaError(SOLANA_ERROR__TRANSACTION__INVALID_NONCE_ACCOUNT_INDEX, {
|
|
5070
|
+
nonce: compiledTransactionMessage.lifetimeToken,
|
|
5071
|
+
nonceAccountIndex: firstInstructionPayload.instructionAccountIndices[0],
|
|
5072
|
+
numberOfStaticAccounts: staticAccounts.length
|
|
5073
|
+
});
|
|
5074
|
+
}
|
|
5075
|
+
return {
|
|
5076
|
+
nonce: compiledTransactionMessage.lifetimeToken,
|
|
5077
|
+
nonceAccountAddress
|
|
5078
|
+
};
|
|
5079
|
+
} else {
|
|
5080
|
+
return {
|
|
5081
|
+
blockhash: compiledTransactionMessage.lifetimeToken,
|
|
5082
|
+
// This is not known from the compiled message, so we set it to the maximum possible value
|
|
5083
|
+
lastValidBlockHeight: 0xffffffffffffffffn
|
|
5084
|
+
};
|
|
5085
|
+
}
|
|
5086
|
+
}
|
|
5087
|
+
throw new SolanaError(SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_NOT_SUPPORTED, {
|
|
5088
|
+
unsupportedVersion: version
|
|
5089
|
+
});
|
|
5048
5090
|
}
|
|
5049
5091
|
function isTransactionWithBlockhashLifetime(transaction) {
|
|
5050
5092
|
return "lifetimeConstraint" in transaction && "blockhash" in transaction.lifetimeConstraint && typeof transaction.lifetimeConstraint.blockhash === "string" && typeof transaction.lifetimeConstraint.lastValidBlockHeight === "bigint" && isBlockhash(transaction.lifetimeConstraint.blockhash);
|
|
@@ -6011,8 +6053,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6011
6053
|
SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT
|
|
6012
6054
|
];
|
|
6013
6055
|
if (isSolanaError(error) && simulationCodes.includes(error.context.__code)) {
|
|
6014
|
-
const { __code, ...
|
|
6015
|
-
const preflightData = rest;
|
|
6056
|
+
const { __code, ...preflightData } = error.context;
|
|
6016
6057
|
return {
|
|
6017
6058
|
logs: (_a = preflightData.logs) != null ? _a : void 0,
|
|
6018
6059
|
preflightData,
|
|
@@ -8137,7 +8178,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
8137
8178
|
...config.headers ? normalizeHeaders2(config.headers) : void 0,
|
|
8138
8179
|
...{
|
|
8139
8180
|
// Keep these headers lowercase so they will override any user-supplied headers above.
|
|
8140
|
-
"solana-client": `js/${"6.
|
|
8181
|
+
"solana-client": `js/${"6.3.0-canary-20260310152357"}`
|
|
8141
8182
|
}
|
|
8142
8183
|
}
|
|
8143
8184
|
}),
|
|
@@ -10416,6 +10457,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
10416
10457
|
exports.SOLANA_ERROR__TRANSACTION__FEE_PAYER_MISSING = SOLANA_ERROR__TRANSACTION__FEE_PAYER_MISSING;
|
|
10417
10458
|
exports.SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING = SOLANA_ERROR__TRANSACTION__FEE_PAYER_SIGNATURE_MISSING;
|
|
10418
10459
|
exports.SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_MASK_PRIORITY_FEE_BITS = SOLANA_ERROR__TRANSACTION__INVALID_CONFIG_MASK_PRIORITY_FEE_BITS;
|
|
10460
|
+
exports.SOLANA_ERROR__TRANSACTION__INVALID_NONCE_ACCOUNT_INDEX = SOLANA_ERROR__TRANSACTION__INVALID_NONCE_ACCOUNT_INDEX;
|
|
10419
10461
|
exports.SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_FIRST_INSTRUCTION_MUST_BE_ADVANCE_NONCE = SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_FIRST_INSTRUCTION_MUST_BE_ADVANCE_NONCE;
|
|
10420
10462
|
exports.SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_INSTRUCTIONS_MISSING = SOLANA_ERROR__TRANSACTION__INVALID_NONCE_TRANSACTION_INSTRUCTIONS_MISSING;
|
|
10421
10463
|
exports.SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES = SOLANA_ERROR__TRANSACTION__INVOKED_PROGRAMS_CANNOT_PAY_FEES;
|