From 569c151857d96bc88c3da2012ac59f2ec91b4b80 Mon Sep 17 00:00:00 2001 From: aleem1314 Date: Tue, 18 Oct 2022 20:04:22 +0530 Subject: [PATCH 1/2] wip: add grpc queries --- x/ecocredit/spec/07_client.md | 198 ++++++++++++++++++++++++++++++++++ 1 file changed, 198 insertions(+) diff --git a/x/ecocredit/spec/07_client.md b/x/ecocredit/spec/07_client.md index 9e79b46ebd..2f6f2d096c 100644 --- a/x/ecocredit/spec/07_client.md +++ b/x/ecocredit/spec/07_client.md @@ -719,6 +719,179 @@ Example Output: } ``` +### BalancesByBatch + +The `BalancesByBatch` endpoint allows users to query all credit balances from a +given credit batch. + +```bash +regen.ecocredit.v1.Query/BalancesByBatch +``` + +Example: + +```bash +grpcurl -plaintext \ + -d '{"batch_denom": "C02-001-20210101-20250101-001"}' \ + localhost:9090 regen.ecocredit.v1.Query/BalancesByBatch +``` + +Example Output: + +```bash +{ + "balances": [ + { + "address": "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "batchDenom": "C02-001-20210101-20250101-001", + "tradableAmount": "92.0", + "retiredAmount": "97", + "escrowedAmount": "30.0" + } + ], + "pagination": { + "nextKey": "BwEJABQDulMR5S+lTY8VaafpDwxlg7jx3AAF" + } +} +``` + + +### AllBalances + +The `AllBalances` endpoint allows users to query all credit balances. + +```bash +regen.ecocredit.v1.Query/AllBalances +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.v1.Query/AllBalances +``` + +Example Output: + +```bash +{ + "balances": [ + { + "address": "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "batchDenom": "C02-001-20210101-20250101-001", + "tradableAmount": "92.0", + "retiredAmount": "97", + "escrowedAmount": "30.0" + } + ], + "pagination": { + "nextKey": "BwEJABQDulMR5S+lTY8VaafpDwxlg7jx3AAF" + } +} +``` + +### ClassCreatorAllowlist + +The `ClassCreatorAllowlist` endpoint allows users to query the credit class +creator allowlist enable setting. + +```bash +regen.ecocredit.v1.Query/ClassCreatorAllowlist +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.v1.Query/ClassCreatorAllowlist +``` + +Example Output: + +```bash +{ + "enabled":"true" +} +``` + +### AllowedClassCreators + +The `AllowedClassCreators` endpoint allows users to query allowed credit class +creators list. + +```bash +regen.ecocredit.v1.Query/AllowedClassCreators +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.v1.Query/AllowedClassCreators +``` + +Example Output: + +```bash +{ + "classCreators":[ + "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "regen123a7e9gvgm53zvswc6daq7c85xtzt8263lgasm" + ], + "pagination": { + "nextKey": "BwEJABQDulMR5S" + } +} +``` + +### ClassFee + +The `ClassFee` endpoint allows users to query credit class creation fee. + +```bash +regen.ecocredit.v1.Query/ClassFee +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.v1.Query/ClassFee +``` + +Example Output: + +```bash +{ + "fee": { + "denom": "uregen", + "amount": "20000000" + } +} +``` + +### AllowedBridgeChains + +The `AllowedBridgeChains` endpoint allows users query list of chains allowed to be +used in bridge operations. + +```bash +regen.ecocredit.v1.Query/AllowedBridgeChains +``` + +Example: + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.v1.Query/AllowedBridgeChains +``` + +Example Output: + +```bash +{ + "allowedBridgeChains":[ + "polygon" + ] +} +``` + + ### Basket The `Basket` endpoint allows users to query for information on basket. @@ -892,6 +1065,31 @@ Example Output: } ``` +### BasketFee + +The `BasketFee` endpoint allows users to query basket creation fee. + +```bash +regen.ecocredit.basket.v1.Query/BasketFee +``` + +Example + +```bash +grpcurl -plaintext localhost:9090 regen.ecocredit.basket.v1.Query/BasketFee +``` + +Example Output: + +```bash +{ + "fee": { + "denom":"uregen", + "amount": "1000000000" + } +} +``` + ### SellOrder From d817aa85042276c1f3042b349d244ce9a232355e Mon Sep 17 00:00:00 2001 From: aleem1314 Date: Wed, 19 Oct 2022 15:24:01 +0530 Subject: [PATCH 2/2] feat: add grpc client docs --- x/ecocredit/spec/07_client.md | 196 ++++++++++++++++++++++++++++++++++ 1 file changed, 196 insertions(+) diff --git a/x/ecocredit/spec/07_client.md b/x/ecocredit/spec/07_client.md index 2f6f2d096c..0103884ce0 100644 --- a/x/ecocredit/spec/07_client.md +++ b/x/ecocredit/spec/07_client.md @@ -1933,6 +1933,177 @@ Example Output: } ``` +### BalancesByBatch + +The `BalancesByBatch` endpoint allows users to query all credit balances from a +given credit batch. + +```bash +/regen/ecocredit/v1/balances-by-batch/{batch_denom} +/regen/ecocredit/v1/batches/{batch_denom}/balances +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/batches/C02-001-20210101-20250101-001/balances +``` + +Example Output: + +```bash +{ + "balances": [ + { + "address": "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "batch_denom": "C02-001-20210101-20250101-001", + "tradable_amount": "92.0", + "retired_amount": "97", + "escrowed_amount": "30.0" + } + ], + "pagination": { + "next_key": "BwEJABQDulMR5S+lTY8VaafpDwxlg7jx3AAF" + } +} +``` + +### AllBalances + +The `AllBalances` endpoint allows users to query all credit balances. + +```bash +/regen/ecocredit/v1/all-balances +/regen/ecocredit/v1/balances +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/balances +``` + +Example Output: + +```bash +{ + "balances": [ + { + "address": "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "batch_denom": "C02-001-20210101-20250101-001", + "tradable_amount": "92.0", + "retired_amount": "97", + "escrowed_amount": "30.0" + } + ], + "pagination": { + "next_key": "BwEJABQDulMR5S+lTY8VaafpDwxlg7jx3AAF" + } +} +``` + +### ClassCreatorAllowlist + +The `ClassCreatorAllowlist` endpoint allows users to query the credit class +creator allowlist enable setting. + +```bash +/regen/ecocredit/v1/class-creator-allowlist +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/class-creator-allowlist +``` + +Example Output: + +```bash +{ + "enabled":"true" +} +``` + +### AllowedClassCreators + +The `AllowedClassCreators` endpoint allows users to query allowed credit class +creators list. + +```bash +/regen/ecocredit/v1/allowed-class-creators +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/allowed-class-creators +``` + +Example Output: + +```bash +{ + "class_creators":[ + "regen1qwa9xy0997j5mrc4dxn7jrcvvkpm3uwuldkrmg", + "regen123a7e9gvgm53zvswc6daq7c85xtzt8263lgasm" + ], + "pagination": { + "next_key": "BwEJABQDulMR5S" + } +} +``` + +### ClassFee + +The `ClassFee` endpoint allows users to query credit class creation fee. + + +```bash +/regen/ecocredit/v1/class-fee +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/class-fee +``` + +Example Output: + +```bash +{ + "fee": { + "denom": "uregen", + "amount": "20000000" + } +} +``` + +### AllowedBridgeChains + +The `AllowedBridgeChains` endpoint allows users query list of chains allowed to be +used in bridge operations. + +```bash +/regen/ecocredit/v1/allowed-bridge-chains +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/v1/allowed-bridge-chains +``` + +Example Output: + +```bash +{ + "allowed_bridge_chains":[ + "polygon" + ] +} +``` ### Basket @@ -2100,6 +2271,31 @@ Example Output: } ``` +### BasketFee + +The `BasketFee` endpoint allows users to query basket creation fee. + +```bash +regen/ecocredit/basket/v1/basket-fee +``` + +Example: + +```bash +curl localhost:1317/regen/ecocredit/basket/v1/basket-fee +``` + +Example Output: + +```bash +{ + "fee": { + "denom":"uregen", + "amount": "1000000000" + } +} +``` + ### sell-orders The `sell-orders` endpoint allows users to query all sell orders.