Skip to main content
logo

feegrant

The feegrant module is responsible for allowing accounts to grant fee allowances and to use fees from their accounts. Grantees can execute any transaction without the need to maintain sufficient fees.

For more information, visit https://docs.cosmos.network/main/modules/feegrant/

Message Types

Msg defines the feegrant msg service.

tx.proto
Copy

_10
service Msg {
_10
_10
// GrantAllowance grants fee allowance to the grantee on the granter's
_10
// account with the provided expiration time.
_10
rpc GrantAllowance(MsgGrantAllowance) returns (MsgGrantAllowanceResponse);
_10
_10
// RevokeAllowance revokes any fee allowance of granter's account that
_10
// has been granted to the grantee.
_10
rpc RevokeAllowance(MsgRevokeAllowance) returns (MsgRevokeAllowanceResponse);
_10
}

MsgGrantAllowance

MsgGrantAllowance adds permission for Grantee to spend up to Allowance of fees from the account of Granter.

tx.proto
Copy

_12
message MsgGrantAllowance {
_12
option (cosmos.msg.v1.signer) = "granter";
_12
_12
// granter is the address of the user granting an allowance of their funds.
_12
string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_12
_12
// grantee is the address of the user being granted an allowance of another user's funds.
_12
string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_12
_12
// allowance can be any of basic, periodic, allowed fee allowance.
_12
google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"];
_12
}

MsgGrantAllowanceResponse

MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type.

tx.proto
Copy

_1
message MsgGrantAllowanceResponse {}

MsgRevokeAllowance

MsgRevokeAllowance removes any existing Allowance from Granter to Grantee.

tx.proto
Copy

_9
message MsgRevokeAllowance {
_9
option (cosmos.msg.v1.signer) = "granter";
_9
_9
// granter is the address of the user granting an allowance of their funds.
_9
string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_9
_9
// grantee is the address of the user being granted an allowance of another user's funds.
_9
string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_9
}

MsgRevokeAllowanceResponse

MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type.

tx.proto
Copy

_1
message MsgRevokeAllowanceResponse {}

Queries

Query defines the gRPC querier service.

query.proto
Copy

_18
service Query {
_18
_18
// Allowance returns fee granted to the grantee by the granter.
_18
rpc Allowance(QueryAllowanceRequest) returns (QueryAllowanceResponse) {
_18
option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowance/{granter}/{grantee}";
_18
}
_18
_18
// Allowances returns all the grants for address.
_18
rpc Allowances(QueryAllowancesRequest) returns (QueryAllowancesResponse) {
_18
option (google.api.http).get = "/cosmos/feegrant/v1beta1/allowances/{grantee}";
_18
}
_18
_18
// AllowancesByGranter returns all the grants given by an address
_18
// Since v0.46
_18
rpc AllowancesByGranter(QueryAllowancesByGranterRequest) returns (QueryAllowancesByGranterResponse) {
_18
option (google.api.http).get = "/cosmos/feegrant/v1beta1/issued/{granter}";
_18
}
_18
}

QueryAllowanceRequest

QueryAllowanceRequest is the request type for the Query/Allowance RPC method.

query.proto
Copy

_7
message QueryAllowanceRequest {
_7
// granter is the address of the user granting an allowance of their funds.
_7
string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_7
_7
// grantee is the address of the user being granted an allowance of another user's funds.
_7
string grantee = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_7
}

QueryAllowanceResponse

QueryAllowanceResponse is the response type for the Query/Allowance RPC method.

query.proto
Copy

_4
message QueryAllowanceResponse {
_4
// allowance is a allowance granted for grantee by granter.
_4
cosmos.feegrant.v1beta1.Grant allowance = 1;
_4
}

QueryAllowancesRequest

QueryAllowancesRequest is the request type for the Query/Allowances RPC method.

query.proto
Copy

_6
message QueryAllowancesRequest {
_6
string grantee = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_6
_6
// pagination defines an pagination for the request.
_6
cosmos.base.query.v1beta1.PageRequest pagination = 2;
_6
}

QueryAllowancesResponse

QueryAllowancesResponse is the response type for the Query/Allowances RPC method.

query.proto
Copy

_7
message QueryAllowancesResponse {
_7
// allowances are allowance's granted for grantee by granter.
_7
repeated cosmos.feegrant.v1beta1.Grant allowances = 1;
_7
_7
// pagination defines an pagination for the response.
_7
cosmos.base.query.v1beta1.PageResponse pagination = 2;
_7
}

QueryAllowancesByGranterRequest

QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method.

query.proto
Copy

_6
message QueryAllowancesByGranterRequest {
_6
string granter = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"];
_6
_6
// pagination defines an pagination for the request.
_6
cosmos.base.query.v1beta1.PageRequest pagination = 2;
_6
}

QueryAllowancesByGranterResponse

QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method.

query.proto
Copy

_7
message QueryAllowancesByGranterResponse {
_7
// allowances that have been issued by the granter.
_7
repeated cosmos.feegrant.v1beta1.Grant allowances = 1;
_7
_7
// pagination defines an pagination for the response.
_7
cosmos.base.query.v1beta1.PageResponse pagination = 2;
_7
}