This page will help you get started with Shield3
๐ก Broadcast
The broadcast API relays all requests that pass Shield3 policy filters. Only eth_sendRawTransaction
are subject to the filter. Any other method is passed through to the node.
Transactions are either:
- Passed - No violations detected, transaction broadcast
- Flagged Violation detected, requests confirmation from sender via webhook or other configured notification mechanism. Transaction can be broadcast with user consent
- Blocked - Violation detected. Transaction cannot be broadcast via Shield3
๐งช Simulate
The proxy API accepts a custom method eth_simulateTransacion
to get the policy results of the transaction without broadcasting.
The parameters passed to eth_simulateTransaction
are [serializedTx, fromAddress]
Example request:
{
"jsonrpc": "2.0",
"method": "eth_simulateTransaction",
"params": [
"0xf86925808307a12094a0b86991c6218b36c1d19d4a2e9eb0ce3606eb488412f7dabbb844a9059cbb00000000000000000000000073058355084d9e10200d20760379a8bfe2c04a310000000000000000000000000000000000000000000000000000000019548352018080",
"0x01B2f8877f3e8F366eF4D4F48230949123733897"
],
"id": 42
}
Example response:
{
"jsonrpc": "2.0",
"result": {
"transaction": {
"id": "3595d30c-84e3-4ea9-9bb3-fa8fff6b238c",
"team_id": "b9027b9d-9a3c-4dd9-807d-b0aa5c307ea0",
"network": "0x013881",
"tx_status": "Simulated",
"decoded_type": "contract_with_data",
"workflow_results": {
"policyResults": [
{
"name": "Demo - Mint Method",
"result": {
"errors": [],
"reasons": [
{
"invoked": true,
"policy_id": "policy0",
"annotations": {
"name": "Mint Method",
"action": "Notify",
"message": "Allow mint on specific contract on Mumbai"
}
}
],
"decision": "Allow"
},
"policyId": "52fc621e-067f-476b-b493-97a261d34181",
"policySource": "Team"
}
],
"routingDecision": "Notify"
},
"created_at": "2023-11-09 01:17:17.59499",
"updated_at": "2023-11-09 01:17:17.797489"
},
"decision": "Notify"
},
"id": 42
}
Simulate Bundle
The proxy api also. accepts a custom method eth_simulateTransactionBundle
to get the policy results of multiple transactions without broadcasting.
The parameters passed to eth_simulateTransactionBundle
are a 2D array of serialized transactions and from addresses. The response is an array of results for each transaction
{
"jsonrpc": "2.0",
"method": "eth_simulateTransaction",
"params": [
[
"0xf86925808307a12094a0b86991c6218b36c1d19d4a2e9eb0ce3606eb488412f7dabbb844a9059cbb00000000000000000000000073058355084d9e10200d20760379a8bfe2c04a310000000000000000000000000000000000000000000000000000000019548352018080",
"0x01B2f8877f3e8F366eF4D4F48230949123733897"
],
[
"0xf86925808307a12094a0b86991c6218b36c1d19d4a2e9eb0ce3606eb488412f7dabbb844a9059cbb00000000000000000000000073058355084d9e10200d20760379a8bfe2c04a310000000000000000000000000000000000000000000000000000000019548352018080",
"0x29Bc11a799924F2Afe6644AFd1decFa777735D23"
]
],
"id": 42
}
Backfill
The proxy api also accepts a custom method eth_backfillTransaction
to get the policy results of a transaction that was already executed using another RPC provider and add it to the reporting dashboard. This can be used in cases where users interact with an application's smart contracts directly from their own wallet, but the transaction policy results are needed to inform business logic. For example in escrow applications the policy result can be used to determine if the escrow should be released or refunded.
The params accept a transaction hash of an already confirmed transaction.
{
"jsonrpc": "2.0",
"method": "eth_backfillTransaction",
"params": ["0xf6bb3574d9ebeb90f56985887cdd9c11373ddb50c53e8e8f20a69697e8b0722f"],
"id": 42
}
๐ Policies
View active policies for an API key. This can be used to embed Shield3 into partner applications