@solana/kit 2.2.0 → 2.3.0-canary-20250708185953
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.browser.cjs +1 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.mjs +2 -2
- package/dist/index.browser.mjs.map +1 -1
- package/dist/index.development.js +133 -97
- package/dist/index.development.js.map +1 -1
- package/dist/index.native.mjs +2 -2
- package/dist/index.native.mjs.map +1 -1
- package/dist/index.node.cjs +1 -1
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +2 -2
- package/dist/index.node.mjs.map +1 -1
- package/dist/index.production.min.js +541 -527
- package/dist/types/compute-limit-internal.d.ts +2 -2
- package/dist/types/compute-limit-internal.d.ts.map +1 -1
- package/dist/types/compute-limit.d.ts +4 -2
- package/dist/types/compute-limit.d.ts.map +1 -1
- package/package.json +19 -19
|
@@ -159,6 +159,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
159
159
|
var SOLANA_ERROR__TRANSACTION__MESSAGE_SIGNATURES_MISMATCH = 5663017;
|
|
160
160
|
var SOLANA_ERROR__TRANSACTION__FAILED_TO_ESTIMATE_COMPUTE_LIMIT = 5663018;
|
|
161
161
|
var SOLANA_ERROR__TRANSACTION__FAILED_WHEN_SIMULATING_TO_ESTIMATE_COMPUTE_LIMIT = 5663019;
|
|
162
|
+
var SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT = 5663020;
|
|
162
163
|
var SOLANA_ERROR__TRANSACTION_ERROR__UNKNOWN = 705e4;
|
|
163
164
|
var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_IN_USE = 7050001;
|
|
164
165
|
var SOLANA_ERROR__TRANSACTION_ERROR__ACCOUNT_LOADED_TWICE = 7050002;
|
|
@@ -392,7 +393,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
392
393
|
[SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SENDING_SIGNER]: "The provided value does not implement the `TransactionSendingSigner` interface",
|
|
393
394
|
[SOLANA_ERROR__SIGNER__EXPECTED_TRANSACTION_SIGNER]: "The provided value does not implement any of the `TransactionSigner` interfaces",
|
|
394
395
|
[SOLANA_ERROR__SIGNER__TRANSACTION_CANNOT_HAVE_MULTIPLE_SENDING_SIGNERS]: "More than one `TransactionSendingSigner` was identified.",
|
|
395
|
-
[SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING]: "No `TransactionSendingSigner` was identified. Please provide a valid `
|
|
396
|
+
[SOLANA_ERROR__SIGNER__TRANSACTION_SENDING_SIGNER_MISSING]: "No `TransactionSendingSigner` was identified. Please provide a valid `TransactionWithSingleSendingSigner` transaction.",
|
|
396
397
|
[SOLANA_ERROR__SIGNER__WALLET_MULTISIGN_UNIMPLEMENTED]: "Wallet account signers do not support signing multiple messages/transactions in a single operation",
|
|
397
398
|
[SOLANA_ERROR__SUBTLE_CRYPTO__CANNOT_EXPORT_NON_EXTRACTABLE_KEY]: "Cannot export a non-extractable key.",
|
|
398
399
|
[SOLANA_ERROR__SUBTLE_CRYPTO__DIGEST_UNIMPLEMENTED]: "No digest implementation could be found.",
|
|
@@ -443,6 +444,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
443
444
|
[SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION]: "Attempted to sign a transaction with an address that is not a signer for it",
|
|
444
445
|
[SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING]: "Transaction is missing an address at index: $index.",
|
|
445
446
|
[SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES]: "Transaction has no expected signers therefore it cannot be encoded",
|
|
447
|
+
[SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT]: "Transaction size $transactionSize exceeds limit of $transactionSizeLimit bytes",
|
|
446
448
|
[SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME]: "Transaction does not have a blockhash lifetime",
|
|
447
449
|
[SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME]: "Transaction is not a durable nonce transaction",
|
|
448
450
|
[SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING]: "Contents of these address lookup tables unknown: $lookupTableAddresses",
|
|
@@ -3425,6 +3427,9 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
3425
3427
|
return false;
|
|
3426
3428
|
},
|
|
3427
3429
|
get(target, p, receiver) {
|
|
3430
|
+
if (p === "then") {
|
|
3431
|
+
return void 0;
|
|
3432
|
+
}
|
|
3428
3433
|
return function(...rawParams) {
|
|
3429
3434
|
const methodName = p.toString();
|
|
3430
3435
|
const getApiPlan = Reflect.get(target, methodName, receiver);
|
|
@@ -4263,7 +4268,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4263
4268
|
...config.headers ? normalizeHeaders2(config.headers) : void 0,
|
|
4264
4269
|
...{
|
|
4265
4270
|
// Keep these headers lowercase so they will override any user-supplied headers above.
|
|
4266
|
-
"solana-client": `js/${"2.
|
|
4271
|
+
"solana-client": `js/${"2.3.0-canary-20250708185953"}`
|
|
4267
4272
|
}
|
|
4268
4273
|
}
|
|
4269
4274
|
}),
|
|
@@ -4533,6 +4538,9 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4533
4538
|
return false;
|
|
4534
4539
|
},
|
|
4535
4540
|
get(target, p, receiver) {
|
|
4541
|
+
if (p === "then") {
|
|
4542
|
+
return void 0;
|
|
4543
|
+
}
|
|
4536
4544
|
return function(...rawParams) {
|
|
4537
4545
|
const notificationName = p.toString();
|
|
4538
4546
|
const createRpcSubscriptionPlan = Reflect.get(target, notificationName, receiver);
|
|
@@ -4620,20 +4628,28 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
4620
4628
|
function incrementSubscriberCount(channel, subscriptionId) {
|
|
4621
4629
|
augmentSubscriberCountAndReturnNewCount(1, channel, subscriptionId);
|
|
4622
4630
|
}
|
|
4631
|
+
function getSubscriberCountBySubscriptionIdForChannel(channel) {
|
|
4632
|
+
let subscriberCountBySubscriptionId = subscriberCountBySubscriptionIdByChannel.get(channel);
|
|
4633
|
+
if (!subscriberCountBySubscriptionId) {
|
|
4634
|
+
subscriberCountBySubscriptionIdByChannel.set(channel, subscriberCountBySubscriptionId = {});
|
|
4635
|
+
}
|
|
4636
|
+
return subscriberCountBySubscriptionId;
|
|
4637
|
+
}
|
|
4623
4638
|
function augmentSubscriberCountAndReturnNewCount(amount, channel, subscriptionId) {
|
|
4624
4639
|
if (subscriptionId === void 0) {
|
|
4625
4640
|
return;
|
|
4626
4641
|
}
|
|
4627
|
-
|
|
4628
|
-
if (!subscriberCountBySubscriptionId && amount > 0) {
|
|
4629
|
-
|
|
4630
|
-
channel,
|
|
4631
|
-
subscriberCountBySubscriptionId = { [subscriptionId]: 0 }
|
|
4632
|
-
);
|
|
4642
|
+
const subscriberCountBySubscriptionId = getSubscriberCountBySubscriptionIdForChannel(channel);
|
|
4643
|
+
if (!subscriberCountBySubscriptionId[subscriptionId] && amount > 0) {
|
|
4644
|
+
subscriberCountBySubscriptionId[subscriptionId] = 0;
|
|
4633
4645
|
}
|
|
4634
|
-
|
|
4635
|
-
|
|
4646
|
+
const newCount = amount + subscriberCountBySubscriptionId[subscriptionId];
|
|
4647
|
+
if (newCount <= 0) {
|
|
4648
|
+
delete subscriberCountBySubscriptionId[subscriptionId];
|
|
4649
|
+
} else {
|
|
4650
|
+
subscriberCountBySubscriptionId[subscriptionId] = newCount;
|
|
4636
4651
|
}
|
|
4652
|
+
return newCount;
|
|
4637
4653
|
}
|
|
4638
4654
|
var cache = /* @__PURE__ */ new WeakMap();
|
|
4639
4655
|
function getMemoizedDemultiplexedNotificationPublisherFromChannelAndResponseTransformer(channel, subscribeRequest, responseTransformer) {
|
|
@@ -5419,49 +5435,20 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5419
5435
|
}
|
|
5420
5436
|
|
|
5421
5437
|
// ../rpc-types/dist/index.browser.mjs
|
|
5422
|
-
var memoizedBase58Encoder2;
|
|
5423
|
-
var memoizedBase58Decoder2;
|
|
5424
|
-
function getMemoizedBase58Encoder2() {
|
|
5425
|
-
if (!memoizedBase58Encoder2) memoizedBase58Encoder2 = getBase58Encoder();
|
|
5426
|
-
return memoizedBase58Encoder2;
|
|
5427
|
-
}
|
|
5428
|
-
function getMemoizedBase58Decoder2() {
|
|
5429
|
-
if (!memoizedBase58Decoder2) memoizedBase58Decoder2 = getBase58Decoder();
|
|
5430
|
-
return memoizedBase58Decoder2;
|
|
5431
|
-
}
|
|
5432
5438
|
function isBlockhash(putativeBlockhash) {
|
|
5433
|
-
|
|
5434
|
-
// Lowest value (32 bytes of zeroes)
|
|
5435
|
-
putativeBlockhash.length < 32 || // Highest value (32 bytes of 255)
|
|
5436
|
-
putativeBlockhash.length > 44
|
|
5437
|
-
) {
|
|
5438
|
-
return false;
|
|
5439
|
-
}
|
|
5440
|
-
const base58Encoder2 = getMemoizedBase58Encoder2();
|
|
5441
|
-
const bytes = base58Encoder2.encode(putativeBlockhash);
|
|
5442
|
-
const numBytes = bytes.byteLength;
|
|
5443
|
-
if (numBytes !== 32) {
|
|
5444
|
-
return false;
|
|
5445
|
-
}
|
|
5446
|
-
return true;
|
|
5439
|
+
return isAddress(putativeBlockhash);
|
|
5447
5440
|
}
|
|
5448
5441
|
function assertIsBlockhash(putativeBlockhash) {
|
|
5449
|
-
|
|
5450
|
-
|
|
5451
|
-
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
const bytes = base58Encoder2.encode(putativeBlockhash);
|
|
5460
|
-
const numBytes = bytes.byteLength;
|
|
5461
|
-
if (numBytes !== 32) {
|
|
5462
|
-
throw new SolanaError(SOLANA_ERROR__INVALID_BLOCKHASH_BYTE_LENGTH, {
|
|
5463
|
-
actualLength: numBytes
|
|
5464
|
-
});
|
|
5442
|
+
try {
|
|
5443
|
+
assertIsAddress(putativeBlockhash);
|
|
5444
|
+
} catch (error) {
|
|
5445
|
+
if (isSolanaError(error, SOLANA_ERROR__ADDRESSES__STRING_LENGTH_OUT_OF_RANGE)) {
|
|
5446
|
+
throw new SolanaError(SOLANA_ERROR__BLOCKHASH_STRING_LENGTH_OUT_OF_RANGE, error.context);
|
|
5447
|
+
}
|
|
5448
|
+
if (isSolanaError(error, SOLANA_ERROR__ADDRESSES__INVALID_BYTE_LENGTH)) {
|
|
5449
|
+
throw new SolanaError(SOLANA_ERROR__INVALID_BLOCKHASH_BYTE_LENGTH, error.context);
|
|
5450
|
+
}
|
|
5451
|
+
throw error;
|
|
5465
5452
|
}
|
|
5466
5453
|
}
|
|
5467
5454
|
function blockhash(putativeBlockhash) {
|
|
@@ -5469,13 +5456,17 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5469
5456
|
return putativeBlockhash;
|
|
5470
5457
|
}
|
|
5471
5458
|
function getBlockhashEncoder() {
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5459
|
+
const addressEncoder = getAddressEncoder();
|
|
5460
|
+
return createEncoder({
|
|
5461
|
+
fixedSize: 32,
|
|
5462
|
+
write: (value, bytes, offset) => {
|
|
5463
|
+
assertIsBlockhash(value);
|
|
5464
|
+
return addressEncoder.write(value, bytes, offset);
|
|
5465
|
+
}
|
|
5466
|
+
});
|
|
5476
5467
|
}
|
|
5477
5468
|
function getBlockhashDecoder() {
|
|
5478
|
-
return
|
|
5469
|
+
return getAddressDecoder();
|
|
5479
5470
|
}
|
|
5480
5471
|
function getBlockhashCodec() {
|
|
5481
5472
|
return combineCodec(getBlockhashEncoder(), getBlockhashDecoder());
|
|
@@ -5617,14 +5608,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5617
5608
|
|
|
5618
5609
|
// ../transaction-messages/dist/index.browser.mjs
|
|
5619
5610
|
function isTransactionMessageWithBlockhashLifetime(transactionMessage) {
|
|
5620
|
-
|
|
5621
|
-
if (!lifetimeConstraintShapeMatches) return false;
|
|
5622
|
-
try {
|
|
5623
|
-
assertIsBlockhash(transactionMessage.lifetimeConstraint.blockhash);
|
|
5624
|
-
return true;
|
|
5625
|
-
} catch {
|
|
5626
|
-
return false;
|
|
5627
|
-
}
|
|
5611
|
+
return "lifetimeConstraint" in transactionMessage && typeof transactionMessage.lifetimeConstraint.blockhash === "string" && typeof transactionMessage.lifetimeConstraint.lastValidBlockHeight === "bigint" && isBlockhash(transactionMessage.lifetimeConstraint.blockhash);
|
|
5628
5612
|
}
|
|
5629
5613
|
function assertIsTransactionMessageWithBlockhashLifetime(transactionMessage) {
|
|
5630
5614
|
if (!isTransactionMessageWithBlockhashLifetime(transactionMessage)) {
|
|
@@ -5632,15 +5616,13 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
5632
5616
|
}
|
|
5633
5617
|
}
|
|
5634
5618
|
function setTransactionMessageLifetimeUsingBlockhash(blockhashLifetimeConstraint, transactionMessage) {
|
|
5635
|
-
if ("lifetimeConstraint" in transactionMessage && transactionMessage.lifetimeConstraint.blockhash === blockhashLifetimeConstraint.blockhash && transactionMessage.lifetimeConstraint.lastValidBlockHeight === blockhashLifetimeConstraint.lastValidBlockHeight) {
|
|
5619
|
+
if ("lifetimeConstraint" in transactionMessage && transactionMessage.lifetimeConstraint && "blockhash" in transactionMessage.lifetimeConstraint && transactionMessage.lifetimeConstraint.blockhash === blockhashLifetimeConstraint.blockhash && transactionMessage.lifetimeConstraint.lastValidBlockHeight === blockhashLifetimeConstraint.lastValidBlockHeight) {
|
|
5636
5620
|
return transactionMessage;
|
|
5637
5621
|
}
|
|
5638
|
-
|
|
5622
|
+
return Object.freeze({
|
|
5639
5623
|
...transactionMessage,
|
|
5640
5624
|
lifetimeConstraint: Object.freeze(blockhashLifetimeConstraint)
|
|
5641
|
-
};
|
|
5642
|
-
Object.freeze(out);
|
|
5643
|
-
return out;
|
|
5625
|
+
});
|
|
5644
5626
|
}
|
|
5645
5627
|
function assertValidBaseString2(alphabet4, testValue, givenValue = testValue) {
|
|
5646
5628
|
if (!testValue.match(new RegExp(`^[${alphabet4}]*$`))) {
|
|
@@ -6260,21 +6242,14 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6260
6242
|
updatedAnyInstructions ? { ...transactionMessage, instructions: newInstructions } : transactionMessage
|
|
6261
6243
|
);
|
|
6262
6244
|
}
|
|
6263
|
-
function createTransactionMessage({
|
|
6264
|
-
version
|
|
6265
|
-
}) {
|
|
6245
|
+
function createTransactionMessage(config) {
|
|
6266
6246
|
return Object.freeze({
|
|
6267
6247
|
instructions: Object.freeze([]),
|
|
6268
|
-
version
|
|
6248
|
+
version: config.version
|
|
6269
6249
|
});
|
|
6270
6250
|
}
|
|
6271
6251
|
var RECENT_BLOCKHASHES_SYSVAR_ADDRESS = "SysvarRecentB1ockHashes11111111111111111111";
|
|
6272
6252
|
var SYSTEM_PROGRAM_ADDRESS = "11111111111111111111111111111111";
|
|
6273
|
-
function assertIsDurableNonceTransactionMessage(transactionMessage) {
|
|
6274
|
-
if (!isDurableNonceTransaction(transactionMessage)) {
|
|
6275
|
-
throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME);
|
|
6276
|
-
}
|
|
6277
|
-
}
|
|
6278
6253
|
function createAdvanceNonceAccountInstruction(nonceAccountAddress, nonceAuthorityAddress) {
|
|
6279
6254
|
return {
|
|
6280
6255
|
accounts: [
|
|
@@ -6301,9 +6276,14 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6301
6276
|
function isAdvanceNonceAccountInstructionData(data) {
|
|
6302
6277
|
return data.byteLength === 4 && data[0] === 4 && data[1] === 0 && data[2] === 0 && data[3] === 0;
|
|
6303
6278
|
}
|
|
6304
|
-
function
|
|
6279
|
+
function isTransactionMessageWithDurableNonceLifetime(transactionMessage) {
|
|
6305
6280
|
return "lifetimeConstraint" in transactionMessage && typeof transactionMessage.lifetimeConstraint.nonce === "string" && transactionMessage.instructions[0] != null && isAdvanceNonceAccountInstruction(transactionMessage.instructions[0]);
|
|
6306
6281
|
}
|
|
6282
|
+
function assertIsTransactionMessageWithDurableNonceLifetime(transactionMessage) {
|
|
6283
|
+
if (!isTransactionMessageWithDurableNonceLifetime(transactionMessage)) {
|
|
6284
|
+
throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME);
|
|
6285
|
+
}
|
|
6286
|
+
}
|
|
6307
6287
|
function isAdvanceNonceAccountInstructionForNonce(instruction, nonceAccountAddress, nonceAuthorityAddress) {
|
|
6308
6288
|
return instruction.accounts[0].address === nonceAccountAddress && instruction.accounts[2].address === nonceAuthorityAddress;
|
|
6309
6289
|
}
|
|
@@ -6316,7 +6296,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6316
6296
|
const firstInstruction = transactionMessage.instructions[0];
|
|
6317
6297
|
if (firstInstruction && isAdvanceNonceAccountInstruction(firstInstruction)) {
|
|
6318
6298
|
if (isAdvanceNonceAccountInstructionForNonce(firstInstruction, nonceAccountAddress, nonceAuthorityAddress)) {
|
|
6319
|
-
if (
|
|
6299
|
+
if (isTransactionMessageWithDurableNonceLifetime(transactionMessage) && transactionMessage.lifetimeConstraint.nonce === nonce) {
|
|
6320
6300
|
return transactionMessage;
|
|
6321
6301
|
} else {
|
|
6322
6302
|
newInstructions = [firstInstruction, ...transactionMessage.instructions.slice(1)];
|
|
@@ -6336,9 +6316,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6336
6316
|
return Object.freeze({
|
|
6337
6317
|
...transactionMessage,
|
|
6338
6318
|
instructions: Object.freeze(newInstructions),
|
|
6339
|
-
lifetimeConstraint: Object.freeze({
|
|
6340
|
-
nonce
|
|
6341
|
-
})
|
|
6319
|
+
lifetimeConstraint: Object.freeze({ nonce })
|
|
6342
6320
|
});
|
|
6343
6321
|
}
|
|
6344
6322
|
function setTransactionMessageFeePayer(feePayer, transactionMessage) {
|
|
@@ -6362,7 +6340,10 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6362
6340
|
function appendTransactionMessageInstructions(instructions, transactionMessage) {
|
|
6363
6341
|
return Object.freeze({
|
|
6364
6342
|
...transactionMessage,
|
|
6365
|
-
instructions: Object.freeze([
|
|
6343
|
+
instructions: Object.freeze([
|
|
6344
|
+
...transactionMessage.instructions,
|
|
6345
|
+
...instructions
|
|
6346
|
+
])
|
|
6366
6347
|
});
|
|
6367
6348
|
}
|
|
6368
6349
|
function prependTransactionMessageInstruction(instruction, transactionMessage) {
|
|
@@ -6371,7 +6352,10 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6371
6352
|
function prependTransactionMessageInstructions(instructions, transactionMessage) {
|
|
6372
6353
|
return Object.freeze({
|
|
6373
6354
|
...transactionMessage,
|
|
6374
|
-
instructions: Object.freeze([
|
|
6355
|
+
instructions: Object.freeze([
|
|
6356
|
+
...instructions,
|
|
6357
|
+
...transactionMessage.instructions
|
|
6358
|
+
])
|
|
6375
6359
|
});
|
|
6376
6360
|
}
|
|
6377
6361
|
function getAccountMetas(message) {
|
|
@@ -6518,12 +6502,15 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6518
6502
|
return pipe(
|
|
6519
6503
|
createTransactionMessage({ version: compiledTransactionMessage.version }),
|
|
6520
6504
|
(m) => setTransactionMessageFeePayer(feePayer, m),
|
|
6521
|
-
(m) => instructions.reduce(
|
|
6522
|
-
|
|
6523
|
-
|
|
6505
|
+
(m) => instructions.reduce(
|
|
6506
|
+
(acc, instruction) => appendTransactionMessageInstruction(instruction, acc),
|
|
6507
|
+
m
|
|
6508
|
+
),
|
|
6524
6509
|
(m) => "blockhash" in lifetimeConstraint ? setTransactionMessageLifetimeUsingBlockhash(lifetimeConstraint, m) : setTransactionMessageLifetimeUsingDurableNonce(lifetimeConstraint, m)
|
|
6525
6510
|
);
|
|
6526
6511
|
}
|
|
6512
|
+
var assertIsDurableNonceTransactionMessage = assertIsTransactionMessageWithDurableNonceLifetime;
|
|
6513
|
+
var isDurableNonceTransaction = isTransactionMessageWithDurableNonceLifetime;
|
|
6527
6514
|
|
|
6528
6515
|
// ../transactions/dist/index.browser.mjs
|
|
6529
6516
|
function getSignaturesToEncode(signaturesMap) {
|
|
@@ -6616,12 +6603,11 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6616
6603
|
nonceAccountAddress: transactionMessage.instructions[0].accounts[0].address
|
|
6617
6604
|
};
|
|
6618
6605
|
}
|
|
6619
|
-
|
|
6606
|
+
return Object.freeze({
|
|
6620
6607
|
lifetimeConstraint,
|
|
6621
6608
|
messageBytes,
|
|
6622
6609
|
signatures: Object.freeze(signatures)
|
|
6623
|
-
};
|
|
6624
|
-
return Object.freeze(transaction);
|
|
6610
|
+
});
|
|
6625
6611
|
}
|
|
6626
6612
|
var base58Decoder;
|
|
6627
6613
|
function getSignatureFromTransaction(transaction) {
|
|
@@ -6679,11 +6665,14 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6679
6665
|
}
|
|
6680
6666
|
async function signTransaction(keyPairs, transaction) {
|
|
6681
6667
|
const out = await partiallySignTransaction(keyPairs, transaction);
|
|
6682
|
-
|
|
6668
|
+
assertIsFullySignedTransaction(out);
|
|
6683
6669
|
Object.freeze(out);
|
|
6684
6670
|
return out;
|
|
6685
6671
|
}
|
|
6686
|
-
function
|
|
6672
|
+
function isFullySignedTransaction(transaction) {
|
|
6673
|
+
return Object.entries(transaction.signatures).every(([_, signatureBytes]) => !!signatureBytes);
|
|
6674
|
+
}
|
|
6675
|
+
function assertIsFullySignedTransaction(transaction) {
|
|
6687
6676
|
const missingSigs = [];
|
|
6688
6677
|
Object.entries(transaction.signatures).forEach(([address2, signatureBytes]) => {
|
|
6689
6678
|
if (!signatureBytes) {
|
|
@@ -6700,6 +6689,40 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6700
6689
|
const wireTransactionBytes = getTransactionEncoder().encode(transaction);
|
|
6701
6690
|
return getBase64Decoder().decode(wireTransactionBytes);
|
|
6702
6691
|
}
|
|
6692
|
+
var TRANSACTION_PACKET_SIZE = 1280;
|
|
6693
|
+
var TRANSACTION_PACKET_HEADER = 40 + 8;
|
|
6694
|
+
var TRANSACTION_SIZE_LIMIT = TRANSACTION_PACKET_SIZE - TRANSACTION_PACKET_HEADER;
|
|
6695
|
+
function getTransactionSize(transaction) {
|
|
6696
|
+
return getTransactionEncoder().getSizeFromValue(transaction);
|
|
6697
|
+
}
|
|
6698
|
+
function isTransactionWithinSizeLimit(transaction) {
|
|
6699
|
+
return getTransactionSize(transaction) <= TRANSACTION_SIZE_LIMIT;
|
|
6700
|
+
}
|
|
6701
|
+
function assertIsTransactionWithinSizeLimit(transaction) {
|
|
6702
|
+
const transactionSize = getTransactionSize(transaction);
|
|
6703
|
+
if (transactionSize > TRANSACTION_SIZE_LIMIT) {
|
|
6704
|
+
throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT, {
|
|
6705
|
+
transactionSize,
|
|
6706
|
+
transactionSizeLimit: TRANSACTION_SIZE_LIMIT
|
|
6707
|
+
});
|
|
6708
|
+
}
|
|
6709
|
+
}
|
|
6710
|
+
function getTransactionMessageSize(transactionMessage) {
|
|
6711
|
+
return getTransactionSize(compileTransaction(transactionMessage));
|
|
6712
|
+
}
|
|
6713
|
+
function isTransactionMessageWithinSizeLimit(transactionMessage) {
|
|
6714
|
+
return getTransactionMessageSize(transactionMessage) <= TRANSACTION_SIZE_LIMIT;
|
|
6715
|
+
}
|
|
6716
|
+
function assertIsTransactionMessageWithinSizeLimit(transactionMessage) {
|
|
6717
|
+
const transactionSize = getTransactionMessageSize(transactionMessage);
|
|
6718
|
+
if (transactionSize > TRANSACTION_SIZE_LIMIT) {
|
|
6719
|
+
throw new SolanaError(SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT, {
|
|
6720
|
+
transactionSize,
|
|
6721
|
+
transactionSizeLimit: TRANSACTION_SIZE_LIMIT
|
|
6722
|
+
});
|
|
6723
|
+
}
|
|
6724
|
+
}
|
|
6725
|
+
var assertTransactionIsFullySigned = assertIsFullySignedTransaction;
|
|
6703
6726
|
|
|
6704
6727
|
// ../signers/dist/index.browser.mjs
|
|
6705
6728
|
function deduplicateSigners(signers) {
|
|
@@ -6914,7 +6937,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6914
6937
|
}
|
|
6915
6938
|
async function signTransactionMessageWithSigners(transactionMessage, config) {
|
|
6916
6939
|
const signedTransaction = await partiallySignTransactionMessageWithSigners(transactionMessage, config);
|
|
6917
|
-
|
|
6940
|
+
assertIsFullySignedTransaction(signedTransaction);
|
|
6918
6941
|
return signedTransaction;
|
|
6919
6942
|
}
|
|
6920
6943
|
async function signAndSendTransactionMessageWithSigners(transaction, config) {
|
|
@@ -6986,15 +7009,14 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
6986
7009
|
return signatures;
|
|
6987
7010
|
})
|
|
6988
7011
|
);
|
|
6989
|
-
|
|
7012
|
+
return Object.freeze({
|
|
6990
7013
|
...modifiedTransaction,
|
|
6991
7014
|
signatures: Object.freeze(
|
|
6992
7015
|
signatureDictionaries.reduce((signatures, signatureDictionary) => {
|
|
6993
7016
|
return { ...signatures, ...signatureDictionary };
|
|
6994
7017
|
}, (_b = modifiedTransaction.signatures) != null ? _b : {})
|
|
6995
7018
|
)
|
|
6996
|
-
};
|
|
6997
|
-
return Object.freeze(signedTransaction);
|
|
7019
|
+
});
|
|
6998
7020
|
}
|
|
6999
7021
|
var o6 = globalThis.TextEncoder;
|
|
7000
7022
|
function createSignableMessage(content, signatures = {}) {
|
|
@@ -7347,7 +7369,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
7347
7369
|
transactionMessage,
|
|
7348
7370
|
...simulateConfig
|
|
7349
7371
|
}) {
|
|
7350
|
-
const isDurableNonceTransactionMessage =
|
|
7372
|
+
const isDurableNonceTransactionMessage = isTransactionMessageWithDurableNonceLifetime(transactionMessage);
|
|
7351
7373
|
let compilableTransactionMessage;
|
|
7352
7374
|
if (isDurableNonceTransactionMessage || isTransactionMessageWithBlockhashLifetime(transactionMessage)) {
|
|
7353
7375
|
compilableTransactionMessage = transactionMessage;
|
|
@@ -7814,6 +7836,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
7814
7836
|
exports.SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION = SOLANA_ERROR__TRANSACTION__ADDRESSES_CANNOT_SIGN_TRANSACTION;
|
|
7815
7837
|
exports.SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING = SOLANA_ERROR__TRANSACTION__ADDRESS_MISSING;
|
|
7816
7838
|
exports.SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES = SOLANA_ERROR__TRANSACTION__CANNOT_ENCODE_WITH_EMPTY_SIGNATURES;
|
|
7839
|
+
exports.SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT = SOLANA_ERROR__TRANSACTION__EXCEEDS_SIZE_LIMIT;
|
|
7817
7840
|
exports.SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME = SOLANA_ERROR__TRANSACTION__EXPECTED_BLOCKHASH_LIFETIME;
|
|
7818
7841
|
exports.SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME = SOLANA_ERROR__TRANSACTION__EXPECTED_NONCE_LIFETIME;
|
|
7819
7842
|
exports.SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING = SOLANA_ERROR__TRANSACTION__FAILED_TO_DECOMPILE_ADDRESS_LOOKUP_TABLE_CONTENTS_MISSING;
|
|
@@ -7832,6 +7855,9 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
7832
7855
|
exports.SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING = SOLANA_ERROR__TRANSACTION__SIGNATURES_MISSING;
|
|
7833
7856
|
exports.SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE = SOLANA_ERROR__TRANSACTION__VERSION_NUMBER_OUT_OF_RANGE;
|
|
7834
7857
|
exports.SolanaError = SolanaError;
|
|
7858
|
+
exports.TRANSACTION_PACKET_HEADER = TRANSACTION_PACKET_HEADER;
|
|
7859
|
+
exports.TRANSACTION_PACKET_SIZE = TRANSACTION_PACKET_SIZE;
|
|
7860
|
+
exports.TRANSACTION_SIZE_LIMIT = TRANSACTION_SIZE_LIMIT;
|
|
7835
7861
|
exports.addCodecSentinel = addCodecSentinel;
|
|
7836
7862
|
exports.addCodecSizePrefix = addCodecSizePrefix;
|
|
7837
7863
|
exports.addDecoderSentinel = addDecoderSentinel;
|
|
@@ -7855,6 +7881,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
7855
7881
|
exports.assertIsBlockhash = assertIsBlockhash;
|
|
7856
7882
|
exports.assertIsDurableNonceTransactionMessage = assertIsDurableNonceTransactionMessage;
|
|
7857
7883
|
exports.assertIsFixedSize = assertIsFixedSize;
|
|
7884
|
+
exports.assertIsFullySignedTransaction = assertIsFullySignedTransaction;
|
|
7858
7885
|
exports.assertIsInstructionForProgram = assertIsInstructionForProgram;
|
|
7859
7886
|
exports.assertIsInstructionWithAccounts = assertIsInstructionWithAccounts;
|
|
7860
7887
|
exports.assertIsInstructionWithData = assertIsInstructionWithData;
|
|
@@ -7869,11 +7896,14 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
7869
7896
|
exports.assertIsStringifiedBigInt = assertIsStringifiedBigInt;
|
|
7870
7897
|
exports.assertIsStringifiedNumber = assertIsStringifiedNumber;
|
|
7871
7898
|
exports.assertIsTransactionMessageWithBlockhashLifetime = assertIsTransactionMessageWithBlockhashLifetime;
|
|
7899
|
+
exports.assertIsTransactionMessageWithDurableNonceLifetime = assertIsTransactionMessageWithDurableNonceLifetime;
|
|
7872
7900
|
exports.assertIsTransactionMessageWithSingleSendingSigner = assertIsTransactionMessageWithSingleSendingSigner;
|
|
7901
|
+
exports.assertIsTransactionMessageWithinSizeLimit = assertIsTransactionMessageWithinSizeLimit;
|
|
7873
7902
|
exports.assertIsTransactionModifyingSigner = assertIsTransactionModifyingSigner;
|
|
7874
7903
|
exports.assertIsTransactionPartialSigner = assertIsTransactionPartialSigner;
|
|
7875
7904
|
exports.assertIsTransactionSendingSigner = assertIsTransactionSendingSigner;
|
|
7876
7905
|
exports.assertIsTransactionSigner = assertIsTransactionSigner;
|
|
7906
|
+
exports.assertIsTransactionWithinSizeLimit = assertIsTransactionWithinSizeLimit;
|
|
7877
7907
|
exports.assertIsUnixTimestamp = assertIsUnixTimestamp;
|
|
7878
7908
|
exports.assertIsVariableSize = assertIsVariableSize;
|
|
7879
7909
|
exports.assertNumberIsBetweenForCodec = assertNumberIsBetweenForCodec;
|
|
@@ -8063,6 +8093,8 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
8063
8093
|
exports.getTransactionCodec = getTransactionCodec;
|
|
8064
8094
|
exports.getTransactionDecoder = getTransactionDecoder;
|
|
8065
8095
|
exports.getTransactionEncoder = getTransactionEncoder;
|
|
8096
|
+
exports.getTransactionMessageSize = getTransactionMessageSize;
|
|
8097
|
+
exports.getTransactionSize = getTransactionSize;
|
|
8066
8098
|
exports.getTransactionVersionCodec = getTransactionVersionCodec;
|
|
8067
8099
|
exports.getTransactionVersionDecoder = getTransactionVersionDecoder;
|
|
8068
8100
|
exports.getTransactionVersionEncoder = getTransactionVersionEncoder;
|
|
@@ -8098,6 +8130,7 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
8098
8130
|
exports.isBlockhash = isBlockhash;
|
|
8099
8131
|
exports.isDurableNonceTransaction = isDurableNonceTransaction;
|
|
8100
8132
|
exports.isFixedSize = isFixedSize;
|
|
8133
|
+
exports.isFullySignedTransaction = isFullySignedTransaction;
|
|
8101
8134
|
exports.isInstructionForProgram = isInstructionForProgram;
|
|
8102
8135
|
exports.isInstructionWithAccounts = isInstructionWithAccounts;
|
|
8103
8136
|
exports.isInstructionWithData = isInstructionWithData;
|
|
@@ -8119,11 +8152,14 @@ this.globalThis.solanaWeb3 = (function (exports) {
|
|
|
8119
8152
|
exports.isStringifiedBigInt = isStringifiedBigInt;
|
|
8120
8153
|
exports.isStringifiedNumber = isStringifiedNumber;
|
|
8121
8154
|
exports.isTransactionMessageWithBlockhashLifetime = isTransactionMessageWithBlockhashLifetime;
|
|
8155
|
+
exports.isTransactionMessageWithDurableNonceLifetime = isTransactionMessageWithDurableNonceLifetime;
|
|
8122
8156
|
exports.isTransactionMessageWithSingleSendingSigner = isTransactionMessageWithSingleSendingSigner;
|
|
8157
|
+
exports.isTransactionMessageWithinSizeLimit = isTransactionMessageWithinSizeLimit;
|
|
8123
8158
|
exports.isTransactionModifyingSigner = isTransactionModifyingSigner;
|
|
8124
8159
|
exports.isTransactionPartialSigner = isTransactionPartialSigner;
|
|
8125
8160
|
exports.isTransactionSendingSigner = isTransactionSendingSigner;
|
|
8126
8161
|
exports.isTransactionSigner = isTransactionSigner;
|
|
8162
|
+
exports.isTransactionWithinSizeLimit = isTransactionWithinSizeLimit;
|
|
8127
8163
|
exports.isUnixTimestamp = isUnixTimestamp;
|
|
8128
8164
|
exports.isVariableSize = isVariableSize;
|
|
8129
8165
|
exports.isWritableRole = isWritableRole;
|