Skip to main content
Version: 1.1.0

Protocol Documentation

Table of Contents​

Top

centerchain/tokenfactory/v1/swap.proto​

Authorization​

FieldTypeLabelDescription
termsMsgCreateAuthorization
consumedbool
revokedbool
used_fromstring
gas_feestring

MsgCreateAuthorization​

FieldTypeLabelDescription
holderstring
order_sequint64
chain_idstring
executorstring
from_denomstring
to_denomstring
to_amountstring
max_fromstring
gas_fee_maxstring
from_nftNFTScope
to_nftNFTScope
kindAuthorizationKind

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.

FieldTypeLabelDescription
executorstring
holderstring
order_sequint64
chain_idstring
amountstring

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.

FieldTypeLabelDescription
executorstring
holderstring
order_sequint64
chain_idstring
amountstring

MsgExecuteSwap​

FieldTypeLabelDescription
executorstring
holderstring
order_sequint64
chain_idstring
used_fromstring
to_amountstring
gas_feestring

MsgRevokeAuthorization​

FieldTypeLabelDescription
holderstring
order_sequint64
chain_idstring

MsgSetSwapConfig​

FieldTypeLabelDescription
authoritystring
configSwapConfig

NFTScope​

FieldTypeLabelDescription
class_idstring
token_idstring

QueryAuthorizationRequest​

FieldTypeLabelDescription
holderstring
order_sequint64

QueryAuthorizationResponse​

FieldTypeLabelDescription
authorizationAuthorization
high_water_markuint64
reserved_fromstring
gas_modestring

QueryAuthorizationsRequest​

QueryAuthorizationsRequest lists every authorization created by a holder, newest sequence last. Consumed and revoked authorizations are included.

FieldTypeLabelDescription
holderstring
paginationcosmos.base.query.v1beta1.PageRequest

QueryAuthorizationsResponse​

FieldTypeLabelDescription
authorizationsAuthorizationrepeated
paginationcosmos.base.query.v1beta1.PageResponse

QueryHighWaterMarkRequest​

FieldTypeLabelDescription
holderstring

QueryHighWaterMarkResponse​

FieldTypeLabelDescription
sequenceuint64

SwapConfig​

FieldTypeLabelDescription
technical_issuerstring
executorsstringrepeated

SwapGenesis​

FieldTypeLabelDescription
configSwapConfig
authorizationsAuthorizationrepeated
high_water_marksSwapHighWaterMarkrepeated

SwapHighWaterMark​

FieldTypeLabelDescription
holderstring
sequenceuint64

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.

NameNumberDescription
AUTHORIZATION_KIND_UNSPECIFIED0
AUTHORIZATION_KIND_SWAP1
AUTHORIZATION_KIND_PULL2
AUTHORIZATION_KIND_BURN3

SwapMsg​

Method NameRequest TypeResponse TypeDescription
CreateAuthorizationMsgCreateAuthorizationSwapResponse
ExecuteSwapMsgExecuteSwapSwapResponse
ExecutePullMsgExecutePullSwapResponse
ExecuteBurnMsgExecuteBurnSwapResponse
RevokeAuthorizationMsgRevokeAuthorizationSwapResponse
SetSwapConfigMsgSetSwapConfigSwapResponse

SwapQuery​

Method NameRequest TypeResponse TypeDescription
AuthorizationQueryAuthorizationRequestQueryAuthorizationResponse
AuthorizationsQueryAuthorizationsRequestQueryAuthorizationsResponse
HighWaterMarkQueryHighWaterMarkRequestQueryHighWaterMarkResponse

Scalar Value Types​

.proto TypeNotesC++JavaPythonGoC#PHPRuby
doubledoubledoublefloatfloat64doublefloatFloat
floatfloatfloatfloatfloat32floatfloatFloat
int32Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead.int32intintint32intintegerBignum or Fixnum (as required)
int64Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead.int64longint/longint64longinteger/stringBignum
uint32Uses variable-length encoding.uint32intint/longuint32uintintegerBignum or Fixnum (as required)
uint64Uses variable-length encoding.uint64longint/longuint64ulonginteger/stringBignum or Fixnum (as required)
sint32Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s.int32intintint32intintegerBignum or Fixnum (as required)
sint64Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s.int64longint/longint64longinteger/stringBignum
fixed32Always four bytes. More efficient than uint32 if values are often greater than 2^28.uint32intintuint32uintintegerBignum or Fixnum (as required)
fixed64Always eight bytes. More efficient than uint64 if values are often greater than 2^56.uint64longint/longuint64ulonginteger/stringBignum
sfixed32Always four bytes.int32intintint32intintegerBignum or Fixnum (as required)
sfixed64Always eight bytes.int64longint/longint64longinteger/stringBignum
boolboolbooleanbooleanboolboolbooleanTrueClass/FalseClass
stringA string must always contain UTF-8 encoded or 7-bit ASCII text.stringStringstr/unicodestringstringstringString (UTF-8)
bytesMay contain any arbitrary sequence of bytes.stringByteStringstr[]byteByteStringstringString (ASCII-8BIT)