@metamask-previews/sentinel-api-service 2.1.0-preview-406090321 → 2.1.0-preview-313288d71
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -0
- package/dist/types.d.ts +9 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
9
9
|
|
|
10
10
|
### Added
|
|
11
11
|
|
|
12
|
+
- Add optional `suggestFees.withRedeemerEnforcer` property to `SentinelSimulationRequest`, optional `balance` property to `SentinelStateOverrides`, and optional `sponsorship.sponsor` property to `SentinelSimulationResponse` ([#9476](https://github.com/MetaMask/core/pull/9476))
|
|
12
13
|
- Add support for Node.js 26 ([#10981](https://github.com/MetaMask/core/pull/10981))
|
|
13
14
|
|
|
14
15
|
### Changed
|
package/dist/types.d.ts
CHANGED
|
@@ -145,6 +145,8 @@ export type SentinelSimulationTransaction = {
|
|
|
145
145
|
*/
|
|
146
146
|
export type SentinelStateOverrides = {
|
|
147
147
|
[address: Hex]: {
|
|
148
|
+
/** Override the native balance of an address. */
|
|
149
|
+
balance?: Hex;
|
|
148
150
|
/** Override the code for an address. */
|
|
149
151
|
code?: Hex;
|
|
150
152
|
/** Overrides to the storage slots for an address. */
|
|
@@ -171,6 +173,11 @@ export type SentinelSimulationRequest = {
|
|
|
171
173
|
with7702?: boolean;
|
|
172
174
|
/** Whether to include the gas fee of the token transfer. */
|
|
173
175
|
withFeeTransfer?: boolean;
|
|
176
|
+
/**
|
|
177
|
+
* Whether to include a RedeemerEnforcer caveat, restricting redemption to
|
|
178
|
+
* the relay signers, in the delegation used for the EIP-7702 estimate.
|
|
179
|
+
*/
|
|
180
|
+
withRedeemerEnforcer?: boolean;
|
|
174
181
|
/** Whether to include the native transfer if available. */
|
|
175
182
|
withTransfer?: boolean;
|
|
176
183
|
};
|
|
@@ -376,6 +383,8 @@ export type SentinelSimulationResponse = {
|
|
|
376
383
|
isSponsored: boolean;
|
|
377
384
|
/** Error message for the sponsorship determination, if any. */
|
|
378
385
|
error: string | null;
|
|
386
|
+
/** Name of the party paying the gas fee, such as `Uniswap` or `MetaMask`. */
|
|
387
|
+
sponsor?: string;
|
|
379
388
|
};
|
|
380
389
|
/** Simulation data for each transaction in the request. */
|
|
381
390
|
transactions: SentinelSimulationResponseTransaction[];
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +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,CAAC;AAC3C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAE9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AACvE,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,+CAA+C,CAAC;AAErG;;GAEG;AACH,MAAM,MAAM,yCAAyC,GACnD,kCAAkC,CAAC,OAAO,WAAW,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GACjC,+BAA+B,GAC/B,yCAAyC,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,mCAAmC,GAAG,4BAA4B,CAC5E,OAAO,WAAW,CACnB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,2CAA2C,GACrD,oCAAoC,CAAC,OAAO,WAAW,CAAC,CAAC;AAE3D;;GAEG;AACH,MAAM,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
|
|
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;AAgXD;;;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, or the\n * configuration of a single network from the `/network` endpoint.\n */\nexport type SentinelNetwork = {\n /** Raw field name from the Sentinel API response; note uppercase 'D'. */\n chainID?: number;\n\n /** Whether simulation (confirmations) is supported for this chain. */\n confirmations?: boolean;\n\n /** Addresses of the relay signers that submit relay transactions. */\n cubistSigners?: Hex[];\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 the bundle path is supported for this chain. */\n sendBundle?: boolean;\n\n /** Whether simulations on this chain include gas fees for native tokens. */\n simulationIncludeFees?: boolean;\n\n /** Whether smart transactions are supported for this chain. */\n smartTransactions?: 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"]}
|
|
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;AA4XD;;;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 native balance of an address. */\n balance?: Hex;\n\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 /**\n * Whether to include a RedeemerEnforcer caveat, restricting redemption to\n * the relay signers, in the delegation used for the EIP-7702 estimate.\n */\n withRedeemerEnforcer?: 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, or the\n * configuration of a single network from the `/network` endpoint.\n */\nexport type SentinelNetwork = {\n /** Raw field name from the Sentinel API response; note uppercase 'D'. */\n chainID?: number;\n\n /** Whether simulation (confirmations) is supported for this chain. */\n confirmations?: boolean;\n\n /** Addresses of the relay signers that submit relay transactions. */\n cubistSigners?: Hex[];\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 the bundle path is supported for this chain. */\n sendBundle?: boolean;\n\n /** Whether simulations on this chain include gas fees for native tokens. */\n simulationIncludeFees?: boolean;\n\n /** Whether smart transactions are supported for this chain. */\n smartTransactions?: 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 /** Name of the party paying the gas fee, such as `Uniswap` or `MetaMask`. */\n sponsor?: string;\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"]}
|