Transaction payload structure - Second-Earth/setchain GitHub Wiki

account number:

-[Create Account](#Create Account) -[Update Account](#Update Account) -[Update Permission](#Update Permission)

assets:

-[Issuing assets] (#Issuing assets) -[Additional Assets] (#Additional Assets) -[Change owner](#Change owner) -[Update Assets] (#Update Assets) -[Destroy Assets] (#Destroy Assets) -[Update Asset Contract] (#Update Asset Contract)

Transfer:

-[Transfer] (#Transfer)

dpos:

-[REGISTRATION CANDIDATE] (#REGISTRATION CANDIDATE) -[Update Candidate] (#Update Candidate) -[Cancellation Candidate](#Cancellation Candidate) -[Candidates get back their deposits] (# Candidates get back their deposits) -[Vote] (#Vote) -[Add candidate to blacklist](#Add candidate to blacklist) -[Exit system to take over] (#Exit system to take over) -[Remove blacklist](#Remove blacklist)

contract:

-[Deployment contract](#Deployment contract) -[Contract method call](#Contract method call)

Module: Account

Features:

Create an account

action:

AType: actionType, //Required item CreateAccount 0x100
  Nonce: nonce, //Required
  AssetID: assetID, //Required item Transfer asset ID
  From: from, //Required
  To: to, //Required field, must be the system account set.account
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //When transferring >0, no transfer=0
  Payload: payload, //Required
  Remark: remark, // Remark information

payload:

type CreateAccountAction struct {
 AccountName common.Name `json:"accountName,omitempty"` //Required The first character of the account name starts with a lowercase letter, and the rest is a combination of lowercase letters and numbers. The length of the main account name is 12-16 digits, and the length of the sub-account name is 2 -16 digits, the full name of the sub-account is called "the name of the main account. The name of the sub-account"
 Founder common.Name `json:"founder,omitempty"` //Can fill in the blanks, the default is the account itself
 PublicKey common.PubKey `json:"publicKey,omitempty"` //Account public key, fill in the blanks for invalid account
 Description string `json:"description,omitempty"` //Description field is limited to 255
}

Features:

Update account

action:

AType: actionType, //Required item UpdateAccount 0x101
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Update the account itself
  To: to, //Required field, must be the system account set.account
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

type UpdataAccountAction struct {
 Founder common.Name `json:"founder,omitempty"` //Required field can be empty or empty The default is the account itself
}

Features:

Update permissions

action:

AType: actionType, //Required item UpdateAccountAuthor 0x103
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Update the account itself
  To: to, //Required field, must be the system account set.account
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

type AccountAuthorAction struct {
 Threshold uint64 `json:"threshold,omitempty"`
 UpdateAuthorThreshold uint64 `json:"updateAuthorThreshold,omitempty"`
 AuthorActions []*AuthorAction `json:"authorActions,omitempty"`
}

data structure desc:

type AuthorAction struct {
 ActionType AuthorActionType //Required field 0 add 1 update 2 delete
 Author *common.Author //Required
}

type Author struct {
 Owner `json:"owner"` //User name, address or public key
 Weight uint64 `json:"weight"` //Required item Weight
}

Owner interface {
 String() string
}

Module: Assets

Features:

Issue assets

action:

AType: actionType, // required item IssueAsset 0x201
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required
  To: to, //Required field, must be the system account set.asset
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

type IssueAsset struct {
 AssetName string `json:"assetName,omitempty"` //Required item The asset name consists of two parts, namely "account name: main asset name "  or  " account name: main asset name. sub-asset name". The first character must be a lowercase letter, and the rest is a combination of lowercase letters and numbers. The length of the main asset name is 2-16 digits, and the length of the sub-asset name is 1-8 digits.
 Symbol string `json:"symbol,omitempty"`//Required a-z0-9 2-16 digits can be repeated
 Amount *big.Int `json:"amount"` //Required field can be 0
 Decimals uint64 `json:"decimals"` //Required field greater than or equal to 0
 Founder common.Name `json:"founder,omitempty"` //Required field can be empty or empty, default is from
 Owner common.Name `json:"owner,omitempty"` //Required field cannot be empty Valid account
 UpperLimit *big.Int `json:"upperLimit"` //Required field 0 means no upper limit
 Contract common.Name `json:"contract"` //Empty means non-contract assets. Non-empty is agreement asset account
 Description string `json:"detail"` //Asset description field length is limited to 255
}

Features:

Additional issuance of assets

action:

AType: actionType, //Required item IncreaseAsset 0x200
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Asset owner
  To: to, //Required field, must be the system account set.asset
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

type IncAsset struct {
 AssetId uint64 `json:"assetId,omitempty"` //Required field Additional asset ID
 Amount *big.Int `json:"amount,omitempty"` //The amount of additional issuance cannot be 0
 To common.Name `json:"acceptor,omitempty"` //Receive asset account
}

Features:

Change owner

action:

AType: actionType, //Required item SetAssetOwner 0x203
    Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Asset owner
  To: to, //Required field, must be the system account set.asset
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

type UpdateAssetOwner struct {
 AssetId uint64 `json:"assetId"` //Required field Change owner asset ID
 Owner common.Name `json:"owner,omitempty"`//Required field Valid account number cannot be empty
}

Features:

Update assets

action:

AType: actionType,//Required item UpdateAsset 0x204
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Asset owner
  To: to, //Required field, must be the system account set.asset
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

type UpdateAsset struct {
 AssetID uint64 `json:"assetId"` //Required field Change owner asset ID
Founder common.Name `json:"founder,omitempty"` //required field valid account
}

Features:

Destroy assets

action:

AType: actionType,//Required DestroyAsset 0x202
  Nonce: nonce,//Required
  AssetID: assetID, //Required item Destroy asset ID
  From: from, //Destroy asset account
  To: to,//Required, must be the system account set.asset
  GasLimit: gasLimit, //Required
  Amount: new(big.Int),//Required field The amount of assets to be destroyed
  Payload: payload,
  Remark: remark, // Remark information

payload:

nil //Filling this field does not affect the transaction result

Features:

Update asset contract

action:

AType: actionType,//Required item UpdateAssetContract 0x206
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Asset owner
  To: to, //Required field, must be the system account set.asset
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

type UpdateAssetContract struct {
AssetID uint64 `json:"assetId,omitempty"` //Asset ID
Contract common.Name `json:"contract"` //Contract asset account
}

Module: Transfer

Features:

Transfer

action:

AType: actionType, //Required field Transfer 0x205
  Nonce: nonce, //Required
  AssetID: assetID, //Required item Transfer asset ID
  From: from, //Required
  To: to, //Required
  GasLimit: gasLimit,//Required
  Amount: new(big.Int), //transfer amount
  Payload: payload,
  Remark: remark, // Remark information

payload:

nil //Filling this field does not affect the transaction result

Module: dpos

setchain consensus introduction

Features:

Register Candidates

action:

AType: actionType, //Required field RegCandidate 0x300
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Registration candidate
  To: to, //Required item set.dpos
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field must be 500,000 FT (500000000000000000000000)
  Payload: payload,
  Remark: remark, // Remark information

payload:

RegisterCandidate{
  Url: url, //Required field can be empty
 }

Features:

Update candidates

action:

AType: actionType, //Required item UpdateCandidate 0x301
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Registration candidate
  To: to, //Required item set.dpos
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

UpdateCandidate{
  Url: url, //Required field can be empty
 }

Features:

Cancel candidates

action:

AType: actionType, //Required field UnregCandidate 0x302
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Registration candidate
  To: to, //Required item set.dpos
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

nil

Features:

Candidates get back their deposit

action:

AType: actionType, //Required item RefundCandidate 0x303
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Voters
  To: to, //Required item set.dpos
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

nil

Features:

Vote

action:

AType: actionType, //Required field VoteCandidate 0x304
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field Voters
  To: to, //Required item set.dpos
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

VoteCandidate{
  Candidate: common.Name, //Required field Valid registered candidate
  Stake: big.Int, //Required item Voting amount
 }

Features:

Add candidates to the blacklist

action:

AType: actionType,//Required KickedCandidate 0x400
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field System account number set.founder
  To: to, //Required item set.dpos
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

KickedCandidate{
  Candidates: []common.Name, //Required field List of registered candidates
 }

Features:

Exit the system to take over

action:

AType: actionType, //Required ExitTakeOver 0x401
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field System account number set.founder
  To: to, //Required item set.dpos
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

nil

Features:

Remove blacklist

action:

AType: actionType, //Required field RemoveKickedCandidate 0x402
  Nonce: nonce, //Required
  AssetID: assetID, //required valid asset ID
  From: from, //Required field System account number set.founder
  To: to, //Required item set.dpos
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Required field 0
  Payload: payload,
  Remark: remark, // Remark information

payload:

RemoveKickedCandidate{
  Candidates: []common.Name, //Required field The list of registered candidates who have been added to the blacklist
 }

Module: Contract

Features:

Deploy the contract

action:

AType: actionType,//Required item CreateContract 0x1
  Nonce: nonce, //Required
  AssetID: assetID, //Required item Transfer asset ID
  From: from, //Required
  To: to, //Required item Contract account number
  GasLimit: gasLimit, //Required
  Amount: new(big.Int), //Amount of transfer
  Payload: payload,
  Remark: remark, // Remark information

payload:

Contract bytes code

Features:

Contract method call

action:

AType: actionType, //Required item CallContract 0x0
  Nonce: nonce, //Required
  AssetID: assetID, //transfer asset ID
  From: from, //Required
  To: to, //Required item Contract account numberGasLimit: gasLimit, //Required
   Amount: new(big.Int),//Amount of transfer
   Payload: payload,
   Remark: remark, // Remark information

payload:

bytes contract method name, method parameters

solidity modification items

⚠️ **GitHub.com Fallback** ⚠️