@cryptorubic/web3 1.1.0-alpha-stellar.30 → 1.1.0-alpha-stellar.31
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/adapter-evm/signer/evm-adapter-signer.d.ts +1 -1
- package/src/lib/adapter/adapters/adapter-evm/signer/evm-adapter-signer.js +7 -7
- package/src/lib/adapter/adapters/adapter-stellar/stellar-adapter.js +0 -1
- package/src/lib/errors/blockchain/user-reject.error.d.ts +1 -1
- package/src/lib/errors/blockchain/user-reject.error.js +2 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BlockchainName, HttpClient, ICustomLogger } from '@cryptorubic/core';
|
|
2
|
+
import { Abi, PublicActions, PublicClient, TransactionReceipt, WalletActions, WalletClient } from 'viem';
|
|
2
3
|
import { ClientAdaptersFactoryParams } from '../../../models/create-factory-params';
|
|
3
4
|
import { AbstractAdapterSigner } from '../../common/signer/abstract-adapter-signer';
|
|
4
|
-
import { Abi, PublicActions, PublicClient, TransactionReceipt, WalletActions, WalletClient } from 'viem';
|
|
5
5
|
import { EvmSendTxParams, EvmTransactionOptions } from '../models/evm-send-tx-params';
|
|
6
6
|
import { Web3Error } from '../utils/parse-evm-error';
|
|
7
7
|
export declare class EvmAdapterSigner extends AbstractAdapterSigner<WalletClient & WalletActions, EvmSendTxParams, TransactionReceipt> {
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.EvmAdapterSigner = void 0;
|
|
4
4
|
const core_1 = require("@cryptorubic/core");
|
|
5
|
-
const
|
|
5
|
+
const bignumber_js_1 = require("bignumber.js");
|
|
6
6
|
const viem_1 = require("viem");
|
|
7
7
|
const actions_1 = require("viem/actions");
|
|
8
|
-
const
|
|
8
|
+
const tx_reverted_in_chain_error_1 = require("../../../../errors/common/tx-reverted-in-chain.error");
|
|
9
|
+
const rubic_sdk_error_1 = require("../../../../errors/rubic-sdk.error");
|
|
9
10
|
const viem_blockchain_mapping_1 = require("../../../constants/viem-blockchain-mapping");
|
|
11
|
+
const abstract_adapter_signer_1 = require("../../common/signer/abstract-adapter-signer");
|
|
12
|
+
const options_1 = require("../../utils/options");
|
|
10
13
|
const parse_evm_error_1 = require("../utils/parse-evm-error");
|
|
11
|
-
const rubic_sdk_error_1 = require("../../../../errors/rubic-sdk.error");
|
|
12
|
-
const tx_reverted_in_chain_error_1 = require("../../../../errors/common/tx-reverted-in-chain.error");
|
|
13
|
-
const bignumber_js_1 = require("bignumber.js");
|
|
14
14
|
class EvmAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSigner {
|
|
15
15
|
get publicClient() {
|
|
16
16
|
if (!this.publicRef.public) {
|
|
@@ -73,8 +73,8 @@ class EvmAdapterSigner extends abstract_adapter_signer_1.AbstractAdapterSigner {
|
|
|
73
73
|
value,
|
|
74
74
|
...(params.txOptions.data && { data: params.txOptions.data })
|
|
75
75
|
};
|
|
76
|
-
const gas = await this.publicClient.estimateGas(gaslessParams);
|
|
77
|
-
const calculatedGas = params.txOptions.gasLimitRatio
|
|
76
|
+
const gas = params.txOptions.gas ? BigInt(params.txOptions.gas) : await this.publicClient.estimateGas(gaslessParams);
|
|
77
|
+
const calculatedGas = !params.txOptions.gas && params.txOptions.gasLimitRatio
|
|
78
78
|
? BigInt(new bignumber_js_1.default(gas.toString()).multipliedBy(params.txOptions.gasLimitRatio).toFixed(0))
|
|
79
79
|
: gas;
|
|
80
80
|
const gasfulParams = {
|
|
@@ -6,8 +6,8 @@ const rubic_sdk_error_1 = require("../rubic-sdk.error");
|
|
|
6
6
|
* Thrown, when user cancels transaction.
|
|
7
7
|
*/
|
|
8
8
|
class UserRejectError extends rubic_sdk_error_1.RubicSdkError {
|
|
9
|
-
constructor() {
|
|
10
|
-
super();
|
|
9
|
+
constructor(message) {
|
|
10
|
+
super(message);
|
|
11
11
|
Object.setPrototypeOf(this, UserRejectError.prototype);
|
|
12
12
|
}
|
|
13
13
|
}
|