@railgun-community/shared-models 2.0.4 → 2.0.5

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/dist/utils/gas.js CHANGED
@@ -13,8 +13,7 @@ var calculateGasPrice = function (gasDetails) {
13
13
  return gasDetails.gasPrice;
14
14
  }
15
15
  case network_config_1.EVMGasType.Type2: {
16
- var maxFeePerGas = gasDetails.maxFeePerGas, maxPriorityFeePerGas = gasDetails.maxPriorityFeePerGas;
17
- return maxFeePerGas.add(maxPriorityFeePerGas);
16
+ return gasDetails.maxFeePerGas;
18
17
  }
19
18
  }
20
19
  };
@@ -1 +1 @@
1
- {"version":3,"file":"gas.js","sourceRoot":"","sources":["../../src/utils/gas.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AAG/C,IAAM,iBAAiB,GAAG,UAAC,WAAsB;IACtD,sCAAsC;IACtC,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC,CAAC;AAHW,QAAA,iBAAiB,qBAG5B;AAEK,IAAM,iBAAiB,GAAG,UAAC,UAAiC;IACjE,QAAQ,UAAU,CAAC,UAAU,EAAE;QAC7B,KAAK,2BAAU,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,UAAU,CAAC,QAAQ,CAAC;SAC5B;QACD,KAAK,2BAAU,CAAC,KAAK,CAAC,CAAC;YACb,IAAA,YAAY,GAA2B,UAAU,aAArC,EAAE,oBAAoB,GAAK,UAAU,qBAAf,CAAgB;YAC1D,OAAO,YAAY,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;SAC/C;KACF;AACH,CAAC,CAAC;AAVW,QAAA,iBAAiB,qBAU5B;AAEK,IAAM,iBAAiB,GAAG,UAC/B,qBAA4C;IAE5C,IAAM,QAAQ,GAAG,IAAA,yBAAiB,EAAC,qBAAqB,CAAC,CAAC;IAClD,IAAA,WAAW,GAAK,qBAAqB,YAA1B,CAA2B;IAC9C,OAAO,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC,CAAC;AANW,QAAA,iBAAiB,qBAM5B;AAEK,IAAM,mBAAmB,GAAG,UACjC,qBAA4C;IAE5C,IAAM,QAAQ,GAAG,IAAA,yBAAiB,EAAC,qBAAqB,CAAC,CAAC;IAClD,IAAA,WAAW,GAAK,qBAAqB,YAA1B,CAA2B;IAC9C,OAAO,IAAA,yBAAiB,EAAC,WAAW,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B","sourcesContent":["import { BigNumber } from '@ethersproject/bignumber';\nimport { EVMGasType } from '../models/network-config';\nimport { TransactionGasDetails } from '../models/response-types';\n\nexport const calculateGasLimit = (gasEstimate: BigNumber): BigNumber => {\n // Gas Limit: Add 20% to gas estimate.\n return gasEstimate.mul(12000).div(10000);\n};\n\nexport const calculateGasPrice = (gasDetails: TransactionGasDetails) => {\n switch (gasDetails.evmGasType) {\n case EVMGasType.Type0: {\n return gasDetails.gasPrice;\n }\n case EVMGasType.Type2: {\n const { maxFeePerGas, maxPriorityFeePerGas } = gasDetails;\n return maxFeePerGas.add(maxPriorityFeePerGas);\n }\n }\n};\n\nexport const calculateTotalGas = (\n transactionGasDetails: TransactionGasDetails,\n) => {\n const gasPrice = calculateGasPrice(transactionGasDetails);\n const { gasEstimate } = transactionGasDetails;\n return gasEstimate.mul(gasPrice);\n};\n\nexport const calculateMaximumGas = (\n transactionGasDetails: TransactionGasDetails,\n): BigNumber => {\n const gasPrice = calculateGasPrice(transactionGasDetails);\n const { gasEstimate } = transactionGasDetails;\n return calculateGasLimit(gasEstimate).mul(gasPrice);\n};\n"]}
1
+ {"version":3,"file":"gas.js","sourceRoot":"","sources":["../../src/utils/gas.ts"],"names":[],"mappings":";;;AACA,2DAAsD;AAG/C,IAAM,iBAAiB,GAAG,UAAC,WAAsB;IACtD,sCAAsC;IACtC,OAAO,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;AAC3C,CAAC,CAAC;AAHW,QAAA,iBAAiB,qBAG5B;AAEK,IAAM,iBAAiB,GAAG,UAAC,UAAiC;IACjE,QAAQ,UAAU,CAAC,UAAU,EAAE;QAC7B,KAAK,2BAAU,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,UAAU,CAAC,QAAQ,CAAC;SAC5B;QACD,KAAK,2BAAU,CAAC,KAAK,CAAC,CAAC;YACrB,OAAO,UAAU,CAAC,YAAY,CAAC;SAChC;KACF;AACH,CAAC,CAAC;AATW,QAAA,iBAAiB,qBAS5B;AAEK,IAAM,iBAAiB,GAAG,UAC/B,qBAA4C;IAE5C,IAAM,QAAQ,GAAG,IAAA,yBAAiB,EAAC,qBAAqB,CAAC,CAAC;IAClD,IAAA,WAAW,GAAK,qBAAqB,YAA1B,CAA2B;IAC9C,OAAO,WAAW,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACnC,CAAC,CAAC;AANW,QAAA,iBAAiB,qBAM5B;AAEK,IAAM,mBAAmB,GAAG,UACjC,qBAA4C;IAE5C,IAAM,QAAQ,GAAG,IAAA,yBAAiB,EAAC,qBAAqB,CAAC,CAAC;IAClD,IAAA,WAAW,GAAK,qBAAqB,YAA1B,CAA2B;IAC9C,OAAO,IAAA,yBAAiB,EAAC,WAAW,CAAC,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;AACtD,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B","sourcesContent":["import { BigNumber } from '@ethersproject/bignumber';\nimport { EVMGasType } from '../models/network-config';\nimport { TransactionGasDetails } from '../models/response-types';\n\nexport const calculateGasLimit = (gasEstimate: BigNumber): BigNumber => {\n // Gas Limit: Add 20% to gas estimate.\n return gasEstimate.mul(12000).div(10000);\n};\n\nexport const calculateGasPrice = (gasDetails: TransactionGasDetails) => {\n switch (gasDetails.evmGasType) {\n case EVMGasType.Type0: {\n return gasDetails.gasPrice;\n }\n case EVMGasType.Type2: {\n return gasDetails.maxFeePerGas;\n }\n }\n};\n\nexport const calculateTotalGas = (\n transactionGasDetails: TransactionGasDetails,\n) => {\n const gasPrice = calculateGasPrice(transactionGasDetails);\n const { gasEstimate } = transactionGasDetails;\n return gasEstimate.mul(gasPrice);\n};\n\nexport const calculateMaximumGas = (\n transactionGasDetails: TransactionGasDetails,\n): BigNumber => {\n const gasPrice = calculateGasPrice(transactionGasDetails);\n const { gasEstimate } = transactionGasDetails;\n return calculateGasLimit(gasEstimate).mul(gasPrice);\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@railgun-community/shared-models",
3
- "version": "2.0.4",
3
+ "version": "2.0.5",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "files": [