Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: initialize fswap module #1336

Merged
merged 17 commits into from
Apr 18, 2024
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/

### Features
* (consensus) [\#1178](https://github.com/Finschia/finschia-sdk/pull/1178) change the consensus from Ostracon to Tendermint v0.34.24
* (x/fswap) [\#1336](https://github.com/Finschia/finschia-sdk/pull/1336) Initialize fswap module

### Improvements
* (docs) [\#1120](https://github.com/Finschia/finschia-sdk/pull/1120) Update links in x/foundation README.md
Expand Down
311 changes: 311 additions & 0 deletions docs/core/proto-docs.md
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,34 @@

- [Msg](#lbm.foundation.v1.Msg)

- [lbm/fswap/v1/event.proto](#lbm/fswap/v1/event.proto)
- [EventSwapCoins](#lbm.fswap.v1.EventSwapCoins)

- [lbm/fswap/v1/fswap.proto](#lbm/fswap/v1/fswap.proto)
- [Swapped](#lbm.fswap.v1.Swapped)

- [lbm/fswap/v1/params.proto](#lbm/fswap/v1/params.proto)
- [Params](#lbm.fswap.v1.Params)

- [lbm/fswap/v1/genesis.proto](#lbm/fswap/v1/genesis.proto)
- [GenesisState](#lbm.fswap.v1.GenesisState)

- [lbm/fswap/v1/query.proto](#lbm/fswap/v1/query.proto)
- [QuerySwappedRequest](#lbm.fswap.v1.QuerySwappedRequest)
- [QuerySwappedResponse](#lbm.fswap.v1.QuerySwappedResponse)
- [QueryTotalSwappableAmountRequest](#lbm.fswap.v1.QueryTotalSwappableAmountRequest)
- [QueryTotalSwappableAmountResponse](#lbm.fswap.v1.QueryTotalSwappableAmountResponse)

- [Query](#lbm.fswap.v1.Query)

- [lbm/fswap/v1/tx.proto](#lbm/fswap/v1/tx.proto)
- [MsgSwapAllRequest](#lbm.fswap.v1.MsgSwapAllRequest)
- [MsgSwapAllResponse](#lbm.fswap.v1.MsgSwapAllResponse)
- [MsgSwapRequest](#lbm.fswap.v1.MsgSwapRequest)
- [MsgSwapResponse](#lbm.fswap.v1.MsgSwapResponse)

- [Msg](#lbm.fswap.v1.Msg)

- [lbm/stakingplus/v1/authz.proto](#lbm/stakingplus/v1/authz.proto)
- [CreateValidatorAuthorization](#lbm.stakingplus.v1.CreateValidatorAuthorization)

Expand Down Expand Up @@ -12683,6 +12711,289 @@ Msg defines the foundation Msg service.



<a name="lbm/fswap/v1/event.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## lbm/fswap/v1/event.proto



<a name="lbm.fswap.v1.EventSwapCoins"></a>

### EventSwapCoins



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `address` | [string](#string) | | holder's address |
| `old_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | amount of the old currency |
| `new_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | amount of the new currency |





<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->

<!-- end services -->



<a name="lbm/fswap/v1/fswap.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## lbm/fswap/v1/fswap.proto



<a name="lbm.fswap.v1.Swapped"></a>

### Swapped



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `old_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | |
| `new_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | |





<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->

<!-- end services -->



<a name="lbm/fswap/v1/params.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## lbm/fswap/v1/params.proto



<a name="lbm.fswap.v1.Params"></a>

### Params
Params defines the parameters for the module.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `new_coin_denom` | [string](#string) | | new denomination for new coin after swap |





<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->

<!-- end services -->



<a name="lbm/fswap/v1/genesis.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## lbm/fswap/v1/genesis.proto



<a name="lbm.fswap.v1.GenesisState"></a>

### GenesisState
GenesisState defines the fswap module's genesis state.


| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `params` | [Params](#lbm.fswap.v1.Params) | | |
| `swapped` | [Swapped](#lbm.fswap.v1.Swapped) | | |





<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->

<!-- end services -->



<a name="lbm/fswap/v1/query.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## lbm/fswap/v1/query.proto



<a name="lbm.fswap.v1.QuerySwappedRequest"></a>

### QuerySwappedRequest







<a name="lbm.fswap.v1.QuerySwappedResponse"></a>

### QuerySwappedResponse



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `swapped` | [Swapped](#lbm.fswap.v1.Swapped) | | |






<a name="lbm.fswap.v1.QueryTotalSwappableAmountRequest"></a>

### QueryTotalSwappableAmountRequest







<a name="lbm.fswap.v1.QueryTotalSwappableAmountResponse"></a>

### QueryTotalSwappableAmountResponse



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `swappable_new_coin_amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | |





<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->


<a name="lbm.fswap.v1.Query"></a>

### Query


| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Swapped` | [QuerySwappedRequest](#lbm.fswap.v1.QuerySwappedRequest) | [QuerySwappedResponse](#lbm.fswap.v1.QuerySwappedResponse) | | GET|/lbm/fswap/v1/swapped|
| `TotalNewCurrencySwapLimit` | [QueryTotalSwappableAmountRequest](#lbm.fswap.v1.QueryTotalSwappableAmountRequest) | [QueryTotalSwappableAmountResponse](#lbm.fswap.v1.QueryTotalSwappableAmountResponse) | | GET|/lbm/fswap/v1/swappable_new_coin_amount|

<!-- end services -->



<a name="lbm/fswap/v1/tx.proto"></a>
<p align="right"><a href="#top">Top</a></p>

## lbm/fswap/v1/tx.proto



<a name="lbm.fswap.v1.MsgSwapAllRequest"></a>

### MsgSwapAllRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `from_address` | [string](#string) | | holder's address |






<a name="lbm.fswap.v1.MsgSwapAllResponse"></a>

### MsgSwapAllResponse







<a name="lbm.fswap.v1.MsgSwapRequest"></a>

### MsgSwapRequest



| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| `from_address` | [string](#string) | | holder's address |
| `amount` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | amount of old currency |






<a name="lbm.fswap.v1.MsgSwapResponse"></a>

### MsgSwapResponse






<!-- end messages -->

<!-- end enums -->

<!-- end HasExtensions -->


<a name="lbm.fswap.v1.Msg"></a>

### Msg


| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint |
| ----------- | ------------ | ------------- | ------------| ------- | -------- |
| `Swap` | [MsgSwapRequest](#lbm.fswap.v1.MsgSwapRequest) | [MsgSwapResponse](#lbm.fswap.v1.MsgSwapResponse) | | |
| `SwapAll` | [MsgSwapAllRequest](#lbm.fswap.v1.MsgSwapAllRequest) | [MsgSwapAllResponse](#lbm.fswap.v1.MsgSwapAllResponse) | | |

<!-- end services -->



<a name="lbm/stakingplus/v1/authz.proto"></a>
<p align="right"><a href="#top">Top</a></p>

Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,6 @@ github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY
github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw=
github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y=
github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw=
github.com/cosmos/iavl v0.19.0 h1:sgyrjqOkycXiN7Tuupuo4QAldKFg7Sipyfeg/IL7cps=
github.com/cosmos/iavl v0.19.0/go.mod h1:l5h9pAB3m5fihB3pXVgwYqdY8aBsMagqz7T0MUjxZeA=
github.com/cosmos/iavl v0.19.4 h1:t82sN+Y0WeqxDLJRSpNd8YFX5URIrT+p8n6oJbJ2Dok=
github.com/cosmos/iavl v0.19.4/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw=
github.com/cosmos/keyring v1.1.7-0.20210622111912-ef00f8ac3d76 h1:DdzS1m6o/pCqeZ8VOAit/gyATedRgjvkVI+UCrLpyuU=
Expand Down
18 changes: 18 additions & 0 deletions proto/lbm/fswap/v1/event.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
syntax = "proto3";
package lbm.fswap.v1;

option go_package = "github.com/Finschia/finschia-sdk/x/fswap/types";
jaeseung-bae marked this conversation as resolved.
Show resolved Hide resolved

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";

message EventSwapCoins {
// holder's address
string address = 1;
// amount of the old currency
cosmos.base.v1beta1.Coin old_coin_amount = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"];
// amount of the new currency
cosmos.base.v1beta1.Coin new_coin_amount = 3
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"];
}
14 changes: 14 additions & 0 deletions proto/lbm/fswap/v1/fswap.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto3";
package lbm.fswap.v1;

option go_package = "github.com/Finschia/finschia-sdk/x/fswap/types";

import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";

message Swapped{
cosmos.base.v1beta1.Coin old_coin_amount = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"];
cosmos.base.v1beta1.Coin new_coin_amount = 2
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/Finschia/finschia-sdk/types.Coin"];
}
14 changes: 14 additions & 0 deletions proto/lbm/fswap/v1/genesis.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
syntax = "proto3";
package lbm.fswap.v1;

option go_package = "github.com/Finschia/finschia-sdk/x/fswap/types";
jaeseung-bae marked this conversation as resolved.
Show resolved Hide resolved

import "gogoproto/gogo.proto";
import "lbm/fswap/v1/params.proto";
import "lbm/fswap/v1/fswap.proto";

// GenesisState defines the fswap module's genesis state.
message GenesisState {
170210 marked this conversation as resolved.
Show resolved Hide resolved
Params params = 1 [(gogoproto.nullable) = false];
Swapped swapped =2 [(gogoproto.nullable) = false];
}
Loading
Loading