@octaflowlabs/onchain-sdk 1.1.1 → 1.1.3

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.
@@ -2,6 +2,7 @@
2
2
  import { Transaction } from 'ethers';
3
3
  /** local imports */
4
4
  import { getProvider } from './getProvider';
5
+ import { errorMessagesForBroadcast, handleErrorMessages } from '../utils/handleErrorMessages';
5
6
  export const broadcastTransaction = async ({ signedTx, rpcUrl, chainId, waitConfirmations = 0, }) => {
6
7
  const provider = getProvider(rpcUrl, chainId);
7
8
  if (!provider)
@@ -10,7 +11,10 @@ export const broadcastTransaction = async ({ signedTx, rpcUrl, chainId, waitConf
10
11
  Transaction.from(signedTx);
11
12
  }
12
13
  catch (error) {
13
- console.error('Invalid signed transaction format:', error);
14
+ handleErrorMessages({
15
+ e: error,
16
+ message: errorMessagesForBroadcast[error.code] || 'Invalid signed transaction format',
17
+ });
14
18
  throw new Error('Invalid signed transaction format' + (error?.message || error || ''));
15
19
  }
16
20
  try {
@@ -21,7 +25,10 @@ export const broadcastTransaction = async ({ signedTx, rpcUrl, chainId, waitConf
21
25
  return txHash;
22
26
  }
23
27
  catch (error) {
24
- console.error('Error computing transaction hash:', error);
28
+ handleErrorMessages({
29
+ e: error,
30
+ message: errorMessagesForBroadcast[error.code] || 'Failed to broadcast transaction',
31
+ });
25
32
  throw new Error(error?.message || error || 'Failed to broadcast transaction');
26
33
  }
27
34
  };
@@ -1,3 +1,4 @@
1
+ import { errorMessagesForGasLimitEstimation, handleErrorMessages, } from '../utils/handleErrorMessages';
1
2
  export const estimateGasLimitFromProvider = async ({ provider, unsignedTx, walletAddress, defaultGasLimit, }) => {
2
3
  let lastFeeData = null;
3
4
  let lastGasEstimated = null;
@@ -42,7 +43,10 @@ export const estimateGasLimitFromProvider = async ({ provider, unsignedTx, walle
42
43
  };
43
44
  }
44
45
  catch (error) {
45
- console.error('Unable to estimate gas limit: ', error);
46
+ handleErrorMessages({
47
+ e: error,
48
+ message: errorMessagesForGasLimitEstimation[error.code] || 'Failed to estimate gas limit',
49
+ });
46
50
  console.log(`Setting default gas limit to: ${defaultGasLimit}`);
47
51
  const feeData = lastFeeData;
48
52
  const gasEstimated = lastGasEstimated ?? defaultGasLimit;
@@ -2,13 +2,10 @@
2
2
  import { JsonRpcProvider, Network } from 'ethers';
3
3
  export const getProvider = (rpcUrl, chainId) => {
4
4
  try {
5
- if (chainId) {
6
- const network = Network.from(chainId);
7
- return new JsonRpcProvider(rpcUrl, network, { staticNetwork: network });
8
- }
9
- else {
5
+ if (!chainId)
10
6
  return new JsonRpcProvider(rpcUrl);
11
- }
7
+ const network = Network.from(chainId);
8
+ return new JsonRpcProvider(rpcUrl, network, { staticNetwork: network });
12
9
  }
13
10
  catch (error) {
14
11
  console.warn('Could not create provider with chainId, falling back to rpcUrl only:', error);
@@ -5,6 +5,7 @@ exports.broadcastTransaction = void 0;
5
5
  const ethers_1 = require("ethers");
6
6
  /** local imports */
7
7
  const getProvider_1 = require("./getProvider");
8
+ const handleErrorMessages_1 = require("../utils/handleErrorMessages");
8
9
  const broadcastTransaction = async ({ signedTx, rpcUrl, chainId, waitConfirmations = 0, }) => {
9
10
  const provider = (0, getProvider_1.getProvider)(rpcUrl, chainId);
10
11
  if (!provider)
@@ -13,7 +14,10 @@ const broadcastTransaction = async ({ signedTx, rpcUrl, chainId, waitConfirmatio
13
14
  ethers_1.Transaction.from(signedTx);
14
15
  }
15
16
  catch (error) {
16
- console.error('Invalid signed transaction format:', error);
17
+ (0, handleErrorMessages_1.handleErrorMessages)({
18
+ e: error,
19
+ message: handleErrorMessages_1.errorMessagesForBroadcast[error.code] || 'Invalid signed transaction format',
20
+ });
17
21
  throw new Error('Invalid signed transaction format' + (error?.message || error || ''));
18
22
  }
19
23
  try {
@@ -24,7 +28,10 @@ const broadcastTransaction = async ({ signedTx, rpcUrl, chainId, waitConfirmatio
24
28
  return txHash;
25
29
  }
26
30
  catch (error) {
27
- console.error('Error computing transaction hash:', error);
31
+ (0, handleErrorMessages_1.handleErrorMessages)({
32
+ e: error,
33
+ message: handleErrorMessages_1.errorMessagesForBroadcast[error.code] || 'Failed to broadcast transaction',
34
+ });
28
35
  throw new Error(error?.message || error || 'Failed to broadcast transaction');
29
36
  }
30
37
  };
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.estimateGasLimitFromProvider = void 0;
4
+ const handleErrorMessages_1 = require("../utils/handleErrorMessages");
4
5
  const estimateGasLimitFromProvider = async ({ provider, unsignedTx, walletAddress, defaultGasLimit, }) => {
5
6
  let lastFeeData = null;
6
7
  let lastGasEstimated = null;
@@ -45,7 +46,10 @@ const estimateGasLimitFromProvider = async ({ provider, unsignedTx, walletAddres
45
46
  };
46
47
  }
47
48
  catch (error) {
48
- console.error('Unable to estimate gas limit: ', error);
49
+ (0, handleErrorMessages_1.handleErrorMessages)({
50
+ e: error,
51
+ message: handleErrorMessages_1.errorMessagesForGasLimitEstimation[error.code] || 'Failed to estimate gas limit',
52
+ });
49
53
  console.log(`Setting default gas limit to: ${defaultGasLimit}`);
50
54
  const feeData = lastFeeData;
51
55
  const gasEstimated = lastGasEstimated ?? defaultGasLimit;
@@ -5,13 +5,10 @@ exports.getProvider = void 0;
5
5
  const ethers_1 = require("ethers");
6
6
  const getProvider = (rpcUrl, chainId) => {
7
7
  try {
8
- if (chainId) {
9
- const network = ethers_1.Network.from(chainId);
10
- return new ethers_1.JsonRpcProvider(rpcUrl, network, { staticNetwork: network });
11
- }
12
- else {
8
+ if (!chainId)
13
9
  return new ethers_1.JsonRpcProvider(rpcUrl);
14
- }
10
+ const network = ethers_1.Network.from(chainId);
11
+ return new ethers_1.JsonRpcProvider(rpcUrl, network, { staticNetwork: network });
15
12
  }
16
13
  catch (error) {
17
14
  console.warn('Could not create provider with chainId, falling back to rpcUrl only:', error);
@@ -14,10 +14,11 @@ export { EvmWalletService, EvmGeneratedWallet, EvmDerivedWallet, } from './servi
14
14
  export { EntropySource } from './services/evm-wallet-core/entropy';
15
15
  export { createWallet, signMessage, signTransaction } from './services/evm-wallet-core/signer';
16
16
  /** utils exports */
17
- export { getShortenTransactionHash } from './utils/getShortenTxHash';
17
+ export { getShortenTransactionHashOrAddress, getShortenData } from './utils/getShortenTxHash';
18
18
  export { transformBigInt } from './utils/transformBigInt';
19
19
  import NATIVE_TOKENS from './utils/tokens';
20
20
  export { NATIVE_TOKENS };
21
21
  export { formattedAmountForDisplay, parsedAmount } from './utils/formatAmount';
22
+ export { handleErrorMessages, errorMessagesForBroadcast, errorMessagesForGasLimitEstimation, } from './utils/handleErrorMessages';
22
23
  /** types exports */
23
24
  export { BroadcastTransactionOptions, BuildMaxNativeTransferTxOptions, BuildMaxNativeTransferTxResponse, BuildUnsignedTransferTxOptions, EstimateGasLimitFromProviderProps, GasEstimateResult, TxStatusOptions, TxStatusResponse, UnsignedTransferTxResponse, FormatAmountOptions, TransactionRequest, } from './types/common';
package/dist/cjs/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.parsedAmount = exports.formattedAmountForDisplay = exports.NATIVE_TOKENS = exports.transformBigInt = exports.getShortenTransactionHash = exports.signTransaction = exports.signMessage = exports.createWallet = exports.EvmWalletService = exports.txStatus = exports.getProvider = exports.estimateGasLimitFromProvider = exports.broadcastTransaction = exports.buildUnsignedTransferTx = exports.buildMaxNativeTransferTx = exports.GAS_LIMIT_PER_TX_TYPE = exports.ERC20_TOKEN_CONTRACT_ABI = void 0;
6
+ exports.errorMessagesForGasLimitEstimation = exports.errorMessagesForBroadcast = exports.handleErrorMessages = exports.parsedAmount = exports.formattedAmountForDisplay = exports.NATIVE_TOKENS = exports.transformBigInt = exports.getShortenData = exports.getShortenTransactionHashOrAddress = exports.signTransaction = exports.signMessage = exports.createWallet = exports.EvmWalletService = exports.txStatus = exports.getProvider = exports.estimateGasLimitFromProvider = exports.broadcastTransaction = exports.buildUnsignedTransferTx = exports.buildMaxNativeTransferTx = exports.GAS_LIMIT_PER_TX_TYPE = exports.ERC20_TOKEN_CONTRACT_ABI = void 0;
7
7
  /** ABIs exports */
8
8
  const ERC20_TOKEN_CONTRACT_ABI_1 = __importDefault(require("./ABIs/ERC20_TOKEN_CONTRACT_ABI"));
9
9
  exports.ERC20_TOKEN_CONTRACT_ABI = ERC20_TOKEN_CONTRACT_ABI_1.default;
@@ -31,7 +31,8 @@ Object.defineProperty(exports, "signMessage", { enumerable: true, get: function
31
31
  Object.defineProperty(exports, "signTransaction", { enumerable: true, get: function () { return signer_1.signTransaction; } });
32
32
  /** utils exports */
33
33
  var getShortenTxHash_1 = require("./utils/getShortenTxHash");
34
- Object.defineProperty(exports, "getShortenTransactionHash", { enumerable: true, get: function () { return getShortenTxHash_1.getShortenTransactionHash; } });
34
+ Object.defineProperty(exports, "getShortenTransactionHashOrAddress", { enumerable: true, get: function () { return getShortenTxHash_1.getShortenTransactionHashOrAddress; } });
35
+ Object.defineProperty(exports, "getShortenData", { enumerable: true, get: function () { return getShortenTxHash_1.getShortenData; } });
35
36
  var transformBigInt_1 = require("./utils/transformBigInt");
36
37
  Object.defineProperty(exports, "transformBigInt", { enumerable: true, get: function () { return transformBigInt_1.transformBigInt; } });
37
38
  const tokens_1 = __importDefault(require("./utils/tokens"));
@@ -39,3 +40,7 @@ exports.NATIVE_TOKENS = tokens_1.default;
39
40
  var formatAmount_1 = require("./utils/formatAmount");
40
41
  Object.defineProperty(exports, "formattedAmountForDisplay", { enumerable: true, get: function () { return formatAmount_1.formattedAmountForDisplay; } });
41
42
  Object.defineProperty(exports, "parsedAmount", { enumerable: true, get: function () { return formatAmount_1.parsedAmount; } });
43
+ var handleErrorMessages_1 = require("./utils/handleErrorMessages");
44
+ Object.defineProperty(exports, "handleErrorMessages", { enumerable: true, get: function () { return handleErrorMessages_1.handleErrorMessages; } });
45
+ Object.defineProperty(exports, "errorMessagesForBroadcast", { enumerable: true, get: function () { return handleErrorMessages_1.errorMessagesForBroadcast; } });
46
+ Object.defineProperty(exports, "errorMessagesForGasLimitEstimation", { enumerable: true, get: function () { return handleErrorMessages_1.errorMessagesForGasLimitEstimation; } });
@@ -1 +1,2 @@
1
- export declare const getShortenTransactionHash: (txHash: string) => string;
1
+ export declare const getShortenTransactionHashOrAddress: (txHashOrAddress: string) => string;
2
+ export declare const getShortenData: (data: string) => string;
@@ -1,9 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getShortenTransactionHash = void 0;
4
- const getShortenTransactionHash = (txHash) => {
5
- const firstCharacters = txHash.substring(0, 6);
6
- const lastCharacters = txHash.slice(-4);
3
+ exports.getShortenData = exports.getShortenTransactionHashOrAddress = void 0;
4
+ const getShortenTransactionHashOrAddress = (txHashOrAddress) => {
5
+ const firstCharacters = txHashOrAddress.substring(0, 6);
6
+ const lastCharacters = txHashOrAddress.slice(-4);
7
7
  return `${firstCharacters}...${lastCharacters}`;
8
8
  };
9
- exports.getShortenTransactionHash = getShortenTransactionHash;
9
+ exports.getShortenTransactionHashOrAddress = getShortenTransactionHashOrAddress;
10
+ const getShortenData = (data) => {
11
+ const firstCharacters = data.substring(0, 12);
12
+ const lastCharacters = data.slice(-12);
13
+ return `${firstCharacters}...${lastCharacters}`;
14
+ };
15
+ exports.getShortenData = getShortenData;
@@ -1,2 +1,9 @@
1
1
  export declare const errorMessagesForBroadcast: Record<string, string>;
2
2
  export declare const errorMessagesForGasLimitEstimation: Record<string, string>;
3
+ type HandleErrorType = {
4
+ e: any;
5
+ message: string;
6
+ };
7
+ export declare const handleErrorMessages: ({ e, message }: HandleErrorType) => void;
8
+ export declare const isEthersError: (error: any) => boolean;
9
+ export {};
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.errorMessagesForGasLimitEstimation = exports.errorMessagesForBroadcast = void 0;
3
+ exports.isEthersError = exports.handleErrorMessages = exports.errorMessagesForGasLimitEstimation = exports.errorMessagesForBroadcast = void 0;
4
+ /** local imports */
5
+ const getShortenTxHash_1 = require("./getShortenTxHash");
4
6
  exports.errorMessagesForBroadcast = {
5
7
  INSUFFICIENT_FUNDS: 'Insufficient funds for gas.',
6
8
  NONCE_EXPIRED: 'Nonce expired.',
@@ -22,4 +24,55 @@ exports.errorMessagesForGasLimitEstimation = {
22
24
  GAS_LIMIT_REACHED: 'Error: Gas estimation exceeds block gas limit.',
23
25
  UNKNOWN_ERROR: 'Unknown error.',
24
26
  };
25
- //TODO: Make methofds to parse errors and return user friendly messages based on the above records
27
+ const handleErrorMessages = ({ e, message }) => {
28
+ const timestamp = new Date().toISOString();
29
+ handleEthersError(e, timestamp);
30
+ };
31
+ exports.handleErrorMessages = handleErrorMessages;
32
+ const handleEthersError = (error, timestamp) => {
33
+ if (!(0, exports.isEthersError)(error)) {
34
+ console.log(`Non-ethers error at ${timestamp}:`, error);
35
+ return;
36
+ }
37
+ const { code, reason, transaction, info } = error;
38
+ const { to, from, data } = transaction || {};
39
+ const payloadError = info?.error?.message || 'No additional error info';
40
+ const params = info?.payload?.params || [];
41
+ console.error(`🚨 ${timestamp}: Ethers Error: ${reason || 'Unknown reason, check transaction parameters!'} (Code: ${code || 'N/A'})`);
42
+ if (transaction) {
43
+ const functionSignature = data ? data.slice(0, 10) : undefined;
44
+ if (functionSignature)
45
+ console.log(`✏️ The function signature detected is: ${functionSignature}`);
46
+ console.log(`
47
+ 📋 Transaction Details:
48
+ - From: ${from || 'N/A'}
49
+ - To: ${to || 'N/A'}
50
+ - Data: ${data ? `${(0, getShortenTxHash_1.getShortenData)(data)}` : 'N/A'}
51
+ `);
52
+ }
53
+ if (params.length > 0) {
54
+ console.log(`📊 Additional Parameters: ${params}`);
55
+ params.forEach((param, index) => {
56
+ const excludedFields = ['data', 'to', 'from'];
57
+ const processedParams = Object.fromEntries(Object.entries(param).map(([key, value]) => {
58
+ if (excludedFields.includes(key))
59
+ return [key, value];
60
+ if (typeof value === 'string' && value.startsWith('0x'))
61
+ return [key, parseInt(value, 16)];
62
+ return [key, value];
63
+ }));
64
+ console.log(`[${index}]: ${JSON.stringify(processedParams, null, 2)}`);
65
+ });
66
+ }
67
+ else
68
+ console.log('🔧 Params: No additional params provided.');
69
+ if (payloadError)
70
+ console.error(`🔍 Details: ${payloadError}`);
71
+ else
72
+ console.error('No further details available.');
73
+ };
74
+ const isEthersError = (error) => error &&
75
+ typeof error === 'object' &&
76
+ (error.code || error.action || error.transaction) &&
77
+ error.constructor?.name?.includes('Error');
78
+ exports.isEthersError = isEthersError;
package/dist/index.d.ts CHANGED
@@ -14,10 +14,11 @@ export { EvmWalletService, EvmGeneratedWallet, EvmDerivedWallet, } from './servi
14
14
  export { EntropySource } from './services/evm-wallet-core/entropy';
15
15
  export { createWallet, signMessage, signTransaction } from './services/evm-wallet-core/signer';
16
16
  /** utils exports */
17
- export { getShortenTransactionHash } from './utils/getShortenTxHash';
17
+ export { getShortenTransactionHashOrAddress, getShortenData } from './utils/getShortenTxHash';
18
18
  export { transformBigInt } from './utils/transformBigInt';
19
19
  import NATIVE_TOKENS from './utils/tokens';
20
20
  export { NATIVE_TOKENS };
21
21
  export { formattedAmountForDisplay, parsedAmount } from './utils/formatAmount';
22
+ export { handleErrorMessages, errorMessagesForBroadcast, errorMessagesForGasLimitEstimation, } from './utils/handleErrorMessages';
22
23
  /** types exports */
23
24
  export { BroadcastTransactionOptions, BuildMaxNativeTransferTxOptions, BuildMaxNativeTransferTxResponse, BuildUnsignedTransferTxOptions, EstimateGasLimitFromProviderProps, GasEstimateResult, TxStatusOptions, TxStatusResponse, UnsignedTransferTxResponse, FormatAmountOptions, TransactionRequest, } from './types/common';
package/dist/index.js CHANGED
@@ -13,8 +13,9 @@ export { txStatus } from './blockchain/txStatus';
13
13
  export { EvmWalletService, } from './services/evm-wallet-core/evmWalletService';
14
14
  export { createWallet, signMessage, signTransaction } from './services/evm-wallet-core/signer';
15
15
  /** utils exports */
16
- export { getShortenTransactionHash } from './utils/getShortenTxHash';
16
+ export { getShortenTransactionHashOrAddress, getShortenData } from './utils/getShortenTxHash';
17
17
  export { transformBigInt } from './utils/transformBigInt';
18
18
  import NATIVE_TOKENS from './utils/tokens';
19
19
  export { NATIVE_TOKENS };
20
20
  export { formattedAmountForDisplay, parsedAmount } from './utils/formatAmount';
21
+ export { handleErrorMessages, errorMessagesForBroadcast, errorMessagesForGasLimitEstimation, } from './utils/handleErrorMessages';
@@ -1 +1,2 @@
1
- export declare const getShortenTransactionHash: (txHash: string) => string;
1
+ export declare const getShortenTransactionHashOrAddress: (txHashOrAddress: string) => string;
2
+ export declare const getShortenData: (data: string) => string;
@@ -1,5 +1,10 @@
1
- export const getShortenTransactionHash = (txHash) => {
2
- const firstCharacters = txHash.substring(0, 6);
3
- const lastCharacters = txHash.slice(-4);
1
+ export const getShortenTransactionHashOrAddress = (txHashOrAddress) => {
2
+ const firstCharacters = txHashOrAddress.substring(0, 6);
3
+ const lastCharacters = txHashOrAddress.slice(-4);
4
+ return `${firstCharacters}...${lastCharacters}`;
5
+ };
6
+ export const getShortenData = (data) => {
7
+ const firstCharacters = data.substring(0, 12);
8
+ const lastCharacters = data.slice(-12);
4
9
  return `${firstCharacters}...${lastCharacters}`;
5
10
  };
@@ -1,2 +1,9 @@
1
1
  export declare const errorMessagesForBroadcast: Record<string, string>;
2
2
  export declare const errorMessagesForGasLimitEstimation: Record<string, string>;
3
+ type HandleErrorType = {
4
+ e: any;
5
+ message: string;
6
+ };
7
+ export declare const handleErrorMessages: ({ e, message }: HandleErrorType) => void;
8
+ export declare const isEthersError: (error: any) => boolean;
9
+ export {};
@@ -1,3 +1,5 @@
1
+ /** local imports */
2
+ import { getShortenData } from './getShortenTxHash';
1
3
  export const errorMessagesForBroadcast = {
2
4
  INSUFFICIENT_FUNDS: 'Insufficient funds for gas.',
3
5
  NONCE_EXPIRED: 'Nonce expired.',
@@ -19,4 +21,53 @@ export const errorMessagesForGasLimitEstimation = {
19
21
  GAS_LIMIT_REACHED: 'Error: Gas estimation exceeds block gas limit.',
20
22
  UNKNOWN_ERROR: 'Unknown error.',
21
23
  };
22
- //TODO: Make methofds to parse errors and return user friendly messages based on the above records
24
+ export const handleErrorMessages = ({ e, message }) => {
25
+ const timestamp = new Date().toISOString();
26
+ handleEthersError(e, timestamp);
27
+ };
28
+ const handleEthersError = (error, timestamp) => {
29
+ if (!isEthersError(error)) {
30
+ console.log(`Non-ethers error at ${timestamp}:`, error);
31
+ return;
32
+ }
33
+ const { code, reason, transaction, info } = error;
34
+ const { to, from, data } = transaction || {};
35
+ const payloadError = info?.error?.message || 'No additional error info';
36
+ const params = info?.payload?.params || [];
37
+ console.error(`🚨 ${timestamp}: Ethers Error: ${reason || 'Unknown reason, check transaction parameters!'} (Code: ${code || 'N/A'})`);
38
+ if (transaction) {
39
+ const functionSignature = data ? data.slice(0, 10) : undefined;
40
+ if (functionSignature)
41
+ console.log(`✏️ The function signature detected is: ${functionSignature}`);
42
+ console.log(`
43
+ 📋 Transaction Details:
44
+ - From: ${from || 'N/A'}
45
+ - To: ${to || 'N/A'}
46
+ - Data: ${data ? `${getShortenData(data)}` : 'N/A'}
47
+ `);
48
+ }
49
+ if (params.length > 0) {
50
+ console.log(`📊 Additional Parameters: ${params}`);
51
+ params.forEach((param, index) => {
52
+ const excludedFields = ['data', 'to', 'from'];
53
+ const processedParams = Object.fromEntries(Object.entries(param).map(([key, value]) => {
54
+ if (excludedFields.includes(key))
55
+ return [key, value];
56
+ if (typeof value === 'string' && value.startsWith('0x'))
57
+ return [key, parseInt(value, 16)];
58
+ return [key, value];
59
+ }));
60
+ console.log(`[${index}]: ${JSON.stringify(processedParams, null, 2)}`);
61
+ });
62
+ }
63
+ else
64
+ console.log('🔧 Params: No additional params provided.');
65
+ if (payloadError)
66
+ console.error(`🔍 Details: ${payloadError}`);
67
+ else
68
+ console.error('No further details available.');
69
+ };
70
+ export const isEthersError = (error) => error &&
71
+ typeof error === 'object' &&
72
+ (error.code || error.action || error.transaction) &&
73
+ error.constructor?.name?.includes('Error');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@octaflowlabs/onchain-sdk",
3
- "version": "1.1.1",
3
+ "version": "1.1.3",
4
4
  "description": "onchain methods for web3",
5
5
  "repository": "https://github.com/crisramb665/onchain-sdk.git",
6
6
  "license": "MIT",