github.com/Finschia/finschia-sdk@v0.49.1/proto/cosmos/feegrant/v1beta1/feegrant.proto (about) 1 // Since: cosmos-sdk 0.43 2 syntax = "proto3"; 3 package cosmos.feegrant.v1beta1; 4 5 import "gogoproto/gogo.proto"; 6 import "google/protobuf/any.proto"; 7 import "cosmos_proto/cosmos.proto"; 8 import "cosmos/base/v1beta1/coin.proto"; 9 import "google/protobuf/timestamp.proto"; 10 import "google/protobuf/duration.proto"; 11 12 option go_package = "github.com/Finschia/finschia-sdk/x/feegrant"; 13 14 // BasicAllowance implements Allowance with a one-time grant of tokens 15 // that optionally expires. The grantee can use up to SpendLimit to cover fees. 16 message BasicAllowance { 17 option (cosmos_proto.implements_interface) = "FeeAllowanceI"; 18 19 // spend_limit specifies the maximum amount of tokens that can be spent 20 // by this allowance and will be updated as tokens are spent. If it is 21 // empty, there is no spend limit and any amount of coins can be spent. 22 repeated cosmos.base.v1beta1.Coin spend_limit = 1 23 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coins"]; 24 25 // expiration specifies an optional time when this allowance expires 26 google.protobuf.Timestamp expiration = 2 [(gogoproto.stdtime) = true]; 27 } 28 29 // PeriodicAllowance extends Allowance to allow for both a maximum cap, 30 // as well as a limit per time period. 31 message PeriodicAllowance { 32 option (cosmos_proto.implements_interface) = "FeeAllowanceI"; 33 34 // basic specifies a struct of `BasicAllowance` 35 BasicAllowance basic = 1 [(gogoproto.nullable) = false]; 36 37 // period specifies the time duration in which period_spend_limit coins can 38 // be spent before that allowance is reset 39 google.protobuf.Duration period = 2 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false]; 40 41 // period_spend_limit specifies the maximum number of coins that can be spent 42 // in the period 43 repeated cosmos.base.v1beta1.Coin period_spend_limit = 3 44 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coins"]; 45 46 // period_can_spend is the number of coins left to be spent before the period_reset time 47 repeated cosmos.base.v1beta1.Coin period_can_spend = 4 48 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coins"]; 49 50 // period_reset is the time at which this period resets and a new one begins, 51 // it is calculated from the start time of the first transaction after the 52 // last period ended 53 google.protobuf.Timestamp period_reset = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; 54 } 55 56 // AllowedMsgAllowance creates allowance only for specified message types. 57 message AllowedMsgAllowance { 58 option (gogoproto.goproto_getters) = false; 59 option (cosmos_proto.implements_interface) = "FeeAllowanceI"; 60 61 // allowance can be any of basic and filtered fee allowance. 62 google.protobuf.Any allowance = 1 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; 63 64 // allowed_messages are the messages for which the grantee has the access. 65 repeated string allowed_messages = 2; 66 } 67 68 // Grant is stored in the KVStore to record a grant with full context 69 message Grant { 70 // granter is the address of the user granting an allowance of their funds. 71 string granter = 1 [(gogoproto.moretags) = "yaml:\"granter_address\""]; 72 73 // grantee is the address of the user being granted an allowance of another user's funds. 74 string grantee = 2 [(gogoproto.moretags) = "yaml:\"grantee_address\""]; 75 76 // allowance can be any of basic and filtered fee allowance. 77 google.protobuf.Any allowance = 3 [(cosmos_proto.accepts_interface) = "FeeAllowanceI"]; 78 }