types

package
v0.0.0-...-4f551e9 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// module name
	ModuleName = "multisig"

	// StoreKey to be used when creating the KVStore
	StoreKey = ModuleName
)
View Source
const RouterKey = ModuleName // this was defined in your key.go file

Variables

View Source
var ModuleCdc = codec.New()

Functions

func RegisterCodec

func RegisterCodec(cdc *codec.Codec)

RegisterCodec registers concrete types on the Amino codec

Types

type MsgCompleteTransaction

type MsgCompleteTransaction struct {
	Signers []sdk.AccAddress `json:"signers"`
	TxID    string           `json:"tx_id"`
	UUID    string           `json:"uuid"`
}

MsgCompleteTransaction defines complete a transaction

func NewMsgCompleteTransaction

func NewMsgCompleteTransaction(uid, txID string, signers []sdk.AccAddress) MsgCompleteTransaction

NewMsgCompleteTransaction is a constructor function for MsgCompleteTransaction

func (MsgCompleteTransaction) GetSignBytes

func (msg MsgCompleteTransaction) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgCompleteTransaction) GetSigners

func (msg MsgCompleteTransaction) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgCompleteTransaction) Route

func (msg MsgCompleteTransaction) Route() string

Route should return the name of the module

func (MsgCompleteTransaction) Type

func (msg MsgCompleteTransaction) Type() string

Type should return the action

func (MsgCompleteTransaction) ValidateBasic

func (msg MsgCompleteTransaction) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgCreateTransaction

type MsgCreateTransaction struct {
	Amount  sdk.Int          `json:"amount"`
	Denom   string           `json:"denom"`
	From    sdk.AccAddress   `json:"from_address"`
	Signers []sdk.AccAddress `json:"signers"`
	To      sdk.AccAddress   `json:"to_address"`
	UUID    string           `json:"uuid"`
}

MsgCreateTransaction defines a CreateTransaction message

func NewMsgCreateTransaction

func NewMsgCreateTransaction(from, to sdk.AccAddress, amount sdk.Int, denom string, signers []sdk.AccAddress) MsgCreateTransaction

NewMsgCreateTransaction is a constructor function for MsgCreateTransaction

func (MsgCreateTransaction) GetSignBytes

func (msg MsgCreateTransaction) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgCreateTransaction) GetSigners

func (msg MsgCreateTransaction) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgCreateTransaction) Route

func (msg MsgCreateTransaction) Route() string

Route should return the name of the module

func (MsgCreateTransaction) Type

func (msg MsgCreateTransaction) Type() string

Type should return the action

func (MsgCreateTransaction) ValidateBasic

func (msg MsgCreateTransaction) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgCreateWallet

type MsgCreateWallet struct {
	MinSigTx int              `json:"min_sig_tx"`
	Name     string           `json:"name"`
	PubKeys  []string         `json:"pub_keys"`
	Signers  []sdk.AccAddress `json:"signers"`
}

MsgCreateWallet defines a CreateWallet message

func NewMsgCreateWallet

func NewMsgCreateWallet(name string, pubKeys []string, min int, signers []sdk.AccAddress) MsgCreateWallet

NewMsgCreateWallet is a constructor function for MsgCreateWallet

func (MsgCreateWallet) GetSignBytes

func (msg MsgCreateWallet) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgCreateWallet) GetSigners

func (msg MsgCreateWallet) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgCreateWallet) Route

func (msg MsgCreateWallet) Route() string

Route should return the name of the module

func (MsgCreateWallet) Type

func (msg MsgCreateWallet) Type() string

Type should return the action

func (MsgCreateWallet) ValidateBasic

func (msg MsgCreateWallet) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MsgSignTransaction

type MsgSignTransaction struct {
	PubKey       string           `json:"pubkey"`
	PubKeyBase64 string           `json:"pubkey_base64"`
	Signature    string           `json:"signature"`
	Signers      []sdk.AccAddress `json:"signers"`
	UUID         string           `json:"uuid"`
}

MsgSignTransaction defines a SignTransaction message

func NewMsgSignTransaction

func NewMsgSignTransaction(uid, pubkey, pubkey_base64, sig string, signers []sdk.AccAddress) MsgSignTransaction

NewMsgSignTransaction is a constructor function for MsgCreateTransaction

func (MsgSignTransaction) GetSignBytes

func (msg MsgSignTransaction) GetSignBytes() []byte

GetSignBytes encodes the message for signing

func (MsgSignTransaction) GetSigners

func (msg MsgSignTransaction) GetSigners() []sdk.AccAddress

GetSigners defines whose signature is required

func (MsgSignTransaction) Route

func (msg MsgSignTransaction) Route() string

Route should return the name of the module

func (MsgSignTransaction) Type

func (msg MsgSignTransaction) Type() string

Type should return the action

func (MsgSignTransaction) ValidateBasic

func (msg MsgSignTransaction) ValidateBasic() sdk.Error

ValidateBasic runs stateless checks on the message

type MultiSigWallet

type MultiSigWallet struct {
	Name     string         `json:"name"`       // name of wallet
	MinSigTx int            `json:"min_sig_tx"` // minimum number of signatures for a transaction
	Address  sdk.AccAddress `json:"address"`    // address of the wallet
	PubKeys  []string       `json:"pub_keys"`   // pubkeys of regular accounts to be used for signing transactions on this multisig wallet.
}

MultiSigWallet is a struct that contains all the metadata of a multiple signature wallet

func NewMultiSigWallet

func NewMultiSigWallet(name string, pubKeys []string, min int) (MultiSigWallet, error)

Returns a new MultiSigWallet with the minprice as the price

func (MultiSigWallet) String

func (w MultiSigWallet) String() string

implement fmt.Stringer

type QueryTransactions

type QueryTransactions []Transaction

func (QueryTransactions) String

func (n QueryTransactions) String() string

implement fmt.Stringer

type QueryWallets

type QueryWallets []MultiSigWallet

func (QueryWallets) String

func (n QueryWallets) String() string

implement fmt.Stringer

type Signature

type Signature struct {
	PubKey       string `json:"pub_key"`
	PubKeyBase64 string `json:"pub_key_base64"`
	Signature    string `json:"signature"`
}

type Transaction

type Transaction struct {
	UUID       string         `json:"uuid"`
	From       sdk.AccAddress `json:"from_address"`
	To         sdk.AccAddress `json:"to_address"`
	Coins      sdk.Coins      `json:"coins"`
	Signatures []Signature    `json:"signatures"` // pubkey signatures
	TxID       string         `json:"tx_id"`      // tx hash given by cosmos once transaction is completed
	CreatedAt  int64          `json:"created_at"` // block height
}

func NewTransaction

func NewTransaction(from, to sdk.AccAddress, coins sdk.Coins, height int64, signatures []Signature) Transaction

func (*Transaction) AddSignature

func (t *Transaction) AddSignature(pubkey, pubkey_base64, signature string) error

adds a signature to Transaction. If signature already exists, overwrite

func (Transaction) String

func (t Transaction) String() string

Jump to

Keyboard shortcuts

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