Skip to main content

SentinelApiService Actions

9 actions registered.

NameDeprecated
cancel
getBatchStatus
getFees
getNetwork
getNetworks
getSmartTransaction
simulateTransactions
submitRelayTransaction
submitTransactions

SentinelApiService:cancel​

Package: @metamask/sentinel-api-service

Cancels a smart transaction via POST /v1/networks/{chainId}/cancel. Not cached.

Parameters:

NameDescription
requestThe cancel request.

Returns: The cancel result. cancelled is true on success.

Handler signature:

(request: SentinelCancelRequest) => Promise<SentinelCancelResponse>

SentinelApiService:getBatchStatus​

Package: @metamask/sentinel-api-service

Looks up the statuses of several smart transactions via GET /v1/networks/{chainId}/batchStatus. Not cached, since statuses change while transactions are pending.

Parameters:

NameDescription
requestThe batch status request.

Returns: The status of each requested transaction, keyed by UUID.

Handler signature:

(request: SentinelBatchStatusRequest) => Promise<SentinelBatchStatusResponse>

SentinelApiService:getFees​

Package: @metamask/sentinel-api-service

Quotes gas fees for unsigned smart transactions via POST /v1/networks/{chainId}/getFees. Not cached, since a quote goes stale immediately.

Parameters:

NameDescription
requestThe fee quote request.

Returns: The fee quote response. One entry in txs per transaction, in request order.

Handler signature:

(request: SentinelGetFeesRequest) => Promise<SentinelGetFeesResponse>

SentinelApiService:getNetwork​

Package: @metamask/sentinel-api-service

Fetches the configuration of a single network from the /network endpoint of that network's subdomain. The subdomain is resolved from the supported-network registry. Not cached as it is the sentinel live capabilities endpoint.

Parameters:

NameDescription
chainIdThe chain ID of the network.

Returns: The network configuration.

Handler signature:

(chainId: Hex) => Promise<SentinelNetwork>

SentinelApiService:getNetworks​

Package: @metamask/sentinel-api-service

Fetches the Sentinel supported-network registry. The result is cached, as the registry is stable and identical across network subdomains.

Returns: The network registry, keyed by decimal chain ID.

Handler signature:

() => Promise<SentinelNetworkRegistry>

SentinelApiService:getSmartTransaction​

Package: @metamask/sentinel-api-service

Looks up the state of a submitted smart transaction by UUID against the /smart-transactions/{uuid} endpoint. Performs a single request; callers own any polling loop. Not cached.

Parameters:

NameDescription
requestThe smart-transaction lookup request.

Returns: The response envelope containing the smart transaction(s) associated with the requested UUID.

Handler signature:

(request: SentinelSmartTransactionRequest) => Promise<SentinelSmartTransactionResponse>

SentinelApiService:simulateTransactions​

Package: @metamask/sentinel-api-service

Simulates transactions against the Sentinel API via infura_simulateTransactions. Not cached, since each request body is unique and stale simulations must not be reused.

Parameters:

NameDescription
chainIdThe chain ID to simulate on.
requestThe simulation request.
optionsAdditional options.
options.getUrlOptional callback that receives the default Sentinel URL resolved for the chain and returns the URL to use instead. Lets consumers rewrite the request URL (for example to route through the MetaMask Shield proxy) without the service knowing about those concerns.
options.traceContextOptional trace context to nest the simulation trace under. Without it, clients that do not infer a parent from the active span record the trace as a root span.

Returns: The simulation response.

Handler signature:

(chainId: Hex, request: SentinelSimulationRequest, options?: {
getUrl?: (defaultUrl: string) => string | Promise<string>;
} & SentinelApiServiceTraceOptions) => Promise<SentinelSimulationResponse>

SentinelApiService:submitRelayTransaction​

Package: @metamask/sentinel-api-service

Submits a signed relay (gas station) transaction to the Sentinel API via eth_sendRelayTransaction. Not cached.

Parameters:

NameDescription
requestThe relay submit request.

Returns: The relay submit response containing the tracking UUID.

Handler signature:

(request: SentinelRelaySubmitRequest) => Promise<SentinelRelaySubmitResponse>

SentinelApiService:submitTransactions​

Package: @metamask/sentinel-api-service

Submits signed smart transactions via POST /v1/networks/{chainId}/submitTransactions. Not cached.

Parameters:

NameDescription
requestThe submit request.

Returns: The UUID assigned to the submitted batch.

Handler signature:

(request: SentinelSubmitTransactionsRequest) => Promise<SentinelSubmitTransactionsResponse>