terra

package
v0.0.0-...-61460eb Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HRP = "terra"
)

Variables

View Source
var (
	ErrInvalidLengthTx        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowTx          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group")
)

Functions

func GetRawTxHex

func GetRawTxHex(input TransactionInput, pub string) string

func NewAddress

func NewAddress(privateKeyHex string) (string, error)

func NewTransaction

func NewTransaction(input TransactionInput, privateKeyHex string) string

func NewTransactionWithTypeUrl

func NewTransactionWithTypeUrl(input TransactionInput, privateKeyHex string) string

func Sign

func Sign(rawHex string, privateKeyHex string) string

func SignEnd

func SignEnd(rawHex string, signHex string) string

func ValidateAddress

func ValidateAddress(address string) bool

Types

type MsgExecuteContract

type MsgExecuteContract struct {
	// Sender is the that actor that signed the messages
	Sender string `protobuf:"bytes,1,opt,name=sender,proto3" json:"sender,omitempty" yaml:"sender"`
	// Contract is the address of the smart contract
	Contract string `protobuf:"bytes,2,opt,name=contract,proto3" json:"contract,omitempty" yaml:"contract"`
	// ExecuteMsg json encoded message to be passed to the contract
	ExecuteMsg json.RawMessage `` /* 144-byte string literal not displayed */
	// Coins that are transferred to the contract on execution
	Coins types.Coins `protobuf:"bytes,5,rep,name=coins,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"coins" yaml:"coins"`
}

MsgExecuteContract represents a message to submits the given message data to a smart contract.

func (*MsgExecuteContract) Marshal

func (m *MsgExecuteContract) Marshal() (dAtA []byte, err error)

func (*MsgExecuteContract) MarshalTo

func (m *MsgExecuteContract) MarshalTo(dAtA []byte) (int, error)

func (*MsgExecuteContract) MarshalToSizedBuffer

func (m *MsgExecuteContract) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgExecuteContract) MessageName

func (m *MsgExecuteContract) MessageName() string

func (*MsgExecuteContract) Size

func (m *MsgExecuteContract) Size() (n int)

func (*MsgExecuteContract) Unmarshal

func (m *MsgExecuteContract) Unmarshal(dAtA []byte) error

type MsgSwap

type MsgSwap struct {
	Trader    string     `protobuf:"bytes,1,opt,name=trader,proto3" json:"trader,omitempty" yaml:"trader"`
	OfferCoin types.Coin `protobuf:"bytes,2,opt,name=offer_coin,json=offerCoin,proto3" json:"offer_coin" yaml:"offer_coin"`
	AskDenom  string     `protobuf:"bytes,3,opt,name=ask_denom,json=askDenom,proto3" json:"ask_denom,omitempty" yaml:"ask_denom"`
}

MsgSwap represents a message to swap coin to another denom.

func (*MsgSwap) Marshal

func (m *MsgSwap) Marshal() (dAtA []byte, err error)

func (*MsgSwap) MarshalTo

func (m *MsgSwap) MarshalTo(dAtA []byte) (int, error)

func (*MsgSwap) MarshalToSizedBuffer

func (m *MsgSwap) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSwap) MessageName

func (m *MsgSwap) MessageName() string

func (*MsgSwap) Size

func (m *MsgSwap) Size() (n int)

func (*MsgSwap) Unmarshal

func (m *MsgSwap) Unmarshal(dAtA []byte) error

type MsgSwapSend

type MsgSwapSend struct {
	FromAddress string     `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty" yaml:"from_address"`
	ToAddress   string     `protobuf:"bytes,2,opt,name=to_address,json=toAddress,proto3" json:"to_address,omitempty" yaml:"to_address"`
	OfferCoin   types.Coin `protobuf:"bytes,3,opt,name=offer_coin,json=offerCoin,proto3" json:"offer_coin" yaml:"offer_coin"`
	AskDenom    string     `protobuf:"bytes,4,opt,name=ask_denom,json=askDenom,proto3" json:"ask_denom,omitempty" yaml:"ask_denom"`
}

MsgSwapSend represents a message to swap coin and send all result coin to recipient

func (*MsgSwapSend) Marshal

func (m *MsgSwapSend) Marshal() (dAtA []byte, err error)

func (*MsgSwapSend) MarshalTo

func (m *MsgSwapSend) MarshalTo(dAtA []byte) (int, error)

func (*MsgSwapSend) MarshalToSizedBuffer

func (m *MsgSwapSend) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*MsgSwapSend) MessageName

func (m *MsgSwapSend) MessageName() string

func (*MsgSwapSend) Size

func (m *MsgSwapSend) Size() (n int)

func (*MsgSwapSend) Unmarshal

func (m *MsgSwapSend) Unmarshal(dAtA []byte) error

type TransactionInput

type TransactionInput struct {
	ChainId       string
	Memo          string
	Sequence      uint64
	AccountNumber uint64
	Fee           types.Coins
	GasLimit      uint64

	SendArray     []types.MsgSend
	SwapArray     []MsgSwap
	ContractArray []MsgExecuteContract
}

func (*TransactionInput) AppendContractMsg

func (m *TransactionInput) AppendContractMsg(sender string, contract string, executeMsg string, coins *types.Coins)

func (*TransactionInput) AppendFeeCoin

func (m *TransactionInput) AppendFeeCoin(demon string, amount *big.Int)

func (*TransactionInput) AppendSendMsg

func (m *TransactionInput) AppendSendMsg(from string, to string, coins *types.Coins)

func (*TransactionInput) AppendSwapMsg

func (m *TransactionInput) AppendSwapMsg(trader string, askDemon string, demon string, amount *big.Int)

Jump to

Keyboard shortcuts

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