@metamask-previews/sentinel-api-service 1.0.1-preview-3e34650c2 → 1.0.1-preview-4f4c98e

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 +1 -0
  2. package/dist/{constants.d.mts → constants.d.ts} +1 -1
  3. package/dist/constants.d.ts.map +1 -0
  4. package/dist/{constants.mjs → constants.js} +1 -1
  5. package/dist/constants.js.map +1 -0
  6. package/dist/{errors.d.cts → errors.d.ts} +1 -1
  7. package/dist/errors.d.ts.map +1 -0
  8. package/dist/{errors.mjs → errors.js} +1 -1
  9. package/dist/errors.js.map +1 -0
  10. package/dist/{index.d.cts → index.d.ts} +7 -7
  11. package/dist/index.d.ts.map +1 -0
  12. package/dist/index.js +5 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/logger.d.ts +4 -0
  15. package/dist/logger.d.ts.map +1 -0
  16. package/dist/logger.js +4 -0
  17. package/dist/logger.js.map +1 -0
  18. package/dist/{sentinel-api-service-method-action-types.d.cts → sentinel-api-service-method-action-types.d.ts} +2 -2
  19. package/dist/sentinel-api-service-method-action-types.d.ts.map +1 -0
  20. package/dist/{sentinel-api-service-method-action-types.mjs → sentinel-api-service-method-action-types.js} +1 -1
  21. package/dist/sentinel-api-service-method-action-types.js.map +1 -0
  22. package/dist/{sentinel-api-service.d.mts → sentinel-api-service.d.ts} +5 -5
  23. package/dist/sentinel-api-service.d.ts.map +1 -0
  24. package/dist/{sentinel-api-service.mjs → sentinel-api-service.js} +8 -8
  25. package/dist/sentinel-api-service.js.map +1 -0
  26. package/dist/{structs.d.cts → structs.d.ts} +4 -4
  27. package/dist/structs.d.ts.map +1 -0
  28. package/dist/{structs.mjs → structs.js} +2 -2
  29. package/dist/structs.js.map +1 -0
  30. package/dist/{types.d.mts → types.d.ts} +8 -8
  31. package/dist/types.d.ts.map +1 -0
  32. package/dist/{types.mjs → types.js} +1 -1
  33. package/dist/types.js.map +1 -0
  34. package/package.json +12 -16
  35. package/dist/constants.cjs +0 -71
  36. package/dist/constants.cjs.map +0 -1
  37. package/dist/constants.d.cts +0 -63
  38. package/dist/constants.d.cts.map +0 -1
  39. package/dist/constants.d.mts.map +0 -1
  40. package/dist/constants.mjs.map +0 -1
  41. package/dist/errors.cjs +0 -43
  42. package/dist/errors.cjs.map +0 -1
  43. package/dist/errors.d.cts.map +0 -1
  44. package/dist/errors.d.mts +0 -27
  45. package/dist/errors.d.mts.map +0 -1
  46. package/dist/errors.mjs.map +0 -1
  47. package/dist/index.cjs +0 -17
  48. package/dist/index.cjs.map +0 -1
  49. package/dist/index.d.cts.map +0 -1
  50. package/dist/index.d.mts +0 -7
  51. package/dist/index.d.mts.map +0 -1
  52. package/dist/index.mjs +0 -5
  53. package/dist/index.mjs.map +0 -1
  54. package/dist/logger.cjs +0 -7
  55. package/dist/logger.cjs.map +0 -1
  56. package/dist/logger.d.cts +0 -5
  57. package/dist/logger.d.cts.map +0 -1
  58. package/dist/logger.d.mts +0 -5
  59. package/dist/logger.d.mts.map +0 -1
  60. package/dist/logger.mjs +0 -4
  61. package/dist/logger.mjs.map +0 -1
  62. package/dist/sentinel-api-service-method-action-types.cjs +0 -7
  63. package/dist/sentinel-api-service-method-action-types.cjs.map +0 -1
  64. package/dist/sentinel-api-service-method-action-types.d.cts.map +0 -1
  65. package/dist/sentinel-api-service-method-action-types.d.mts +0 -62
  66. package/dist/sentinel-api-service-method-action-types.d.mts.map +0 -1
  67. package/dist/sentinel-api-service-method-action-types.mjs.map +0 -1
  68. package/dist/sentinel-api-service.cjs +0 -316
  69. package/dist/sentinel-api-service.cjs.map +0 -1
  70. package/dist/sentinel-api-service.d.cts +0 -90
  71. package/dist/sentinel-api-service.d.cts.map +0 -1
  72. package/dist/sentinel-api-service.d.mts.map +0 -1
  73. package/dist/sentinel-api-service.mjs.map +0 -1
  74. package/dist/structs.cjs +0 -58
  75. package/dist/structs.cjs.map +0 -1
  76. package/dist/structs.d.cts.map +0 -1
  77. package/dist/structs.d.mts +0 -63
  78. package/dist/structs.d.mts.map +0 -1
  79. package/dist/structs.mjs.map +0 -1
  80. package/dist/types.cjs +0 -36
  81. package/dist/types.cjs.map +0 -1
  82. package/dist/types.d.cts +0 -420
  83. package/dist/types.d.cts.map +0 -1
  84. package/dist/types.d.mts.map +0 -1
  85. package/dist/types.mjs.map +0 -1
package/CHANGELOG.md CHANGED
@@ -11,6 +11,7 @@ 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))
14
15
  - Bump `@metamask/superstruct` from `^3.1.0` to `^3.4.1` ([#9754](https://github.com/MetaMask/core/pull/9754))
15
16
  - Bump `@tanstack/query-core` from `^4.43.0` to `^5.62.16` ([#9712](https://github.com/MetaMask/core/pull/9712))
16
17
  - Bump `@metamask/base-data-service` from `^0.1.3` to `^1.0.0` ([#9972](https://github.com/MetaMask/core/pull/9972))
@@ -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.mts.map
63
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","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.mjs.map
68
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","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"]}
@@ -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.cts.map
27
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;IAC7C,uDAAuD;IACvD,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEvB,YAAY,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,EAIzC;CACF;AAED;;;;GAIG;AACH,qBAAa,8BAA+B,SAAQ,KAAK;IACvD,YAAY,OAAO,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,MAAM,EAO/C;CACF;AAED;;;;;GAKG;AACH,qBAAa,kCAAmC,SAAQ,KAAK;IAC3D,YAAY,OAAO,CAAC,EAAE,MAAM,EAG3B;CACF"}
@@ -34,4 +34,4 @@ export class SentinelApiResponseValidationError extends Error {
34
34
  this.name = 'SentinelApiResponseValidationError';
35
35
  }
36
36
  }
37
- //# sourceMappingURL=errors.mjs.map
37
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","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"]}
@@ -1,7 +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
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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;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,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,eAAe,EACf,YAAY,EACZ,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AACpB,YAAY,EACV,mCAAmC,EACnC,4CAA4C,EAC5C,8CAA8C,EAC9C,2CAA2C,GAC5C,MAAM,+CAA+C,CAAC;AACvD,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,aAAa,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ export { SentinelApiService } from './sentinel-api-service.js';
2
+ export { SentinelEnvironment, serviceName } from './constants.js';
3
+ export { SentinelFeature, SentinelKind, SentinelSmartTransactionStatus, } from './types.js';
4
+ export { SentinelApiResponseValidationError, SentinelChainNotSupportedError, SentinelJsonRpcError, } from './errors.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AA6BlE,OAAO,EACL,eAAe,EACf,YAAY,EACZ,8BAA8B,GAC/B,MAAM,YAAY,CAAC;AAOpB,OAAO,EACL,kCAAkC,EAClC,8BAA8B,EAC9B,oBAAoB,GACrB,MAAM,aAAa,CAAC","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,4 @@
1
+ import { createModuleLogger } from '@metamask/utils';
2
+ export declare const projectLogger: import("debug").Debugger;
3
+ export { createModuleLogger };
4
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAE1E,eAAO,MAAM,aAAa,0BAA8C,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,CAAC"}
package/dist/logger.js ADDED
@@ -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.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;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"]}
@@ -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.cjs";
5
+ import type { SentinelApiService } from './sentinel-api-service.js';
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.cts.map
62
+ //# sourceMappingURL=sentinel-api-service-method-action-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel-api-service-method-action-types.d.ts","sourceRoot":"","sources":["../src/sentinel-api-service-method-action-types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;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.mjs.map
6
+ //# sourceMappingURL=sentinel-api-service-method-action-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel-api-service-method-action-types.js","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"]}
@@ -1,7 +1,7 @@
1
- import { BaseDataService } from "@metamask/base-data-service";
2
- import type { Hex } from "@metamask/utils";
3
- import { serviceName } from "./constants.mjs";
4
- import type { SentinelApiServiceMessenger, SentinelApiServiceOptions, SentinelNetworkRegistry, SentinelRelaySubmitRequest, SentinelRelaySubmitResponse, SentinelSimulationRequest, SentinelSimulationResponse, SentinelSmartTransactionRequest, SentinelSmartTransactionResponse } from "./types.mjs";
1
+ import { BaseDataService } from '@metamask/base-data-service';
2
+ import type { Hex } from '@metamask/utils';
3
+ import { serviceName } from './constants.js';
4
+ import type { SentinelApiServiceMessenger, SentinelApiServiceOptions, SentinelNetworkRegistry, SentinelRelaySubmitRequest, SentinelRelaySubmitResponse, SentinelSimulationRequest, SentinelSimulationResponse, SentinelSmartTransactionRequest, SentinelSmartTransactionResponse } from './types.js';
5
5
  /**
6
6
  * Data service that centralises all interactions with the MetaMask Sentinel
7
7
  * API (`tx-sentinel-<network>.api.cx.metamask.io`).
@@ -87,4 +87,4 @@ export declare class SentinelApiService extends BaseDataService<typeof serviceNa
87
87
  */
88
88
  getSmartTransaction(request: SentinelSmartTransactionRequest): Promise<SentinelSmartTransactionResponse>;
89
89
  }
90
- //# sourceMappingURL=sentinel-api-service.d.mts.map
90
+ //# sourceMappingURL=sentinel-api-service.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel-api-service.d.ts","sourceRoot":"","sources":["../src/sentinel-api-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAG9D,OAAO,KAAK,EAAE,GAAG,EAAQ,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAUL,WAAW,EACZ,MAAM,gBAAgB,CAAC;AAaxB,OAAO,KAAK,EACV,2BAA2B,EAC3B,yBAAyB,EAEzB,uBAAuB,EACvB,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,EACzB,0BAA0B,EAC1B,+BAA+B,EAC/B,gCAAgC,EACjC,MAAM,YAAY,CAAC;AAWpB;;;;;;;;;;;;;;;;;GAiBG;AACH,qBAAa,kBAAmB,SAAQ,eAAe,CACrD,OAAO,WAAW,EAClB,2BAA2B,CAC5B;;IASC;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,YAAY,EACV,SAAS,EACT,KAAK,EAAE,aAAgC,EACvC,WAAiC,EACjC,QAAQ,EACR,aAAa,EACb,iBAAsB,EACtB,aAAkB,GACnB,EAAE,yBAAyB,EA+B3B;IAED;;;;;OAKG;IACG,WAAW,IAAI,OAAO,CAAC,uBAAuB,CAAC,CAoCpD;IAED;;;;;;;;;;;;;OAaG;IACG,oBAAoB,CACxB,OAAO,EAAE,GAAG,EACZ,OAAO,EAAE,yBAAyB,EAClC,OAAO,GAAE;QAAE,MAAM,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;KAAO,GAC1E,OAAO,CAAC,0BAA0B,CAAC,CA4BrC;IAED;;;;;;OAMG;IACG,sBAAsB,CAC1B,OAAO,EAAE,0BAA0B,GAClC,OAAO,CAAC,2BAA2B,CAAC,CA2BtC;IAED;;;;;;;;OAQG;IACG,mBAAmB,CACvB,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,gCAAgC,CAAC,CAsC3C;CA2IF"}
@@ -10,13 +10,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
10
10
  return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
11
11
  };
12
12
  var _SentinelApiService_instances, _SentinelApiService_fetch, _SentinelApiService_clientId, _SentinelApiService_clientVersion, _SentinelApiService_environmentDomain, _SentinelApiService_jsonRpc, _SentinelApiService_getHeaders, _SentinelApiService_resolveUrl, _SentinelApiService_getNetwork, _SentinelApiService_buildUrl;
13
- import { BaseDataService } from "@metamask/base-data-service";
14
- import { handleWhen, HttpError } from "@metamask/controller-utils";
15
- import { validate } from "@metamask/superstruct";
16
- import { BASE_URL_TEMPLATE, DEFAULT_ENVIRONMENT, ENDPOINT_NETWORKS, ENDPOINT_SMART_TRANSACTIONS, ENVIRONMENT_DOMAIN, NETWORKS_STALE_TIME_MS, NETWORKS_SUBDOMAIN, RPC_METHOD_SEND_RELAY, RPC_METHOD_SIMULATE, serviceName } from "./constants.mjs";
17
- import { SentinelApiResponseValidationError, SentinelChainNotSupportedError, SentinelJsonRpcError } from "./errors.mjs";
18
- import { projectLogger, createModuleLogger } from "./logger.mjs";
19
- import { SentinelSmartTransactionResponseStruct, SentinelNetworkRegistryStruct, SentinelRelaySubmitResponseStruct, SentinelSimulationResponseStruct } from "./structs.mjs";
13
+ import { BaseDataService } from '@metamask/base-data-service';
14
+ import { handleWhen, HttpError } from '@metamask/controller-utils';
15
+ import { validate } from '@metamask/superstruct';
16
+ import { BASE_URL_TEMPLATE, DEFAULT_ENVIRONMENT, ENDPOINT_NETWORKS, ENDPOINT_SMART_TRANSACTIONS, ENVIRONMENT_DOMAIN, NETWORKS_STALE_TIME_MS, NETWORKS_SUBDOMAIN, RPC_METHOD_SEND_RELAY, RPC_METHOD_SIMULATE, serviceName, } from './constants.js';
17
+ import { SentinelApiResponseValidationError, SentinelChainNotSupportedError, SentinelJsonRpcError, } from './errors.js';
18
+ import { projectLogger, createModuleLogger } from './logger.js';
19
+ import { SentinelSmartTransactionResponseStruct, SentinelNetworkRegistryStruct, SentinelRelaySubmitResponseStruct, SentinelSimulationResponseStruct, } from './structs.js';
20
20
  const log = createModuleLogger(projectLogger, serviceName);
21
21
  const MESSENGER_EXPOSED_METHODS = [
22
22
  'getNetworks',
@@ -309,4 +309,4 @@ async function _SentinelApiService_getNetwork(chainId) {
309
309
  }, _SentinelApiService_buildUrl = function _SentinelApiService_buildUrl(subdomain) {
310
310
  return BASE_URL_TEMPLATE.replace('{0}', subdomain).replace('{1}', __classPrivateFieldGet(this, _SentinelApiService_environmentDomain, "f"));
311
311
  };
312
- //# sourceMappingURL=sentinel-api-service.mjs.map
312
+ //# sourceMappingURL=sentinel-api-service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sentinel-api-service.js","sourceRoot":"","sources":["../src/sentinel-api-service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAu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ClC,CAAC,uEASS,SAAiB;IACzB,OAAO,iBAAiB,CAAC,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC,OAAO,CACxD,KAAK,EACL,uBAAA,IAAI,6CAAmB,CACxB,CAAC;AACJ,CAAC","sourcesContent":["import { BaseDataService } from '@metamask/base-data-service';\nimport { handleWhen, HttpError } from '@metamask/controller-utils';\nimport { validate } from '@metamask/superstruct';\nimport type { Hex, Json } from '@metamask/utils';\n\nimport {\n BASE_URL_TEMPLATE,\n DEFAULT_ENVIRONMENT,\n ENDPOINT_NETWORKS,\n ENDPOINT_SMART_TRANSACTIONS,\n ENVIRONMENT_DOMAIN,\n NETWORKS_STALE_TIME_MS,\n NETWORKS_SUBDOMAIN,\n RPC_METHOD_SEND_RELAY,\n RPC_METHOD_SIMULATE,\n serviceName,\n} from './constants.js';\nimport {\n SentinelApiResponseValidationError,\n SentinelChainNotSupportedError,\n SentinelJsonRpcError,\n} from './errors.js';\nimport { projectLogger, createModuleLogger } from './logger.js';\nimport {\n SentinelSmartTransactionResponseStruct,\n SentinelNetworkRegistryStruct,\n SentinelRelaySubmitResponseStruct,\n SentinelSimulationResponseStruct,\n} from './structs.js';\nimport type {\n SentinelApiServiceMessenger,\n SentinelApiServiceOptions,\n SentinelNetwork,\n SentinelNetworkRegistry,\n SentinelRelaySubmitRequest,\n SentinelRelaySubmitResponse,\n SentinelSimulationRequest,\n SentinelSimulationResponse,\n SentinelSmartTransactionRequest,\n SentinelSmartTransactionResponse,\n} from './types.js';\n\nconst log = createModuleLogger(projectLogger, serviceName);\n\nconst MESSENGER_EXPOSED_METHODS = [\n 'getNetworks',\n 'simulateTransactions',\n 'submitRelayTransaction',\n 'getSmartTransaction',\n] as const;\n\n/**\n * Data service that centralises all interactions with the MetaMask Sentinel\n * API (`tx-sentinel-<network>.api.cx.metamask.io`).\n *\n * It exposes one method per Sentinel endpoint:\n * - {@link SentinelApiService.getNetworks} — the supported-network registry\n * (`/networks`), cached since it is stable and identical across subdomains.\n * - {@link SentinelApiService.simulateTransactions} — transaction simulation\n * (`infura_simulateTransactions`), used by `@metamask/transaction-controller`\n * and `@metamask/transaction-pay-controller`.\n * - {@link SentinelApiService.submitRelayTransaction} — gas station relay\n * submission (`eth_sendRelayTransaction`), used by the extension and mobile.\n * - {@link SentinelApiService.getSmartTransaction} — smart-transaction status\n * lookup (`/smart-transactions/{uuid}`).\n *\n * Consumers derive higher-level concerns (whether a chain supports simulation\n * or relay, polling loops, etc.) from the raw endpoint responses.\n */\nexport class SentinelApiService extends BaseDataService<\n typeof serviceName,\n SentinelApiServiceMessenger\n> {\n readonly #fetch: typeof fetch;\n\n readonly #clientId?: string;\n\n readonly #clientVersion?: string;\n\n readonly #environmentDomain: string;\n\n /**\n * Constructs a new SentinelApiService.\n *\n * @param options - The constructor options. See\n * {@link SentinelApiServiceOptions}.\n * @param options.messenger - The messenger suited for this service.\n * @param options.fetch - The `fetch` function to use for requests. Defaults\n * to the global `fetch`.\n * @param options.environment - The Sentinel API environment to target\n * (`dev`, `uat`, or `prod`). Defaults to `prod`.\n * @param options.clientId - Identifier for the calling client (for example\n * `extension` or `mobile`), sent as the `X-Client-Id` header.\n * @param options.clientVersion - Version of the calling client, sent as the\n * `X-Client-Version` header when provided.\n * @param options.queryClientConfig - Configuration for the underlying\n * TanStack Query client.\n * @param options.policyOptions - Options to pass to `createServicePolicy`.\n * Retries are disabled by default (`maxRetries: 0`) to preserve the\n * single-attempt behaviour of the clients this service replaces; pass\n * `maxRetries` here to opt in.\n */\n constructor({\n messenger,\n fetch: fetchFunction = globalThis.fetch,\n environment = DEFAULT_ENVIRONMENT,\n clientId,\n clientVersion,\n queryClientConfig = {},\n policyOptions = {},\n }: SentinelApiServiceOptions) {\n super({\n name: serviceName,\n messenger,\n queryClientConfig,\n policyOptions: {\n // Disable retries by default so the service is behaviourally\n // backwards-compatible with the single-request clients it replaces.\n // Callers can override via `policyOptions.maxRetries`.\n maxRetries: 0,\n retryFilterPolicy: handleWhen(\n (error) =>\n !(error instanceof SentinelApiResponseValidationError) &&\n !(error instanceof SentinelChainNotSupportedError) &&\n !(error instanceof SentinelJsonRpcError),\n ),\n ...policyOptions,\n },\n });\n\n this.#fetch = fetchFunction;\n this.#environmentDomain = ENVIRONMENT_DOMAIN[environment];\n this.#clientId = clientId;\n this.#clientVersion = clientVersion;\n\n this.messenger.registerMethodActionHandlers(\n this,\n MESSENGER_EXPOSED_METHODS,\n );\n\n log('Initialized');\n }\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 */\n async getNetworks(): Promise<SentinelNetworkRegistry> {\n const url = `${this.#buildUrl(NETWORKS_SUBDOMAIN)}${ENDPOINT_NETWORKS}`;\n\n const result = await this.fetchQuery({\n queryKey: [`${this.name}:getNetworks`],\n staleTime: NETWORKS_STALE_TIME_MS,\n queryFn: async (): Promise<Json> => {\n const headers = await this.#getHeaders();\n\n log('getNetworks', 'Request', url);\n\n const response = await this.#fetch(url, { headers });\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `Sentinel API: Networks request failed with status '${response.status}'`,\n );\n }\n\n const json: Json = await response.json();\n\n const [error] = validate(json, SentinelNetworkRegistryStruct);\n if (error) {\n throw new SentinelApiResponseValidationError(\n `Sentinel API: Malformed response from networks endpoint: ${error.message}`,\n );\n }\n\n log('getNetworks', 'Response', json);\n\n return json;\n },\n });\n\n return result as unknown as SentinelNetworkRegistry;\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 */\n async simulateTransactions(\n chainId: Hex,\n request: SentinelSimulationRequest,\n options: { getUrl?: (defaultUrl: string) => string | Promise<string> } = {},\n ): Promise<SentinelSimulationResponse> {\n const defaultUrl = await this.#resolveUrl(chainId, 'confirmations');\n const url = options.getUrl ? await options.getUrl(defaultUrl) : defaultUrl;\n\n const result = await this.fetchQuery({\n queryKey: [`${this.name}:simulateTransactions`, chainId, request, url],\n staleTime: 0,\n queryFn: async (): Promise<Json> => {\n log('simulateTransactions', 'Request', url, request);\n\n const rpcResult = await this.#jsonRpc(url, RPC_METHOD_SIMULATE, [\n request,\n ]);\n\n const [error] = validate(rpcResult, SentinelSimulationResponseStruct);\n if (error) {\n throw new SentinelApiResponseValidationError(\n `Sentinel API: Malformed response from simulation endpoint: ${error.message}`,\n );\n }\n\n log('simulateTransactions', 'Response', rpcResult);\n\n return rpcResult;\n },\n });\n\n return result as unknown as SentinelSimulationResponse;\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 */\n async submitRelayTransaction(\n request: SentinelRelaySubmitRequest,\n ): Promise<SentinelRelaySubmitResponse> {\n const url = await this.#resolveUrl(request.chainId, 'relayTransactions');\n\n const result = await this.fetchQuery({\n queryKey: [`${this.name}:submitRelayTransaction`, request],\n staleTime: 0,\n queryFn: async (): Promise<Json> => {\n log('submitRelayTransaction', 'Request', url, request);\n\n const rpcResult = await this.#jsonRpc(url, RPC_METHOD_SEND_RELAY, [\n request,\n ]);\n\n const [error] = validate(rpcResult, SentinelRelaySubmitResponseStruct);\n if (error) {\n throw new SentinelApiResponseValidationError(\n `Sentinel API: Malformed response from relay submit endpoint: ${error.message}`,\n );\n }\n\n log('submitRelayTransaction', 'Response', rpcResult);\n\n return rpcResult;\n },\n });\n\n return result as unknown as SentinelRelaySubmitResponse;\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 */\n async getSmartTransaction(\n request: SentinelSmartTransactionRequest,\n ): Promise<SentinelSmartTransactionResponse> {\n const { chainId, uuid } = request;\n const baseUrl = await this.#resolveUrl(chainId, 'relayTransactions');\n const url = `${baseUrl}${ENDPOINT_SMART_TRANSACTIONS}/${uuid}`;\n\n const result = await this.fetchQuery({\n queryKey: [`${this.name}:getSmartTransaction`, chainId, uuid],\n staleTime: 0,\n queryFn: async (): Promise<Json> => {\n const headers = await this.#getHeaders();\n\n log('getSmartTransaction', 'Request', url);\n\n const response = await this.#fetch(url, { headers });\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `Sentinel API: Smart-transaction request failed with status '${response.status}'`,\n );\n }\n\n const json: Json = await response.json();\n\n const [error] = validate(json, SentinelSmartTransactionResponseStruct);\n if (error) {\n throw new SentinelApiResponseValidationError(\n `Sentinel API: Malformed response from smart-transactions endpoint: ${error.message}`,\n );\n }\n\n log('getSmartTransaction', 'Response', json);\n\n return json;\n },\n });\n\n return result as unknown as SentinelSmartTransactionResponse;\n }\n\n /**\n * Performs a JSON-RPC POST to the Sentinel API and returns the `result`.\n *\n * @param url - The URL to post to.\n * @param method - The JSON-RPC method name.\n * @param params - The JSON-RPC params.\n * @returns The `result` field of the JSON-RPC response.\n */\n async #jsonRpc(url: string, method: string, params: Json[]): Promise<Json> {\n const headers = await this.#getHeaders();\n\n const response = await this.#fetch(url, {\n method: 'POST',\n headers: {\n ...headers,\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify({\n id: '1',\n jsonrpc: '2.0',\n method,\n params,\n }),\n });\n\n if (!response.ok) {\n throw new HttpError(\n response.status,\n `Sentinel API: JSON-RPC request '${method}' failed with status '${response.status}'`,\n );\n }\n\n const responseJson = (await response.json()) as {\n error?: { code?: number; message?: string };\n result?: Json;\n };\n\n if (responseJson.error) {\n const { code, message } = responseJson.error;\n throw new SentinelJsonRpcError(\n `Sentinel API: JSON-RPC error: ${message}`,\n code,\n );\n }\n\n if (responseJson.result === undefined) {\n throw new SentinelJsonRpcError(\n 'Sentinel API: JSON-RPC response missing result',\n -32603,\n );\n }\n\n return responseJson.result;\n }\n\n /**\n * Builds the outbound headers for a Sentinel request: the client identity\n * headers plus a best-effort `Authorization` bearer token. Token retrieval\n * failures are swallowed so unauthenticated requests still proceed.\n *\n * @returns The headers to attach to the request.\n */\n async #getHeaders(): Promise<Record<string, string>> {\n const headers: Record<string, string> = {};\n\n if (this.#clientId !== undefined) {\n headers['X-Client-Id'] = this.#clientId;\n }\n\n if (this.#clientVersion !== undefined) {\n headers['X-Client-Version'] = this.#clientVersion;\n }\n\n try {\n const token = await this.messenger.call(\n 'AuthenticationController:getBearerToken',\n );\n if (token) {\n headers.Authorization = `Bearer ${token}`;\n }\n } catch (error: unknown) {\n // Proceed without auth if token retrieval fails.\n log(\n 'getHeaders',\n 'Auth token unavailable, proceeding unauthenticated',\n error,\n );\n }\n\n return headers;\n }\n\n /**\n * Resolves the Sentinel URL for a chain, asserting the required capability.\n *\n * @param chainId - The chain ID to resolve a URL for.\n * @param capability - The capability flag that must be enabled.\n * @returns The resolved base URL.\n */\n async #resolveUrl(\n chainId: Hex,\n capability: 'confirmations' | 'relayTransactions',\n ): Promise<string> {\n const network = await this.#getNetwork(chainId);\n\n if (!network?.[capability]) {\n throw new SentinelChainNotSupportedError(chainId, capability);\n }\n\n return this.#buildUrl(network.network);\n }\n\n /**\n * Looks up a single network entry from the registry by chain ID.\n *\n * @param chainId - The chain ID to look up.\n * @returns The network entry, or undefined if not present.\n */\n async #getNetwork(chainId: Hex): Promise<SentinelNetwork | undefined> {\n const registry = await this.getNetworks();\n const chainIdDecimal = BigInt(chainId).toString(10);\n return registry[chainIdDecimal];\n }\n\n /**\n * Builds a Sentinel base URL for the given network subdomain, targeting the\n * environment this service was constructed with.\n *\n * @param subdomain - The network subdomain (for example `ethereum-mainnet`).\n * @returns The full base URL.\n */\n #buildUrl(subdomain: string): string {\n return BASE_URL_TEMPLATE.replace('{0}', subdomain).replace(\n '{1}',\n this.#environmentDomain,\n );\n }\n}\n"]}
@@ -41,18 +41,18 @@ export declare const SentinelRelaySubmitResponseStruct: import("@metamask/supers
41
41
  */
42
42
  export declare const SentinelSmartTransactionResponseStruct: import("@metamask/superstruct").Struct<{
43
43
  transactions: {
44
- status: string;
45
44
  hash?: string | undefined;
45
+ status: string;
46
46
  errorReason?: string | null | undefined;
47
47
  }[];
48
48
  }, {
49
49
  transactions: import("@metamask/superstruct").Struct<{
50
- status: string;
51
50
  hash?: string | undefined;
51
+ status: string;
52
52
  errorReason?: string | null | undefined;
53
53
  }[], import("@metamask/superstruct").Struct<{
54
- status: string;
55
54
  hash?: string | undefined;
55
+ status: string;
56
56
  errorReason?: string | null | undefined;
57
57
  }, {
58
58
  hash: import("@metamask/superstruct").Struct<string | undefined, null>;
@@ -60,4 +60,4 @@ export declare const SentinelSmartTransactionResponseStruct: import("@metamask/s
60
60
  errorReason: import("@metamask/superstruct").Struct<string | null | undefined, null>;
61
61
  }>>;
62
62
  }>;
63
- //# sourceMappingURL=structs.d.cts.map
63
+ //# sourceMappingURL=structs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.d.ts","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":"AAyBA;;;GAGG;AACH,eAAO,MAAM,6BAA6B;;;;;;;SAGzC,CAAC;AAUF;;;GAGG;AACH,eAAO,MAAM,gCAAgC;;;;;;;;;;;;EAE3C,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,iCAAiC;;;;EAE5C,CAAC;AAWH;;;GAGG;AACH,eAAO,MAAM,sCAAsC;;;;;;;;;;;;;;;;;;;;EAEjD,CAAC"}
@@ -1,4 +1,4 @@
1
- import { array, boolean, nullable, number, optional, record, string, type } from "@metamask/superstruct";
1
+ import { array, boolean, nullable, number, optional, record, string, type, } from '@metamask/superstruct';
2
2
  /**
3
3
  * Validates a single network entry from the `/networks` registry. Uses `type`
4
4
  * (loose) validation so that additional fields returned by the API do not
@@ -52,4 +52,4 @@ const SentinelSmartTransactionStruct = type({
52
52
  export const SentinelSmartTransactionResponseStruct = type({
53
53
  transactions: array(SentinelSmartTransactionStruct),
54
54
  });
55
- //# sourceMappingURL=structs.mjs.map
55
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../src/structs.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,MAAM,EACN,IAAI,GACL,MAAM,uBAAuB,CAAC;AAE/B;;;;GAIG;AACH,MAAM,qBAAqB,GAAG,IAAI,CAAC;IACjC,OAAO,EAAE,MAAM,EAAE;IACjB,aAAa,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IAClC,OAAO,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC3B,iBAAiB,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IACtC,iBAAiB,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;IACtC,UAAU,EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC;CAChC,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,MAAM,CACjD,MAAM,EAAE,EACR,qBAAqB,CACtB,CAAC;AAEF;;;GAGG;AACH,MAAM,2CAA2C,GAAG,IAAI,CAAC;IACvD,KAAK,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;CAC1B,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,gCAAgC,GAAG,IAAI,CAAC;IACnD,YAAY,EAAE,KAAK,CAAC,2CAA2C,CAAC;CACjE,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,iCAAiC,GAAG,IAAI,CAAC;IACpD,IAAI,EAAE,MAAM,EAAE;CACf,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,8BAA8B,GAAG,IAAI,CAAC;IAC1C,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE;IAChB,WAAW,EAAE,QAAQ,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC;CAC1C,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,sCAAsC,GAAG,IAAI,CAAC;IACzD,YAAY,EAAE,KAAK,CAAC,8BAA8B,CAAC;CACpD,CAAC,CAAC","sourcesContent":["import {\n array,\n boolean,\n nullable,\n number,\n optional,\n record,\n string,\n type,\n} from '@metamask/superstruct';\n\n/**\n * Validates a single network entry from the `/networks` registry. Uses `type`\n * (loose) validation so that additional fields returned by the API do not\n * cause rejection; only the fields we depend on are asserted.\n */\nconst SentinelNetworkStruct = type({\n network: string(),\n confirmations: optional(boolean()),\n chainID: optional(number()),\n relayTransactions: optional(boolean()),\n smartTransactions: optional(boolean()),\n sendBundle: optional(boolean()),\n});\n\n/**\n * Validates the `/networks` registry response (a map keyed by decimal chain\n * ID).\n */\nexport const SentinelNetworkRegistryStruct = record(\n string(),\n SentinelNetworkStruct,\n);\n\n/**\n * Validates a simulated-transaction result. Loose to tolerate the many\n * optional fields the API may return.\n */\nconst SentinelSimulationResponseTransactionStruct = type({\n error: optional(string()),\n});\n\n/**\n * Validates the top-level simulation response. Only the `transactions` array\n * is required by consumers.\n */\nexport const SentinelSimulationResponseStruct = type({\n transactions: array(SentinelSimulationResponseTransactionStruct),\n});\n\n/**\n * Validates the response from submitting a relay transaction.\n */\nexport const SentinelRelaySubmitResponseStruct = type({\n uuid: string(),\n});\n\n/**\n * Validates a single entry in the smart-transactions endpoint response.\n */\nconst SentinelSmartTransactionStruct = type({\n hash: optional(string()),\n status: string(),\n errorReason: optional(nullable(string())),\n});\n\n/**\n * Validates the smart-transactions endpoint response body (a list of\n * transactions).\n */\nexport const SentinelSmartTransactionResponseStruct = type({\n transactions: array(SentinelSmartTransactionStruct),\n});\n"]}
@@ -1,10 +1,10 @@
1
- import type { DataServiceCacheUpdatedEvent, DataServiceGranularCacheUpdatedEvent, DataServiceInvalidateQueriesAction } from "@metamask/base-data-service";
2
- import type { CreateServicePolicyOptions } from "@metamask/controller-utils";
3
- import type { Messenger } from "@metamask/messenger";
4
- import type { Hex } from "@metamask/utils";
5
- import type { QueryClientConfig } from "@tanstack/query-core";
6
- import type { SentinelEnvironment, serviceName } from "./constants.mjs";
7
- import type { SentinelApiServiceMethodActions } from "./sentinel-api-service-method-action-types.mjs";
1
+ import type { DataServiceCacheUpdatedEvent, DataServiceGranularCacheUpdatedEvent, DataServiceInvalidateQueriesAction } from '@metamask/base-data-service';
2
+ import type { CreateServicePolicyOptions } from '@metamask/controller-utils';
3
+ import type { Messenger } from '@metamask/messenger';
4
+ import type { Hex } from '@metamask/utils';
5
+ import type { QueryClientConfig } from '@tanstack/query-core';
6
+ import type { SentinelEnvironment, serviceName } from './constants.js';
7
+ import type { SentinelApiServiceMethodActions } from './sentinel-api-service-method-action-types.js';
8
8
  /**
9
9
  * Invalidates cached queries for {@link SentinelApiService}.
10
10
  */
@@ -417,4 +417,4 @@ export type SentinelSmartTransactionResponse = {
417
417
  transactions: SentinelSmartTransaction[];
418
418
  };
419
419
  export {};
420
- //# sourceMappingURL=types.d.mts.map
420
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,4BAA4B,EAC5B,oCAAoC,EACpC,kCAAkC,EACnC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,iBAAiB,CA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CAAC;IAEf;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,YAAY,EAAE,wBAAwB,EAAE,CAAC;CAC1C,CAAC"}
@@ -30,4 +30,4 @@ export var SentinelSmartTransactionStatus;
30
30
  SentinelSmartTransactionStatus["Validated"] = "VALIDATED";
31
31
  SentinelSmartTransactionStatus["Failed"] = "FAILED";
32
32
  })(SentinelSmartTransactionStatus || (SentinelSmartTransactionStatus = {}));
33
- //# sourceMappingURL=types.mjs.map
33
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAgHA;;;;GAIG;AACH,MAAM,CAAN,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,wCAAqB,CAAA;IACrB,sCAAmB,CAAA;IACnB,0CAAuB,CAAA;AACzB,CAAC,EAJW,eAAe,KAAf,eAAe,QAI1B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,iCAAiB,CAAA;IACjB,mCAAmB,CAAA;IACnB,iDAAiC,CAAA;IACjC,uDAAuC,CAAA;AACzC,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AAyWD;;;GAGG;AACH,MAAM,CAAN,IAAY,8BAIX;AAJD,WAAY,8BAA8B;IACxC,qDAAmB,CAAA;IACnB,yDAAuB,CAAA;IACvB,mDAAiB,CAAA;AACnB,CAAC,EAJW,8BAA8B,KAA9B,8BAA8B,QAIzC","sourcesContent":["import type {\n DataServiceCacheUpdatedEvent,\n DataServiceGranularCacheUpdatedEvent,\n DataServiceInvalidateQueriesAction,\n} from '@metamask/base-data-service';\nimport type { CreateServicePolicyOptions } from '@metamask/controller-utils';\nimport type { Messenger } from '@metamask/messenger';\nimport type { Hex } from '@metamask/utils';\nimport type { QueryClientConfig } from '@tanstack/query-core';\n\nimport type { SentinelEnvironment, serviceName } from './constants.js';\nimport type { SentinelApiServiceMethodActions } from './sentinel-api-service-method-action-types.js';\n\n/**\n * Invalidates cached queries for {@link SentinelApiService}.\n */\nexport type SentinelApiServiceInvalidateQueriesAction =\n DataServiceInvalidateQueriesAction<typeof serviceName>;\n\n/**\n * Actions that {@link SentinelApiService} exposes to other consumers.\n */\nexport type SentinelApiServiceActions =\n | SentinelApiServiceMethodActions\n | SentinelApiServiceInvalidateQueriesAction;\n\n/**\n * Published when {@link SentinelApiService}'s cache is updated.\n */\nexport type SentinelApiServiceCacheUpdatedEvent = DataServiceCacheUpdatedEvent<\n typeof serviceName\n>;\n\n/**\n * Published when a key within {@link SentinelApiService}'s cache is updated.\n */\nexport type SentinelApiServiceGranularCacheUpdatedEvent =\n DataServiceGranularCacheUpdatedEvent<typeof serviceName>;\n\n/**\n * Events that {@link SentinelApiService} exposes to other consumers.\n */\nexport type SentinelApiServiceEvents =\n | SentinelApiServiceCacheUpdatedEvent\n | SentinelApiServiceGranularCacheUpdatedEvent;\n\n/**\n * Retrieves a bearer token from the `AuthenticationController` in\n * `@metamask/profile-sync-controller`. Declared structurally to avoid pulling\n * that package's transitive dependency tree in for a single action contract.\n */\ntype AuthenticationControllerGetBearerTokenAction = {\n type: 'AuthenticationController:getBearerToken';\n handler: (entropySourceId?: string) => Promise<string>;\n};\n\n/**\n * Actions from other messengers that {@link SentinelApiService} calls.\n */\ntype AllowedActions = AuthenticationControllerGetBearerTokenAction;\n\n/**\n * The messenger which is restricted to actions and events accessed by\n * {@link SentinelApiService}.\n */\nexport type SentinelApiServiceMessenger = Messenger<\n typeof serviceName,\n SentinelApiServiceActions | AllowedActions,\n SentinelApiServiceEvents\n>;\n\n/**\n * Constructor options for {@link SentinelApiService}.\n */\nexport type SentinelApiServiceOptions = {\n /** The messenger suited for this service. */\n messenger: SentinelApiServiceMessenger;\n\n /**\n * The `fetch` function to use for requests. Defaults to the global `fetch`.\n */\n fetch?: typeof fetch;\n\n /**\n * The Sentinel API environment to target (`dev`, `uat`, or `prod`).\n * Defaults to `prod`.\n */\n environment?: SentinelEnvironment;\n\n /**\n * Identifier for the calling client (for example `extension` or `mobile`),\n * sent as the `X-Client-Id` header.\n */\n clientId?: string;\n\n /**\n * Version of the calling client, sent as the `X-Client-Version` header when\n * provided.\n */\n clientVersion?: string;\n\n /** Configuration for the underlying TanStack Query client. */\n queryClientConfig?: QueryClientConfig;\n\n /**\n * Options to pass to `createServicePolicy`. Retries are disabled by default\n * (`maxRetries: 0`) to preserve the single-attempt behaviour of the clients\n * this service replaces; pass `maxRetries` here to opt in.\n */\n policyOptions?: CreateServicePolicyOptions;\n};\n\n/**\n * The feature that originated a relay (gas station) submission. Used purely as\n * metadata forwarded to the Sentinel API for observability. Redefined here so\n * that this package does not depend on `@metamask/smart-transactions-controller`.\n */\nexport enum SentinelFeature {\n Advanced = 'advanced',\n Default = 'default',\n Sponsored = 'sponsored',\n}\n\n/**\n * The kind of relay (gas station) submission. Redefined here so that this\n * package does not depend on `@metamask/smart-transactions-controller`.\n */\nexport enum SentinelKind {\n Bundle = 'bundle',\n Default = 'default',\n GaslessEIP7702 = 'gaslessEIP7702',\n GaslessSendBundle = 'gaslessSendBundle',\n}\n\n/**\n * Optional metadata forwarded with a relay submission for observability. All\n * fields are optional and passed through verbatim to the Sentinel API.\n */\nexport type SentinelMeta = {\n client?: string;\n clientVersion?: string;\n feature?: SentinelFeature;\n kind?: SentinelKind;\n origin?: string;\n txType?: string;\n wallet?: string;\n};\n\n/**\n * An EIP-7702 authorization entry, as accepted by the Sentinel simulation API.\n */\nexport type SentinelAuthorization = {\n /** Address of the smart contract that contains the code to be set. */\n address: Hex;\n\n /** Address of the account being upgraded. */\n from: Hex;\n};\n\n/**\n * A single transaction to simulate in a Sentinel simulation request.\n */\nexport type SentinelSimulationTransaction = {\n /** EIP-7702 authorization list for the transaction. */\n authorizationList?: SentinelAuthorization[];\n\n /** Data to send with the transaction. */\n data?: Hex;\n\n /** Sender of the transaction. */\n from: Hex;\n\n /** Gas limit for the transaction. */\n gas?: Hex;\n\n /** Maximum fee per gas for the transaction. */\n maxFeePerGas?: Hex;\n\n /** Maximum priority fee per gas for the transaction. */\n maxPriorityFeePerGas?: Hex;\n\n /** Recipient of the transaction. */\n to?: Hex;\n\n /** Value to send with the transaction. */\n value?: Hex;\n};\n\n/**\n * Overrides to blockchain state, keyed by address, for a simulation request.\n */\nexport type SentinelStateOverrides = {\n [address: Hex]: {\n /** Override the code for an address. */\n code?: Hex;\n\n /** Overrides to the storage slots for an address. */\n stateDiff?: {\n [slot: Hex]: Hex;\n };\n };\n};\n\n/**\n * A request to the Sentinel API to simulate transactions. This is the superset\n * of the shapes previously used by `@metamask/transaction-controller` and\n * `@metamask/transaction-pay-controller`.\n */\nexport type SentinelSimulationRequest = {\n /** Overrides to block data for the simulation. */\n blockOverrides?: {\n time?: Hex;\n };\n\n /** Overrides to blockchain state, keyed by address. */\n overrides?: SentinelStateOverrides;\n\n /** Whether to include available token fees in the response. */\n suggestFees?: {\n /** Whether the transaction is submitted via a delegation (EIP-7702). */\n with7702?: boolean;\n\n /** Whether to include the gas fee of the token transfer. */\n withFeeTransfer?: boolean;\n\n /** Whether to include the native transfer if available. */\n withTransfer?: boolean;\n };\n\n /**\n * Transactions to be sequentially simulated. State changes impact subsequent\n * transactions in the list.\n */\n transactions: SentinelSimulationTransaction[];\n\n /** Whether to include call traces in the response. Defaults to false. */\n withCallTrace?: boolean;\n\n /** Whether to include the default block data. Defaults to false. */\n withDefaultBlockOverrides?: boolean;\n\n /** Whether to use gas fees in the simulation. Defaults to false. */\n withGas?: boolean;\n\n /** Whether to include event logs in the response. Defaults to false. */\n withLogs?: boolean;\n};\n\n/**\n * A request to submit a signed relay (gas station) transaction to the Sentinel\n * API via `eth_sendRelayTransaction`.\n */\nexport type SentinelRelaySubmitRequest = {\n /** EIP-7702 authorization tuples for the delegation. */\n authorizationList?: SentinelSignedAuthorization[];\n\n /** The chain to submit the transaction on. */\n chainId: Hex;\n\n /** The encoded calldata (for example `redeemDelegations`). */\n data: Hex;\n\n /** Optional metadata forwarded to the API for observability. */\n metadata?: SentinelMeta;\n\n /** The recipient of the transaction (for example the DelegationManager). */\n to: Hex;\n};\n\n/**\n * A fully signed EIP-7702 authorization tuple, as submitted to the relay.\n */\nexport type SentinelSignedAuthorization = {\n address: Hex;\n chainId: Hex;\n nonce: Hex;\n r: Hex;\n s: Hex;\n yParity: Hex;\n};\n\n/**\n * A request to look up the state of a submitted smart transaction by UUID.\n */\nexport type SentinelSmartTransactionRequest = {\n /** The chain the transaction was submitted on. */\n chainId: Hex;\n\n /** The UUID returned by {@link SentinelRelaySubmitResponse}. */\n uuid: string;\n};\n\n/**\n * A single network entry from the Sentinel `/networks` registry.\n */\nexport type SentinelNetwork = {\n /** Whether simulation (confirmations) is supported for this chain. */\n confirmations?: boolean;\n\n /** Raw field name from the Sentinel API response; note uppercase 'D'. */\n chainID?: number;\n\n /** The subdomain used to build the Sentinel URL for this chain. */\n network: string;\n\n /** Whether the gas station relay is supported for this chain. */\n relayTransactions?: boolean;\n\n /** Whether smart transactions are supported for this chain. */\n smartTransactions?: boolean;\n\n /** Whether the bundle path is supported for this chain. */\n sendBundle?: boolean;\n};\n\n/**\n * The Sentinel `/networks` registry response, keyed by decimal chain ID.\n */\nexport type SentinelNetworkRegistry = Record<string, SentinelNetwork>;\n\n/**\n * Raw event log emitted by a simulated transaction.\n */\nexport type SentinelSimulationLog = {\n /** Address of the account that created the event. */\n address: Hex;\n\n /** Raw data in the event that is not indexed. */\n data: Hex;\n\n /** Raw indexed data from the event. */\n topics: Hex[];\n};\n\n/**\n * Call trace of a single simulated transaction.\n */\nexport type SentinelSimulationCallTrace = {\n /** Nested calls. */\n calls?: SentinelSimulationCallTrace[] | null;\n\n /** Error message for the call, if any. */\n error?: string;\n\n /** Raw event logs created by the call. */\n logs?: SentinelSimulationLog[] | null;\n\n /** Raw return data from the call (revert hex when reverted). */\n output?: Hex;\n};\n\n/**\n * Per-account state changes recorded by a simulated transaction.\n */\nexport type SentinelSimulationStateDiffAccount = {\n /** Native balance of the account. */\n balance?: Hex;\n\n /** Nonce of the account. */\n nonce?: Hex;\n\n /** Storage values per slot. */\n storage?: {\n [slot: Hex]: Hex;\n };\n};\n\n/**\n * Changes to the blockchain state (pre/post) for a single simulated\n * transaction. Each side is keyed by account address.\n */\nexport type SentinelSimulationStateDiff = {\n /** Initial blockchain state before the transaction. */\n pre?: {\n [address: Hex]: SentinelSimulationStateDiffAccount;\n };\n\n /** Updated blockchain state after the transaction. */\n post?: {\n [address: Hex]: SentinelSimulationStateDiffAccount;\n };\n};\n\n/**\n * A token-denominated fee option returned by the simulation API when\n * `suggestFees` is requested.\n */\nexport type SentinelSimulationTokenFee = {\n /** Amount of tokens needed to pay for gas. */\n balanceNeededToken: Hex;\n\n /** Current token balance of the sender. */\n currentBalanceToken: Hex;\n\n /** Account address that the token should be transferred to. */\n feeRecipient: Hex;\n\n /** Conversion rate of 1 token to native WEI. */\n rateWei: Hex;\n\n /** Portion of `balanceNeededToken` that is the fee paid to MetaMask. */\n serviceFee?: Hex;\n\n /** Token data independent of the current transaction. */\n token: {\n /** Address of the token contract. */\n address: Hex;\n\n /** Number of decimals used by the token. */\n decimals: number;\n\n /** Symbol of the token. */\n symbol: string;\n };\n\n /** Estimated gas limit required for the fee transfer. */\n transferEstimate: Hex;\n};\n\n/**\n * A single recommended fee level for a simulated transaction, including the\n * gas fee parameters and the token-fee options at that level.\n */\nexport type SentinelSimulationFeeLevel = {\n /** Gas limit for the fee level. */\n gas: Hex;\n\n /** Maximum fee per gas for the fee level. */\n maxFeePerGas: Hex;\n\n /** Maximum priority fee per gas for the fee level. */\n maxPriorityFeePerGas: Hex;\n\n /** Token fee options for the fee level. */\n tokenFees: SentinelSimulationTokenFee[];\n};\n\n/**\n * The result of simulating a single transaction.\n */\nexport type SentinelSimulationResponseTransaction = {\n /** Hierarchy of call data including nested calls and logs. */\n callTrace?: SentinelSimulationCallTrace;\n\n /** An error message indicating the transaction could not be simulated. */\n error?: string;\n\n /** Recommended gas fees for the transaction, per fee level. */\n fees?: SentinelSimulationFeeLevel[];\n\n /**\n * Estimated total gas cost of the transaction, in wei as a decimal number.\n * Included in the `stateDiff` when `withGas` is true.\n */\n gasCost?: number;\n\n /** Required `gasLimit` for the transaction. */\n gasLimit?: Hex;\n\n /** Total gas used by the transaction. */\n gasUsed?: Hex;\n\n /** Return value of the transaction (for example the balance from `balanceOf`). */\n return: Hex;\n\n /** Changes to the blockchain state produced by the transaction. */\n stateDiff?: SentinelSimulationStateDiff;\n};\n\n/**\n * The response from the Sentinel simulation API.\n */\nexport type SentinelSimulationResponse = {\n /** Sponsorship determination for the request. */\n sponsorship: {\n /** Whether the gas costs are sponsored (no transfer required). */\n isSponsored: boolean;\n\n /** Error message for the sponsorship determination, if any. */\n error: string | null;\n };\n\n /** Simulation data for each transaction in the request. */\n transactions: SentinelSimulationResponseTransaction[];\n};\n\n/**\n * The response from submitting a relay transaction.\n */\nexport type SentinelRelaySubmitResponse = {\n uuid: string;\n};\n\n/**\n * Terminal and non-terminal statuses reported by the smart-transactions\n * endpoint.\n */\nexport enum SentinelSmartTransactionStatus {\n Pending = 'PENDING',\n Validated = 'VALIDATED',\n Failed = 'FAILED',\n}\n\n/**\n * A single smart-transaction entry returned by the `/smart-transactions/{uuid}`\n * endpoint.\n */\nexport type SentinelSmartTransaction = {\n /** The on-chain transaction hash, once available. */\n hash?: string;\n\n /**\n * The current status of the smart transaction. Compare against\n * {@link SentinelSmartTransactionStatus} values.\n */\n status: string;\n\n /**\n * The reason the transaction failed, if any. May be `null` when the API\n * explicitly reports no error reason.\n */\n errorReason?: string | null;\n};\n\n/**\n * The response from the `/smart-transactions/{uuid}` endpoint. Consumers\n * select the transaction(s) they care about from the `transactions` array\n * (typically the first entry).\n */\nexport type SentinelSmartTransactionResponse = {\n transactions: SentinelSmartTransaction[];\n};\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/sentinel-api-service",
3
- "version": "1.0.1-preview-3e34650c2",
3
+ "version": "1.0.1-preview-4f4c98e",
4
4
  "description": "Data service for the MetaMask Sentinel API",
5
5
  "keywords": [
6
6
  "Ethereum",
@@ -18,19 +18,12 @@
18
18
  "files": [
19
19
  "dist/"
20
20
  ],
21
+ "type": "module",
21
22
  "sideEffects": false,
22
- "main": "./dist/index.cjs",
23
- "types": "./dist/index.d.cts",
24
23
  "exports": {
25
24
  ".": {
26
- "import": {
27
- "types": "./dist/index.d.mts",
28
- "default": "./dist/index.mjs"
29
- },
30
- "require": {
31
- "types": "./dist/index.d.cts",
32
- "default": "./dist/index.cjs"
33
- }
25
+ "types": "./dist/index.d.ts",
26
+ "default": "./dist/index.js"
34
27
  },
35
28
  "./package.json": "./package.json"
36
29
  },
@@ -39,9 +32,11 @@
39
32
  "registry": "https://registry.npmjs.org/"
40
33
  },
41
34
  "scripts": {
42
- "build": "ts-bridge --project tsconfig.build.json --verbose --clean --no-references",
43
- "build:all": "ts-bridge --project tsconfig.build.json --verbose --clean",
35
+ "build": "tsc --project tsconfig.build.json",
36
+ "build:all": "tsc --build tsconfig.build.json --verbose",
37
+ "build:clean": "yarn build:only-clean && yarn build",
44
38
  "build:docs": "typedoc",
39
+ "build:only-clean": "rimraf './dist' './tsconfig.build.tsbuildinfo'",
45
40
  "changelog:update": "../../scripts/update-changelog.sh @metamask/sentinel-api-service",
46
41
  "changelog:validate": "../../scripts/validate-changelog.sh @metamask/sentinel-api-service",
47
42
  "lint:tsconfigs": "tsx ../../scripts/lint-tsconfigs/lint-tsconfigs.mts",
@@ -64,18 +59,19 @@
64
59
  },
65
60
  "devDependencies": {
66
61
  "@metamask/auto-changelog": "^6.1.0",
67
- "@ts-bridge/cli": "^0.6.4",
68
62
  "@types/jest": "^30.0.0",
63
+ "@typescript/native": "npm:typescript@^7.0.2",
69
64
  "deepmerge": "^4.2.2",
70
65
  "jest": "^30.4.2",
71
66
  "nock": "^13.3.1",
67
+ "rimraf": "^5.0.5",
72
68
  "ts-jest": "^29.4.11",
73
69
  "tsx": "^4.20.5",
74
70
  "typedoc": "^0.25.13",
75
71
  "typedoc-plugin-missing-exports": "^2.0.0",
76
- "typescript": "~5.3.3"
72
+ "typescript": "npm:@typescript/typescript6@^6.0.2"
77
73
  },
78
74
  "engines": {
79
- "node": "^18.18 || >=20"
75
+ "node": "^22.14.0 || ^24"
80
76
  }
81
77
  }
@@ -1,71 +0,0 @@
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
@@ -1 +0,0 @@
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"]}