> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cosmos.network/llms.txt
> Use this file to discover all available pages before exploring further.

# Feegrant

> gRPC queries and transaction messages defined by the feegrant module in Cosmos SDK v0.55.

<Info>
  Generated from [`cosmos/cosmos-sdk@2086680ff8b0`](https://github.com/cosmos/cosmos-sdk/tree/2086680ff8b08fd269ee653e087ea577bab79534/proto) on ref `release/v0.55.x`.
</Info>

## Queries

A node exposes only the services its application registers:

* gRPC on port 9090
* REST on port 1317, if the method has an HTTP binding

Run `grpcurl -plaintext localhost:9090 list` to see what a node serves.

Queries are read-only and never pass through consensus. See [Queries](/sdk/latest/learn/concepts/transactions#queries).

Replace `<string>` placeholders with real values and omit unused filters. Payloads use protobuf JSON, and some `string` fields accept enum constants listed under Types. Field tables give the encoding each value takes.

Examples assume a local node. For TLS endpoints, use port 443 and omit `-plaintext`. See [gRPC services](/sdk/latest/api-reference/grpc/index) for reflection, address formats, and decimal encoding.

### Allowance

Allowance returns granted allowance to the grantee by the granter.

|      |                                                              |
| ---- | ------------------------------------------------------------ |
| gRPC | `cosmos.feegrant.v1beta1.Query/Allowance`                    |
| REST | `GET /cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}` |

Request `QueryAllowanceRequest`:

| Field     | Type     | Description                                                                                                             |
| --------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `granter` | `string` | granter is the address of the user granting an allowance of their funds. Encoded as cosmos.AddressString.               |
| `grantee` | `string` | grantee is the address of the user being granted an allowance of another user's funds. Encoded as cosmos.AddressString. |

Response `QueryAllowanceResponse`:

| Field       | Type                                      | Description                                               |
| ----------- | ----------------------------------------- | --------------------------------------------------------- |
| `allowance` | [`Grant`](#cosmos-feegrant-v1beta1-grant) | allowance is an allowance granted for grantee by granter. |

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext -d '{"granter":"<string>","grantee":"<string>"}' \
  localhost:9090 cosmos.feegrant.v1beta1.Query/Allowance
```

### Allowances

Allowances returns all the grants for the given grantee address.

|      |                                                     |
| ---- | --------------------------------------------------- |
| gRPC | `cosmos.feegrant.v1beta1.Query/Allowances`          |
| REST | `GET /cosmos/feegrant/v1beta1/allowances/{grantee}` |

Request `QueryAllowancesRequest`:

| Field        | Type                                                    | Description                                      |
| ------------ | ------------------------------------------------------- | ------------------------------------------------ |
| `grantee`    | `string`                                                | Encoded as cosmos.AddressString.                 |
| `pagination` | [`PageRequest`](#cosmos-base-query-v1beta1-pagerequest) | pagination defines a pagination for the request. |

Response `QueryAllowancesResponse`:

| Field        | Type                                                      | Description                                                |
| ------------ | --------------------------------------------------------- | ---------------------------------------------------------- |
| `allowances` | [`Grant`](#cosmos-feegrant-v1beta1-grant)\[]              | allowances are allowance's granted for grantee by granter. |
| `pagination` | [`PageResponse`](#cosmos-base-query-v1beta1-pageresponse) | pagination defines a pagination for the response.          |

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext -d '{"grantee":"<string>","pagination":{"limit":"1"}}' \
  localhost:9090 cosmos.feegrant.v1beta1.Query/Allowances
```

### AllowancesByGranter

AllowancesByGranter returns all the grants given by an address

|      |                                                     |
| ---- | --------------------------------------------------- |
| gRPC | `cosmos.feegrant.v1beta1.Query/AllowancesByGranter` |
| REST | `GET /cosmos/feegrant/v1beta1/issued/{granter}`     |

Request `QueryAllowancesByGranterRequest`:

| Field        | Type                                                    | Description                                      |
| ------------ | ------------------------------------------------------- | ------------------------------------------------ |
| `granter`    | `string`                                                | Encoded as cosmos.AddressString.                 |
| `pagination` | [`PageRequest`](#cosmos-base-query-v1beta1-pagerequest) | pagination defines a pagination for the request. |

Response `QueryAllowancesByGranterResponse`:

| Field        | Type                                                      | Description                                       |
| ------------ | --------------------------------------------------------- | ------------------------------------------------- |
| `allowances` | [`Grant`](#cosmos-feegrant-v1beta1-grant)\[]              | allowances that have been issued by the granter.  |
| `pagination` | [`PageResponse`](#cosmos-base-query-v1beta1-pageresponse) | pagination defines a pagination for the response. |

```bash theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
grpcurl -plaintext -d '{"granter":"<string>","pagination":{"limit":"1"}}' \
  localhost:9090 cosmos.feegrant.v1beta1.Query/AllowancesByGranter
```

## Transaction messages

These messages are included in signed transactions, not called as endpoints. See [Transactions](/sdk/latest/learn/concepts/transactions#transactions) for the execution model, and [Sending transactions](/sdk/latest/api-reference/transactions) for the envelope they go into.

Examples use CLI transaction JSON. Decimal fields use values such as `"0.05"`, even when their proto type is `bytes`. The gRPC `TxEncode` method instead requires the scaled value `"50000000000000000"`. See [scalar encodings](/sdk/latest/api-reference/grpc/index#scalar-encodings).

* Handler: Generated client method
* Signer: Account that must sign
* Amino name: Legacy identifier used by hardware wallets and other Amino signers

### GrantAllowance

GrantAllowance grants fee allowance to the grantee on the granter's account with the provided expiration time.

|            |                                              |
| ---------- | -------------------------------------------- |
| Type URL   | `/cosmos.feegrant.v1beta1.MsgGrantAllowance` |
| Handler    | `cosmos.feegrant.v1beta1.Msg/GrantAllowance` |
| Signer     | `granter`                                    |
| Amino name | `cosmos-sdk/MsgGrantAllowance`               |

| Field       | Type     | Description                                                                                                                                                                                                      |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `granter`   | `string` | granter is the address of the user granting an allowance of their funds. Encoded as cosmos.AddressString.                                                                                                        |
| `grantee`   | `string` | grantee is the address of the user being granted an allowance of another user's funds. Encoded as cosmos.AddressString.                                                                                          |
| `allowance` | `Any`    | allowance can be any of basic, periodic, allowed fee allowance. One of: `/cosmos.feegrant.v1beta1.AllowedMsgAllowance`, `/cosmos.feegrant.v1beta1.BasicAllowance`, `/cosmos.feegrant.v1beta1.PeriodicAllowance`. |

In a transaction:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "@type": "/cosmos.feegrant.v1beta1.MsgGrantAllowance",
  "granter": "<string>",
  "grantee": "<string>",
  "allowance": {
    "@type": "/cosmos.example.v1.MsgExample",
    "...": "the fields of that message, inline"
  }
}
```

Response `MsgGrantAllowanceResponse`:

This message has no fields.

### PruneAllowances

PruneAllowances prunes expired fee allowances, currently up to 75 at a time.

|            |                                               |
| ---------- | --------------------------------------------- |
| Type URL   | `/cosmos.feegrant.v1beta1.MsgPruneAllowances` |
| Handler    | `cosmos.feegrant.v1beta1.Msg/PruneAllowances` |
| Signer     | `pruner`                                      |
| Amino name | none registered                               |

| Field    | Type     | Description                                                                                    |
| -------- | -------- | ---------------------------------------------------------------------------------------------- |
| `pruner` | `string` | pruner is the address of the user pruning expired allowances. Encoded as cosmos.AddressString. |

In a transaction:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "@type": "/cosmos.feegrant.v1beta1.MsgPruneAllowances",
  "pruner": "<string>"
}
```

Response `MsgPruneAllowancesResponse`:

This message has no fields.

### RevokeAllowance

RevokeAllowance revokes any fee allowance of granter's account that has been granted to the grantee.

|            |                                               |
| ---------- | --------------------------------------------- |
| Type URL   | `/cosmos.feegrant.v1beta1.MsgRevokeAllowance` |
| Handler    | `cosmos.feegrant.v1beta1.Msg/RevokeAllowance` |
| Signer     | `granter`                                     |
| Amino name | `cosmos-sdk/MsgRevokeAllowance`               |

| Field     | Type     | Description                                                                                                             |
| --------- | -------- | ----------------------------------------------------------------------------------------------------------------------- |
| `granter` | `string` | granter is the address of the user granting an allowance of their funds. Encoded as cosmos.AddressString.               |
| `grantee` | `string` | grantee is the address of the user being granted an allowance of another user's funds. Encoded as cosmos.AddressString. |

In a transaction:

```json theme={"theme":{"light":"github-light-high-contrast","dark":"github-dark-high-contrast"}}
{
  "@type": "/cosmos.feegrant.v1beta1.MsgRevokeAllowance",
  "granter": "<string>",
  "grantee": "<string>"
}
```

Response `MsgRevokeAllowanceResponse`:

This message has no fields.

## Types

Messages referenced by the fields above. Protocol buffers version 3 has no required fields, so every field is optional on the wire, and a `[]` suffix marks a repeated field.

### cosmos.base.query.v1beta1.PageRequest

PageRequest is to be embedded in gRPC request messages for efficient pagination. Ex:

`message SomeRequest { Foo some_parameter = 1; PageRequest pagination = 2; }`

| Field         | Type     | Description                                                                                                                                                                                                                          |
| ------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `key`         | `bytes`  | key is a value returned in PageResponse.next\_key to begin querying the next page most efficiently. Only one of offset or key should be set.                                                                                         |
| `offset`      | `uint64` | offset is a numeric offset that can be used when key is unavailable. It is less efficient than using key. Only one of offset or key should be set.                                                                                   |
| `limit`       | `uint64` | limit is the total number of results to be returned in the result page. If left empty it will default to a value to be set by each app.                                                                                              |
| `count_total` | `bool`   | count\_total is set to true  to indicate that the result set should include a count of the total number of items available for pagination in UIs. count\_total is only respected when offset is used. It is ignored when key is set. |
| `reverse`     | `bool`   | reverse is set to true if results are to be returned in the descending order.                                                                                                                                                        |

### cosmos.base.query.v1beta1.PageResponse

PageResponse is to be embedded in gRPC response messages where the corresponding request message has used PageRequest.

`message SomeResponse { repeated Bar results = 1; PageResponse page = 2; }`

| Field      | Type     | Description                                                                                                                                  |
| ---------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| `next_key` | `bytes`  | next\_key is the key to be passed to PageRequest.key to query the next page most efficiently. It will be empty if there are no more results. |
| `total`    | `uint64` | total is total number of results available if PageRequest.count\_total was set, its value is undefined otherwise                             |

### cosmos.feegrant.v1beta1.Grant

Grant is stored in the KVStore to record a grant with full context

| Field       | Type     | Description                                                                                                                                                                                                      |
| ----------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `granter`   | `string` | granter is the address of the user granting an allowance of their funds. Encoded as cosmos.AddressString.                                                                                                        |
| `grantee`   | `string` | grantee is the address of the user being granted an allowance of another user's funds. Encoded as cosmos.AddressString.                                                                                          |
| `allowance` | `Any`    | allowance can be any of basic, periodic, allowed fee allowance. One of: `/cosmos.feegrant.v1beta1.AllowedMsgAllowance`, `/cosmos.feegrant.v1beta1.BasicAllowance`, `/cosmos.feegrant.v1beta1.PeriodicAllowance`. |
