@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cryptorubic/web3",
3
- "version": "1.1.0-alpha-stellar.30",
3
+ "version": "1.1.0-alpha-stellar.31",
4
4
  "dependencies": {
5
5
  "@ethersproject/bignumber": "^5.8.0",
6
6
  "@mysten/sui": "^1.24.0",
@@ -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 abstract_adapter_signer_1 = require("../../common/signer/abstract-adapter-signer");
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 options_1 = require("../../utils/options");
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 = {
@@ -84,7 +84,6 @@ class StellarAdapter extends abstract_adapter_1.AbstractAdapter {
84
84
  return new bignumber_js_1.default(trustline.limit().toString()).lt(token.weiAmount);
85
85
  }
86
86
  catch (err) {
87
- console.error(err);
88
87
  return true;
89
88
  }
90
89
  }
@@ -3,5 +3,5 @@ import { RubicSdkError } from '../rubic-sdk.error';
3
3
  * Thrown, when user cancels transaction.
4
4
  */
5
5
  export declare class UserRejectError extends RubicSdkError {
6
- constructor();
6
+ constructor(message?: string);
7
7
  }
@@ -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
  }