# RpcCondition

`RpcCondition` is based on the evaluation of a JSON-RPC call.

Below, we can see an example of using `RpcCondition` to restrict based on a native asset balance.

```typescript
import { conditions } from '@nucypher/taco';

const ownsETH = new conditions.base.rpc.RpcCondition({
  method: 'eth_getBalance',
  parameters: [':userAddress'],
  chain: 1,
  returnValueTest: {
    comparator: '>=',
    value: 1,
  },
});

```

Knowing the [signature of this method](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance), we need to pass a wallet address parameter into the `parameters` field (the default block used is `latest`).

```typescript
 method: 'eth_getBalance',
 parameters: [':userAddress'],
```

`':userAddress'` is a reserved [context variable](/for-developers/taco-sdk/references/authentication/conditioncontext-and-context-variables.md) that denotes the address of the operation requester. Before the attempt is made, the `':userAddress'` value will be replaced with the actual wallet address.

Now that we've specified our contract call, we need to figure out what to do with the contract call results. Let's take a look at the `returnValueTest` field:

```typescript
returnValueTest: {
  comparator: '>=',
  value: 1,
},
```

`returnValueTest` is going to evaluate the contract call result according to the following logic:

* Since the RPC call returns only one value, we don't need to specify the `index` field
* Compare it using the following comparator, `comparator: '>='`
* Compare the value returned by the RPC call to the following value, `value: 1`

Combining these three, we can see that the `returnValueTest` will "trigger" if the value returned by the RPC call is greater than one.

In other words, our condition is only satisfied if `eth_getBalance(:userAddress) >= 1` i.e. only if the user's wallet has a native balance greater than or equal to 1.

### Learn more

* [Programmable Conditions](/for-developers/taco-sdk/references.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.taco.build/for-developers/taco-sdk/references/conditions/rpccondition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
