github.com/Finschia/finschia-sdk@v0.49.1/x/feegrant/spec/05_client.md (about) 1 <!-- 2 order: 6 3 --> 4 5 # Client 6 7 ## CLI 8 9 A user can query and interact with the `feegrant` module using the CLI. 10 11 ### Query 12 13 The `query` commands allow users to query `feegrant` state. 14 15 ``` 16 simd query feegrant --help 17 ``` 18 19 #### grant 20 21 The `grant` command allows users to query a grant for a given granter-grantee pair. 22 23 ``` 24 simd query feegrant grant [granter] [grantee] [flags] 25 ``` 26 27 Example: 28 29 ``` 30 simd query feegrant grant cosmos1.. cosmos1.. 31 ``` 32 33 Example Output: 34 35 ``` 36 allowance: 37 '@type': /cosmos.feegrant.v1beta1.BasicAllowance 38 expiration: null 39 spend_limit: 40 - amount: "100" 41 denom: stake 42 grantee: cosmos1.. 43 granter: cosmos1.. 44 ``` 45 46 #### grants 47 48 The `grants` command allows users to query all grants for a given grantee. 49 50 ``` 51 simd query feegrant grants [grantee] [flags] 52 ``` 53 54 Example: 55 56 ``` 57 simd query feegrant grants cosmos1.. 58 ``` 59 60 Example Output: 61 62 ``` 63 allowances: 64 - allowance: 65 '@type': /cosmos.feegrant.v1beta1.BasicAllowance 66 expiration: null 67 spend_limit: 68 - amount: "100" 69 denom: stake 70 grantee: cosmos1.. 71 granter: cosmos1.. 72 pagination: 73 next_key: null 74 total: "0" 75 ``` 76 77 ### Transactions 78 79 The `tx` commands allow users to interact with the `feegrant` module. 80 81 ``` 82 simd tx feegrant --help 83 ``` 84 85 #### grant 86 87 The `grant` command allows users to grant fee allowances to another account. The fee allowance can have an expiration date, a total spend limit, and/or a periodic spend limit. 88 89 ``` 90 simd tx feegrant grant [granter] [grantee] [flags] 91 ``` 92 93 Example (one-time spend limit): 94 95 ``` 96 simd tx feegrant grant cosmos1.. cosmos1.. --spend-limit 100stake 97 ``` 98 99 Example (periodic spend limit): 100 101 ``` 102 simd tx feegrant grant cosmos1.. cosmos1.. --period 3600 --period-limit 10stake 103 ``` 104 105 #### revoke 106 107 The `revoke` command allows users to revoke a granted fee allowance. 108 109 ``` 110 simd tx feegrant revoke [granter] [grantee] [flags] 111 ``` 112 113 Example: 114 115 ``` 116 simd tx feegrant revoke cosmos1.. cosmos1.. 117 ``` 118 119 ## gRPC 120 121 A user can query the `feegrant` module using gRPC endpoints. 122 123 ### Allowance 124 125 The `Allowance` endpoint allows users to query a granted fee allowance. 126 127 ``` 128 cosmos.feegrant.v1beta1.Query/Allowance 129 ``` 130 131 Example: 132 133 ``` 134 grpcurl -plaintext \ 135 -d '{"grantee":"cosmos1..","granter":"cosmos1.."}' \ 136 localhost:9090 \ 137 cosmos.feegrant.v1beta1.Query/Allowance 138 ``` 139 140 Example Output: 141 142 ``` 143 { 144 "allowance": { 145 "granter": "cosmos1..", 146 "grantee": "cosmos1..", 147 "allowance": {"@type":"/cosmos.feegrant.v1beta1.BasicAllowance","spendLimit":[{"denom":"stake","amount":"100"}]} 148 } 149 } 150 ``` 151 152 ### Allowances 153 154 The `Allowances` endpoint allows users to query all granted fee allowances for a given grantee. 155 156 ``` 157 cosmos.feegrant.v1beta1.Query/Allowances 158 ``` 159 160 Example: 161 162 ``` 163 grpcurl -plaintext \ 164 -d '{"address":"cosmos1.."}' \ 165 localhost:9090 \ 166 cosmos.feegrant.v1beta1.Query/Allowances 167 ``` 168 169 Example Output: 170 171 ``` 172 { 173 "allowances": [ 174 { 175 "granter": "cosmos1..", 176 "grantee": "cosmos1..", 177 "allowance": {"@type":"/cosmos.feegrant.v1beta1.BasicAllowance","spendLimit":[{"denom":"stake","amount":"100"}]} 178 } 179 ], 180 "pagination": { 181 "total": "1" 182 } 183 } 184 ```