@clonegod/ttd-sol-common 1.0.124 → 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,
|
|
@@ -737,17 +732,17 @@ class RpcClient {
|
|
|
737
732
|
});
|
|
738
733
|
}
|
|
739
734
|
sendJitoTransaction(serializedTransaction_1, jitoApiUrl_1) {
|
|
740
|
-
return __awaiter(this, arguments, void 0, function* (serializedTransaction, jitoApiUrl, encoding = '
|
|
735
|
+
return __awaiter(this, arguments, void 0, function* (serializedTransaction, jitoApiUrl, encoding = 'base58') {
|
|
741
736
|
let start = Date.now();
|
|
742
737
|
let params;
|
|
743
|
-
if (encoding === '
|
|
744
|
-
params = [serializedTransaction, { encoding }];
|
|
745
|
-
}
|
|
746
|
-
else if (encoding === 'bs58') {
|
|
738
|
+
if (encoding === 'base58') {
|
|
747
739
|
params = [serializedTransaction];
|
|
748
740
|
}
|
|
741
|
+
else if (encoding === 'base64') {
|
|
742
|
+
params = [serializedTransaction, { encoding }];
|
|
743
|
+
}
|
|
749
744
|
else {
|
|
750
|
-
throw new Error('Invalid type
|
|
745
|
+
throw new Error('Invalid encoding type:' + encoding);
|
|
751
746
|
}
|
|
752
747
|
const response = yield axios_1.default.post(jitoApiUrl, {
|
|
753
748
|
jsonrpc: '2.0',
|