@cryptorubic/web3 1.0.0-alpha.no-sdk.4 → 1.0.0-alpha.no-sdk.4.1-test

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.0.0-alpha.no-sdk.4",
3
+ "version": "1.0.0-alpha.no-sdk.4.1-test",
4
4
  "dependencies": {
5
5
  "@ethersproject/bignumber": "^5.8.0",
6
6
  "@mysten/sui": "^1.24.0",
package/src/index.d.ts CHANGED
@@ -143,3 +143,15 @@ export * from './lib/utils/web3-types/solana-web3-pure';
143
143
  export * from './lib/utils/web3-types/sui-web3-pure';
144
144
  export * from './lib/utils/web3-types/ton-web3-pure';
145
145
  export * from './lib/utils/web3-types/tron-web3-pure';
146
+ export * from './lib/utils/models/primitive-types';
147
+ export * from './lib/utils/models/tron-transaction-info';
148
+ export * from './lib/utils/models/tron-transaction-config';
149
+ export * from './lib/utils/models/tron-parameters';
150
+ export * from './lib/utils/models/tron-multicall-response';
151
+ export * from './lib/utils/models/tron-call';
152
+ export * from './lib/utils/models/tron-block';
153
+ export * from './lib/utils/models/abi-types';
154
+ export * from './lib/utils/models/evm-transaction-config';
155
+ export * from './lib/utils/models/cn-validation-response';
156
+ export * from './lib/utils/constants/changenow-api-blockchain';
157
+ export * from './lib/utils/models/ton-transaction-config';
package/src/index.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- // Auto-generated exports - do not edit manually
5
4
  tslib_1.__exportStar(require("./lib/adapter/adapters/adapter-bitcoin/bitcoin-adapter"), exports);
6
5
  tslib_1.__exportStar(require("./lib/adapter/adapters/adapter-bitcoin/client/bitcoin-adapter-client"), exports);
7
6
  tslib_1.__exportStar(require("./lib/adapter/adapters/adapter-bitcoin/models/btc-send-tx-params"), exports);
@@ -147,3 +146,15 @@ tslib_1.__exportStar(require("./lib/utils/web3-types/solana-web3-pure"), exports
147
146
  tslib_1.__exportStar(require("./lib/utils/web3-types/sui-web3-pure"), exports);
148
147
  tslib_1.__exportStar(require("./lib/utils/web3-types/ton-web3-pure"), exports);
149
148
  tslib_1.__exportStar(require("./lib/utils/web3-types/tron-web3-pure"), exports);
149
+ tslib_1.__exportStar(require("./lib/utils/models/primitive-types"), exports);
150
+ tslib_1.__exportStar(require("./lib/utils/models/tron-transaction-info"), exports);
151
+ tslib_1.__exportStar(require("./lib/utils/models/tron-transaction-config"), exports);
152
+ tslib_1.__exportStar(require("./lib/utils/models/tron-parameters"), exports);
153
+ tslib_1.__exportStar(require("./lib/utils/models/tron-multicall-response"), exports);
154
+ tslib_1.__exportStar(require("./lib/utils/models/tron-call"), exports);
155
+ tslib_1.__exportStar(require("./lib/utils/models/tron-block"), exports);
156
+ tslib_1.__exportStar(require("./lib/utils/models/abi-types"), exports);
157
+ tslib_1.__exportStar(require("./lib/utils/models/evm-transaction-config"), exports);
158
+ tslib_1.__exportStar(require("./lib/utils/models/cn-validation-response"), exports);
159
+ tslib_1.__exportStar(require("./lib/utils/constants/changenow-api-blockchain"), exports);
160
+ tslib_1.__exportStar(require("./lib/utils/models/ton-transaction-config"), exports);
@@ -53,7 +53,7 @@ export declare class EvmAdapterClient extends AbstractAdapterClient<WalletClient
53
53
  * @param [options] Additional options.
54
54
  * @returns Transaction receipt.
55
55
  */
56
- trySendTransaction(toAddress: string, options: EvmTransactionOptions): Promise<TransactionReceipt>;
56
+ trySendTransaction(params: EvmSendTxParams): Promise<TransactionReceipt>;
57
57
  /**
58
58
  * Executes method of smart-contract and resolve the promise when the transaction is included in the block.
59
59
  * @param contractAddress Address of smart-contract which method is to be executed.
@@ -134,23 +134,25 @@ class EvmAdapterClient extends abstract_adapter_client_1.AbstractAdapterClient {
134
134
  * @param [options] Additional options.
135
135
  * @returns Transaction receipt.
136
136
  */
137
- async trySendTransaction(toAddress, options) {
137
+ async trySendTransaction(params) {
138
138
  try {
139
+ const to = params.txOptions.to;
140
+ const value = BigInt(params.txOptions.value?.toString() || '0');
139
141
  const gaslessParams = {
140
142
  account: this.walletAddress,
141
- to: toAddress,
142
- value: BigInt(options.value?.toString() || '0'),
143
- ...(options.data && { data: options.data })
143
+ to,
144
+ value,
145
+ ...(params.txOptions.data && { data: params.txOptions.data })
144
146
  };
145
147
  const gas = await this.evmAdapter.public.estimateGas(gaslessParams);
146
148
  const gasfulParams = {
147
149
  ...gaslessParams,
148
- ...(0, options_1.getGasOptions)(options),
150
+ ...(0, options_1.getGasOptions)(params.txOptions),
149
151
  gas: gas.toString()
150
152
  };
151
153
  const gasfulViemParams = {
152
154
  ...gaslessParams,
153
- ...(0, options_1.getViemGasOptions)(options),
155
+ ...(0, options_1.getViemGasOptions)(params.txOptions),
154
156
  gas
155
157
  };
156
158
  try {
@@ -161,9 +163,9 @@ class EvmAdapterClient extends abstract_adapter_client_1.AbstractAdapterClient {
161
163
  }
162
164
  const sendParams = {
163
165
  ...gasfulParams,
164
- ...(options.onTransactionHash && {
165
- onTransactionHash: options.onTransactionHash,
166
- gasPriceOptions: options?.gasPriceOptions
166
+ ...(params.txOptions.onTransactionHash && {
167
+ onTransactionHash: params.txOptions.onTransactionHash,
168
+ gasPriceOptions: params.txOptions?.gasPriceOptions
167
169
  })
168
170
  };
169
171
  const receipt = await this.sendTransaction({ txOptions: sendParams });
@@ -173,7 +175,7 @@ class EvmAdapterClient extends abstract_adapter_client_1.AbstractAdapterClient {
173
175
  console.debug('Call tokens transfer error', err);
174
176
  const shouldIgnore = await this.shouldIgnoreError(err);
175
177
  if (shouldIgnore) {
176
- return this.sendTransaction({ txOptions: options });
178
+ return this.sendTransaction(params);
177
179
  }
178
180
  throw (0, parse_evm_error_1.parseEvmError)(err);
179
181
  }