@atomiqlabs/chain-starknet 4.0.0-dev.24 → 4.0.0-dev.26

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.
@@ -94,10 +94,10 @@ class StarknetPersistentSigner extends StarknetSigner_1.StarknetSigner {
94
94
  const feeRate = await this.chainInterface.Fees.getFeeRate();
95
95
  _gasPrice = StarknetFees_1.StarknetFees.extractFromFeeRateString(feeRate);
96
96
  }
97
- let l1GasCost = lastTx.details.resourceBounds.l1_gas.max_price_per_unit;
98
- let l2GasCost = lastTx.details.resourceBounds.l2_gas.max_price_per_unit;
99
- let l1DataGasCost = lastTx.details.resourceBounds.l1_data_gas.max_price_per_unit;
100
- let tip = BigInt(lastTx.details.tip);
97
+ let l1GasCost = (0, Utils_1.toBigInt)(lastTx.details.resourceBounds.l1_gas.max_price_per_unit);
98
+ let l2GasCost = (0, Utils_1.toBigInt)(lastTx.details.resourceBounds.l2_gas.max_price_per_unit);
99
+ let l1DataGasCost = (0, Utils_1.toBigInt)(lastTx.details.resourceBounds.l1_data_gas.max_price_per_unit);
100
+ let tip = (0, Utils_1.toBigInt)(lastTx.details.tip);
101
101
  let feeBumped = false;
102
102
  if (_gasPrice.l1GasCost > l1GasCost) {
103
103
  //Bump by minimum allowed or to the actual _gasPrice.l1GasCost
@@ -141,7 +141,7 @@ class StarknetPersistentSigner extends StarknetSigner_1.StarknetSigner {
141
141
  newTx.details.resourceBounds.l2_gas.max_price_per_unit = l2GasCost;
142
142
  newTx.details.resourceBounds.l1_data_gas.max_price_per_unit = l1DataGasCost;
143
143
  this.logger.info("checkPastTransactions(): Bump fee for tx: ", lastTx.txId);
144
- await this.signTransaction(newTx);
144
+ await this._signTransaction(newTx);
145
145
  //Double check pending txns still has nonce after async signTransaction was called
146
146
  if (!this.pendingTxs.has(nonce))
147
147
  continue;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/chain-starknet",
3
- "version": "4.0.0-dev.24",
3
+ "version": "4.0.0-dev.26",
4
4
  "description": "Starknet specific base implementation",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -1,7 +1,7 @@
1
1
  import {StarknetSigner} from "./StarknetSigner";
2
2
  import {StarknetTransactions, StarknetTx} from "../chain/modules/StarknetTransactions";
3
3
  import {StarknetChainInterface} from "../chain/StarknetChainInterface";
4
- import {bigIntMax, getLogger, LoggerType} from "../../utils/Utils";
4
+ import {bigIntMax, getLogger, LoggerType, toBigInt} from "../../utils/Utils";
5
5
  import {Account} from "starknet";
6
6
  import {access, readFile, writeFile, mkdir, constants} from "fs/promises";
7
7
  import {StarknetFees} from "../chain/modules/StarknetFees";
@@ -145,10 +145,10 @@ export class StarknetPersistentSigner extends StarknetSigner {
145
145
  _gasPrice = StarknetFees.extractFromFeeRateString(feeRate);
146
146
  }
147
147
 
148
- let l1GasCost = lastTx.details.resourceBounds.l1_gas.max_price_per_unit;
149
- let l2GasCost = lastTx.details.resourceBounds.l2_gas.max_price_per_unit;
150
- let l1DataGasCost = lastTx.details.resourceBounds.l1_data_gas.max_price_per_unit;
151
- let tip = BigInt(lastTx.details.tip);
148
+ let l1GasCost = toBigInt(lastTx.details.resourceBounds.l1_gas.max_price_per_unit);
149
+ let l2GasCost = toBigInt(lastTx.details.resourceBounds.l2_gas.max_price_per_unit);
150
+ let l1DataGasCost = toBigInt(lastTx.details.resourceBounds.l1_data_gas.max_price_per_unit);
151
+ let tip = toBigInt(lastTx.details.tip);
152
152
 
153
153
  let feeBumped: boolean = false;
154
154
  if(_gasPrice.l1GasCost > l1GasCost) {
@@ -196,7 +196,7 @@ export class StarknetPersistentSigner extends StarknetSigner {
196
196
  newTx.details.resourceBounds.l1_data_gas.max_price_per_unit = l1DataGasCost;
197
197
  this.logger.info("checkPastTransactions(): Bump fee for tx: ", lastTx.txId);
198
198
 
199
- await this.signTransaction(newTx);
199
+ await this._signTransaction(newTx);
200
200
 
201
201
  //Double check pending txns still has nonce after async signTransaction was called
202
202
  if(!this.pendingTxs.has(nonce)) continue;