ALLOW
or DENY
) prescribed by the rule.nodeJS
SDK, or via the REST API.
DENY
actions take precedence over ALLOW
actions. If no rules resolve, the policy will default to DENY
.
Policy objects have the following properties:
rules
that are associated with the requested RPC method.
For instance, if your application makes an 'eth_signTransaction'
request, the policy engine will only evalaute rules associated with the 'eth_signTransaction'
method in the policy.
The rules are evaluated as follows:
DENY
action, the policy engine will DENY
the request.ALLOW
action, and no rules evaluate to DENY
, then the policy engine will ALLOW
the request.DENY
the request.
This also applies to Solana transactions such that every Instruction in a Solana transaction is evaluated against the rules of the policy. Every instruction must evaluate to an ALLOW
action for the transaction to be allowed.
X
, and the policy’s
rules
contains no entry with a method
corresponding to X
, the engine will deny the request
by default. If you’d like the policy engine to instead allow requests for RPC method X
by
default, we recommend setting up an “Allow all” Rule
for that RPC method like
so.Rule
object within the policy’s rules
array. A rule is composed of an set of boolean conditions and an action (ALLOW
or DENY
) that is taken if an RPC request satisfies all of the conditions in the rule.
Rule objects have the following fields:
Each rule corresponds to an individual action that should be allowed or denied by a server wallet. For example, you might configure rules for a policy to:
ALLOW
transfers of the native token to a set of allowlisted recipient addressesDENY
interactions with specific Ethereum smart contracts or Solana programsethereum_calldata
conditions also require an abi
parameter used to decode the calldata, and ethereum_typed_data_message
conditions require a typed_data
parameter to define the schema for the typed data message.
to
parameter of an EVM transaction, the fee_payer
parameter of a Solana transaction, or an spl_transfer_recipient
field that is populated when the policy engine interprets a transaction.
Fields are derived from field sources, which surface data from the wallet request. Possible field sources are listed below.
Field source | Description | Example fields |
---|---|---|
'ethereum_transaction' | The verbatim Ethereum transaction object in an eth_signTransaction or eth_sendTransaction request. | to , chain_id , value . |
'ethereum_calldata' | The decoded calldata in a smart contract interaction as the smart contract method’s parameters. Note that that 'ethereum_calldata' conditions must contain an abi parameter with the JSON ABI of the smart contract | function_name , _to , _value (for a ERC20 interaction) |
'ethereum_typed_data_domain' | Attributes from the signing domain that will verify the signature. | chainId , verifyingContract |
'ethereum_typed_data_message' | types and primary_type attributes of the TypedData JSON object defined in EIP-712. | dot-separated path to value in message object, i.e. to.wallet |
'solana_program_instruction' | Solana program instruction from a signTransaction or signAndSendTransaction request. | programId |
'solana_system_program_instruction' | Fields relevant to the Solana System Program and its Transfer instruction. | instructionName , Transfer.to , Transfer.from , Transfer.lamports |
'solana_token_program_instruction' | Fields relevant to the SPL Token Program and its Transfer instruction. | instructionName , Transfer.source , Transfer.destination , Transfer.authority , Transfer.amount |
eq
, neq
, lt
, lte
, gt
, gte
, in
.
X
, the value for the condition is X
.