github.com/Finschia/finschia-sdk@v0.49.1/x/auth/spec/07_client.md (about) 1 <!-- 2 order: 7 3 --> 4 5 # Client 6 7 # Auth 8 9 ## CLI 10 11 A user can query and interact with the `auth` module using the CLI. 12 13 ### Query 14 15 The `query` commands allow users to query `auth` state. 16 17 ```bash 18 simd query auth --help 19 ``` 20 21 #### account 22 23 The `account` command allow users to query for an account by it's address. 24 25 ```bash 26 simd query auth account [address] [flags] 27 ``` 28 29 Example: 30 31 ```bash 32 simd query auth account cosmos1... 33 ``` 34 35 Example Output: 36 37 ```bash 38 '@type': /cosmos.auth.v1beta1.BaseAccount 39 account_number: "0" 40 address: cosmos1zwg6tpl8aw4rawv8sgag9086lpw5hv33u5ctr2 41 pub_key: 42 '@type': /cosmos.crypto.secp256k1.PubKey 43 key: ApDrE38zZdd7wLmFS9YmqO684y5DG6fjZ4rVeihF/AQD 44 sequence: "1" 45 ``` 46 47 #### accounts 48 49 The `accounts` command allow users to query all the available accounts. 50 51 ```bash 52 simd query auth accounts [flags] 53 ``` 54 55 Example: 56 57 ```bash 58 simd query auth accounts 59 ``` 60 61 Example Output: 62 63 ```bash 64 accounts: 65 - '@type': /cosmos.auth.v1beta1.BaseAccount 66 account_number: "0" 67 address: cosmos1zwg6tpl8aw4rawv8sgag9086lpw5hv33u5ctr2 68 pub_key: 69 '@type': /cosmos.crypto.secp256k1.PubKey 70 key: ApDrE38zZdd7wLmFS9YmqO684y5DG6fjZ4rVeihF/AQD 71 sequence: "1" 72 - '@type': /cosmos.auth.v1beta1.ModuleAccount 73 base_account: 74 account_number: "8" 75 address: cosmos1yl6hdjhmkf37639730gffanpzndzdpmhwlkfhr 76 pub_key: null 77 sequence: "0" 78 name: transfer 79 permissions: 80 - minter 81 - burner 82 - '@type': /cosmos.auth.v1beta1.ModuleAccount 83 base_account: 84 account_number: "4" 85 address: cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh 86 pub_key: null 87 sequence: "0" 88 name: bonded_tokens_pool 89 permissions: 90 - burner 91 - staking 92 - '@type': /cosmos.auth.v1beta1.ModuleAccount 93 base_account: 94 account_number: "5" 95 address: cosmos1tygms3xhhs3yv487phx3dw4a95jn7t7lpm470r 96 pub_key: null 97 sequence: "0" 98 name: not_bonded_tokens_pool 99 permissions: 100 - burner 101 - staking 102 - '@type': /cosmos.auth.v1beta1.ModuleAccount 103 base_account: 104 account_number: "6" 105 address: cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn 106 pub_key: null 107 sequence: "0" 108 name: gov 109 permissions: 110 - burner 111 - '@type': /cosmos.auth.v1beta1.ModuleAccount 112 base_account: 113 account_number: "3" 114 address: cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl 115 pub_key: null 116 sequence: "0" 117 name: distribution 118 permissions: [] 119 - '@type': /cosmos.auth.v1beta1.BaseAccount 120 account_number: "1" 121 address: cosmos147k3r7v2tvwqhcmaxcfql7j8rmkrlsemxshd3j 122 pub_key: null 123 sequence: "0" 124 - '@type': /cosmos.auth.v1beta1.ModuleAccount 125 base_account: 126 account_number: "7" 127 address: cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q 128 pub_key: null 129 sequence: "0" 130 name: mint 131 permissions: 132 - minter 133 - '@type': /cosmos.auth.v1beta1.ModuleAccount 134 base_account: 135 account_number: "2" 136 address: cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta 137 pub_key: null 138 sequence: "0" 139 name: fee_collector 140 permissions: [] 141 pagination: 142 next_key: null 143 total: "0" 144 ``` 145 146 #### params 147 148 The `params` command allow users to query the current auth parameters. 149 150 ```bash 151 simd query auth params [flags] 152 ``` 153 154 Example: 155 156 ```bash 157 simd query auth params 158 ``` 159 160 Example Output: 161 162 ```bash 163 max_memo_characters: "256" 164 sig_verify_cost_ed25519: "590" 165 sig_verify_cost_secp256k1: "1000" 166 tx_sig_limit: "7" 167 tx_size_cost_per_byte: "10" 168 ``` 169 170 ## gRPC 171 172 A user can query the `auth` module using gRPC endpoints. 173 174 ### Account 175 176 The `account` endpoint allow users to query for an account by it's address. 177 178 ```bash 179 cosmos.auth.v1beta1.Query/Account 180 ``` 181 182 Example: 183 184 ```bash 185 grpcurl -plaintext \ 186 -d '{"address":"cosmos1.."}' \ 187 localhost:9090 \ 188 cosmos.auth.v1beta1.Query/Account 189 ``` 190 191 Example Output: 192 193 ```bash 194 { 195 "account":{ 196 "@type":"/cosmos.auth.v1beta1.BaseAccount", 197 "address":"cosmos1zwg6tpl8aw4rawv8sgag9086lpw5hv33u5ctr2", 198 "pubKey":{ 199 "@type":"/cosmos.crypto.secp256k1.PubKey", 200 "key":"ApDrE38zZdd7wLmFS9YmqO684y5DG6fjZ4rVeihF/AQD" 201 }, 202 "sequence":"1" 203 } 204 } 205 ``` 206 207 ### Accounts 208 209 The `accounts` endpoint allow users to query all the available accounts. 210 211 ```bash 212 cosmos.auth.v1beta1.Query/Accounts 213 ``` 214 215 Example: 216 217 ```bash 218 grpcurl -plaintext \ 219 localhost:9090 \ 220 cosmos.auth.v1beta1.Query/Accounts 221 ``` 222 223 Example Output: 224 225 ```bash 226 { 227 "accounts":[ 228 { 229 "@type":"/cosmos.auth.v1beta1.BaseAccount", 230 "address":"cosmos1zwg6tpl8aw4rawv8sgag9086lpw5hv33u5ctr2", 231 "pubKey":{ 232 "@type":"/cosmos.crypto.secp256k1.PubKey", 233 "key":"ApDrE38zZdd7wLmFS9YmqO684y5DG6fjZ4rVeihF/AQD" 234 }, 235 "sequence":"1" 236 }, 237 { 238 "@type":"/cosmos.auth.v1beta1.ModuleAccount", 239 "baseAccount":{ 240 "address":"cosmos1yl6hdjhmkf37639730gffanpzndzdpmhwlkfhr", 241 "accountNumber":"8" 242 }, 243 "name":"transfer", 244 "permissions":[ 245 "minter", 246 "burner" 247 ] 248 }, 249 { 250 "@type":"/cosmos.auth.v1beta1.ModuleAccount", 251 "baseAccount":{ 252 "address":"cosmos1fl48vsnmsdzcv85q5d2q4z5ajdha8yu34mf0eh", 253 "accountNumber":"4" 254 }, 255 "name":"bonded_tokens_pool", 256 "permissions":[ 257 "burner", 258 "staking" 259 ] 260 }, 261 { 262 "@type":"/cosmos.auth.v1beta1.ModuleAccount", 263 "baseAccount":{ 264 "address":"cosmos1tygms3xhhs3yv487phx3dw4a95jn7t7lpm470r", 265 "accountNumber":"5" 266 }, 267 "name":"not_bonded_tokens_pool", 268 "permissions":[ 269 "burner", 270 "staking" 271 ] 272 }, 273 { 274 "@type":"/cosmos.auth.v1beta1.ModuleAccount", 275 "baseAccount":{ 276 "address":"cosmos10d07y265gmmuvt4z0w9aw880jnsr700j6zn9kn", 277 "accountNumber":"6" 278 }, 279 "name":"gov", 280 "permissions":[ 281 "burner" 282 ] 283 }, 284 { 285 "@type":"/cosmos.auth.v1beta1.ModuleAccount", 286 "baseAccount":{ 287 "address":"cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl", 288 "accountNumber":"3" 289 }, 290 "name":"distribution" 291 }, 292 { 293 "@type":"/cosmos.auth.v1beta1.BaseAccount", 294 "accountNumber":"1", 295 "address":"cosmos147k3r7v2tvwqhcmaxcfql7j8rmkrlsemxshd3j" 296 }, 297 { 298 "@type":"/cosmos.auth.v1beta1.ModuleAccount", 299 "baseAccount":{ 300 "address":"cosmos1m3h30wlvsf8llruxtpukdvsy0km2kum8g38c8q", 301 "accountNumber":"7" 302 }, 303 "name":"mint", 304 "permissions":[ 305 "minter" 306 ] 307 }, 308 { 309 "@type":"/cosmos.auth.v1beta1.ModuleAccount", 310 "baseAccount":{ 311 "address":"cosmos17xpfvakm2amg962yls6f84z3kell8c5lserqta", 312 "accountNumber":"2" 313 }, 314 "name":"fee_collector" 315 } 316 ], 317 "pagination":{ 318 "total":"9" 319 } 320 } 321 ``` 322 323 ### Params 324 325 The `params` endpoint allow users to query the current auth parameters. 326 327 ```bash 328 cosmos.auth.v1beta1.Query/Params 329 ``` 330 331 Example: 332 333 ```bash 334 grpcurl -plaintext \ 335 localhost:9090 \ 336 cosmos.auth.v1beta1.Query/Params 337 ``` 338 339 Example Output: 340 341 ```bash 342 { 343 "params": { 344 "maxMemoCharacters": "256", 345 "txSigLimit": "7", 346 "txSizeCostPerByte": "10", 347 "sigVerifyCostEd25519": "590", 348 "sigVerifyCostSecp256k1": "1000" 349 } 350 } 351 ``` 352 353 ## REST 354 355 A user can query the `auth` module using REST endpoints. 356 357 ### Account 358 359 The `account` endpoint allow users to query for an account by it's address. 360 361 ```bash 362 /cosmos/auth/v1beta1/account?address={address} 363 ``` 364 365 ### Accounts 366 367 The `accounts` endpoint allow users to query all the available accounts. 368 369 ```bash 370 /cosmos/auth/v1beta1/accounts 371 ``` 372 373 ### Params 374 375 The `params` endpoint allow users to query the current auth parameters. 376 377 ```bash 378 /cosmos/auth/v1beta1/params 379 ``` 380 381 # Vesting 382 383 ## CLI 384 385 A user can query and interact with the `vesting` module using the CLI. 386 387 ### Transactions 388 389 The `tx` commands allow users to interact with the `vesting` module. 390 391 ```bash 392 simd tx vesting --help 393 ``` 394 395 #### create-periodic-vesting-account 396 397 The `create-periodic-vesting-account` command creates a new vesting account funded with an allocation of tokens, where a sequence of coins and period length in seconds. Periods are sequential, in that the duration of of a period only starts at the end of the previous period. The duration of the first period starts upon account creation. 398 399 ```bash 400 simd tx vesting create-periodic-vesting-account [to_address] [periods_json_file] [flags] 401 ``` 402 403 Example: 404 405 ```bash 406 simd tx vesting create-periodic-vesting-account cosmos1.. periods.json 407 ``` 408 409 #### create-vesting-account 410 411 The `create-vesting-account` command creates a new vesting account funded with an allocation of tokens. The account can either be a delayed or continuous vesting account, which is determined by the '--delayed' flag. All vesting accouts created will have their start time set by the committed block's time. The end_time must be provided as a UNIX epoch timestamp. 412 413 ```bash 414 simd tx vesting create-vesting-account [to_address] [amount] [end_time] [flags] 415 ``` 416 417 Example: 418 419 ```bash 420 simd tx vesting create-vesting-account cosmos1.. 100stake 2592000 421 ```