@requestnetwork/utils 0.36.1-next.1929 → 0.36.1-next.1930

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/index.d.ts CHANGED
@@ -6,7 +6,7 @@ export { minBigNumber, maxBigNumber } from './bignumber';
6
6
  export { cachedThrottle } from './cached-throttle';
7
7
  export { decryptWithAes256cbc, decryptWithAes256gcm, encryptWithAes256cbc, encryptWithAes256gcm, random32Bytes, ecDecrypt, ecEncrypt, getAddressFromPrivateKey, getAddressFromPublicKey, ecRecover, ecSign, generate32BufferKey, generate8randomBytes, keccak256Hash, last20bytesOfNormalizedKeccak256Hash, normalize, normalizeKeccak256Hash, } from './crypto';
8
8
  export { decrypt, encrypt, getIdentityFromEncryptionParams } from './encryption';
9
- export { estimateGasFees } from './estimate-gas-fees';
9
+ export { normalizeGasFees } from './normalize-gas-fees';
10
10
  export { areEqualIdentities, identityHasError, normalizeIdentityValue, supportedIdentities, } from './identity';
11
11
  export { setProviderFactory, initPaymentDetectionApiKeys, isEip1559Supported, getDefaultProvider, getCeloProvider, networkRpcs, } from './providers';
12
12
  export { retry } from './retry';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,SAAS,EACT,wBAAwB,EACxB,uBAAuB,EACvB,SAAS,EACT,MAAM,EACN,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,oCAAoC,EACpC,SAAS,EACT,sBAAsB,GAC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E,OAAO,EAAE,+BAA+B,EAAE,MAAM,cAAc,CAAC;AAEjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,GACpB,MAAM,YAAY,CAAC;AAEpB,OAAO,EACL,kBAAkB,EAClB,2BAA2B,EAC3B,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,WAAW,GACZ,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,OAAO,EAAE,8BAA8B,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAElF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EACL,QAAQ,EACR,QAAQ,EACR,uBAAuB,EACvB,2BAA2B,EAC3B,QAAQ,EACR,cAAc,EACd,MAAM,EACN,gBAAgB,EAChB,OAAO,GACR,MAAM,SAAS,CAAC"}
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * Collection of general purpose utility function
4
4
  */
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.uniqueByProperty = exports.unique = exports.timeoutPromise = exports.isString = exports.getCurrentTimestampInSecond = exports.flatten2DimensionsArray = exports.deepSort = exports.deepCopy = exports.SimpleLogger = exports.sign = exports.recoverSigner = exports.getIdentityFromSignatureParams = exports.retry = exports.networkRpcs = exports.getCeloProvider = exports.getDefaultProvider = exports.isEip1559Supported = exports.initPaymentDetectionApiKeys = exports.setProviderFactory = exports.supportedIdentities = exports.normalizeIdentityValue = exports.identityHasError = exports.areEqualIdentities = exports.estimateGasFees = exports.getIdentityFromEncryptionParams = exports.encrypt = exports.decrypt = exports.normalizeKeccak256Hash = exports.normalize = exports.last20bytesOfNormalizedKeccak256Hash = exports.keccak256Hash = exports.generate8randomBytes = exports.generate32BufferKey = exports.ecSign = exports.ecRecover = exports.getAddressFromPublicKey = exports.getAddressFromPrivateKey = exports.ecEncrypt = exports.ecDecrypt = exports.random32Bytes = exports.encryptWithAes256gcm = exports.encryptWithAes256cbc = exports.decryptWithAes256gcm = exports.decryptWithAes256cbc = exports.cachedThrottle = exports.maxBigNumber = exports.minBigNumber = exports.reduceAmount = exports.isValidAmount = exports.addAmount = void 0;
6
+ exports.uniqueByProperty = exports.unique = exports.timeoutPromise = exports.isString = exports.getCurrentTimestampInSecond = exports.flatten2DimensionsArray = exports.deepSort = exports.deepCopy = exports.SimpleLogger = exports.sign = exports.recoverSigner = exports.getIdentityFromSignatureParams = exports.retry = exports.networkRpcs = exports.getCeloProvider = exports.getDefaultProvider = exports.isEip1559Supported = exports.initPaymentDetectionApiKeys = exports.setProviderFactory = exports.supportedIdentities = exports.normalizeIdentityValue = exports.identityHasError = exports.areEqualIdentities = exports.normalizeGasFees = exports.getIdentityFromEncryptionParams = exports.encrypt = exports.decrypt = exports.normalizeKeccak256Hash = exports.normalize = exports.last20bytesOfNormalizedKeccak256Hash = exports.keccak256Hash = exports.generate8randomBytes = exports.generate32BufferKey = exports.ecSign = exports.ecRecover = exports.getAddressFromPublicKey = exports.getAddressFromPrivateKey = exports.ecEncrypt = exports.ecDecrypt = exports.random32Bytes = exports.encryptWithAes256gcm = exports.encryptWithAes256cbc = exports.decryptWithAes256gcm = exports.decryptWithAes256cbc = exports.cachedThrottle = exports.maxBigNumber = exports.minBigNumber = exports.reduceAmount = exports.isValidAmount = exports.addAmount = void 0;
7
7
  exports.notNull = void 0;
8
8
  var amount_1 = require("./amount");
9
9
  Object.defineProperty(exports, "addAmount", { enumerable: true, get: function () { return amount_1.addAmount; } });
@@ -36,8 +36,8 @@ var encryption_1 = require("./encryption");
36
36
  Object.defineProperty(exports, "decrypt", { enumerable: true, get: function () { return encryption_1.decrypt; } });
37
37
  Object.defineProperty(exports, "encrypt", { enumerable: true, get: function () { return encryption_1.encrypt; } });
38
38
  Object.defineProperty(exports, "getIdentityFromEncryptionParams", { enumerable: true, get: function () { return encryption_1.getIdentityFromEncryptionParams; } });
39
- var estimate_gas_fees_1 = require("./estimate-gas-fees");
40
- Object.defineProperty(exports, "estimateGasFees", { enumerable: true, get: function () { return estimate_gas_fees_1.estimateGasFees; } });
39
+ var normalize_gas_fees_1 = require("./normalize-gas-fees");
40
+ Object.defineProperty(exports, "normalizeGasFees", { enumerable: true, get: function () { return normalize_gas_fees_1.normalizeGasFees; } });
41
41
  var identity_1 = require("./identity");
42
42
  Object.defineProperty(exports, "areEqualIdentities", { enumerable: true, get: function () { return identity_1.areEqualIdentities; } });
43
43
  Object.defineProperty(exports, "identityHasError", { enumerable: true, get: function () { return identity_1.identityHasError; } });
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAEH,mCAAkE;AAAzD,mGAAA,SAAS,OAAA;AAAE,uGAAA,aAAa,OAAA;AAAE,sGAAA,YAAY,OAAA;AAE/C,yCAAyD;AAAhD,yGAAA,YAAY,OAAA;AAAE,yGAAA,YAAY,OAAA;AAEnC,qDAAmD;AAA1C,iHAAA,cAAc,OAAA;AAEvB,mCAkBkB;AAjBhB,8GAAA,oBAAoB,OAAA;AACpB,8GAAA,oBAAoB,OAAA;AACpB,8GAAA,oBAAoB,OAAA;AACpB,8GAAA,oBAAoB,OAAA;AACpB,uGAAA,aAAa,OAAA;AACb,mGAAA,SAAS,OAAA;AACT,mGAAA,SAAS,OAAA;AACT,kHAAA,wBAAwB,OAAA;AACxB,iHAAA,uBAAuB,OAAA;AACvB,mGAAA,SAAS,OAAA;AACT,gGAAA,MAAM,OAAA;AACN,6GAAA,mBAAmB,OAAA;AACnB,8GAAA,oBAAoB,OAAA;AACpB,uGAAA,aAAa,OAAA;AACb,8HAAA,oCAAoC,OAAA;AACpC,mGAAA,SAAS,OAAA;AACT,gHAAA,sBAAsB,OAAA;AAGxB,2CAAiF;AAAxE,qGAAA,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 @@
1
+ import { BigNumber } from 'ethers';
2
+ import { LogTypes, FeeTypes } from '@requestnetwork/types';
3
+ /**
4
+ * The function estimates gas fee with EIP-1559.
5
+ * @returns an object containing:
6
+ * - maxFeePerGas: The maximum fee per unit of gas for this transaction.
7
+ * maxFeePerGas = baseFeePerGas + maxPriorityFeePerGas
8
+ * The baseFeePerGas depends on how full the previous blocks were.
9
+ * - maxPriorityFeePerGas: The maximum priority fee per unit of gas for this transaction.
10
+ */
11
+ declare function normalizeGasFees({ logger, gasPriceMin, suggestFees, }: {
12
+ logger: LogTypes.ILogger;
13
+ gasPriceMin?: BigNumber;
14
+ suggestFees: () => Promise<FeeTypes.SuggestedFees>;
15
+ }): Promise<FeeTypes.EstimatedGasFees>;
16
+ export { normalizeGasFees };
17
+ //# sourceMappingURL=normalize-gas-fees.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-gas-fees.d.ts","sourceRoot":"","sources":["../src/normalize-gas-fees.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,MAAM,QAAQ,CAAC;AAG9C,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE3D;;;;;;;GAOG;AACH,iBAAe,gBAAgB,CAAC,EAC9B,MAAM,EACN,WAAW,EACX,WAAW,GACZ,EAAE;IACD,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,WAAW,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC;CACpD,GAAG,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CA2BrC;AAED,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,29 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.estimateGasFees = void 0;
3
+ exports.normalizeGasFees = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ethers_1 = require("ethers");
6
- const fee_suggestions_1 = require("@rainbow-me/fee-suggestions");
7
6
  const index_1 = require("./index");
8
7
  /**
9
8
  * The function estimates gas fee with EIP-1559.
10
- * @param provider Generic provider.
11
- * @param gasPriceMin Minimum gas price to return.
12
9
  * @returns an object containing:
13
10
  * - maxFeePerGas: The maximum fee per unit of gas for this transaction.
14
11
  * maxFeePerGas = baseFeePerGas + maxPriorityFeePerGas
15
12
  * The baseFeePerGas depends on how full the previous blocks were.
16
13
  * - maxPriorityFeePerGas: The maximum priority fee per unit of gas for this transaction.
17
14
  */
18
- function estimateGasFees({ logger, provider, gasPriceMin, }) {
15
+ function normalizeGasFees({ logger, gasPriceMin, suggestFees, }) {
19
16
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
20
17
  try {
21
- const suggestedFee = yield (0, fee_suggestions_1.suggestFees)(provider);
22
- const baseFee = (0, index_1.maxBigNumber)(suggestedFee.baseFeeSuggestion, gasPriceMin || ethers_1.constants.Zero);
23
- const maxPriorityFeePerGas = (0, index_1.maxBigNumber)(suggestedFee.maxPriorityFeeSuggestions.urgent, gasPriceMin || ethers_1.constants.Zero);
18
+ const suggestedFee = yield suggestFees();
19
+ const baseFee = (0, index_1.maxBigNumber)(suggestedFee.baseFee, gasPriceMin || ethers_1.constants.Zero);
20
+ const maxPriorityFeePerGas = (0, index_1.maxBigNumber)(suggestedFee.maxPriorityFee, gasPriceMin || ethers_1.constants.Zero);
24
21
  const maxFeePerGas = baseFee.add(maxPriorityFeePerGas);
25
22
  if (maxPriorityFeePerGas.eq(0) || maxFeePerGas.eq(0)) {
26
- logger.warn(`estimateGasFees: maxPriorityFeePerGas or maxFeePerGas too low (maxPriorityFeePerGas: ${maxPriorityFeePerGas.toString()} / maxFeePerGas: ${maxFeePerGas.toString()})`);
23
+ logger.warn(`normalizeGasFees: maxPriorityFeePerGas or maxFeePerGas too low (maxPriorityFeePerGas: ${maxPriorityFeePerGas.toString()} / maxFeePerGas: ${maxFeePerGas.toString()})`);
27
24
  return {};
28
25
  }
29
26
  return {
@@ -32,10 +29,10 @@ function estimateGasFees({ logger, provider, gasPriceMin, }) {
32
29
  };
33
30
  }
34
31
  catch (e) {
35
- logger.error(`estimateGasFees error: ${e}`);
32
+ logger.error(`normalizeGasFees error: ${e}`);
36
33
  return {};
37
34
  }
38
35
  });
39
36
  }
40
- exports.estimateGasFees = estimateGasFees;
41
- //# sourceMappingURL=estimate-gas-fees.js.map
37
+ exports.normalizeGasFees = normalizeGasFees;
38
+ //# sourceMappingURL=normalize-gas-fees.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-gas-fees.js","sourceRoot":"","sources":["../src/normalize-gas-fees.ts"],"names":[],"mappings":";;;;AAAA,mCAA8C;AAE9C,mCAAuC;AAGvC;;;;;;;GAOG;AACH,SAAe,gBAAgB,CAAC,EAC9B,MAAM,EACN,WAAW,EACX,WAAW,GAKZ;;QACC,IAAI;YACF,MAAM,YAAY,GAAG,MAAM,WAAW,EAAE,CAAC;YAEzC,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,YAAY,CAAC,OAAO,EAAE,WAAW,IAAI,kBAAS,CAAC,IAAI,CAAC,CAAC;YAElF,MAAM,oBAAoB,GAAG,IAAA,oBAAY,EACvC,YAAY,CAAC,cAAc,EAC3B,WAAW,IAAI,kBAAS,CAAC,IAAI,CAC9B,CAAC;YACF,MAAM,YAAY,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAC;YAEvD,IAAI,oBAAoB,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE;gBACpD,MAAM,CAAC,IAAI,CACT,yFAAyF,oBAAoB,CAAC,QAAQ,EAAE,oBAAoB,YAAY,CAAC,QAAQ,EAAE,GAAG,CACvK,CAAC;gBACF,OAAO,EAAE,CAAC;aACX;YAED,OAAO;gBACL,oBAAoB;gBACpB,YAAY;aACb,CAAC;SACH;QAAC,OAAO,CAAC,EAAE;YACV,MAAM,CAAC,KAAK,CAAC,2BAA2B,CAAC,EAAE,CAAC,CAAC;YAC7C,OAAO,EAAE,CAAC;SACX;IACH,CAAC;CAAA;AAEQ,4CAAgB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@requestnetwork/utils",
3
- "version": "0.36.1-next.1929+67411989",
3
+ "version": "0.36.1-next.1930+a7b50433",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -40,8 +40,7 @@
40
40
  "test:watch": "yarn test --watch"
41
41
  },
42
42
  "dependencies": {
43
- "@rainbow-me/fee-suggestions": "2.1.0",
44
- "@requestnetwork/types": "0.36.1-next.1929+67411989",
43
+ "@requestnetwork/types": "0.36.1-next.1930+a7b50433",
45
44
  "eccrypto": "1.1.6",
46
45
  "ethers": "5.5.1",
47
46
  "secp256k1": "4.0.2",
@@ -57,5 +56,5 @@
57
56
  "ts-node": "10.9.1",
58
57
  "typescript": "4.9.5"
59
58
  },
60
- "gitHead": "674119895847bdfa9207c177b44e956cb07a0437"
59
+ "gitHead": "a7b50433d005eeaa6a353040357623ebc828b641"
61
60
  }
@@ -1,22 +0,0 @@
1
- import { BigNumber, providers } from 'ethers';
2
- import { LogTypes } from '@requestnetwork/types';
3
- /**
4
- * The function estimates gas fee with EIP-1559.
5
- * @param provider Generic provider.
6
- * @param gasPriceMin Minimum gas price to return.
7
- * @returns an object containing:
8
- * - maxFeePerGas: The maximum fee per unit of gas for this transaction.
9
- * maxFeePerGas = baseFeePerGas + maxPriorityFeePerGas
10
- * The baseFeePerGas depends on how full the previous blocks were.
11
- * - maxPriorityFeePerGas: The maximum priority fee per unit of gas for this transaction.
12
- */
13
- declare function estimateGasFees({ logger, provider, gasPriceMin, }: {
14
- logger: LogTypes.ILogger;
15
- provider: providers.Provider | providers.JsonRpcProvider;
16
- gasPriceMin?: BigNumber;
17
- }): Promise<{
18
- maxFeePerGas?: BigNumber;
19
- maxPriorityFeePerGas?: BigNumber;
20
- }>;
21
- export { estimateGasFees };
22
- //# sourceMappingURL=estimate-gas-fees.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"estimate-gas-fees.d.ts","sourceRoot":"","sources":["../src/estimate-gas-fees.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAa,SAAS,EAAE,MAAM,QAAQ,CAAC;AAGzD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjD;;;;;;;;;GASG;AACH,iBAAe,eAAe,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,WAAW,GACZ,EAAE;IACD,MAAM,EAAE,QAAQ,CAAC,OAAO,CAAC;IACzB,QAAQ,EAAE,SAAS,CAAC,QAAQ,GAAG,SAAS,CAAC,eAAe,CAAC;IACzD,WAAW,CAAC,EAAE,SAAS,CAAC;CACzB,GAAG,OAAO,CAAC;IACV,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,oBAAoB,CAAC,EAAE,SAAS,CAAC;CAClC,CAAC,CA2BD;AAED,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"estimate-gas-fees.js","sourceRoot":"","sources":["../src/estimate-gas-fees.ts"],"names":[],"mappings":";;;;AAAA,mCAAyD;AACzD,iEAA0D;AAC1D,mCAAuC;AAGvC;;;;;;;;;GASG;AACH,SAAe,eAAe,CAAC,EAC7B,MAAM,EACN,QAAQ,EACR,WAAW,GAKZ;;QAIC,IAAI;YACF,MAAM,YAAY,GAAG,MAAM,IAAA,6BAAW,EAAC,QAAqC,CAAC,CAAC;YAE9E,MAAM,OAAO,GAAG,IAAA,oBAAY,EAAC,YAAY,CAAC,iBAAiB,EAAE,WAAW,IAAI,kBAAS,CAAC,IAAI,CAAC,CAAC;YAE5F,MAAM,oBAAoB,GAAG,IAAA,oBAAY,EACvC,YAAY,CAAC,yBAAyB,CAAC,MAAM,EAC7C,WAAW,IAAI,kBAAS,CAAC,IAAI,CAC9B,CAAC;YACF,MA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