@portal-hq/utils 0.2.19 → 0.2.21

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.
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class InvalidRpcConfigError extends Error {
4
+ constructor() {
5
+ super('[Portal] A valid RPC configuration was not provided.');
6
+ // Set the prototype explicitly.
7
+ Object.setPrototypeOf(this, InvalidRpcConfigError.prototype);
8
+ }
9
+ }
10
+ exports.default = InvalidRpcConfigError;
@@ -3,14 +3,13 @@ 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.HttpRequester = exports.HttpRequest = exports.parseRequest = exports.RpcErrorCodes = exports.ProviderRpcError = exports.NoAddressError = exports.MpcSigningError = exports.MissingOptionError = exports.InvalidGatewayConfigError = exports.InvalidChainIdError = exports.InvalidApiKeyError = exports.HttpError = exports.Storage = exports.PortalApi = exports.KeychainAdapter = exports.convert = exports.convertCryptoToLocal = exports.convertLocalToCrypto = void 0;
6
+ exports.HttpRequester = exports.HttpRequest = exports.parseRequest = exports.RpcErrorCodes = exports.ProviderRpcError = exports.NoAddressError = exports.MpcSigningError = exports.MissingOptionError = exports.InvalidGatewayConfigError = exports.InvalidChainIdError = exports.InvalidApiKeyError = exports.HttpError = exports.Storage = exports.KeychainAdapter = exports.convert = exports.convertCryptoToLocal = exports.convertLocalToCrypto = void 0;
7
7
  var currency_1 = require("./currency");
8
8
  Object.defineProperty(exports, "convertLocalToCrypto", { enumerable: true, get: function () { return currency_1.convertLocalToCrypto; } });
9
9
  Object.defineProperty(exports, "convertCryptoToLocal", { enumerable: true, get: function () { return currency_1.convertCryptoToLocal; } });
10
10
  Object.defineProperty(exports, "convert", { enumerable: true, get: function () { return currency_1.convert; } });
11
11
  var definitions_1 = require("./definitions");
12
12
  Object.defineProperty(exports, "KeychainAdapter", { enumerable: true, get: function () { return definitions_1.KeychainAdapter; } });
13
- Object.defineProperty(exports, "PortalApi", { enumerable: true, get: function () { return definitions_1.PortalApi; } });
14
13
  Object.defineProperty(exports, "Storage", { enumerable: true, get: function () { return definitions_1.Storage; } });
15
14
  var errors_1 = require("./errors");
16
15
  Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return errors_1.HttpError; } });
@@ -0,0 +1,26 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var InvalidRpcConfigError = /** @class */ (function (_super) {
17
+ __extends(InvalidRpcConfigError, _super);
18
+ function InvalidRpcConfigError() {
19
+ var _this = _super.call(this, '[Portal] A valid RPC configuration was not provided.') || this;
20
+ // Set the prototype explicitly.
21
+ Object.setPrototypeOf(_this, InvalidRpcConfigError.prototype);
22
+ return _this;
23
+ }
24
+ return InvalidRpcConfigError;
25
+ }(Error));
26
+ export default InvalidRpcConfigError;
package/lib/esm/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export { convertLocalToCrypto, convertCryptoToLocal, convert } from './currency';
2
- export { KeychainAdapter, PortalApi, Storage } from './definitions';
2
+ export { KeychainAdapter, Storage } from './definitions';
3
3
  export { HttpError, InvalidApiKeyError, InvalidChainIdError, InvalidGatewayConfigError, MissingOptionError, MpcSigningError, NoAddressError, ProviderRpcError, RpcErrorCodes, } from './errors';
4
4
  export { parseRequest } from './eth-requests';
5
5
  export { default as HttpRequest } from './http-request';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portal-hq/utils",
3
- "version": "0.2.19",
3
+ "version": "0.2.21",
4
4
  "main": "lib/commonjs/index",
5
5
  "module": "lib/esm/index",
6
6
  "source": "src/index",
@@ -12,6 +12,7 @@
12
12
  "types.d.ts"
13
13
  ],
14
14
  "scripts": {
15
+ "coverage": "jest --collect-coverage",
15
16
  "prepare": "yarn prepare:cjs && yarn prepare:esm",
16
17
  "prepare:cjs": "tsc --outDir lib/commonjs --module commonjs",
17
18
  "prepare:esm": "tsc --outDir lib/esm --module es2015 --target es2015",
package/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { convertLocalToCrypto, convertCryptoToLocal, convert } from './currency'
2
2
 
3
- export { KeychainAdapter, PortalApi, Storage } from './definitions'
3
+ export { KeychainAdapter, type PortalApi, Storage } from './definitions'
4
4
 
5
5
  export {
6
6
  HttpError,