@metamask-previews/sentinel-api-service 0.0.0-preview-d34fa10c8

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.
Files changed (70) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +6 -0
  3. package/LICENSE.APACHE2 +201 -0
  4. package/LICENSE.MIT +21 -0
  5. package/README.md +15 -0
  6. package/dist/constants.cjs +71 -0
  7. package/dist/constants.cjs.map +1 -0
  8. package/dist/constants.d.cts +63 -0
  9. package/dist/constants.d.cts.map +1 -0
  10. package/dist/constants.d.mts +63 -0
  11. package/dist/constants.d.mts.map +1 -0
  12. package/dist/constants.mjs +68 -0
  13. package/dist/constants.mjs.map +1 -0
  14. package/dist/errors.cjs +43 -0
  15. package/dist/errors.cjs.map +1 -0
  16. package/dist/errors.d.cts +27 -0
  17. package/dist/errors.d.cts.map +1 -0
  18. package/dist/errors.d.mts +27 -0
  19. package/dist/errors.d.mts.map +1 -0
  20. package/dist/errors.mjs +37 -0
  21. package/dist/errors.mjs.map +1 -0
  22. package/dist/index.cjs +17 -0
  23. package/dist/index.cjs.map +1 -0
  24. package/dist/index.d.cts +7 -0
  25. package/dist/index.d.cts.map +1 -0
  26. package/dist/index.d.mts +7 -0
  27. package/dist/index.d.mts.map +1 -0
  28. package/dist/index.mjs +5 -0
  29. package/dist/index.mjs.map +1 -0
  30. package/dist/logger.cjs +7 -0
  31. package/dist/logger.cjs.map +1 -0
  32. package/dist/logger.d.cts +5 -0
  33. package/dist/logger.d.cts.map +1 -0
  34. package/dist/logger.d.mts +5 -0
  35. package/dist/logger.d.mts.map +1 -0
  36. package/dist/logger.mjs +4 -0
  37. package/dist/logger.mjs.map +1 -0
  38. package/dist/sentinel-api-service-method-action-types.cjs +7 -0
  39. package/dist/sentinel-api-service-method-action-types.cjs.map +1 -0
  40. package/dist/sentinel-api-service-method-action-types.d.cts +62 -0
  41. package/dist/sentinel-api-service-method-action-types.d.cts.map +1 -0
  42. package/dist/sentinel-api-service-method-action-types.d.mts +62 -0
  43. package/dist/sentinel-api-service-method-action-types.d.mts.map +1 -0
  44. package/dist/sentinel-api-service-method-action-types.mjs +6 -0
  45. package/dist/sentinel-api-service-method-action-types.mjs.map +1 -0
  46. package/dist/sentinel-api-service.cjs +316 -0
  47. package/dist/sentinel-api-service.cjs.map +1 -0
  48. package/dist/sentinel-api-service.d.cts +90 -0
  49. package/dist/sentinel-api-service.d.cts.map +1 -0
  50. package/dist/sentinel-api-service.d.mts +90 -0
  51. package/dist/sentinel-api-service.d.mts.map +1 -0
  52. package/dist/sentinel-api-service.mjs +312 -0
  53. package/dist/sentinel-api-service.mjs.map +1 -0
  54. package/dist/structs.cjs +58 -0
  55. package/dist/structs.cjs.map +1 -0
  56. package/dist/structs.d.cts +63 -0
  57. package/dist/structs.d.cts.map +1 -0
  58. package/dist/structs.d.mts +63 -0
  59. package/dist/structs.d.mts.map +1 -0
  60. package/dist/structs.mjs +55 -0
  61. package/dist/structs.mjs.map +1 -0
  62. package/dist/types.cjs +36 -0
  63. package/dist/types.cjs.map +1 -0
  64. package/dist/types.d.cts +420 -0
  65. package/dist/types.d.cts.map +1 -0
  66. package/dist/types.d.mts +420 -0
  67. package/dist/types.d.mts.map +1 -0
  68. package/dist/types.mjs +33 -0
  69. package/dist/types.mjs.map +1 -0
  70. package/package.json +79 -0
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Thrown when the Sentinel API returns a JSON-RPC error object (for example
3
+ * from `infura_simulateTransactions` or `eth_sendRelayTransaction`).
4
+ */
5
+ export declare class SentinelJsonRpcError extends Error {
6
+ /** The JSON-RPC error code, if provided by the API. */
7
+ readonly code?: number;
8
+ constructor(message: string, code?: number);
9
+ }
10
+ /**
11
+ * Thrown when a Sentinel operation is requested for a chain that the API does
12
+ * not support (either not present in the network registry, or the required
13
+ * capability flag is not enabled for that chain).
14
+ */
15
+ export declare class SentinelChainNotSupportedError extends Error {
16
+ constructor(chainId: string, capability?: string);
17
+ }
18
+ /**
19
+ * Thrown when a response from the Sentinel API fails superstruct validation.
20
+ * Indicates a contract mismatch between client and server. Excluded from the
21
+ * service policy's retry filter, since retrying will not fix a malformed
22
+ * response.
23
+ */
24
+ export declare class SentinelApiResponseValidationError extends Error {
25
+ constructor(message?: string);
26
+ }
27
+ //# sourceMappingURL=errors.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.mts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,uDAAuD;IACvD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;gBAEX,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM;CAK3C;AAED;;;;GAIG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;gBAC3C,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM;CAQjD;AAED;;;;;GAKG;AACH,qBAAa,kCAAmC,SAAQ,KAAK;gBAC/C,OAAO,CAAC,EAAE,MAAM;CAI7B"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Thrown when the Sentinel API returns a JSON-RPC error object (for example
3
+ * from `infura_simulateTransactions` or `eth_sendRelayTransaction`).
4
+ */
5
+ export class SentinelJsonRpcError extends Error {
6
+ constructor(message, code) {
7
+ super(message);
8
+ this.name = 'SentinelJsonRpcError';
9
+ this.code = code;
10
+ }
11
+ }
12
+ /**
13
+ * Thrown when a Sentinel operation is requested for a chain that the API does
14
+ * not support (either not present in the network registry, or the required
15
+ * capability flag is not enabled for that chain).
16
+ */
17
+ export class SentinelChainNotSupportedError extends Error {
18
+ constructor(chainId, capability) {
19
+ super(capability
20
+ ? `Sentinel API: Does not support '${capability}' for chain ${chainId}`
21
+ : `Sentinel API: Does not support chain ${chainId}`);
22
+ this.name = 'SentinelChainNotSupportedError';
23
+ }
24
+ }
25
+ /**
26
+ * Thrown when a response from the Sentinel API fails superstruct validation.
27
+ * Indicates a contract mismatch between client and server. Excluded from the
28
+ * service policy's retry filter, since retrying will not fix a malformed
29
+ * response.
30
+ */
31
+ export class SentinelApiResponseValidationError extends Error {
32
+ constructor(message) {
33
+ super(message ?? 'Sentinel API: Malformed response received');
34
+ this.name = 'SentinelApiResponseValidationError';
35
+ }
36
+ }
37
+ //# sourceMappingURL=errors.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.mjs","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAI7C,YAAY,OAAe,EAAE,IAAa;QACxC,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,sBAAsB,CAAC;QACnC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IACvD,YAAY,OAAe,EAAE,UAAmB;QAC9C,KAAK,CACH,UAAU;YACR,CAAC,CAAC,mCAAmC,UAAU,eAAe,OAAO,EAAE;YACvE,CAAC,CAAC,wCAAwC,OAAO,EAAE,CACtD,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;IAC/C,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,kCAAmC,SAAQ,KAAK;IAC3D,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,IAAI,2CAA2C,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,oCAAoC,CAAC;IACnD,CAAC;CACF","sourcesContent":["/**\n * Thrown when the Sentinel API returns a JSON-RPC error object (for example\n * from `infura_simulateTransactions` or `eth_sendRelayTransaction`).\n */\nexport class SentinelJsonRpcError extends Error {\n /** The JSON-RPC error code, if provided by the API. */\n readonly code?: number;\n\n constructor(message: string, code?: number) {\n super(message);\n this.name = 'SentinelJsonRpcError';\n this.code = code;\n }\n}\n\n/**\n * Thrown when a Sentinel operation is requested for a chain that the API does\n * not support (either not present in the network registry, or the required\n * capability flag is not enabled for that chain).\n */\nexport class SentinelChainNotSupportedError extends Error {\n constructor(chainId: string, capability?: string) {\n super(\n capability\n ? `Sentinel API: Does not support '${capability}' for chain ${chainId}`\n : `Sentinel API: Does not support chain ${chainId}`,\n );\n this.name = 'SentinelChainNotSupportedError';\n }\n}\n\n/**\n * Thrown when a response from the Sentinel API fails superstruct validation.\n * Indicates a contract mismatch between client and server. Excluded from the\n * service policy's retry filter, since retrying will not fix a malformed\n * response.\n */\nexport class SentinelApiResponseValidationError extends Error {\n constructor(message?: string) {\n super(message ?? 'Sentinel API: Malformed response received');\n this.name = 'SentinelApiResponseValidationError';\n }\n}\n"]}
package/dist/index.cjs ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SentinelJsonRpcError = exports.SentinelChainNotSupportedError = exports.SentinelApiResponseValidationError = exports.SentinelSmartTransactionStatus = exports.SentinelKind = exports.SentinelFeature = exports.serviceName = exports.SentinelEnvironment = exports.SentinelApiService = void 0;
4
+ var sentinel_api_service_1 = require("./sentinel-api-service.cjs");
5
+ Object.defineProperty(exports, "SentinelApiService", { enumerable: true, get: function () { return sentinel_api_service_1.SentinelApiService; } });
6
+ var constants_1 = require("./constants.cjs");
7
+ Object.defineProperty(exports, "SentinelEnvironment", { enumerable: true, get: function () { return constants_1.SentinelEnvironment; } });
8
+ Object.defineProperty(exports, "serviceName", { enumerable: true, get: function () { return constants_1.serviceName; } });
9
+ var types_1 = require("./types.cjs");
10
+ Object.defineProperty(exports, "SentinelFeature", { enumerable: true, get: function () { return types_1.SentinelFeature; } });
11
+ Object.defineProperty(exports, "SentinelKind", { enumerable: true, get: function () { return types_1.SentinelKind; } });
12
+ Object.defineProperty(exports, "SentinelSmartTransactionStatus", { enumerable: true, get: function () { return types_1.SentinelSmartTransactionStatus; } });
13
+ var errors_1 = require("./errors.cjs");
14
+ Object.defineProperty(exports, "SentinelApiResponseValidationError", { enumerable: true, get: function () { return errors_1.SentinelApiResponseValidationError; } });
15
+ Object.defineProperty(exports, "SentinelChainNotSupportedError", { enumerable: true, get: function () { return errors_1.SentinelChainNotSupportedError; } });
16
+ Object.defineProperty(exports, "SentinelJsonRpcError", { enumerable: true, get: function () { return errors_1.SentinelJsonRpcError; } });
17
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mEAA4D;AAAnD,0HAAA,kBAAkB,OAAA;AAC3B,6CAA+D;AAAtD,gHAAA,mBAAmB,OAAA;AAAE,wGAAA,WAAW,OAAA;AA6BzC,qCAIiB;AAHf,wGAAA,eAAe,OAAA;AACf,qGAAA,YAAY,OAAA;AACZ,uHAAA,8BAA8B,OAAA;AAQhC,uCAIkB;AAHhB,4HAAA,kCAAkC,OAAA;AAClC,wHAAA,8BAA8B,OAAA;AAC9B,8GAAA,oBAAoB,OAAA","sourcesContent":["export { SentinelApiService } from './sentinel-api-service';\nexport { SentinelEnvironment, serviceName } from './constants';\nexport type {\n SentinelApiServiceActions,\n SentinelApiServiceEvents,\n SentinelApiServiceMessenger,\n SentinelApiServiceOptions,\n SentinelApiServiceInvalidateQueriesAction,\n SentinelApiServiceCacheUpdatedEvent,\n SentinelApiServiceGranularCacheUpdatedEvent,\n SentinelAuthorization,\n SentinelMeta,\n SentinelNetwork,\n SentinelNetworkRegistry,\n SentinelRelaySubmitRequest,\n SentinelRelaySubmitResponse,\n SentinelSignedAuthorization,\n SentinelSimulationCallTrace,\n SentinelSimulationLog,\n SentinelSimulationRequest,\n SentinelSimulationResponse,\n SentinelSimulationResponseTransaction,\n SentinelSimulationStateDiff,\n SentinelSimulationTokenFee,\n SentinelSimulationTransaction,\n SentinelSmartTransaction,\n SentinelSmartTransactionRequest,\n SentinelSmartTransactionResponse,\n SentinelStateOverrides,\n} from './types';\nexport {\n SentinelFeature,\n SentinelKind,\n SentinelSmartTransactionStatus,\n} from './types';\nexport type {\n SentinelApiServiceGetNetworksAction,\n SentinelApiServiceSimulateTransactionsAction,\n SentinelApiServiceSubmitRelayTransactionAction,\n SentinelApiServiceGetSmartTransactionAction,\n} from './sentinel-api-service-method-action-types';\nexport {\n SentinelApiResponseValidationError,\n SentinelChainNotSupportedError,\n SentinelJsonRpcError,\n} from './errors';\n"]}
@@ -0,0 +1,7 @@
1
+ export { SentinelApiService } from "./sentinel-api-service.cjs";
2
+ export { SentinelEnvironment, serviceName } from "./constants.cjs";
3
+ export type { SentinelApiServiceActions, SentinelApiServiceEvents, SentinelApiServiceMessenger, SentinelApiServiceOptions, SentinelApiServiceInvalidateQueriesAction, SentinelApiServiceCacheUpdatedEvent, SentinelApiServiceGranularCacheUpdatedEvent, SentinelAuthorization, SentinelMeta, SentinelNetwork, SentinelNetworkRegistry, SentinelRelaySubmitRequest, SentinelRelaySubmitResponse, SentinelSignedAuthorization, SentinelSimulationCallTrace, SentinelSimulationLog, SentinelSimulationRequest, SentinelSimulationResponse, SentinelSimulationResponseTransaction, SentinelSimulationStateDiff, SentinelSimulationTokenFee, SentinelSimulationTransaction, SentinelSmartTransaction, SentinelSmartTransactionRequest, SentinelSmartTransactionResponse, SentinelStateOverrides, } from "./types.cjs";
4
+ export { SentinelFeature, SentinelKind, SentinelSmartTransactionStatus, } from "./types.cjs";
5
+ export type { SentinelApiServiceGetNetworksAction, SentinelApiServiceSimulateTransactionsAction, SentinelApiServiceSubmitRelayTransactionAction, SentinelApiServiceGetSmartTransactionAction, } from "./sentinel-api-service-method-action-types.cjs";
6
+ export { SentinelApiResponseValidationError, SentinelChainNotSupportedError, SentinelJsonRpcError, } from "./errors.cjs";
7
+ //# sourceMappingURL=index.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mCAA+B;AAC5D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,wBAAoB;AAC/D,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,yCAAyC,EACzC,mCAAmC,EACnC,2CAA2C,EAC3C,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,qCAAqC,EACrC,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,sBAAsB,GACvB,oBAAgB;AACjB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,8BAA8B,GAC/B,oBAAgB;AACjB,YAAY,EACV,mCAAmC,EACnC,4CAA4C,EAC5C,8CAA8C,EAC9C,2CAA2C,GAC5C,uDAAmD;AACpD,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC9B,oBAAoB,GACrB,qBAAiB"}
@@ -0,0 +1,7 @@
1
+ export { SentinelApiService } from "./sentinel-api-service.mjs";
2
+ export { SentinelEnvironment, serviceName } from "./constants.mjs";
3
+ export type { SentinelApiServiceActions, SentinelApiServiceEvents, SentinelApiServiceMessenger, SentinelApiServiceOptions, SentinelApiServiceInvalidateQueriesAction, SentinelApiServiceCacheUpdatedEvent, SentinelApiServiceGranularCacheUpdatedEvent, SentinelAuthorization, SentinelMeta, SentinelNetwork, SentinelNetworkRegistry, SentinelRelaySubmitRequest, SentinelRelaySubmitResponse, SentinelSignedAuthorization, SentinelSimulationCallTrace, SentinelSimulationLog, SentinelSimulationRequest, SentinelSimulationResponse, SentinelSimulationResponseTransaction, SentinelSimulationStateDiff, SentinelSimulationTokenFee, SentinelSimulationTransaction, SentinelSmartTransaction, SentinelSmartTransactionRequest, SentinelSmartTransactionResponse, SentinelStateOverrides, } from "./types.mjs";
4
+ export { SentinelFeature, SentinelKind, SentinelSmartTransactionStatus, } from "./types.mjs";
5
+ export type { SentinelApiServiceGetNetworksAction, SentinelApiServiceSimulateTransactionsAction, SentinelApiServiceSubmitRelayTransactionAction, SentinelApiServiceGetSmartTransactionAction, } from "./sentinel-api-service-method-action-types.mjs";
6
+ export { SentinelApiResponseValidationError, SentinelChainNotSupportedError, SentinelJsonRpcError, } from "./errors.mjs";
7
+ //# sourceMappingURL=index.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mCAA+B;AAC5D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,wBAAoB;AAC/D,YAAY,EACV,yBAAyB,EACzB,wBAAwB,EACxB,2BAA2B,EAC3B,yBAAyB,EACzB,yCAAyC,EACzC,mCAAmC,EACnC,2CAA2C,EAC3C,qBAAqB,EACrB,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,2BAA2B,EAC3B,qBAAqB,EACrB,yBAAyB,EACzB,0BAA0B,EAC1B,qCAAqC,EACrC,2BAA2B,EAC3B,0BAA0B,EAC1B,6BAA6B,EAC7B,wBAAwB,EACxB,+BAA+B,EAC/B,gCAAgC,EAChC,sBAAsB,GACvB,oBAAgB;AACjB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,8BAA8B,GAC/B,oBAAgB;AACjB,YAAY,EACV,mCAAmC,EACnC,4CAA4C,EAC5C,8CAA8C,EAC9C,2CAA2C,GAC5C,uDAAmD;AACpD,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC9B,oBAAoB,GACrB,qBAAiB"}
package/dist/index.mjs ADDED
@@ -0,0 +1,5 @@
1
+ export { SentinelApiService } from "./sentinel-api-service.mjs";
2
+ export { SentinelEnvironment, serviceName } from "./constants.mjs";
3
+ export { SentinelFeature, SentinelKind, SentinelSmartTransactionStatus } from "./types.mjs";
4
+ export { SentinelApiResponseValidationError, SentinelChainNotSupportedError, SentinelJsonRpcError } from "./errors.mjs";
5
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,mCAA+B;AAC5D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,wBAAoB;AA6B/D,OAAO,EACL,eAAe,EACf,YAAY,EACZ,8BAA8B,EAC/B,oBAAgB;AAOjB,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC9B,oBAAoB,EACrB,qBAAiB","sourcesContent":["export { SentinelApiService } from './sentinel-api-service';\nexport { SentinelEnvironment, serviceName } from './constants';\nexport type {\n SentinelApiServiceActions,\n SentinelApiServiceEvents,\n SentinelApiServiceMessenger,\n SentinelApiServiceOptions,\n SentinelApiServiceInvalidateQueriesAction,\n SentinelApiServiceCacheUpdatedEvent,\n SentinelApiServiceGranularCacheUpdatedEvent,\n SentinelAuthorization,\n SentinelMeta,\n SentinelNetwork,\n SentinelNetworkRegistry,\n SentinelRelaySubmitRequest,\n SentinelRelaySubmitResponse,\n SentinelSignedAuthorization,\n SentinelSimulationCallTrace,\n SentinelSimulationLog,\n SentinelSimulationRequest,\n SentinelSimulationResponse,\n SentinelSimulationResponseTransaction,\n SentinelSimulationStateDiff,\n SentinelSimulationTokenFee,\n SentinelSimulationTransaction,\n SentinelSmartTransaction,\n SentinelSmartTransactionRequest,\n SentinelSmartTransactionResponse,\n SentinelStateOverrides,\n} from './types';\nexport {\n SentinelFeature,\n SentinelKind,\n SentinelSmartTransactionStatus,\n} from './types';\nexport type {\n SentinelApiServiceGetNetworksAction,\n SentinelApiServiceSimulateTransactionsAction,\n SentinelApiServiceSubmitRelayTransactionAction,\n SentinelApiServiceGetSmartTransactionAction,\n} from './sentinel-api-service-method-action-types';\nexport {\n SentinelApiResponseValidationError,\n SentinelChainNotSupportedError,\n SentinelJsonRpcError,\n} from './errors';\n"]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createModuleLogger = exports.projectLogger = void 0;
4
+ const utils_1 = require("@metamask/utils");
5
+ Object.defineProperty(exports, "createModuleLogger", { enumerable: true, get: function () { return utils_1.createModuleLogger; } });
6
+ exports.projectLogger = (0, utils_1.createProjectLogger)('sentinel-api-service');
7
+ //# sourceMappingURL=logger.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.cjs","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;AAAA,2CAA0E;AAIjE,mGAJqB,0BAAkB,OAIrB;AAFd,QAAA,aAAa,GAAG,IAAA,2BAAmB,EAAC,sBAAsB,CAAC,CAAC","sourcesContent":["import { createProjectLogger, createModuleLogger } from '@metamask/utils';\n\nexport const projectLogger = createProjectLogger('sentinel-api-service');\n\nexport { createModuleLogger };\n"]}
@@ -0,0 +1,5 @@
1
+ /// <reference types="debug" />
2
+ import { createModuleLogger } from "@metamask/utils";
3
+ export declare const projectLogger: import("debug").Debugger;
4
+ export { createModuleLogger };
5
+ //# sourceMappingURL=logger.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.cts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA,OAAO,EAAuB,kBAAkB,EAAE,wBAAwB;AAE1E,eAAO,MAAM,aAAa,0BAA8C,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,5 @@
1
+ /// <reference types="debug" />
2
+ import { createModuleLogger } from "@metamask/utils";
3
+ export declare const projectLogger: import("debug").Debugger;
4
+ export { createModuleLogger };
5
+ //# sourceMappingURL=logger.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.mts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";AAAA,OAAO,EAAuB,kBAAkB,EAAE,wBAAwB;AAE1E,eAAO,MAAM,aAAa,0BAA8C,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
@@ -0,0 +1,4 @@
1
+ import { createProjectLogger, createModuleLogger } from "@metamask/utils";
2
+ export const projectLogger = createProjectLogger('sentinel-api-service');
3
+ export { createModuleLogger };
4
+ //# sourceMappingURL=logger.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.mjs","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,wBAAwB;AAE1E,MAAM,CAAC,MAAM,aAAa,GAAG,mBAAmB,CAAC,sBAAsB,CAAC,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,CAAC","sourcesContent":["import { createProjectLogger, createModuleLogger } from '@metamask/utils';\n\nexport const projectLogger = createProjectLogger('sentinel-api-service');\n\nexport { createModuleLogger };\n"]}
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ /**
3
+ * This file is auto generated.
4
+ * Do not edit manually.
5
+ */
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ //# sourceMappingURL=sentinel-api-service-method-action-types.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel-api-service-method-action-types.cjs","sourceRoot":"","sources":["../src/sentinel-api-service-method-action-types.ts"],"names":[],"mappings":";AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SentinelApiService } from './sentinel-api-service';\n\n/**\n * Fetches the Sentinel supported-network registry. The result is cached, as\n * the registry is stable and identical across network subdomains.\n *\n * @returns The network registry, keyed by decimal chain ID.\n */\nexport type SentinelApiServiceGetNetworksAction = {\n type: `SentinelApiService:getNetworks`;\n handler: SentinelApiService['getNetworks'];\n};\n\n/**\n * Simulates transactions against the Sentinel API via\n * `infura_simulateTransactions`. Not cached, since each request body is\n * unique and stale simulations must not be reused.\n *\n * @param chainId - The chain ID to simulate on.\n * @param request - The simulation request.\n * @param options - Additional options.\n * @param options.getUrl - Optional callback that receives the default\n * Sentinel URL resolved for the chain and returns the URL to use instead.\n * Lets consumers rewrite the request URL (for example to route through the\n * MetaMask Shield proxy) without the service knowing about those concerns.\n * @returns The simulation response.\n */\nexport type SentinelApiServiceSimulateTransactionsAction = {\n type: `SentinelApiService:simulateTransactions`;\n handler: SentinelApiService['simulateTransactions'];\n};\n\n/**\n * Submits a signed relay (gas station) transaction to the Sentinel API via\n * `eth_sendRelayTransaction`. Not cached.\n *\n * @param request - The relay submit request.\n * @returns The relay submit response containing the tracking UUID.\n */\nexport type SentinelApiServiceSubmitRelayTransactionAction = {\n type: `SentinelApiService:submitRelayTransaction`;\n handler: SentinelApiService['submitRelayTransaction'];\n};\n\n/**\n * Looks up the state of a submitted smart transaction by UUID against the\n * `/smart-transactions/{uuid}` endpoint. Performs a single request; callers\n * own any polling loop. Not cached.\n *\n * @param request - The smart-transaction lookup request.\n * @returns The response envelope containing the smart transaction(s)\n * associated with the requested UUID.\n */\nexport type SentinelApiServiceGetSmartTransactionAction = {\n type: `SentinelApiService:getSmartTransaction`;\n handler: SentinelApiService['getSmartTransaction'];\n};\n\n/**\n * Union of all SentinelApiService action types.\n */\nexport type SentinelApiServiceMethodActions =\n | SentinelApiServiceGetNetworksAction\n | SentinelApiServiceSimulateTransactionsAction\n | SentinelApiServiceSubmitRelayTransactionAction\n | SentinelApiServiceGetSmartTransactionAction;\n"]}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ import type { SentinelApiService } from "./sentinel-api-service.cjs";
6
+ /**
7
+ * Fetches the Sentinel supported-network registry. The result is cached, as
8
+ * the registry is stable and identical across network subdomains.
9
+ *
10
+ * @returns The network registry, keyed by decimal chain ID.
11
+ */
12
+ export type SentinelApiServiceGetNetworksAction = {
13
+ type: `SentinelApiService:getNetworks`;
14
+ handler: SentinelApiService['getNetworks'];
15
+ };
16
+ /**
17
+ * Simulates transactions against the Sentinel API via
18
+ * `infura_simulateTransactions`. Not cached, since each request body is
19
+ * unique and stale simulations must not be reused.
20
+ *
21
+ * @param chainId - The chain ID to simulate on.
22
+ * @param request - The simulation request.
23
+ * @param options - Additional options.
24
+ * @param options.getUrl - Optional callback that receives the default
25
+ * Sentinel URL resolved for the chain and returns the URL to use instead.
26
+ * Lets consumers rewrite the request URL (for example to route through the
27
+ * MetaMask Shield proxy) without the service knowing about those concerns.
28
+ * @returns The simulation response.
29
+ */
30
+ export type SentinelApiServiceSimulateTransactionsAction = {
31
+ type: `SentinelApiService:simulateTransactions`;
32
+ handler: SentinelApiService['simulateTransactions'];
33
+ };
34
+ /**
35
+ * Submits a signed relay (gas station) transaction to the Sentinel API via
36
+ * `eth_sendRelayTransaction`. Not cached.
37
+ *
38
+ * @param request - The relay submit request.
39
+ * @returns The relay submit response containing the tracking UUID.
40
+ */
41
+ export type SentinelApiServiceSubmitRelayTransactionAction = {
42
+ type: `SentinelApiService:submitRelayTransaction`;
43
+ handler: SentinelApiService['submitRelayTransaction'];
44
+ };
45
+ /**
46
+ * Looks up the state of a submitted smart transaction by UUID against the
47
+ * `/smart-transactions/{uuid}` endpoint. Performs a single request; callers
48
+ * own any polling loop. Not cached.
49
+ *
50
+ * @param request - The smart-transaction lookup request.
51
+ * @returns The response envelope containing the smart transaction(s)
52
+ * associated with the requested UUID.
53
+ */
54
+ export type SentinelApiServiceGetSmartTransactionAction = {
55
+ type: `SentinelApiService:getSmartTransaction`;
56
+ handler: SentinelApiService['getSmartTransaction'];
57
+ };
58
+ /**
59
+ * Union of all SentinelApiService action types.
60
+ */
61
+ export type SentinelApiServiceMethodActions = SentinelApiServiceGetNetworksAction | SentinelApiServiceSimulateTransactionsAction | SentinelApiServiceSubmitRelayTransactionAction | SentinelApiServiceGetSmartTransactionAction;
62
+ //# sourceMappingURL=sentinel-api-service-method-action-types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel-api-service-method-action-types.d.cts","sourceRoot":"","sources":["../src/sentinel-api-service-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAA+B;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;CACpD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,+BAA+B,GACvC,mCAAmC,GACnC,4CAA4C,GAC5C,8CAA8C,GAC9C,2CAA2C,CAAC"}
@@ -0,0 +1,62 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ import type { SentinelApiService } from "./sentinel-api-service.mjs";
6
+ /**
7
+ * Fetches the Sentinel supported-network registry. The result is cached, as
8
+ * the registry is stable and identical across network subdomains.
9
+ *
10
+ * @returns The network registry, keyed by decimal chain ID.
11
+ */
12
+ export type SentinelApiServiceGetNetworksAction = {
13
+ type: `SentinelApiService:getNetworks`;
14
+ handler: SentinelApiService['getNetworks'];
15
+ };
16
+ /**
17
+ * Simulates transactions against the Sentinel API via
18
+ * `infura_simulateTransactions`. Not cached, since each request body is
19
+ * unique and stale simulations must not be reused.
20
+ *
21
+ * @param chainId - The chain ID to simulate on.
22
+ * @param request - The simulation request.
23
+ * @param options - Additional options.
24
+ * @param options.getUrl - Optional callback that receives the default
25
+ * Sentinel URL resolved for the chain and returns the URL to use instead.
26
+ * Lets consumers rewrite the request URL (for example to route through the
27
+ * MetaMask Shield proxy) without the service knowing about those concerns.
28
+ * @returns The simulation response.
29
+ */
30
+ export type SentinelApiServiceSimulateTransactionsAction = {
31
+ type: `SentinelApiService:simulateTransactions`;
32
+ handler: SentinelApiService['simulateTransactions'];
33
+ };
34
+ /**
35
+ * Submits a signed relay (gas station) transaction to the Sentinel API via
36
+ * `eth_sendRelayTransaction`. Not cached.
37
+ *
38
+ * @param request - The relay submit request.
39
+ * @returns The relay submit response containing the tracking UUID.
40
+ */
41
+ export type SentinelApiServiceSubmitRelayTransactionAction = {
42
+ type: `SentinelApiService:submitRelayTransaction`;
43
+ handler: SentinelApiService['submitRelayTransaction'];
44
+ };
45
+ /**
46
+ * Looks up the state of a submitted smart transaction by UUID against the
47
+ * `/smart-transactions/{uuid}` endpoint. Performs a single request; callers
48
+ * own any polling loop. Not cached.
49
+ *
50
+ * @param request - The smart-transaction lookup request.
51
+ * @returns The response envelope containing the smart transaction(s)
52
+ * associated with the requested UUID.
53
+ */
54
+ export type SentinelApiServiceGetSmartTransactionAction = {
55
+ type: `SentinelApiService:getSmartTransaction`;
56
+ handler: SentinelApiService['getSmartTransaction'];
57
+ };
58
+ /**
59
+ * Union of all SentinelApiService action types.
60
+ */
61
+ export type SentinelApiServiceMethodActions = SentinelApiServiceGetNetworksAction | SentinelApiServiceSimulateTransactionsAction | SentinelApiServiceSubmitRelayTransactionAction | SentinelApiServiceGetSmartTransactionAction;
62
+ //# sourceMappingURL=sentinel-api-service-method-action-types.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel-api-service-method-action-types.d.mts","sourceRoot":"","sources":["../src/sentinel-api-service-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,mCAA+B;AAEjE;;;;;GAKG;AACH,MAAM,MAAM,mCAAmC,GAAG;IAChD,IAAI,EAAE,gCAAgC,CAAC;IACvC,OAAO,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;CAC5C,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,4CAA4C,GAAG;IACzD,IAAI,EAAE,yCAAyC,CAAC;IAChD,OAAO,EAAE,kBAAkB,CAAC,sBAAsB,CAAC,CAAC;CACrD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,8CAA8C,GAAG;IAC3D,IAAI,EAAE,2CAA2C,CAAC;IAClD,OAAO,EAAE,kBAAkB,CAAC,wBAAwB,CAAC,CAAC;CACvD,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,2CAA2C,GAAG;IACxD,IAAI,EAAE,wCAAwC,CAAC;IAC/C,OAAO,EAAE,kBAAkB,CAAC,qBAAqB,CAAC,CAAC;CACpD,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,+BAA+B,GACvC,mCAAmC,GACnC,4CAA4C,GAC5C,8CAA8C,GAC9C,2CAA2C,CAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This file is auto generated.
3
+ * Do not edit manually.
4
+ */
5
+ export {};
6
+ //# sourceMappingURL=sentinel-api-service-method-action-types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel-api-service-method-action-types.mjs","sourceRoot":"","sources":["../src/sentinel-api-service-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG","sourcesContent":["/**\n * This file is auto generated.\n * Do not edit manually.\n */\n\nimport type { SentinelApiService } from './sentinel-api-service';\n\n/**\n * Fetches the Sentinel supported-network registry. The result is cached, as\n * the registry is stable and identical across network subdomains.\n *\n * @returns The network registry, keyed by decimal chain ID.\n */\nexport type SentinelApiServiceGetNetworksAction = {\n type: `SentinelApiService:getNetworks`;\n handler: SentinelApiService['getNetworks'];\n};\n\n/**\n * Simulates transactions against the Sentinel API via\n * `infura_simulateTransactions`. Not cached, since each request body is\n * unique and stale simulations must not be reused.\n *\n * @param chainId - The chain ID to simulate on.\n * @param request - The simulation request.\n * @param options - Additional options.\n * @param options.getUrl - Optional callback that receives the default\n * Sentinel URL resolved for the chain and returns the URL to use instead.\n * Lets consumers rewrite the request URL (for example to route through the\n * MetaMask Shield proxy) without the service knowing about those concerns.\n * @returns The simulation response.\n */\nexport type SentinelApiServiceSimulateTransactionsAction = {\n type: `SentinelApiService:simulateTransactions`;\n handler: SentinelApiService['simulateTransactions'];\n};\n\n/**\n * Submits a signed relay (gas station) transaction to the Sentinel API via\n * `eth_sendRelayTransaction`. Not cached.\n *\n * @param request - The relay submit request.\n * @returns The relay submit response containing the tracking UUID.\n */\nexport type SentinelApiServiceSubmitRelayTransactionAction = {\n type: `SentinelApiService:submitRelayTransaction`;\n handler: SentinelApiService['submitRelayTransaction'];\n};\n\n/**\n * Looks up the state of a submitted smart transaction by UUID against the\n * `/smart-transactions/{uuid}` endpoint. Performs a single request; callers\n * own any polling loop. Not cached.\n *\n * @param request - The smart-transaction lookup request.\n * @returns The response envelope containing the smart transaction(s)\n * associated with the requested UUID.\n */\nexport type SentinelApiServiceGetSmartTransactionAction = {\n type: `SentinelApiService:getSmartTransaction`;\n handler: SentinelApiService['getSmartTransaction'];\n};\n\n/**\n * Union of all SentinelApiService action types.\n */\nexport type SentinelApiServiceMethodActions =\n | SentinelApiServiceGetNetworksAction\n | SentinelApiServiceSimulateTransactionsAction\n | SentinelApiServiceSubmitRelayTransactionAction\n | SentinelApiServiceGetSmartTransactionAction;\n"]}