Versions in this module Expand all Collapse all v0 v0.1.0 Mar 28, 2017 Changes in this version + const EntityTypeCHByte + const EntityTypeCustodianByte + const EntityTypeGCMByte + const EntityTypeICMByte + const PermCreateAccountTx + const PermCreateLegalEntityTx + const PermCreateUserTx + const PermNone + const PermTransferTx + const TxTypeCreateAccount + const TxTypeCreateLegalEntity + const TxTypeCreateUser + const TxTypeTransfer + var Currencies map[string]ConcreteCurrency + func CanExecTx(executor TxExecutor, tx Tx) bool + func IsValidEntityType(b byte) bool + func SignTx(signedBytes []byte, addr []byte, privKey crypto.PrivKey) (crypto.Signature, error) + type Account struct + EntityID string + ID string + Wallets []Wallet + func NewAccount(id, entityID string) *Account + func (acc *Account) BelongsTo(legalEntityID string) bool + func (acc *Account) Copy() *Account + func (acc *Account) Equal(a *Account) bool + func (acc *Account) GetWallet(currency string) *Wallet + func (acc *Account) String() string + func (account *Account) SetWallet(wallet Wallet) + type AccountGetter interface + GetAccount func(id string) *Account + type AccountGetterSetter interface + GetAccount func(id string) *Account + SetAccount func(id string, acc *Account) + type AccountIndex struct + Accounts []string + func NewAccountIndex() *AccountIndex + func (i *AccountIndex) Add(s string) + func (i *AccountIndex) Has(s string) bool + func (i *AccountIndex) ToStringSlice() []string + type AccountIndexGetter interface + GetAccountIndex func() *AccountIndex + type AccountIndexGetterSetter interface + GetAccountIndex func() *AccountIndex + SetAccountIndex func(i *AccountIndex) + type AccountIndexSetter interface + SetAccountIndex func(i *AccountIndex) + type AccountSetter interface + SetAccount func(id string, acc *Account) + type AccountsReturned struct + Account []*Account + type ConcreteCurrency struct + func (c ConcreteCurrency) DecimalPlaces() uint + func (c ConcreteCurrency) MinimumUnit() int64 + func (c ConcreteCurrency) Symbol() string + func (c ConcreteCurrency) ValidateAmount(amount int64) bool + type CreateAccountTx struct + AccountID string + Address []byte + Signature crypto.Signature + func (tx *CreateAccountTx) SignBytes(chainID string) []byte + func (tx *CreateAccountTx) SignTx(privateKey crypto.PrivKey, chainID string) error + func (tx *CreateAccountTx) String() string + func (tx *CreateAccountTx) TxType() byte + func (tx *CreateAccountTx) ValidateBasic() abci.Result + type CreateLegalEntityTx struct + Address []byte + EntityID string + Name string + ParentID string + Signature crypto.Signature + Type byte + func (tx *CreateLegalEntityTx) SignBytes(chainID string) []byte + func (tx *CreateLegalEntityTx) SignTx(privateKey crypto.PrivKey, chainID string) error + func (tx *CreateLegalEntityTx) String() string + func (tx *CreateLegalEntityTx) TxType() byte + func (tx *CreateLegalEntityTx) ValidateBasic() abci.Result + type CreateUserTx struct + Address []byte + CanCreate bool + Name string + PubKey crypto.PubKey + Signature crypto.Signature + func (tx *CreateUserTx) SignBytes(chainID string) []byte + func (tx *CreateUserTx) SignTx(privateKey crypto.PrivKey, chainID string) error + func (tx *CreateUserTx) String() string + func (tx *CreateUserTx) TxType() byte + func (tx *CreateUserTx) ValidateBasic() abci.Result + type Currency interface + DecimalPlaces func() uint + MinimumUnit func() int64 + Symbol func() string + ValidateAmount func(int64) bool + type Index interface + Add func(s string) + Has func(s string) bool + ToStringSlice func() []string + type LegalEntitiesReturned struct + LegalEntities []*LegalEntity + type LegalEntity struct + CreatorAddr []byte + EntityID string + ID string + Name string + Permissions Perm + Type byte + func NewCH(id string, name string, creatorAddr []byte, EntityID string) *LegalEntity + func NewCustodian(id string, name string, creatorAddr []byte, EntityID string) *LegalEntity + func NewGCM(id string, name string, creatorAddr []byte, EntityID string) *LegalEntity + func NewICM(id string, name string, creatorAddr []byte, EntityID string) *LegalEntity + func NewLegalEntity(id string, t byte, name string, permissions Perm, creatorAddr []byte, ...) *LegalEntity + func NewLegalEntityByType(t byte, id string, name string, creatorAddr []byte, EntityID string) *LegalEntity + func (l *LegalEntity) CanExecTx(txType byte) bool + func (l *LegalEntity) Equal(e *LegalEntity) bool + func (l *LegalEntity) String() string + type LegalEntityGetter interface + GetLegalEntity func(id string) *LegalEntity + type LegalEntityGetterSetter interface + GetLegalEntity func(id string) *LegalEntity + SetLegalEntity func(id string, acc *LegalEntity) + type LegalEntityIndex struct + Ids []string + func (i *LegalEntityIndex) Add(s string) + func (i *LegalEntityIndex) Has(s string) bool + type LegalEntitySetter interface + SetLegalEntity func(id string, acc *LegalEntity) + type Perm uint64 + func NewPermByTxType(bs ...byte) Perm + func (p Perm) Add(perms Perm) Perm + func (p Perm) Clear(perms Perm) Perm + func (p Perm) Has(perms Perm) bool + type PrivUser struct + type SignedTx interface + SignBytes func(chainID string) []byte + SignTx func(privateKey crypto.PrivKey, chainID string) error + TxType func() byte + type TransferTx struct + Committer TxTransferCommitter + CounterSigners []TxTransferCounterSigner + Recipient TxTransferRecipient + Sender TxTransferSender + func (tx *TransferTx) SetSignature(addr []byte, sig crypto.Signature) bool + func (tx *TransferTx) SignBytes(chainID string) []byte + func (tx *TransferTx) SignTx(privateKey crypto.PrivKey, chainID string) error + func (tx *TransferTx) String() string + func (tx *TransferTx) TxType() byte + func (tx *TransferTx) ValidateBasic() (res abci.Result) + type Tx interface + SignBytes func(chainID string) []byte + TxType func() byte + type TxBasicValidator interface + ValidateBasic func() abci.Result + type TxExecutor interface + CanExecTx func(byte) bool + type TxTransferCommitter struct + Address []byte + Signature crypto.Signature + func (t *TxTransferCommitter) SignTx(privateKey crypto.PrivKey, chainID string) error + func (t TxTransferCommitter) SignBytes(chainID string) []byte + func (t TxTransferCommitter) String() string + func (t TxTransferCommitter) ValidateBasic() abci.Result + type TxTransferCounterSigner struct + Address []byte + Signature crypto.Signature + func (t *TxTransferCounterSigner) SignTx(privateKey crypto.PrivKey, chainID string) error + func (t TxTransferCounterSigner) SignBytes(chainID string) []byte + func (t TxTransferCounterSigner) String() string + func (t TxTransferCounterSigner) ValidateBasic() abci.Result + type TxTransferRecipient struct + AccountID string + func (t TxTransferRecipient) String() string + func (t TxTransferRecipient) ValidateBasic() abci.Result + type TxTransferSender struct + AccountID string + Amount int64 + Currency string + Sequence int + func (t TxTransferSender) String() string + func (t TxTransferSender) ValidateBasic() abci.Result + type User struct + EntityID string + Name string + Permissions Perm + PubKey crypto.PubKey + func NewUser(pubKey crypto.PubKey, name string, entityID string, permissions Perm) *User + func (u *User) CanExecTx(txType byte) bool + func (u *User) Equal(v *User) bool + func (u *User) String() string + func (u *User) VerifySignature(signBytes []byte, signature crypto.Signature) bool + type UserGetter interface + GetUser func(addr []byte) *User + type UserGetterSetter interface + GetUser func(addr []byte) *User + SetUser func(addr []byte, acc *User) + type UserSetter interface + SetUser func(addr []byte, acc *User) + type Wallet struct + Balance int64 + Currency string + Sequence int + func (w *Wallet) Equal(z *Wallet) bool + func (w *Wallet) String() string