@cryptorubic/web3 1.8.1-alpha.solana.4 → 1.8.1
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/package.json
CHANGED
|
@@ -35,10 +35,10 @@ class SolanaAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSigne
|
|
|
35
35
|
const tx = web3_js_1.VersionedTransaction.deserialize(decodedData);
|
|
36
36
|
const { blockhash } = await this.publicClient.getLatestBlockhash('confirmed');
|
|
37
37
|
tx.message.recentBlockhash = blockhash;
|
|
38
|
+
const signedTx = await this.wallet.signTransaction(tx);
|
|
39
|
+
const txBase64 = js_base64_1.Base64.fromUint8Array(signedTx.serialize());
|
|
38
40
|
let signature;
|
|
39
41
|
if (params.txOptions?.sponsorParams) {
|
|
40
|
-
const signedTx = await this.wallet.signTransaction(tx);
|
|
41
|
-
const txBase64 = js_base64_1.Base64.fromUint8Array(signedTx.serialize());
|
|
42
42
|
const response = await this.httpClient.post(`${this.apiUrl}/api/utility/solana/relay`, {
|
|
43
43
|
data: txBase64,
|
|
44
44
|
id: params.txOptions.sponsorParams.tradeId
|
|
@@ -47,7 +47,7 @@ class SolanaAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSigne
|
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
49
|
try {
|
|
50
|
-
const simulation = await this.publicClient.simulateTransaction(
|
|
50
|
+
const simulation = await this.publicClient.simulateTransaction(signedTx, {
|
|
51
51
|
sigVerify: true,
|
|
52
52
|
replaceRecentBlockhash: false
|
|
53
53
|
});
|
|
@@ -56,14 +56,10 @@ class SolanaAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSigne
|
|
|
56
56
|
catch (err) {
|
|
57
57
|
console.log(err);
|
|
58
58
|
}
|
|
59
|
-
signature = await this.publicClient.
|
|
59
|
+
signature = await this.publicClient.sendRawTransaction(signedTx.serialize(), {
|
|
60
60
|
maxRetries: 3,
|
|
61
61
|
skipPreflight: false
|
|
62
62
|
});
|
|
63
|
-
// signature = await this.publicClient.sendRawTransaction(signedTx.serialize(), {
|
|
64
|
-
// maxRetries: 3,
|
|
65
|
-
// skipPreflight: false
|
|
66
|
-
// });
|
|
67
63
|
}
|
|
68
64
|
params.txOptions.onTransactionHash?.(signature);
|
|
69
65
|
await this.waitForTxConfirmation(signature);
|