From 09cdcaec93c26623b8c0574d5efe8a703eed0d30 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 31 May 2023 20:29:47 +0530 Subject: [PATCH 1/5] add docs for cosmwasm --- app/app.go | 3 ++- docs/cosmwasm.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 docs/cosmwasm.md diff --git a/app/app.go b/app/app.go index 5d5227cbec..f32d1f6f0d 100644 --- a/app/app.go +++ b/app/app.go @@ -649,7 +649,8 @@ func New( // The last arguments can contain custom message handlers, and custom query handlers, // if we want to allow any custom callbacks - availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1,umee" + // default available capabilities https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md + availableCapabilities := "iterator,staking,stargate,cosmwasm_1_1,cosmwasm_1_2,umee" // Register umee custom plugin to wasm wasmOpts = append(uwasm.RegisterCustomPlugins(app.LeverageKeeper, app.OracleKeeper), wasmOpts...) diff --git a/docs/cosmwasm.md b/docs/cosmwasm.md new file mode 100644 index 0000000000..0c20c1981a --- /dev/null +++ b/docs/cosmwasm.md @@ -0,0 +1,57 @@ +# Cosmwasm + +## Cosmwasm Built-in capabilities + - [Built-in capabilities](https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md) - iterator, staking, stargate, cosmwasm_1_1, cosmwasm_1_2 + - Custom capability of umee chain + - umee + +## Allowed native module queries + +- [ugov](https:github.com/umee-network/umee/blob/main/proto/umee/ugov/v1/query.proto) +- [leverage](https:github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/query.proto) +- [oracle](https:github.com/umee-network/umee/blob/main/proto/umee/oracle/v1/query.proto) +- [uibc](https:github.com/umee-network/umee/blob/main/proto/umee/uibc/v1/quota.proto) + +```json +// queries for anything available from the umee native modules (ugov,leverage,oracle.uibc) +{ + "chain": { + "custom": { + "leverage_parameters": {} + } + } +} +``` + +Example command to execute the query: +```bash +$ umeed q wasm contract-state smart ${json_input} +$ umeed q wasm contract-state smart umee14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9scsdqqx '{"chain":{"custom":{"leverage_params":{}}}}' +``` + +## Allowed native module transactions +Allowed only [leverage module transactions](https:github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/tx.proto) + +``` +Example JSON input for umee native module: +```json +{ + "umee": { + "leverage": { + "supply": { + "supplier": "", + "asset": { + "denom": "uumee", + "amount": "123123123" + } + } + } + } +} +``` + +Example command to execute the transaction: +```bash +$ umeed tx wasm execute ${contract_id} ${json_input} +$ umeed tx wasm execute umee14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9scsdqqx '{"umee":{"leverage":{"supply_collateral":{"supplier":"umee1s84d29zk3k20xk9f0hvczkax90l9t94g72n6wm","asset":{"denom":"uumee","amount":"1234"}}}}}' +``` \ No newline at end of file From e73ded742f00cea38c0aee800ccf34268b7e3df2 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 31 May 2023 21:18:17 +0530 Subject: [PATCH 2/5] fix: fix the lint issue --- docs/cosmwasm.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/cosmwasm.md b/docs/cosmwasm.md index 0c20c1981a..54375e3734 100644 --- a/docs/cosmwasm.md +++ b/docs/cosmwasm.md @@ -1,19 +1,20 @@ # Cosmwasm -## Cosmwasm Built-in capabilities +## Cosmwasm Built-in capabilities - [Built-in capabilities](https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md) - iterator, staking, stargate, cosmwasm_1_1, cosmwasm_1_2 - - Custom capability of umee chain + - Custom capability of umee chain - umee -## Allowed native module queries +## Allowed native module queries -- [ugov](https:github.com/umee-network/umee/blob/main/proto/umee/ugov/v1/query.proto) -- [leverage](https:github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/query.proto) -- [oracle](https:github.com/umee-network/umee/blob/main/proto/umee/oracle/v1/query.proto) -- [uibc](https:github.com/umee-network/umee/blob/main/proto/umee/uibc/v1/quota.proto) +- [ugov](https://github.com/umee-network/umee/blob/main/proto/umee/ugov/v1/query.proto) +- [leverage](https://github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/query.proto) +- [oracle](https://github.com/umee-network/umee/blob/main/proto/umee/oracle/v1/query.proto) +- [uibc](https://github.com/umee-network/umee/blob/main/proto/umee/uibc/v1/quota.proto) + +> queries for anything available from the umee native modules (ugov,leverage,oracle.uibc) ```json -// queries for anything available from the umee native modules (ugov,leverage,oracle.uibc) { "chain": { "custom": { @@ -29,10 +30,11 @@ $ umeed q wasm contract-state smart ${json_input} $ umeed q wasm contract-state smart umee14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9scsdqqx '{"chain":{"custom":{"leverage_params":{}}}}' ``` -## Allowed native module transactions +## Allowed native module transactions Allowed only [leverage module transactions](https:github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/tx.proto) ``` + Example JSON input for umee native module: ```json { From 2b6813ec7ec56fea5bd486f113b43f5f30b77388 Mon Sep 17 00:00:00 2001 From: Sai Kumar Date: Wed, 31 May 2023 22:05:58 +0530 Subject: [PATCH 3/5] add example smart contract repo --- docs/cosmwasm.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/cosmwasm.md b/docs/cosmwasm.md index 54375e3734..525655b63c 100644 --- a/docs/cosmwasm.md +++ b/docs/cosmwasm.md @@ -1,5 +1,9 @@ # Cosmwasm +## Example smart contract to interact with umee native modules (leverage and oracle) + - [umee-cosmwasm](https://github.com/umee-network/umee-cosmwasm) + + ## Cosmwasm Built-in capabilities - [Built-in capabilities](https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md) - iterator, staking, stargate, cosmwasm_1_1, cosmwasm_1_2 - Custom capability of umee chain @@ -31,7 +35,7 @@ $ umeed q wasm contract-state smart umee14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmst ``` ## Allowed native module transactions -Allowed only [leverage module transactions](https:github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/tx.proto) +Allowed only [leverage module transactions](https://github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/tx.proto) ``` @@ -56,4 +60,5 @@ Example command to execute the transaction: ```bash $ umeed tx wasm execute ${contract_id} ${json_input} $ umeed tx wasm execute umee14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9scsdqqx '{"umee":{"leverage":{"supply_collateral":{"supplier":"umee1s84d29zk3k20xk9f0hvczkax90l9t94g72n6wm","asset":{"denom":"uumee","amount":"1234"}}}}}' -``` \ No newline at end of file +``` + From 026c7035cd670bf26bc145c7a999aee86b966dd2 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 31 May 2023 19:12:15 +0200 Subject: [PATCH 4/5] lint --- docs/cosmwasm.md | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/docs/cosmwasm.md b/docs/cosmwasm.md index 525655b63c..c627addc8e 100644 --- a/docs/cosmwasm.md +++ b/docs/cosmwasm.md @@ -1,23 +1,23 @@ # Cosmwasm ## Example smart contract to interact with umee native modules (leverage and oracle) - - [umee-cosmwasm](https://github.com/umee-network/umee-cosmwasm) +- [umee-cosmwasm](https://github.com/umee-network/umee-cosmwasm) ## Cosmwasm Built-in capabilities - - [Built-in capabilities](https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md) - iterator, staking, stargate, cosmwasm_1_1, cosmwasm_1_2 - - Custom capability of umee chain - - umee + +- [Built-in capabilities](https://github.com/CosmWasm/cosmwasm/blob/main/docs/CAPABILITIES-BUILT-IN.md) - iterator, staking, stargate, cosmwasm_1_1, cosmwasm_1_2 +- Custom capability of umee chain: `umee` ## Allowed native module queries +!ueries for all native Umee modules: + - [ugov](https://github.com/umee-network/umee/blob/main/proto/umee/ugov/v1/query.proto) - [leverage](https://github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/query.proto) - [oracle](https://github.com/umee-network/umee/blob/main/proto/umee/oracle/v1/query.proto) - [uibc](https://github.com/umee-network/umee/blob/main/proto/umee/uibc/v1/quota.proto) - -> queries for anything available from the umee native modules (ugov,leverage,oracle.uibc) ```json { "chain": { @@ -28,18 +28,17 @@ } ``` -Example command to execute the query: +Example command to execute a query: + ```bash $ umeed q wasm contract-state smart ${json_input} $ umeed q wasm contract-state smart umee14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9scsdqqx '{"chain":{"custom":{"leverage_params":{}}}}' ``` ## Allowed native module transactions -Allowed only [leverage module transactions](https://github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/tx.proto) -``` +Only [leverage module transactions](https:github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/tx.proto) are allowed. Example JSON input for umee native module: -Example JSON input for umee native module: ```json { "umee": { @@ -56,9 +55,9 @@ Example JSON input for umee native module: } ``` -Example command to execute the transaction: +Example commands to execute a transaction: + ```bash $ umeed tx wasm execute ${contract_id} ${json_input} $ umeed tx wasm execute umee14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9scsdqqx '{"umee":{"leverage":{"supply_collateral":{"supplier":"umee1s84d29zk3k20xk9f0hvczkax90l9t94g72n6wm","asset":{"denom":"uumee","amount":"1234"}}}}}' ``` - From 8307bf3704a90a9cea1880e7c4e991a7984d93b5 Mon Sep 17 00:00:00 2001 From: Robert Zaremba Date: Wed, 31 May 2023 19:18:21 +0200 Subject: [PATCH 5/5] docs --- docs/cosmwasm.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/cosmwasm.md b/docs/cosmwasm.md index c627addc8e..a1fec5bc0c 100644 --- a/docs/cosmwasm.md +++ b/docs/cosmwasm.md @@ -11,7 +11,7 @@ ## Allowed native module queries -!ueries for all native Umee modules: +Queries for all native Umee modules: - [ugov](https://github.com/umee-network/umee/blob/main/proto/umee/ugov/v1/query.proto) - [leverage](https://github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/query.proto) @@ -37,7 +37,7 @@ $ umeed q wasm contract-state smart umee14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmst ## Allowed native module transactions -Only [leverage module transactions](https:github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/tx.proto) are allowed. Example JSON input for umee native module: +Only [leverage module transactions](https://github.com/umee-network/umee/blob/main/proto/umee/leverage/v1/tx.proto) are allowed. Example JSON input for Umee native module: ```json {