Protocol Documentation
Table of Contents
-
centerchain/tokenfactory/v1/swap.proto
-
Scalar Value Types
centerchain/tokenfactory/v1/swap.proto
Authorization
| Field | Type | Label | Description |
|---|---|---|---|
| terms | MsgCreateAuthorization | ||
| consumed | bool | ||
| revoked | bool | ||
| used_from | string | ||
| gas_fee | string |
MsgCreateAuthorization
| Field | Type | Label | Description |
|---|---|---|---|
| holder | string | ||
| order_seq | uint64 | ||
| chain_id | string | ||
| executor | string | ||
| from_denom | string | ||
| to_denom | string | ||
| to_amount | string | ||
| max_from | string | ||
| gas_fee_max | string | ||
| from_nft | NFTScope | ||
| to_nft | NFTScope | ||
| kind | AuthorizationKind |
MsgExecuteBurn
MsgExecuteBurn executes the input leg of a kind=BURN authorization: the fungible amount (or the single locked NFT) is moved into the module account and burned. There is no output leg and no gas field. Only the denom admin (fungible input) or the class issuer (NFT input) may execute it.
| Field | Type | Label | Description |
|---|---|---|---|
| executor | string | ||
| holder | string | ||
| order_seq | uint64 | ||
| chain_id | string | ||
| amount | string |
MsgExecutePull
MsgExecutePull executes the input leg only: the amount is escrowed from the holder into the module account (never burned). There is no output leg and no gas field. It consumes a kind=PULL authorization.
| Field | Type | Label | Description |
|---|---|---|---|
| executor | string | ||
| holder | string | ||
| order_seq | uint64 | ||
| chain_id | string | ||
| amount | string |
MsgExecuteSwap
| Field | Type | Label | Description |
|---|---|---|---|
| executor | string | ||
| holder | string | ||
| order_seq | uint64 | ||
| chain_id | string | ||
| used_from | string | ||
| to_amount | string | ||
| gas_fee | string |
MsgRevokeAuthorization
| Field | Type | Label | Description |
|---|---|---|---|
| holder | string | ||
| order_seq | uint64 | ||
| chain_id | string |
MsgSetSwapConfig
| Field | Type | Label | Description |
|---|---|---|---|
| authority | string | ||
| config | SwapConfig |
NFTScope
| Field | Type | Label | Description |
|---|---|---|---|
| class_id | string | ||
| token_id | string |
QueryAuthorizationRequest
| Field | Type | Label | Description |
|---|---|---|---|
| holder | string | ||
| order_seq | uint64 |
QueryAuthorizationResponse
| Field | Type | Label | Description |
|---|---|---|---|
| authorization | Authorization | ||
| high_water_mark | uint64 | ||
| reserved_from | string | ||
| gas_mode | string |
QueryAuthorizationsRequest
QueryAuthorizationsRequest lists every authorization created by a holder, newest sequence last. Consumed and revoked authorizations are included.
| Field | Type | Label | Description |
|---|---|---|---|
| holder | string | ||
| pagination | cosmos.base.query.v1beta1.PageRequest |
QueryAuthorizationsResponse
| Field | Type | Label | Description |
|---|---|---|---|
| authorizations | Authorization | repeated | |
| pagination | cosmos.base.query.v1beta1.PageResponse |
QueryHighWaterMarkRequest
| Field | Type | Label | Description |
|---|---|---|---|
| holder | string |
QueryHighWaterMarkResponse
| Field | Type | Label | Description |
|---|---|---|---|
| sequence | uint64 |
SwapConfig
| Field | Type | Label | Description |
|---|---|---|---|
| technical_issuer | string | ||
| executors | string | repeated |
SwapGenesis
| Field | Type | Label | Description |
|---|---|---|---|
| config | SwapConfig | ||
| authorizations | Authorization | repeated | |
| high_water_marks | SwapHighWaterMark | repeated |
SwapHighWaterMark
| Field | Type | Label | Description |
|---|---|---|---|
| holder | string | ||
| sequence | uint64 |
SwapResponse
AuthorizationKind
AuthorizationKind is the purpose binding of a two-phase authorization. The kind decides which consuming message is allowed to spend it, so a swap authorization can never be reduced to a single-leg pull or burn and vice versa.
| Name | Number | Description |
|---|---|---|
| AUTHORIZATION_KIND_UNSPECIFIED | 0 | |
| AUTHORIZATION_KIND_SWAP | 1 | |
| AUTHORIZATION_KIND_PULL | 2 | |
| AUTHORIZATION_KIND_BURN | 3 |
SwapMsg
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| CreateAuthorization | MsgCreateAuthorization | SwapResponse | |
| ExecuteSwap | MsgExecuteSwap | SwapResponse | |
| ExecutePull | MsgExecutePull | SwapResponse | |
| ExecuteBurn | MsgExecuteBurn | SwapResponse | |
| RevokeAuthorization | MsgRevokeAuthorization | SwapResponse | |
| SetSwapConfig | MsgSetSwapConfig | SwapResponse |
SwapQuery
| Method Name | Request Type | Response Type | Description |
|---|---|---|---|
| Authorization | QueryAuthorizationRequest | QueryAuthorizationResponse | |
| Authorizations | QueryAuthorizationsRequest | QueryAuthorizationsResponse | |
| HighWaterMark | QueryHighWaterMarkRequest | QueryHighWaterMarkResponse |