Skip to content

Commit

Permalink
docs: update docs based sdk 0.43.x
Browse files Browse the repository at this point in the history
  • Loading branch information
dongsam committed Aug 30, 2021
1 parent c30574b commit ca1087f
Show file tree
Hide file tree
Showing 3 changed files with 115 additions and 51 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

* [\#436](https://github.com/tendermint/liquidity/pull/436) Validation `MsgSwapWithinBatch` and `OfferCoinFee` ceiling
* When calculating `OfferCoinFee`, the decimal points are rounded up.
- before (v1.2.x): `MsgSwapWithinBatch.OfferCoinFee` should be `OfferCoin` * `params.SwapFeeRate` with Truncate or 0
- after (v1.3.x): `MsgSwapWithinBatch.OfferCoinFee` should be `OfferCoin` * `params.SwapFeeRate` with Ceil
- before (v1.2.x): `MsgSwapWithinBatch.OfferCoinFee` should be `OfferCoin` * `params.SwapFeeRate/2` with Truncate or 0
- after (v1.3.x): `MsgSwapWithinBatch.OfferCoinFee` should be `OfferCoin` * `params.SwapFeeRate/2` with Ceil
* Fix reserveOfferCoinFee residual Issue due to decimal error

* [\#438](https://github.com/tendermint/liquidity/pull/438) Fix PoolBatch index, beginHeight issues and genesis logic
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ $BINARY tx liquidity swap 1 1 50000000uusd uatom 0.019 0.003 --from validator --

# An example of generating unsigned tx
validator=$($BINARY keys show validator --keyring-backend test -a)
$BINARY tx liquidity swap 1 1 50000000uusd uatom 0.019 0.003 --from $validator --chain-id testing --generate-only > tx_swap.json
$BINARY tx liquidity swap 1 1 50000000uusd uatom 0.019 0.003 --from $validator --chain-id testing --generate-only &> tx_swap.json
cat tx_swap.json

# Sign the unsigned tx
$BINARY tx sign tx_swap.json --from validator --chain-id testing --keyring-backend test -y > tx_swap_signed.json
$BINARY tx sign tx_swap.json --from validator --chain-id testing --keyring-backend test -y &> tx_swap_signed.json
cat tx_swap_signed.json

# Encode the signed tx
Expand Down
158 changes: 111 additions & 47 deletions doc/client.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ JSON Structure:
"body": {
"messages": [
{
"@type": "/tendermint.liquidity.MsgCreatePool",
"@type": "/tendermint.liquidity.v1beta1.MsgCreatePool",
"pool_creator_address": "cosmos1s6cjfm4djg95jkzsfe490yfc9k6wazx6culyft",
"pool_type_id": 1,
"deposit_coins": [
Expand Down Expand Up @@ -119,6 +119,32 @@ Result
"msg_index": 0,
"log": "",
"events": [
{
"type": "coin_received",
"attributes": [
{
"key": "receiver",
"value": "cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl"
},
{
"key": "amount",
"value": "40000000stake"
}
]
},
{
"type": "coin_spent",
"attributes": [
{
"key": "spender",
"value": "cosmos1s6cjfm4djg95jkzsfe490yfc9k6wazx6culyft"
},
{
"key": "amount",
"value": "40000000stake"
}
]
},
{
"type": "create_pool",
"attributes": [
Expand Down Expand Up @@ -153,15 +179,7 @@ Result
"attributes": [
{
"key": "action",
"value": "create_pool"
},
{
"key": "sender",
"value": "cosmos1s6cjfm4djg95jkzsfe490yfc9k6wazx6culyft"
},
{
"key": "sender",
"value": "cosmos1tx68a8k9yz54z06qfve9l2zxvgsz4ka3hr8962"
"value": "/tendermint.liquidity.v1beta1.MsgCreatePool"
},
{
"key": "sender",
Expand All @@ -176,22 +194,6 @@ Result
{
"type": "transfer",
"attributes": [
{
"key": "recipient",
"value": "cosmos1jmhkafh94jpgakr735r70t32sxq9wzkayzs9we"
},
{
"key": "amount",
"value": "1000000000uatom,50000000000uusd"
},
{
"key": "recipient",
"value": "cosmos1s6cjfm4djg95jkzsfe490yfc9k6wazx6culyft"
},
{
"key": "amount",
"value": "1000000pool96EF6EA6E5AC828ED87E8D07E7AE2A8180570ADD212117B2DA6F0B75D17A6295"
},
{
"key": "recipient",
"value": "cosmos1jv65s3grqf6v6jl3dp4t6c9t9rk99cd88lyufl"
Expand All @@ -202,7 +204,7 @@ Result
},
{
"key": "amount",
"value": "100000000stake"
"value": "40000000stake"
}
]
}
Expand Down Expand Up @@ -232,7 +234,7 @@ JSON Structure:
"body": {
"messages": [
{
"@type": "/tendermint.liquidity.MsgDepositWithinBatch",
"@type": "/tendermint.liquidity.v1beta1.MsgDepositWithinBatch",
"depositor_address": "cosmos1h6ht09xx0ue0fqmezk7msgqcc9k20a5x5ynvc3",
"pool_id": "1",
"deposit_coins": [
Expand Down Expand Up @@ -280,6 +282,32 @@ Result:
"msg_index": 0,
"log": "",
"events": [
{
"type": "coin_received",
"attributes": [
{
"key": "receiver",
"value": "cosmos1tx68a8k9yz54z06qfve9l2zxvgsz4ka3hr8962"
},
{
"key": "amount",
"value": "100000000uatom,5000000000uusd"
}
]
},
{
"type": "coin_spent",
"attributes": [
{
"key": "spender",
"value": "cosmos1h6ht09xx0ue0fqmezk7msgqcc9k20a5x5ynvc3"
},
{
"key": "amount",
"value": "100000000uatom,5000000000uusd"
}
]
},
{
"type": "deposit_within_batch",
"attributes": [
Expand All @@ -306,7 +334,7 @@ Result:
"attributes": [
{
"key": "action",
"value": "deposit_within_batch"
"value": "/tendermint.liquidity.v1beta1.MsgDepositWithinBatch"
},
{
"key": "sender",
Expand Down Expand Up @@ -403,12 +431,38 @@ Result:
"msg_index": 0,
"log": "",
"events": [
{
"type": "coin_received",
"attributes": [
{
"key": "receiver",
"value": "cosmos1tx68a8k9yz54z06qfve9l2zxvgsz4ka3hr8962"
},
{
"key": "amount",
"value": "10000pool96EF6EA6E5AC828ED87E8D07E7AE2A8180570ADD212117B2DA6F0B75D17A6295"
}
]
},
{
"type": "coin_spent",
"attributes": [
{
"key": "spender",
"value": "cosmos1h6ht09xx0ue0fqmezk7msgqcc9k20a5x5ynvc3"
},
{
"key": "amount",
"value": "10000pool96EF6EA6E5AC828ED87E8D07E7AE2A8180570ADD212117B2DA6F0B75D17A6295"
}
]
},
{
"type": "message",
"attributes": [
{
"key": "action",
"value": "withdraw_within_batch"
"value": "/tendermint.liquidity.v1beta1.MsgWithdrawWithinBatch"
},
{
"key": "sender",
Expand Down Expand Up @@ -537,16 +591,38 @@ Result:
"log": "",
"events": [
{
"type": "message",
"type": "coin_received",
"attributes": [
{
"key": "action",
"value": "swap_within_batch"
"key": "receiver",
"value": "cosmos1tx68a8k9yz54z06qfve9l2zxvgsz4ka3hr8962"
},
{
"key": "sender",
"key": "amount",
"value": "50075000uusd"
}
]
},
{
"type": "coin_spent",
"attributes": [
{
"key": "spender",
"value": "cosmos1h6ht09xx0ue0fqmezk7msgqcc9k20a5x5ynvc3"
},
{
"key": "amount",
"value": "50075000uusd"
}
]
},
{
"type": "message",
"attributes": [
{
"key": "action",
"value": "/tendermint.liquidity.v1beta1.MsgSwapWithinBatch"
},
{
"key": "sender",
"value": "cosmos1h6ht09xx0ue0fqmezk7msgqcc9k20a5x5ynvc3"
Expand Down Expand Up @@ -611,19 +687,7 @@ Result:
},
{
"key": "amount",
"value": "50000000uusd"
},
{
"key": "recipient",
"value": "cosmos1tx68a8k9yz54z06qfve9l2zxvgsz4ka3hr8962"
},
{
"key": "sender",
"value": "cosmos1h6ht09xx0ue0fqmezk7msgqcc9k20a5x5ynvc3"
},
{
"key": "amount",
"value": "75000uusd"
"value": "50075000uusd"
}
]
}
Expand Down

0 comments on commit ca1087f

Please sign in to comment.