Documentation ¶
Overview ¶
Copyright (C) 2017, Zipper Team. All rights reserved.
This file is part of zipper ¶
The zipper is free software: you can use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
The zipper is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ISC License for more details.
You should have received a copy of the ISC License along with this program. If not, see <https://opensource.org/licenses/isc>.
Copyright (C) 2017, Zipper Team. All rights reserved.
This file is part of zipper ¶
The zipper is free software: you can use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
The zipper is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ISC License for more details.
You should have received a copy of the ISC License along with this program. If not, see <https://opensource.org/licenses/isc>.
Copyright (C) 2017, Zipper Team. All rights reserved.
This file is part of zipper ¶
The zipper is free software: you can use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
The zipper is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ISC License for more details.
You should have received a copy of the ISC License along with this program. If not, see <https://opensource.org/licenses/isc>.
Copyright (C) 2017, Zipper Team. All rights reserved.
This file is part of zipper ¶
The zipper is free software: you can use, copy, modify, and distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
The zipper is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ISC License for more details.
You should have received a copy of the ISC License along with this program. If not, see <https://opensource.org/licenses/isc>.
Index ¶
Constants ¶
const ( AccountTypeCommon uint32 = iota AccountTypeChain AccountTypeHot AccountTypeIssue )
account type
const AccountVariety = 3
AccountVariety max index of account type
const (
AddressLength = 20
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Account ¶
type Account struct { URL URL `json:"url"` AccountType uint32 //AhainCoords []uint32 PublicKey *crypto.PublicKey Address Address }
Account the definition of common account struct
func (*Account) Deserialize ¶
Deserialize restore an account var from an serialized bytes
type Address ¶
type Address [AddressLength]byte
Address definition
func ChainCoordinateToAddress ¶
func ChainCoordinateToAddress(cc ChainCoordinate) Address
ChainCoordinateToAddress return the publicaccount address of the specified chain by chaincoordinate
func HexToAddress ¶
HexToAddress creates address from address string
func PublicKeyToAddress ¶
PublicKeyToAddress generate address from the public key
func (Address) MarshalText ¶
MarshalText returns the hex representation of a.
func (*Address) UnmarshalText ¶
UnmarshalText parses a hash in hex syntax.
type ChainCoordinate ¶
type ChainCoordinate []byte
ChainCoordinate represents the coordinate of the blockchain
func HexToChainCoordinate ¶
func HexToChainCoordinate(hex string) ChainCoordinate
HexToChainCoordinate returns chain coordinate via the hex
func NewChainCoordinate ¶
func NewChainCoordinate(c []byte) ChainCoordinate
NewChainCoordinate returns an instance of ChainCoordinate
func (ChainCoordinate) MarshalText ¶
func (cc ChainCoordinate) MarshalText() ([]byte, error)
MarshalText returns the hex representation of a.
func (ChainCoordinate) ParentCoorinate ¶
func (cc ChainCoordinate) ParentCoorinate() ChainCoordinate
ParentCoorinate returns parent coorinate
func (ChainCoordinate) String ¶
func (cc ChainCoordinate) String() string
String returns string format of chain coordinate
func (ChainCoordinate) UnmarshalText ¶
func (cc ChainCoordinate) UnmarshalText(input []byte) error
UnmarshalText parses a hash in hex syntax.
type URL ¶
type URL struct { Scheme string // Protocol scheme to identify a capable account backend Path string // Path for the backend to identify a unique entity }
URL definition
func (URL) MarshalJSON ¶
MarshalJSON implements the json.Marshaller interface.
func (URL) TerminalString ¶
TerminalString implements the log.TerminalStringer interface.