@cryptorubic/web3 0.8.17-alpha.solana.21 → 0.8.17-alpha.solana.22
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 +1 -1
- package/src/lib/adapter/adapters/solana-adapter.js +7 -1
- package/src/lib/adapter/adapters/utils/solana-utils/solana-gas-service.d.ts +1 -1
- package/src/lib/adapter/adapters/utils/solana-utils/solana-gas-service.js +2 -2
- package/src/lib/utils/models/solana-transaction-config.d.ts +1 -0
package/package.json
CHANGED
|
@@ -50,7 +50,13 @@ class SolanaAdapter extends abstract_adapter_1.AbstractAdapter {
|
|
|
50
50
|
const { blockhash } = await this.public.getLatestBlockhash();
|
|
51
51
|
const tx = web3_js_1.VersionedTransaction.deserialize(bufferData);
|
|
52
52
|
tx.message.recentBlockhash = blockhash;
|
|
53
|
-
const simulation = this.public.simulateTransaction(tx, {
|
|
53
|
+
const simulation = this.public.simulateTransaction(tx, {
|
|
54
|
+
replaceRecentBlockhash: true,
|
|
55
|
+
accounts: {
|
|
56
|
+
encoding: 'base64',
|
|
57
|
+
addresses: [config.walletAddress]
|
|
58
|
+
}
|
|
59
|
+
});
|
|
54
60
|
const resp = await (0, timeout_1.withTimeout)(simulation, timeout, 'Solana Simulation Timeout!');
|
|
55
61
|
return new bignumber_js_1.default(resp.value.unitsConsumed || exports.DEFAULT_CU_LIMIT).toFixed(0);
|
|
56
62
|
}
|
|
@@ -20,7 +20,7 @@ export declare class SolanaGasService {
|
|
|
20
20
|
*/
|
|
21
21
|
getPriorityFee(txData: string): Promise<BigNumber>;
|
|
22
22
|
/**
|
|
23
|
-
* @returns
|
|
23
|
+
* @returns prioritizationFee in micro-lamports(lamport * 10^-6)
|
|
24
24
|
*/
|
|
25
25
|
private calculatePriorityFeeHelius;
|
|
26
26
|
private getRecentPriorityFeeSolWeb3;
|
|
@@ -40,7 +40,7 @@ class SolanaGasService {
|
|
|
40
40
|
*/
|
|
41
41
|
async getPriorityFee(txData) {
|
|
42
42
|
if (!this.HELIUS_API_KEY) {
|
|
43
|
-
console.warn('[
|
|
43
|
+
console.warn('[SolanaApiService_getPriorityFee] heliusApiKey is not provided in "createFactory"');
|
|
44
44
|
}
|
|
45
45
|
const resp = await Promise.allSettled([this.calculatePriorityFeeHelius(txData), this.getRecentPriorityFeeSolWeb3()]);
|
|
46
46
|
const cuPrice = resp
|
|
@@ -50,7 +50,7 @@ class SolanaGasService {
|
|
|
50
50
|
return cuPrice;
|
|
51
51
|
}
|
|
52
52
|
/**
|
|
53
|
-
* @returns
|
|
53
|
+
* @returns prioritizationFee in micro-lamports(lamport * 10^-6)
|
|
54
54
|
*/
|
|
55
55
|
async calculatePriorityFeeHelius(txData) {
|
|
56
56
|
try {
|