v010types

package
v1.5.0-beta.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2022 License: AGPL-3.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Yes        = "Yes"
	Abstain    = "Abstain"
	No         = "No"
	NoWithVeto = "NoWithVeto"
)

Functions

This section is empty.

Types

type BankMsg

type BankMsg struct {
	Send *SendMsg `json:"send,omitempty"`
}

type CosmosMsg

type CosmosMsg struct {
	Bank    *BankMsg        `json:"bank,omitempty"`
	Custom  json.RawMessage `json:"custom,omitempty"`
	Staking *StakingMsg     `json:"staking,omitempty"`
	Wasm    *WasmMsg        `json:"wasm,omitempty"`
	Gov     *GovMsg         `json:"gov,omitempty"`
}

CosmosMsg is an rust enum and only (exactly) one of the fields should be set Should we do a cleaner approach in Go? (type/data?)

type DelegateMsg

type DelegateMsg struct {
	Validator string     `json:"validator"`
	Amount    types.Coin `json:"amount"`
}

type ExecuteMsg

type ExecuteMsg struct {
	// ContractAddr is the sdk.AccAddress of the contract, which uniquely defines
	// the contract ID and instance ID. The sdk module should maintain a reverse lookup table.
	ContractAddr string `json:"contract_addr"`
	// Custom addition to support binding a message to specific code to harden against offline & replay attacks
	// This is only needed when creating a callback message
	CallbackCodeHash string `json:"callback_code_hash"`
	// Msg is assumed to be a json-encoded message, which will be passed directly
	// as `userMsg` when calling `Handle` on the above-defined contract
	Msg []byte `json:"msg"`
	// Send is an optional amount of coins this contract sends to the called contract
	Send              types.Coins `json:"send"`
	CallbackSignature []byte      `json:"callback_sig"` // Optional
}

ExecuteMsg is used to call another defined contract on this chain. The calling contract requires the callee to be defined beforehand, and the address should have been defined in initialization. And we assume the developer tested the ABIs and coded them together.

Since a contract is immutable once it is deployed, we don't need to transform this. If it was properly coded and worked once, it will continue to work throughout upgrades.

type GovMsg

type GovMsg struct {
	Vote *VoteMsg `json:"vote,omitempty"`
}

type HandleResponse

type HandleResponse struct {
	// Messages comes directly from the contract and is it's request for action
	Messages []CosmosMsg `json:"messages"`
	// base64-encoded bytes to return as ABCI.Data field
	Data []byte `json:"data"`
	// log message to return over abci interface
	Log []LogAttribute `json:"log"`
}

HandleResponse defines the return value on a successful handle

type HandleResult

type HandleResult struct {
	Ok  *HandleResponse `json:"Ok,omitempty"`
	Err *types.StdError `json:"Err,omitempty"`
}

HandleResult is the raw response from the handle call

type InitResponse

type InitResponse struct {
	// Messages comes directly from the contract and is it's request for action
	Messages []CosmosMsg `json:"messages"`
	// log message to return over abci interface
	Log  []LogAttribute `json:"log"`
	Data []byte         `json:"data,omitempty"`
}

InitResponse defines the return value on a successful handle

type InitResult

type InitResult struct {
	Ok  *InitResponse   `json:"Ok,omitempty"`
	Err *types.StdError `json:"Err,omitempty"`
}

InitResult is the raw response from the handle call

type InstantiateMsg

type InstantiateMsg struct {
	// CodeID is the reference to the wasm byte code as used by the Cosmos-SDK
	CodeID uint64 `json:"code_id"`
	// Custom addition to support binding a message to specific code to harden against offline & replay attacks
	// This is only needed when creating a callback message
	CallbackCodeHash string `json:"callback_code_hash"`
	// Msg is assumed to be a json-encoded message, which will be passed directly
	// as `userMsg` when calling `Handle` on the above-defined contract
	Msg []byte `json:"msg"`
	/// Label is a mandatory human-readbale label for the contract
	Label string `json:"label"`
	// Send is an optional amount of coins this contract sends to the called contract
	Send              types.Coins `json:"send"`
	CallbackSignature []byte      `json:"callback_sig"` // Optional
}

type LogAttribute

type LogAttribute struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

LogAttribute

type RedelegateMsg

type RedelegateMsg struct {
	SrcValidator string     `json:"src_validator"`
	DstValidator string     `json:"dst_validator"`
	Amount       types.Coin `json:"amount"`
}

type SendMsg

type SendMsg struct {
	FromAddress string      `json:"from_address"`
	ToAddress   string      `json:"to_address"`
	Amount      types.Coins `json:"amount"`
}

SendMsg contains instructions for a Cosmos-SDK/SendMsg It has a fixed interface here and should be converted into the proper SDK format before dispatching

type StakingMsg

type StakingMsg struct {
	Delegate   *DelegateMsg   `json:"delegate,omitempty"`
	Undelegate *UndelegateMsg `json:"undelegate,omitempty"`
	Redelegate *RedelegateMsg `json:"redelegate,omitempty"`
	Withdraw   *WithdrawMsg   `json:"withdraw,omitempty"`
}

type UndelegateMsg

type UndelegateMsg struct {
	Validator string     `json:"validator"`
	Amount    types.Coin `json:"amount"`
}

type VoteMsg

type VoteMsg struct {
	Proposal   uint64 `json:"proposal"`
	VoteOption string `json:"vote_option"`
}

VoteMsg contains instructions for a Cosmos-SDK/GovVote It has a fixed interface here and should be converted into the proper SDK format before dispatching

type WasmMsg

type WasmMsg struct {
	Execute     *ExecuteMsg     `json:"execute,omitempty"`
	Instantiate *InstantiateMsg `json:"instantiate,omitempty"`
}

type WithdrawMsg

type WithdrawMsg struct {
	Validator string `json:"validator"`
	// this is optional
	Recipient string `json:"recipient,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL