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