invoice

package
v0.22.4 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2018 License: Apache-2.0, Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CodespaceDefault     sdk.CodespaceType = 69
	CodeDuplicateInvoice sdk.CodeType      = 1
)
View Source
const (
	DefaultCodespace sdk.CodespaceType = 11
)

Variables

View Source
var (
	PrefixKey             = []byte{0x01}
	AccountInvoiceKey     = []byte{0x02}
	ErrorDuplicateInvoice = sdk.NewError(CodespaceDefault, CodeDuplicateInvoice, "Duplicate invoice.")
)
View Source
var MsgCdc *wire.Codec

generic sealed codec to be used throughout sdk

Functions

func GetAccountInvoiceKey added in v0.9.0

func GetAccountInvoiceKey(addr sdk.AccAddress, contractID string) []byte

func GetAccountInvoicesKey added in v0.9.0

func GetAccountInvoicesKey(addr sdk.AccAddress) []byte

func GetKey

func GetKey(id string) []byte

func MakeHandle

func MakeHandle(k InvoiceKeeper) sdk.Handler

func NewPubKey added in v0.20.0

func NewPubKey(pk string) (res ed25519.PubKeyEd25519)

func RegisterWire

func RegisterWire(cdc *wire.Codec)

Register concrete types on wire codec

func TestAddr added in v0.20.0

func TestAddr(addr string, bech string) sdk.AccAddress

for incode address generation

Types

type Invoice

type Invoice struct {
	ID         string         `json:"id"`
	Issuer     sdk.AccAddress `json:"issuer"`
	Receiver   sdk.AccAddress `json:"receiver"`
	Items      []Item         `json:"items"`
	CreateTime int64          `json:"create_time"`
}

type InvoiceKeeper

type InvoiceKeeper struct {
	// contains filtered or unexported fields
}

func NewInvoiceKeeper

func NewInvoiceKeeper(store sdk.StoreKey, cdc *wire.Codec, assetKeeper asset.Keeper) InvoiceKeeper

func (InvoiceKeeper) CreateInvoice

func (ik InvoiceKeeper) CreateInvoice(ctx sdk.Context, msg MsgCreate) (sdk.Tags, sdk.Error)

func (InvoiceKeeper) GetInvoice

func (ik InvoiceKeeper) GetInvoice(ctx sdk.Context, id string) *Invoice

func (InvoiceKeeper) HasInvoice

func (ik InvoiceKeeper) HasInvoice(ctx sdk.Context, id string) bool

func (InvoiceKeeper) SetInvoice

func (ik InvoiceKeeper) SetInvoice(ctx sdk.Context, invoice Invoice)

type Item

type Item struct {
	AssetID string `json:"asset_id"`
}

type MsgCreate

type MsgCreate struct {
	ID       string         `json:"id"`
	Issuer   sdk.AccAddress `json:"issuer"`
	Receiver sdk.AccAddress `json:"receiver"`
	Items    []Item         `json:"items"`
}

func NewMsgCreate

func NewMsgCreate(id string, issuer, receiver sdk.AccAddress, items []Item) MsgCreate

func (MsgCreate) GetSignBytes

func (msg MsgCreate) GetSignBytes() []byte

func (MsgCreate) GetSigners

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

func (MsgCreate) Type

func (msg MsgCreate) Type() string

func (MsgCreate) ValidateBasic

func (msg MsgCreate) ValidateBasic() sdk.Error

Directories

Path Synopsis
client

Jump to

Keyboard shortcuts

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