@octaflowlabs/onchain-sdk 1.1.0 → 1.1.1
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.
|
@@ -4,7 +4,6 @@ import { Interface, formatUnits, parseUnits } from 'ethers';
|
|
|
4
4
|
import { getProvider } from './getProvider';
|
|
5
5
|
import { estimateGasLimitFromProvider } from './estimateGasLimitFromProvider';
|
|
6
6
|
export const buildUnsignedTransferTx = async (options) => {
|
|
7
|
-
console.log({ options });
|
|
8
7
|
const provider = getProvider(options.rpcUrl, options.chainId);
|
|
9
8
|
if (!provider)
|
|
10
9
|
throw new Error('Could not create provider with given rpcUrl and chainId');
|
|
@@ -66,7 +65,6 @@ export const buildUnsignedTransferTx = async (options) => {
|
|
|
66
65
|
: estimateGas.feeData.gasPrice
|
|
67
66
|
? estimateGas.gasLimit * estimateGas.feeData.gasPrice
|
|
68
67
|
: undefined;
|
|
69
|
-
console.log({ gasReserve: gasReserve?.toString() });
|
|
70
68
|
try {
|
|
71
69
|
await provider.call({
|
|
72
70
|
from: options.fromAddress,
|
|
@@ -79,7 +77,6 @@ export const buildUnsignedTransferTx = async (options) => {
|
|
|
79
77
|
catch (error) {
|
|
80
78
|
throw new Error('Transaction would revert, provider call unsuccessful: ' + error.message || error);
|
|
81
79
|
}
|
|
82
|
-
console.log('Built unsigned transfer transaction:', unsignedTxToReturn);
|
|
83
80
|
return {
|
|
84
81
|
unsignedTx: unsignedTxToReturn,
|
|
85
82
|
nonce,
|
|
@@ -11,7 +11,6 @@ export const estimateGasLimitFromProvider = async ({ provider, unsignedTx, walle
|
|
|
11
11
|
txForEstimation.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;
|
|
12
12
|
if (feeData.gasPrice !== undefined && txForEstimation.maxFeePerGas === undefined)
|
|
13
13
|
txForEstimation.gasPrice = feeData.gasPrice;
|
|
14
|
-
console.log('Estimating gas with transaction:!!!!!! ', txForEstimation);
|
|
15
14
|
const gasEstimated = await provider.estimateGas(txForEstimation);
|
|
16
15
|
lastGasEstimated = gasEstimated;
|
|
17
16
|
let congestionFactor = 1.5;
|
|
@@ -7,7 +7,6 @@ const ethers_1 = require("ethers");
|
|
|
7
7
|
const getProvider_1 = require("./getProvider");
|
|
8
8
|
const estimateGasLimitFromProvider_1 = require("./estimateGasLimitFromProvider");
|
|
9
9
|
const buildUnsignedTransferTx = async (options) => {
|
|
10
|
-
console.log({ options });
|
|
11
10
|
const provider = (0, getProvider_1.getProvider)(options.rpcUrl, options.chainId);
|
|
12
11
|
if (!provider)
|
|
13
12
|
throw new Error('Could not create provider with given rpcUrl and chainId');
|
|
@@ -69,7 +68,6 @@ const buildUnsignedTransferTx = async (options) => {
|
|
|
69
68
|
: estimateGas.feeData.gasPrice
|
|
70
69
|
? estimateGas.gasLimit * estimateGas.feeData.gasPrice
|
|
71
70
|
: undefined;
|
|
72
|
-
console.log({ gasReserve: gasReserve?.toString() });
|
|
73
71
|
try {
|
|
74
72
|
await provider.call({
|
|
75
73
|
from: options.fromAddress,
|
|
@@ -82,7 +80,6 @@ const buildUnsignedTransferTx = async (options) => {
|
|
|
82
80
|
catch (error) {
|
|
83
81
|
throw new Error('Transaction would revert, provider call unsuccessful: ' + error.message || error);
|
|
84
82
|
}
|
|
85
|
-
console.log('Built unsigned transfer transaction:', unsignedTxToReturn);
|
|
86
83
|
return {
|
|
87
84
|
unsignedTx: unsignedTxToReturn,
|
|
88
85
|
nonce,
|
|
@@ -14,7 +14,6 @@ const estimateGasLimitFromProvider = async ({ provider, unsignedTx, walletAddres
|
|
|
14
14
|
txForEstimation.maxPriorityFeePerGas = feeData.maxPriorityFeePerGas;
|
|
15
15
|
if (feeData.gasPrice !== undefined && txForEstimation.maxFeePerGas === undefined)
|
|
16
16
|
txForEstimation.gasPrice = feeData.gasPrice;
|
|
17
|
-
console.log('Estimating gas with transaction:!!!!!! ', txForEstimation);
|
|
18
17
|
const gasEstimated = await provider.estimateGas(txForEstimation);
|
|
19
18
|
lastGasEstimated = gasEstimated;
|
|
20
19
|
let congestionFactor = 1.5;
|