Documentation ¶
Index ¶
- Constants
- Variables
- func AmountToZeroFinString() string
- func CleanAddressListByCharacterSort(addrs []Address, addradds []Address) (VarUint1, []Address)
- func IsDiamondValueString(diamondStr string) bool
- func IsValidVisibleString(str string) bool
- type Address
- type AddressListByCharacterSort
- type AddressReadable
- type Amount
- func NewAmount(unit uint8, num []byte) *Amount
- func NewAmountByBigInt(bignum *big.Int) (*Amount, error)
- func NewAmountByBigIntWithUnit(bignum *big.Int, unit int) (*Amount, error)
- func NewAmountByUnit(num int64, unit int) *Amount
- func NewAmountByUnitMei(num int64) *Amount
- func NewAmountFromFinString(finstr string) (*Amount, error)
- func NewAmountFromMeiStringUnsafe(meistr string) (*Amount, error)
- func NewAmountFromMeiUnsafe(mei float64) (*Amount, error)
- func NewAmountFromString(numstr string) (*Amount, error)
- func NewAmountNumOneByUnit(unit uint8) *Amount
- func NewAmountNumSmallCoin(num uint8) *Amount
- func NewAmountSmall(num uint8, unit uint8) *Amount
- func NewAmountSmallValue(num uint8, unit uint8) Amount
- func NewEmptyAmount() *Amount
- func NewEmptyAmountValue() Amount
- func ParseAmount(buf []byte, seek uint32) *Amount
- func (bill Amount) Add(amt *Amount) (*Amount, error)
- func (bill *Amount) CompressForMainNumLen(numlen int, enlarge bool) (*Amount, bool, error)
- func (bill Amount) Copy() *Amount
- func (bill *Amount) EllipsisDecimalFor11SizeStore() (*Amount, bool, error)
- func (bill Amount) Equal(amt *Amount) bool
- func (bill Amount) GetValue() *big.Int
- func (bill Amount) IsEmpty() bool
- func (bill Amount) IsNegative() bool
- func (bill Amount) IsNotEmpty() bool
- func (bill Amount) IsPositive() bool
- func (bill Amount) LessThan(amt *Amount) bool
- func (bill Amount) MoreThan(amt *Amount) bool
- func (bill Amount) NotEqual(amt *Amount) bool
- func (bill *Amount) Parse(buf []byte, seek uint32) (uint32, error)
- func (bill Amount) Serialize() ([]byte, error)
- func (bill Amount) Size() uint32
- func (bill Amount) Sub(amt *Amount) (*Amount, error)
- func (bill Amount) ToFinString() string
- func (bill Amount) ToFinStringWithMark(mark string) string
- func (bill Amount) ToFinStringWithMarkBySegmentSplit(mark string) string
- func (bill Amount) ToMei() float64
- func (bill Amount) ToMeiBigFloat() *big.Float
- func (bill Amount) ToMeiOrFinString(usemei bool) string
- func (bill Amount) ToMeiString() string
- func (bill Amount) ToUnitBigFloat(unit int) *big.Float
- func (bill Amount) ToUnitString(unit_name string) string
- func (bill Amount) ToZhu() float64
- func (bill Amount) ToZhuBigFloat() *big.Float
- func (bill Amount) ToZhuOmit() uint64
- type BitcoinSyslendId
- type BlockHeight
- type BlockTxTimestamp
- type Bool
- type Bytes10
- type Bytes12
- type Bytes14
- type Bytes15
- type Bytes16
- type Bytes17
- type Bytes18
- type Bytes2
- type Bytes21
- type Bytes24
- type Bytes3
- type Bytes32
- type Bytes33
- type Bytes4
- type Bytes5
- type Bytes6
- type Bytes64
- type Bytes8
- type ChannelId
- type DiamondListMaxLen200
- func (elm *DiamondListMaxLen200) Parse(buf []byte, seek uint32) (uint32, error)
- func (elm *DiamondListMaxLen200) ParseHACDlistBySplitCommaFromString(hacdlistsplitcomma string) error
- func (elm DiamondListMaxLen200) Serialize() ([]byte, error)
- func (elm *DiamondListMaxLen200) SerializeHACDlistToCommaSplitString() string
- func (elm DiamondListMaxLen200) Size() uint32
- type DiamondName
- type DiamondNumber
- type DiamondSyslendId
- type ExtendMessageMaxLen255
- type Hash
- type HashHalfChecker
- type HashListMax65535
- type HashNonceChecker
- type LockblsId
- type Multisign
- type Multisign2
- type OptionalAddress
- type Property
- type Satoshi
- type SatoshiVariation
- type Sign
- type SignCheckData
- type SignListMax255
- type SignListMax65535
- type StringMax16777215
- type StringMax255
- type StringMax255List255
- type StringMax65535
- type TrimString16
- type TrimString34
- type TrimString64
- type UserLendingId
- type VarUint1
- type VarUint2
- type VarUint3
- type VarUint4
- type VarUint5
- type VarUint6
- type VarUint7
- type VarUint8
Constants ¶
const ( HashSize = 32 HashHalfCheckerSize = 16 HashNonceCheckerSize = 8 )
const (
AddressSize = 21
)
const (
BlockHeightSize uint32 = 5
)
const (
DiamondNameSize = 6
)
const (
SignSize uint32 = 33 + 64
)
Variables ¶
var EmptyZeroBytes32 = bytes.Repeat([]byte{0}, 32)
var EmptyZeroBytes512 = bytes.Repeat([]byte{0}, 512)
Functions ¶
func AmountToZeroFinString ¶
func AmountToZeroFinString() string
func CleanAddressListByCharacterSort ¶
De duplication and sorting address list
func IsDiamondValueString ¶
Judge whether it is a diamond
func IsValidVisibleString ¶
Types ¶
type Address ¶
type Address = Bytes21
func CheckReadableAddress ¶
check address is ok ?
func (Address) ToReadable ¶
type AddressListByCharacterSort ¶
type AddressListByCharacterSort []Address
Alphabetical sort
func (AddressListByCharacterSort) Len ¶
func (n AddressListByCharacterSort) Len() int
func (AddressListByCharacterSort) Less ¶
func (n AddressListByCharacterSort) Less(i, j int) bool
func (AddressListByCharacterSort) Swap ¶
func (n AddressListByCharacterSort) Swap(i, j int)
type AddressReadable ¶
type AddressReadable = TrimString34
type Amount ¶
func NewAmountByUnit ¶
func NewAmountByUnitMei ¶
func NewAmountFromFinString ¶
create form readble string
func NewAmountFromMeiStringUnsafe ¶
create form readble string
func NewAmountFromMeiUnsafe ¶
func NewAmountFromString ¶
Create amount from string
func NewAmountNumOneByUnit ¶
func NewAmountNumSmallCoin ¶
func NewAmountSmall ¶
func NewAmountSmallValue ¶
func NewEmptyAmount ¶
func NewEmptyAmount() *Amount
func NewEmptyAmountValue ¶
func NewEmptyAmountValue() Amount
func ParseAmount ¶
func (*Amount) CompressForMainNumLen ¶
Omit the decimal part in order to save it in the 4-digit space Enlargeindicates whether to enlarge (round up)
func (*Amount) EllipsisDecimalFor11SizeStore ¶
Omit the decimal part in order to save it in the 11 bit space
func (Amount) IsNegative ¶
Judgment must be negative and cannot be zero
func (Amount) IsNotEmpty ¶
func (Amount) IsPositive ¶
Judgment must be positive and cannot be zero
func (Amount) ToFinString ¶
func (Amount) ToFinStringWithMark ¶
func (Amount) ToFinStringWithMarkBySegmentSplit ¶
func (Amount) ToMeiOrFinString ¶
func (Amount) ToMeiString ¶
Convert the unit to pieces, keep 8 decimal places, and round off the excess
func (Amount) ToUnitString ¶
Convert the unit to pieces, keep 8 decimal places, and round off the excess
func (Amount) ToZhuBigFloat ¶
type BitcoinSyslendId ¶
type BitcoinSyslendId = Bytes15
type BlockHeight ¶
type BlockHeight = VarUint5
type BlockTxTimestamp ¶
type BlockTxTimestamp = VarUint5
type DiamondListMaxLen200 ¶
type DiamondListMaxLen200 struct { Count VarUint1 Diamonds []DiamondName }
func NewEmptyDiamondListMaxLen200 ¶
func NewEmptyDiamondListMaxLen200() *DiamondListMaxLen200
func (*DiamondListMaxLen200) Parse ¶
func (elm *DiamondListMaxLen200) Parse(buf []byte, seek uint32) (uint32, error)
func (*DiamondListMaxLen200) ParseHACDlistBySplitCommaFromString ¶
func (elm *DiamondListMaxLen200) ParseHACDlistBySplitCommaFromString(hacdlistsplitcomma string) error
Create diamond
func (DiamondListMaxLen200) Serialize ¶
func (elm DiamondListMaxLen200) Serialize() ([]byte, error)
func (*DiamondListMaxLen200) SerializeHACDlistToCommaSplitString ¶
func (elm *DiamondListMaxLen200) SerializeHACDlistToCommaSplitString() string
Get the name list of block diamonds
func (DiamondListMaxLen200) Size ¶
func (elm DiamondListMaxLen200) Size() uint32
type DiamondName ¶
type DiamondName = Bytes6
func (DiamondName) Name ¶
func (d DiamondName) Name() string
type DiamondNumber ¶
type DiamondNumber = VarUint3
type DiamondSyslendId ¶
type DiamondSyslendId = Bytes14
type ExtendMessageMaxLen255 ¶
func (*ExtendMessageMaxLen255) Parse ¶
func (e *ExtendMessageMaxLen255) Parse(buf []byte, seek uint32) (uint32, error)
func (ExtendMessageMaxLen255) Serialize ¶
func (e ExtendMessageMaxLen255) Serialize() ([]byte, error)
func (ExtendMessageMaxLen255) Size ¶
func (e ExtendMessageMaxLen255) Size() uint32
type Hash ¶
type Hash = Bytes32
func (Hash) GetHalfChecker ¶
func (h Hash) GetHalfChecker() HashHalfChecker
func (Hash) GetNonceChecker ¶
func (h Hash) GetNonceChecker() HashNonceChecker
func (Hash) NotZeroBlank ¶
type HashHalfChecker ¶
type HashHalfChecker = Bytes16
func (HashHalfChecker) Equal ¶
func (h HashHalfChecker) Equal(tar HashHalfChecker) bool
type HashListMax65535 ¶
func CreateHashListMax65535 ¶
func CreateHashListMax65535(hxs []Hash) HashListMax65535
func (*HashListMax65535) Parse ¶
func (this *HashListMax65535) Parse(buf []byte, seek uint32) (uint32, error)
func (*HashListMax65535) Serialize ¶
func (this *HashListMax65535) Serialize() ([]byte, error)
func (*HashListMax65535) Size ¶
func (this *HashListMax65535) Size() uint32
type HashNonceChecker ¶
type HashNonceChecker = Bytes8
func (HashNonceChecker) Equal ¶
func (h HashNonceChecker) Equal(tar HashNonceChecker) bool
type Multisign ¶
type Multisign2 ¶
type OptionalAddress ¶
func NewEmptyOptionalAddress ¶
func NewEmptyOptionalAddress() OptionalAddress
func (*OptionalAddress) Parse ¶
func (elm *OptionalAddress) Parse(buf []byte, seek uint32) (uint32, error)
func (OptionalAddress) Serialize ¶
func (elm OptionalAddress) Serialize() ([]byte, error)
func (OptionalAddress) ShowReadableOrEmpty ¶
func (elm OptionalAddress) ShowReadableOrEmpty() string
display address
func (OptionalAddress) Size ¶
func (elm OptionalAddress) Size() uint32
type Satoshi ¶
type Satoshi = VarUint8
比特币一亿分之一
func (Satoshi) GetSatoshiVariation ¶
func (elm Satoshi) GetSatoshiVariation() SatoshiVariation
type SatoshiVariation ¶
func NewEmptySatoshiVariation ¶
func NewEmptySatoshiVariation() SatoshiVariation
func NewSatoshiVariation ¶
func NewSatoshiVariation(sats uint64) SatoshiVariation
func (*SatoshiVariation) GetRealSatoshi ¶
func (elm *SatoshiVariation) GetRealSatoshi() Satoshi
Get true value
func (*SatoshiVariation) Parse ¶
func (elm *SatoshiVariation) Parse(buf []byte, seek uint32) (uint32, error)
func (SatoshiVariation) Serialize ¶
func (elm SatoshiVariation) Serialize() ([]byte, error)
func (SatoshiVariation) Size ¶
func (elm SatoshiVariation) Size() uint32
type SignCheckData ¶
type SignCheckData struct { Signdata Sign Stuffstr StringMax65535 }
Signature verification data
func CreateSignCheckData ¶
func CreateSignCheckData(str string) SignCheckData
func (*SignCheckData) FillSign ¶
func (elm *SignCheckData) FillSign(acc *account.Account) error
Fill in signature
func (*SignCheckData) Parse ¶
func (elm *SignCheckData) Parse(buf []byte, seek uint32) (uint32, error)
func (SignCheckData) Serialize ¶
func (elm SignCheckData) Serialize() ([]byte, error)
func (SignCheckData) Size ¶
func (elm SignCheckData) Size() uint32
func (SignCheckData) VerifySign ¶
func (elm SignCheckData) VerifySign() (bool, Address, error)
check sign
type SignListMax255 ¶
func CreateEmptySignListMax255 ¶
func CreateEmptySignListMax255() *SignListMax255
func (*SignListMax255) Append ¶
func (this *SignListMax255) Append(sign Sign)
func (*SignListMax255) Parse ¶
func (this *SignListMax255) Parse(buf []byte, seek uint32) (uint32, error)
func (*SignListMax255) Serialize ¶
func (this *SignListMax255) Serialize() ([]byte, error)
func (*SignListMax255) Size ¶
func (this *SignListMax255) Size() uint32
type SignListMax65535 ¶
func (*SignListMax65535) Parse ¶
func (this *SignListMax65535) Parse(buf []byte, seek uint32) (uint32, error)
func (*SignListMax65535) Serialize ¶
func (this *SignListMax65535) Serialize() ([]byte, error)
func (*SignListMax65535) Size ¶
func (this *SignListMax65535) Size() uint32
type StringMax16777215 ¶
max length = 16777215
func CreateStringMax16777215 ¶
func CreateStringMax16777215(str string) StringMax16777215
func (*StringMax16777215) Parse ¶
func (elm *StringMax16777215) Parse(buf []byte, seek uint32) (uint32, error)
func (StringMax16777215) Serialize ¶
func (elm StringMax16777215) Serialize() ([]byte, error)
func (StringMax16777215) Size ¶
func (elm StringMax16777215) Size() uint32
func (StringMax16777215) Value ¶
func (elm StringMax16777215) Value() string
type StringMax255 ¶
max length = 255
func CreateStringMax255 ¶
func CreateStringMax255(str string) StringMax255
func (*StringMax255) Parse ¶
func (elm *StringMax255) Parse(buf []byte, seek uint32) (uint32, error)
func (StringMax255) Serialize ¶
func (elm StringMax255) Serialize() ([]byte, error)
func (StringMax255) ShowString ¶
func (elm StringMax255) ShowString() string
func (StringMax255) Size ¶
func (elm StringMax255) Size() uint32
func (StringMax255) Value ¶
func (elm StringMax255) Value() string
type StringMax255List255 ¶
type StringMax255List255 struct { Count VarUint1 Lists []StringMax255 }
max length = 255
func CreateEmptyStringMax255List255 ¶
func CreateEmptyStringMax255List255() StringMax255List255
func (*StringMax255List255) Append ¶
func (this *StringMax255List255) Append(str *StringMax255) error
func (*StringMax255List255) Parse ¶
func (this *StringMax255List255) Parse(buf []byte, seek uint32) (uint32, error)
func (*StringMax255List255) Serialize ¶
func (this *StringMax255List255) Serialize() ([]byte, error)
func (*StringMax255List255) Size ¶
func (this *StringMax255List255) Size() uint32
type StringMax65535 ¶
max length = 65535
func CreateStringMax65535 ¶
func CreateStringMax65535(str string) StringMax65535
func (*StringMax65535) Parse ¶
func (elm *StringMax65535) Parse(buf []byte, seek uint32) (uint32, error)
func (StringMax65535) Serialize ¶
func (elm StringMax65535) Serialize() ([]byte, error)
func (StringMax65535) Size ¶
func (elm StringMax65535) Size() uint32
func (StringMax65535) Value ¶
func (elm StringMax65535) Value() string
type TrimString16 ¶
type TrimString16 string
func (*TrimString16) Parse ¶
func (elm *TrimString16) Parse(buf []byte, seek uint32) (uint32, error)
func (TrimString16) Serialize ¶
func (elm TrimString16) Serialize() ([]byte, error)
func (TrimString16) Size ¶
func (elm TrimString16) Size() uint32
func (TrimString16) ValueShow ¶
func (elm TrimString16) ValueShow() string
type TrimString34 ¶
type TrimString34 string
func (*TrimString34) Parse ¶
func (elm *TrimString34) Parse(buf []byte, seek uint32) (uint32, error)
func (TrimString34) Serialize ¶
func (elm TrimString34) Serialize() ([]byte, error)
func (TrimString34) Size ¶
func (elm TrimString34) Size() uint32
func (TrimString34) ValueShow ¶
func (elm TrimString34) ValueShow() string
type TrimString64 ¶
type TrimString64 string
func (*TrimString64) Parse ¶
func (elm *TrimString64) Parse(buf []byte, seek uint32) (uint32, error)
func (TrimString64) Serialize ¶
func (elm TrimString64) Serialize() ([]byte, error)
func (TrimString64) Size ¶
func (elm TrimString64) Size() uint32
func (TrimString64) ValueShow ¶
func (elm TrimString64) ValueShow() string
type UserLendingId ¶
type UserLendingId = Bytes17