@metamask-previews/sentinel-api-service 1.0.1-preview-3866c0ff1 → 1.0.1-preview-e3275932a

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 (85) hide show
  1. package/CHANGELOG.md +0 -1
  2. package/dist/constants.cjs +71 -0
  3. package/dist/constants.cjs.map +1 -0
  4. package/dist/{constants.d.ts → constants.d.cts} +1 -1
  5. package/dist/constants.d.cts.map +1 -0
  6. package/dist/constants.d.mts +63 -0
  7. package/dist/constants.d.mts.map +1 -0
  8. package/dist/{constants.js → constants.mjs} +1 -1
  9. package/dist/constants.mjs.map +1 -0
  10. package/dist/errors.cjs +43 -0
  11. package/dist/errors.cjs.map +1 -0
  12. package/dist/{errors.d.ts → errors.d.cts} +1 -1
  13. package/dist/errors.d.cts.map +1 -0
  14. package/dist/errors.d.mts +27 -0
  15. package/dist/errors.d.mts.map +1 -0
  16. package/dist/{errors.js → errors.mjs} +1 -3
  17. package/dist/errors.mjs.map +1 -0
  18. package/dist/index.cjs +17 -0
  19. package/dist/index.cjs.map +1 -0
  20. package/dist/{index.d.ts → index.d.cts} +7 -7
  21. package/dist/index.d.cts.map +1 -0
  22. package/dist/index.d.mts +7 -0
  23. package/dist/index.d.mts.map +1 -0
  24. package/dist/index.mjs +5 -0
  25. package/dist/index.mjs.map +1 -0
  26. package/dist/logger.cjs +7 -0
  27. package/dist/logger.cjs.map +1 -0
  28. package/dist/logger.d.cts +5 -0
  29. package/dist/logger.d.cts.map +1 -0
  30. package/dist/logger.d.mts +5 -0
  31. package/dist/logger.d.mts.map +1 -0
  32. package/dist/logger.mjs +4 -0
  33. package/dist/logger.mjs.map +1 -0
  34. package/dist/sentinel-api-service-method-action-types.cjs +7 -0
  35. package/dist/sentinel-api-service-method-action-types.cjs.map +1 -0
  36. package/dist/{sentinel-api-service-method-action-types.d.ts → sentinel-api-service-method-action-types.d.cts} +2 -2
  37. package/dist/sentinel-api-service-method-action-types.d.cts.map +1 -0
  38. package/dist/sentinel-api-service-method-action-types.d.mts +62 -0
  39. package/dist/sentinel-api-service-method-action-types.d.mts.map +1 -0
  40. package/dist/{sentinel-api-service-method-action-types.js → sentinel-api-service-method-action-types.mjs} +1 -1
  41. package/dist/sentinel-api-service-method-action-types.mjs.map +1 -0
  42. package/dist/sentinel-api-service.cjs +316 -0
  43. package/dist/sentinel-api-service.cjs.map +1 -0
  44. package/dist/{sentinel-api-service.d.ts → sentinel-api-service.d.cts} +5 -5
  45. package/dist/sentinel-api-service.d.cts.map +1 -0
  46. package/dist/sentinel-api-service.d.mts +90 -0
  47. package/dist/sentinel-api-service.d.mts.map +1 -0
  48. package/dist/{sentinel-api-service.js → sentinel-api-service.mjs} +125 -119
  49. package/dist/sentinel-api-service.mjs.map +1 -0
  50. package/dist/structs.cjs +58 -0
  51. package/dist/structs.cjs.map +1 -0
  52. package/dist/{structs.d.ts → structs.d.cts} +4 -4
  53. package/dist/structs.d.cts.map +1 -0
  54. package/dist/structs.d.mts +63 -0
  55. package/dist/structs.d.mts.map +1 -0
  56. package/dist/{structs.js → structs.mjs} +2 -2
  57. package/dist/structs.mjs.map +1 -0
  58. package/dist/types.cjs +36 -0
  59. package/dist/types.cjs.map +1 -0
  60. package/dist/{types.d.ts → types.d.cts} +8 -8
  61. package/dist/types.d.cts.map +1 -0
  62. package/dist/types.d.mts +420 -0
  63. package/dist/types.d.mts.map +1 -0
  64. package/dist/{types.js → types.mjs} +1 -1
  65. package/dist/types.mjs.map +1 -0
  66. package/package.json +16 -12
  67. package/dist/constants.d.ts.map +0 -1
  68. package/dist/constants.js.map +0 -1
  69. package/dist/errors.d.ts.map +0 -1
  70. package/dist/errors.js.map +0 -1
  71. package/dist/index.d.ts.map +0 -1
  72. package/dist/index.js +0 -5
  73. package/dist/index.js.map +0 -1
  74. package/dist/logger.d.ts +0 -4
  75. package/dist/logger.d.ts.map +0 -1
  76. package/dist/logger.js +0 -4
  77. package/dist/logger.js.map +0 -1
  78. package/dist/sentinel-api-service-method-action-types.d.ts.map +0 -1
  79. package/dist/sentinel-api-service-method-action-types.js.map +0 -1
  80. package/dist/sentinel-api-service.d.ts.map +0 -1
  81. package/dist/sentinel-api-service.js.map +0 -1
  82. package/dist/structs.d.ts.map +0 -1
  83. package/dist/structs.js.map +0 -1
  84. package/dist/types.d.ts.map +0 -1
  85. package/dist/types.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -11,7 +11,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
11
11
 
12
12
  ### Changed
13
13
 
14
- - **BREAKING:** Bump minimum Node.js version to 22 ([#9168](https://github.com/MetaMask/core/pull/9168))
15
14
  - Bump `@metamask/superstruct` from `^3.1.0` to `^3.4.1` ([#9754](https://github.com/MetaMask/core/pull/9754))
16
15
  - Bump `@tanstack/query-core` from `^4.43.0` to `^5.62.16` ([#9712](https://github.com/MetaMask/core/pull/9712))
17
16
  - Bump `@metamask/base-data-service` from `^0.1.3` to `^1.0.0` ([#9972](https://github.com/MetaMask/core/pull/9972))
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NETWORKS_STALE_TIME_MS = exports.ENDPOINT_SMART_TRANSACTIONS = exports.ENDPOINT_NETWORKS = exports.NETWORKS_SUBDOMAIN = exports.DEFAULT_ENVIRONMENT = exports.ENVIRONMENT_DOMAIN = exports.SentinelEnvironment = exports.BASE_URL_TEMPLATE = exports.RPC_METHOD_SEND_RELAY = exports.RPC_METHOD_SIMULATE = exports.serviceName = void 0;
4
+ /**
5
+ * The name of the {@link SentinelApiService}, used to namespace the service's
6
+ * actions and events.
7
+ */
8
+ exports.serviceName = 'SentinelApiService';
9
+ /**
10
+ * JSON-RPC method used to simulate transactions against the Sentinel API.
11
+ */
12
+ exports.RPC_METHOD_SIMULATE = 'infura_simulateTransactions';
13
+ /**
14
+ * JSON-RPC method used to submit a signed relay (gas station) transaction to
15
+ * the Sentinel API.
16
+ */
17
+ exports.RPC_METHOD_SEND_RELAY = 'eth_sendRelayTransaction';
18
+ /**
19
+ * Template for the Sentinel API base URL. `{0}` is replaced with the network
20
+ * subdomain (for example `ethereum-mainnet`) and `{1}` with the environment
21
+ * API-domain segment (see {@link ENVIRONMENT_DOMAIN}).
22
+ */
23
+ exports.BASE_URL_TEMPLATE = 'https://tx-sentinel-{0}.{1}.cx.metamask.io/';
24
+ /**
25
+ * The Sentinel API environments. Each maps to a distinct API domain segment;
26
+ * see {@link ENVIRONMENT_DOMAIN}.
27
+ */
28
+ var SentinelEnvironment;
29
+ (function (SentinelEnvironment) {
30
+ /** Development environment (`dev-api.cx.metamask.io`). */
31
+ SentinelEnvironment["Dev"] = "dev";
32
+ /** User-acceptance-testing environment (`uat-api.cx.metamask.io`). */
33
+ SentinelEnvironment["Uat"] = "uat";
34
+ /** Production environment (`api.cx.metamask.io`). */
35
+ SentinelEnvironment["Prod"] = "prod";
36
+ })(SentinelEnvironment || (exports.SentinelEnvironment = SentinelEnvironment = {}));
37
+ /**
38
+ * Maps a {@link SentinelEnvironment} to the API-domain segment substituted into
39
+ * {@link BASE_URL_TEMPLATE} (the `{1}` placeholder).
40
+ */
41
+ exports.ENVIRONMENT_DOMAIN = {
42
+ [SentinelEnvironment.Dev]: 'dev-api',
43
+ [SentinelEnvironment.Uat]: 'uat-api',
44
+ [SentinelEnvironment.Prod]: 'api',
45
+ };
46
+ /**
47
+ * The default {@link SentinelEnvironment} used when the constructor does not
48
+ * specify one. Production, matching the behaviour of the clients this service
49
+ * replaces.
50
+ */
51
+ exports.DEFAULT_ENVIRONMENT = SentinelEnvironment.Prod;
52
+ /**
53
+ * The subdomain used for network-registry lookups. The `/networks` endpoint
54
+ * returns identical data regardless of subdomain, so a stable one is used.
55
+ */
56
+ exports.NETWORKS_SUBDOMAIN = 'ethereum-mainnet';
57
+ /**
58
+ * The REST path used to retrieve the supported-network registry.
59
+ */
60
+ exports.ENDPOINT_NETWORKS = 'networks';
61
+ /**
62
+ * The REST path prefix used to poll the status of a submitted smart
63
+ * transaction by UUID.
64
+ */
65
+ exports.ENDPOINT_SMART_TRANSACTIONS = 'smart-transactions';
66
+ /**
67
+ * How long the network registry (`/networks`) response is considered fresh.
68
+ * The registry is stable, so caching it avoids re-fetching on every request.
69
+ */
70
+ exports.NETWORKS_STALE_TIME_MS = 5 * 60 * 1000;
71
+ //# sourceMappingURL=constants.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.cjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACU,QAAA,WAAW,GAAG,oBAAoB,CAAC;AAEhD;;GAEG;AACU,QAAA,mBAAmB,GAAG,6BAA6B,CAAC;AAEjE;;;GAGG;AACU,QAAA,qBAAqB,GAAG,0BAA0B,CAAC;AAEhE;;;;GAIG;AACU,QAAA,iBAAiB,GAAG,6CAA6C,CAAC;AAE/E;;;GAGG;AACH,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,0DAA0D;IAC1D,kCAAW,CAAA;IACX,sEAAsE;IACtE,kCAAW,CAAA;IACX,qDAAqD;IACrD,oCAAa,CAAA;AACf,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B;AAED;;;GAGG;AACU,QAAA,kBAAkB,GAAwC;IACrE,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,SAAS;IACpC,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,SAAS;IACpC,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK;CAClC,CAAC;AAEF;;;;GAIG;AACU,QAAA,mBAAmB,GAAG,mBAAmB,CAAC,IAAI,CAAC;AAE5D;;;GAGG;AACU,QAAA,kBAAkB,GAAG,kBAAkB,CAAC;AAErD;;GAEG;AACU,QAAA,iBAAiB,GAAG,UAAU,CAAC;AAE5C;;;GAGG;AACU,QAAA,2BAA2B,GAAG,oBAAoB,CAAC;AAEhE;;;GAGG;AACU,QAAA,sBAAsB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC","sourcesContent":["/**\n * The name of the {@link SentinelApiService}, used to namespace the service's\n * actions and events.\n */\nexport const serviceName = 'SentinelApiService';\n\n/**\n * JSON-RPC method used to simulate transactions against the Sentinel API.\n */\nexport const RPC_METHOD_SIMULATE = 'infura_simulateTransactions';\n\n/**\n * JSON-RPC method used to submit a signed relay (gas station) transaction to\n * the Sentinel API.\n */\nexport const RPC_METHOD_SEND_RELAY = 'eth_sendRelayTransaction';\n\n/**\n * Template for the Sentinel API base URL. `{0}` is replaced with the network\n * subdomain (for example `ethereum-mainnet`) and `{1}` with the environment\n * API-domain segment (see {@link ENVIRONMENT_DOMAIN}).\n */\nexport const BASE_URL_TEMPLATE = 'https://tx-sentinel-{0}.{1}.cx.metamask.io/';\n\n/**\n * The Sentinel API environments. Each maps to a distinct API domain segment;\n * see {@link ENVIRONMENT_DOMAIN}.\n */\nexport enum SentinelEnvironment {\n /** Development environment (`dev-api.cx.metamask.io`). */\n Dev = 'dev',\n /** User-acceptance-testing environment (`uat-api.cx.metamask.io`). */\n Uat = 'uat',\n /** Production environment (`api.cx.metamask.io`). */\n Prod = 'prod',\n}\n\n/**\n * Maps a {@link SentinelEnvironment} to the API-domain segment substituted into\n * {@link BASE_URL_TEMPLATE} (the `{1}` placeholder).\n */\nexport const ENVIRONMENT_DOMAIN: Record<SentinelEnvironment, string> = {\n [SentinelEnvironment.Dev]: 'dev-api',\n [SentinelEnvironment.Uat]: 'uat-api',\n [SentinelEnvironment.Prod]: 'api',\n};\n\n/**\n * The default {@link SentinelEnvironment} used when the constructor does not\n * specify one. Production, matching the behaviour of the clients this service\n * replaces.\n */\nexport const DEFAULT_ENVIRONMENT = SentinelEnvironment.Prod;\n\n/**\n * The subdomain used for network-registry lookups. The `/networks` endpoint\n * returns identical data regardless of subdomain, so a stable one is used.\n */\nexport const NETWORKS_SUBDOMAIN = 'ethereum-mainnet';\n\n/**\n * The REST path used to retrieve the supported-network registry.\n */\nexport const ENDPOINT_NETWORKS = 'networks';\n\n/**\n * The REST path prefix used to poll the status of a submitted smart\n * transaction by UUID.\n */\nexport const ENDPOINT_SMART_TRANSACTIONS = 'smart-transactions';\n\n/**\n * How long the network registry (`/networks`) response is considered fresh.\n * The registry is stable, so caching it avoids re-fetching on every request.\n */\nexport const NETWORKS_STALE_TIME_MS = 5 * 60 * 1000;\n"]}
@@ -60,4 +60,4 @@ export declare const ENDPOINT_SMART_TRANSACTIONS = "smart-transactions";
60
60
  * The registry is stable, so caching it avoids re-fetching on every request.
61
61
  */
62
62
  export declare const NETWORKS_STALE_TIME_MS: number;
63
- //# sourceMappingURL=constants.d.ts.map
63
+ //# sourceMappingURL=constants.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.cts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,6BAA6B,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gDAAgD,CAAC;AAE/E;;;GAGG;AACH,oBAAY,mBAAmB;IAC7B,0DAA0D;IAC1D,GAAG,QAAQ;IACX,sEAAsE;IACtE,GAAG,QAAQ;IACX,qDAAqD;IACrD,IAAI,SAAS;CACd;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAIlE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,2BAA2B,uBAAuB,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAgB,CAAC"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * The name of the {@link SentinelApiService}, used to namespace the service's
3
+ * actions and events.
4
+ */
5
+ export declare const serviceName = "SentinelApiService";
6
+ /**
7
+ * JSON-RPC method used to simulate transactions against the Sentinel API.
8
+ */
9
+ export declare const RPC_METHOD_SIMULATE = "infura_simulateTransactions";
10
+ /**
11
+ * JSON-RPC method used to submit a signed relay (gas station) transaction to
12
+ * the Sentinel API.
13
+ */
14
+ export declare const RPC_METHOD_SEND_RELAY = "eth_sendRelayTransaction";
15
+ /**
16
+ * Template for the Sentinel API base URL. `{0}` is replaced with the network
17
+ * subdomain (for example `ethereum-mainnet`) and `{1}` with the environment
18
+ * API-domain segment (see {@link ENVIRONMENT_DOMAIN}).
19
+ */
20
+ export declare const BASE_URL_TEMPLATE = "https://tx-sentinel-{0}.{1}.cx.metamask.io/";
21
+ /**
22
+ * The Sentinel API environments. Each maps to a distinct API domain segment;
23
+ * see {@link ENVIRONMENT_DOMAIN}.
24
+ */
25
+ export declare enum SentinelEnvironment {
26
+ /** Development environment (`dev-api.cx.metamask.io`). */
27
+ Dev = "dev",
28
+ /** User-acceptance-testing environment (`uat-api.cx.metamask.io`). */
29
+ Uat = "uat",
30
+ /** Production environment (`api.cx.metamask.io`). */
31
+ Prod = "prod"
32
+ }
33
+ /**
34
+ * Maps a {@link SentinelEnvironment} to the API-domain segment substituted into
35
+ * {@link BASE_URL_TEMPLATE} (the `{1}` placeholder).
36
+ */
37
+ export declare const ENVIRONMENT_DOMAIN: Record<SentinelEnvironment, string>;
38
+ /**
39
+ * The default {@link SentinelEnvironment} used when the constructor does not
40
+ * specify one. Production, matching the behaviour of the clients this service
41
+ * replaces.
42
+ */
43
+ export declare const DEFAULT_ENVIRONMENT = SentinelEnvironment.Prod;
44
+ /**
45
+ * The subdomain used for network-registry lookups. The `/networks` endpoint
46
+ * returns identical data regardless of subdomain, so a stable one is used.
47
+ */
48
+ export declare const NETWORKS_SUBDOMAIN = "ethereum-mainnet";
49
+ /**
50
+ * The REST path used to retrieve the supported-network registry.
51
+ */
52
+ export declare const ENDPOINT_NETWORKS = "networks";
53
+ /**
54
+ * The REST path prefix used to poll the status of a submitted smart
55
+ * transaction by UUID.
56
+ */
57
+ export declare const ENDPOINT_SMART_TRANSACTIONS = "smart-transactions";
58
+ /**
59
+ * How long the network registry (`/networks`) response is considered fresh.
60
+ * The registry is stable, so caching it avoids re-fetching on every request.
61
+ */
62
+ export declare const NETWORKS_STALE_TIME_MS: number;
63
+ //# sourceMappingURL=constants.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.mts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,WAAW,uBAAuB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,mBAAmB,gCAAgC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,qBAAqB,6BAA6B,CAAC;AAEhE;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,gDAAgD,CAAC;AAE/E;;;GAGG;AACH,oBAAY,mBAAmB;IAC7B,0DAA0D;IAC1D,GAAG,QAAQ;IACX,sEAAsE;IACtE,GAAG,QAAQ;IACX,qDAAqD;IACrD,IAAI,SAAS;CACd;AAED;;;GAGG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,mBAAmB,EAAE,MAAM,CAIlE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,kBAAkB,qBAAqB,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,2BAA2B,uBAAuB,CAAC;AAEhE;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAgB,CAAC"}
@@ -65,4 +65,4 @@ export const ENDPOINT_SMART_TRANSACTIONS = 'smart-transactions';
65
65
  * The registry is stable, so caching it avoids re-fetching on every request.
66
66
  */
67
67
  export const NETWORKS_STALE_TIME_MS = 5 * 60 * 1000;
68
- //# sourceMappingURL=constants.js.map
68
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,oBAAoB,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,6BAA6B,CAAC;AAEjE;;;GAGG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,0BAA0B,CAAC;AAEhE;;;;GAIG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,6CAA6C,CAAC;AAE/E;;;GAGG;AACH,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,0DAA0D;IAC1D,kCAAW,CAAA;IACX,sEAAsE;IACtE,kCAAW,CAAA;IACX,qDAAqD;IACrD,oCAAa,CAAA;AACf,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwC;IACrE,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,SAAS;IACpC,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,SAAS;IACpC,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK;CAClC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,IAAI,CAAC;AAE5D;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,kBAAkB,CAAC;AAErD;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,UAAU,CAAC;AAE5C;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,oBAAoB,CAAC;AAEhE;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC","sourcesContent":["/**\n * The name of the {@link SentinelApiService}, used to namespace the service's\n * actions and events.\n */\nexport const serviceName = 'SentinelApiService';\n\n/**\n * JSON-RPC method used to simulate transactions against the Sentinel API.\n */\nexport const RPC_METHOD_SIMULATE = 'infura_simulateTransactions';\n\n/**\n * JSON-RPC method used to submit a signed relay (gas station) transaction to\n * the Sentinel API.\n */\nexport const RPC_METHOD_SEND_RELAY = 'eth_sendRelayTransaction';\n\n/**\n * Template for the Sentinel API base URL. `{0}` is replaced with the network\n * subdomain (for example `ethereum-mainnet`) and `{1}` with the environment\n * API-domain segment (see {@link ENVIRONMENT_DOMAIN}).\n */\nexport const BASE_URL_TEMPLATE = 'https://tx-sentinel-{0}.{1}.cx.metamask.io/';\n\n/**\n * The Sentinel API environments. Each maps to a distinct API domain segment;\n * see {@link ENVIRONMENT_DOMAIN}.\n */\nexport enum SentinelEnvironment {\n /** Development environment (`dev-api.cx.metamask.io`). */\n Dev = 'dev',\n /** User-acceptance-testing environment (`uat-api.cx.metamask.io`). */\n Uat = 'uat',\n /** Production environment (`api.cx.metamask.io`). */\n Prod = 'prod',\n}\n\n/**\n * Maps a {@link SentinelEnvironment} to the API-domain segment substituted into\n * {@link BASE_URL_TEMPLATE} (the `{1}` placeholder).\n */\nexport const ENVIRONMENT_DOMAIN: Record<SentinelEnvironment, string> = {\n [SentinelEnvironment.Dev]: 'dev-api',\n [SentinelEnvironment.Uat]: 'uat-api',\n [SentinelEnvironment.Prod]: 'api',\n};\n\n/**\n * The default {@link SentinelEnvironment} used when the constructor does not\n * specify one. Production, matching the behaviour of the clients this service\n * replaces.\n */\nexport const DEFAULT_ENVIRONMENT = SentinelEnvironment.Prod;\n\n/**\n * The subdomain used for network-registry lookups. The `/networks` endpoint\n * returns identical data regardless of subdomain, so a stable one is used.\n */\nexport const NETWORKS_SUBDOMAIN = 'ethereum-mainnet';\n\n/**\n * The REST path used to retrieve the supported-network registry.\n */\nexport const ENDPOINT_NETWORKS = 'networks';\n\n/**\n * The REST path prefix used to poll the status of a submitted smart\n * transaction by UUID.\n */\nexport const ENDPOINT_SMART_TRANSACTIONS = 'smart-transactions';\n\n/**\n * How long the network registry (`/networks`) response is considered fresh.\n * The registry is stable, so caching it avoids re-fetching on every request.\n */\nexport const NETWORKS_STALE_TIME_MS = 5 * 60 * 1000;\n"]}
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SentinelApiResponseValidationError = exports.SentinelChainNotSupportedError = exports.SentinelJsonRpcError = void 0;
4
+ /**
5
+ * Thrown when the Sentinel API returns a JSON-RPC error object (for example
6
+ * from `infura_simulateTransactions` or `eth_sendRelayTransaction`).
7
+ */
8
+ class SentinelJsonRpcError extends Error {
9
+ constructor(message, code) {
10
+ super(message);
11
+ this.name = 'SentinelJsonRpcError';
12
+ this.code = code;
13
+ }
14
+ }
15
+ exports.SentinelJsonRpcError = SentinelJsonRpcError;
16
+ /**
17
+ * Thrown when a Sentinel operation is requested for a chain that the API does
18
+ * not support (either not present in the network registry, or the required
19
+ * capability flag is not enabled for that chain).
20
+ */
21
+ class SentinelChainNotSupportedError extends Error {
22
+ constructor(chainId, capability) {
23
+ super(capability
24
+ ? `Sentinel API: Does not support '${capability}' for chain ${chainId}`
25
+ : `Sentinel API: Does not support chain ${chainId}`);
26
+ this.name = 'SentinelChainNotSupportedError';
27
+ }
28
+ }
29
+ exports.SentinelChainNotSupportedError = SentinelChainNotSupportedError;
30
+ /**
31
+ * Thrown when a response from the Sentinel API fails superstruct validation.
32
+ * Indicates a contract mismatch between client and server. Excluded from the
33
+ * service policy's retry filter, since retrying will not fix a malformed
34
+ * response.
35
+ */
36
+ class SentinelApiResponseValidationError extends Error {
37
+ constructor(message) {
38
+ super(message ?? 'Sentinel API: Malformed response received');
39
+ this.name = 'SentinelApiResponseValidationError';
40
+ }
41
+ }
42
+ exports.SentinelApiResponseValidationError = SentinelApiResponseValidationError;
43
+ //# sourceMappingURL=errors.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.cjs","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,MAAa,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;AATD,oDASC;AAED;;;;GAIG;AACH,MAAa,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;AATD,wEASC;AAED;;;;;GAKG;AACH,MAAa,kCAAmC,SAAQ,KAAK;IAC3D,YAAY,OAAgB;QAC1B,KAAK,CAAC,OAAO,IAAI,2CAA2C,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,oCAAoC,CAAC;IACnD,CAAC;CACF;AALD,gFAKC","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"]}
@@ -24,4 +24,4 @@ export declare class SentinelChainNotSupportedError extends Error {
24
24
  export declare class SentinelApiResponseValidationError extends Error {
25
25
  constructor(message?: string);
26
26
  }
27
- //# sourceMappingURL=errors.d.ts.map
27
+ //# sourceMappingURL=errors.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.cts","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,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"}
@@ -3,8 +3,6 @@
3
3
  * from `infura_simulateTransactions` or `eth_sendRelayTransaction`).
4
4
  */
5
5
  export class SentinelJsonRpcError extends Error {
6
- /** The JSON-RPC error code, if provided by the API. */
7
- code;
8
6
  constructor(message, code) {
9
7
  super(message);
10
8
  this.name = 'SentinelJsonRpcError';
@@ -36,4 +34,4 @@ export class SentinelApiResponseValidationError extends Error {
36
34
  this.name = 'SentinelApiResponseValidationError';
37
35
  }
38
36
  }
39
- //# sourceMappingURL=errors.js.map
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_js_1 = require("./sentinel-api-service.cjs");
5
+ Object.defineProperty(exports, "SentinelApiService", { enumerable: true, get: function () { return sentinel_api_service_js_1.SentinelApiService; } });
6
+ var constants_js_1 = require("./constants.cjs");
7
+ Object.defineProperty(exports, "SentinelEnvironment", { enumerable: true, get: function () { return constants_js_1.SentinelEnvironment; } });
8
+ Object.defineProperty(exports, "serviceName", { enumerable: true, get: function () { return constants_js_1.serviceName; } });
9
+ var types_js_1 = require("./types.cjs");
10
+ Object.defineProperty(exports, "SentinelFeature", { enumerable: true, get: function () { return types_js_1.SentinelFeature; } });
11
+ Object.defineProperty(exports, "SentinelKind", { enumerable: true, get: function () { return types_js_1.SentinelKind; } });
12
+ Object.defineProperty(exports, "SentinelSmartTransactionStatus", { enumerable: true, get: function () { return types_js_1.SentinelSmartTransactionStatus; } });
13
+ var errors_js_1 = require("./errors.cjs");
14
+ Object.defineProperty(exports, "SentinelApiResponseValidationError", { enumerable: true, get: function () { return errors_js_1.SentinelApiResponseValidationError; } });
15
+ Object.defineProperty(exports, "SentinelChainNotSupportedError", { enumerable: true, get: function () { return errors_js_1.SentinelChainNotSupportedError; } });
16
+ Object.defineProperty(exports, "SentinelJsonRpcError", { enumerable: true, get: function () { return errors_js_1.SentinelJsonRpcError; } });
17
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,sEAA+D;AAAtD,6HAAA,kBAAkB,OAAA;AAC3B,gDAAkE;AAAzD,mHAAA,mBAAmB,OAAA;AAAE,2GAAA,WAAW,OAAA;AA6BzC,wCAIoB;AAHlB,2GAAA,eAAe,OAAA;AACf,wGAAA,YAAY,OAAA;AACZ,0HAAA,8BAA8B,OAAA;AAQhC,0CAIqB;AAHnB,+HAAA,kCAAkC,OAAA;AAClC,2HAAA,8BAA8B,OAAA;AAC9B,iHAAA,oBAAoB,OAAA","sourcesContent":["export { SentinelApiService } from './sentinel-api-service.js';\nexport { SentinelEnvironment, serviceName } from './constants.js';\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.js';\nexport {\n SentinelFeature,\n SentinelKind,\n SentinelSmartTransactionStatus,\n} from './types.js';\nexport type {\n SentinelApiServiceGetNetworksAction,\n SentinelApiServiceSimulateTransactionsAction,\n SentinelApiServiceSubmitRelayTransactionAction,\n SentinelApiServiceGetSmartTransactionAction,\n} from './sentinel-api-service-method-action-types.js';\nexport {\n SentinelApiResponseValidationError,\n SentinelChainNotSupportedError,\n SentinelJsonRpcError,\n} from './errors.js';\n"]}
@@ -1,7 +1,7 @@
1
- export { SentinelApiService } from './sentinel-api-service.js';
2
- export { SentinelEnvironment, serviceName } from './constants.js';
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.js';
4
- export { SentinelFeature, SentinelKind, SentinelSmartTransactionStatus, } from './types.js';
5
- export type { SentinelApiServiceGetNetworksAction, SentinelApiServiceSimulateTransactionsAction, SentinelApiServiceSubmitRelayTransactionAction, SentinelApiServiceGetSmartTransactionAction, } from './sentinel-api-service-method-action-types.js';
6
- export { SentinelApiResponseValidationError, SentinelChainNotSupportedError, SentinelJsonRpcError, } from './errors.js';
7
- //# sourceMappingURL=index.d.ts.map
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,mCAAkC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,wBAAuB;AAClE,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,oBAAmB;AACpB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,8BAA8B,GAC/B,oBAAmB;AACpB,YAAY,EACV,mCAAmC,EACnC,4CAA4C,EAC5C,8CAA8C,EAC9C,2CAA2C,GAC5C,uDAAsD;AACvD,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC9B,oBAAoB,GACrB,qBAAoB"}
@@ -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,mCAAkC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,wBAAuB;AAClE,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,oBAAmB;AACpB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,8BAA8B,GAC/B,oBAAmB;AACpB,YAAY,EACV,mCAAmC,EACnC,4CAA4C,EAC5C,8CAA8C,EAC9C,2CAA2C,GAC5C,uDAAsD;AACvD,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC9B,oBAAoB,GACrB,qBAAoB"}
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,mCAAkC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,wBAAuB;AA6BlE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,8BAA8B,EAC/B,oBAAmB;AAOpB,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC9B,oBAAoB,EACrB,qBAAoB","sourcesContent":["export { SentinelApiService } from './sentinel-api-service.js';\nexport { SentinelEnvironment, serviceName } from './constants.js';\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.js';\nexport {\n SentinelFeature,\n SentinelKind,\n SentinelSmartTransactionStatus,\n} from './types.js';\nexport type {\n SentinelApiServiceGetNetworksAction,\n SentinelApiServiceSimulateTransactionsAction,\n SentinelApiServiceSubmitRelayTransactionAction,\n SentinelApiServiceGetSmartTransactionAction,\n} from './sentinel-api-service-method-action-types.js';\nexport {\n SentinelApiResponseValidationError,\n SentinelChainNotSupportedError,\n SentinelJsonRpcError,\n} from './errors.js';\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.js';\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"]}
@@ -2,7 +2,7 @@
2
2
  * This file is auto generated.
3
3
  * Do not edit manually.
4
4
  */
5
- import type { SentinelApiService } from './sentinel-api-service.js';
5
+ import type { SentinelApiService } from "./sentinel-api-service.cjs";
6
6
  /**
7
7
  * Fetches the Sentinel supported-network registry. The result is cached, as
8
8
  * the registry is stable and identical across network subdomains.
@@ -59,4 +59,4 @@ export type SentinelApiServiceGetSmartTransactionAction = {
59
59
  * Union of all SentinelApiService action types.
60
60
  */
61
61
  export type SentinelApiServiceMethodActions = SentinelApiServiceGetNetworksAction | SentinelApiServiceSimulateTransactionsAction | SentinelApiServiceSubmitRelayTransactionAction | SentinelApiServiceGetSmartTransactionAction;
62
- //# sourceMappingURL=sentinel-api-service-method-action-types.d.ts.map
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,mCAAkC;AAEpE;;;;;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,mCAAkC;AAEpE;;;;;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"}
@@ -3,4 +3,4 @@
3
3
  * Do not edit manually.
4
4
  */
5
5
  export {};
6
- //# sourceMappingURL=sentinel-api-service-method-action-types.js.map
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.js';\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"]}