@clonegod/ttd-sol-common 1.0.123 → 1.0.126
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.
|
@@ -374,30 +374,30 @@ class RpcClient {
|
|
|
374
374
|
const isVersioned = lookupTables.length > 0;
|
|
375
375
|
let legacyTransaction = null;
|
|
376
376
|
let versionedTransaction = null;
|
|
377
|
-
if (isVersioned) {
|
|
378
|
-
const v0Message = new web3_js_1.TransactionMessage({
|
|
379
|
-
instructions,
|
|
380
|
-
payerKey,
|
|
381
|
-
recentBlockhash,
|
|
382
|
-
}).compileToV0Message(lookupTables);
|
|
383
|
-
versionedTransaction = new web3_js_1.VersionedTransaction(v0Message);
|
|
384
|
-
const allSigners = feePayer ? [...signers, feePayer] : signers;
|
|
385
|
-
versionedTransaction.sign(allSigners);
|
|
386
|
-
}
|
|
387
|
-
else {
|
|
388
|
-
legacyTransaction = new web3_js_1.Transaction().add(...instructions);
|
|
389
|
-
legacyTransaction.recentBlockhash = recentBlockhash;
|
|
390
|
-
legacyTransaction.feePayer = payerKey;
|
|
391
|
-
for (const signer of signers) {
|
|
392
|
-
legacyTransaction.partialSign(signer);
|
|
393
|
-
}
|
|
394
|
-
if (feePayer) {
|
|
395
|
-
legacyTransaction.partialSign(feePayer);
|
|
396
|
-
}
|
|
397
|
-
}
|
|
398
377
|
setTimeout(() => __awaiter(this, void 0, void 0, function* () {
|
|
399
378
|
if (Math.random() > -1)
|
|
400
379
|
return;
|
|
380
|
+
if (isVersioned) {
|
|
381
|
+
const v0Message = new web3_js_1.TransactionMessage({
|
|
382
|
+
instructions,
|
|
383
|
+
payerKey,
|
|
384
|
+
recentBlockhash,
|
|
385
|
+
}).compileToV0Message(lookupTables);
|
|
386
|
+
versionedTransaction = new web3_js_1.VersionedTransaction(v0Message);
|
|
387
|
+
const allSigners = feePayer ? [...signers, feePayer] : signers;
|
|
388
|
+
versionedTransaction.sign(allSigners);
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
legacyTransaction = new web3_js_1.Transaction().add(...instructions);
|
|
392
|
+
legacyTransaction.recentBlockhash = recentBlockhash;
|
|
393
|
+
legacyTransaction.feePayer = payerKey;
|
|
394
|
+
for (const signer of signers) {
|
|
395
|
+
legacyTransaction.partialSign(signer);
|
|
396
|
+
}
|
|
397
|
+
if (feePayer) {
|
|
398
|
+
legacyTransaction.partialSign(feePayer);
|
|
399
|
+
}
|
|
400
|
+
}
|
|
401
401
|
const serializedTransaction = bs58_1.default.encode(isVersioned
|
|
402
402
|
? versionedTransaction.serialize()
|
|
403
403
|
: legacyTransaction.serialize(serializeOptions));
|
|
@@ -455,12 +455,7 @@ class RpcClient {
|
|
|
455
455
|
legacyTransaction = new web3_js_1.Transaction().add(...instructions);
|
|
456
456
|
legacyTransaction.recentBlockhash = recentBlockhash;
|
|
457
457
|
legacyTransaction.feePayer = payerKey;
|
|
458
|
-
|
|
459
|
-
legacyTransaction.partialSign(signer);
|
|
460
|
-
}
|
|
461
|
-
if (feePayer) {
|
|
462
|
-
legacyTransaction.partialSign(feePayer);
|
|
463
|
-
}
|
|
458
|
+
legacyTransaction.sign(signers[0]);
|
|
464
459
|
return {
|
|
465
460
|
transaction: legacyTransaction,
|
|
466
461
|
blockhash,
|
|
@@ -607,7 +602,6 @@ class RpcClient {
|
|
|
607
602
|
}
|
|
608
603
|
let err = new Error('Bundle failed to confirm within the timeout period:' + timeout + 'ms');
|
|
609
604
|
(0, dist_1.log_error)(`Bundle failed to confirm, txid=${txid}`, err);
|
|
610
|
-
throw err;
|
|
611
605
|
}), 0);
|
|
612
606
|
return txid;
|
|
613
607
|
});
|
|
@@ -738,17 +732,17 @@ class RpcClient {
|
|
|
738
732
|
});
|
|
739
733
|
}
|
|
740
734
|
sendJitoTransaction(serializedTransaction_1, jitoApiUrl_1) {
|
|
741
|
-
return __awaiter(this, arguments, void 0, function* (serializedTransaction, jitoApiUrl, encoding = '
|
|
735
|
+
return __awaiter(this, arguments, void 0, function* (serializedTransaction, jitoApiUrl, encoding = 'base58') {
|
|
742
736
|
let start = Date.now();
|
|
743
737
|
let params;
|
|
744
|
-
if (encoding === '
|
|
745
|
-
params = [serializedTransaction, { encoding }];
|
|
746
|
-
}
|
|
747
|
-
else if (encoding === 'bs58') {
|
|
738
|
+
if (encoding === 'base58') {
|
|
748
739
|
params = [serializedTransaction];
|
|
749
740
|
}
|
|
741
|
+
else if (encoding === 'base64') {
|
|
742
|
+
params = [serializedTransaction, { encoding }];
|
|
743
|
+
}
|
|
750
744
|
else {
|
|
751
|
-
throw new Error('Invalid type
|
|
745
|
+
throw new Error('Invalid encoding type:' + encoding);
|
|
752
746
|
}
|
|
753
747
|
const response = yield axios_1.default.post(jitoApiUrl, {
|
|
754
748
|
jsonrpc: '2.0',
|