Documentation ¶
Index ¶
- Constants
- type Address
- func (a Address) Base58() string
- func (a Address) Big() *big.Int
- func (a Address) Bytes() []byte
- func (a Address) Cmp(other Address) int
- func (a Address) Equals(b Address) bool
- func (a Address) ImplementsGraphQLType(name string) bool
- func (a Address) IsEmpty() bool
- func (a Address) MarshalText() ([]byte, error)
- func (a *Address) Scan(src interface{}) error
- func (a *Address) SetBytes(b []byte)
- func (a Address) String() string
- func (a *Address) UnmarshalGraphQL(input interface{}) error
- func (a *Address) UnmarshalJSON(input []byte) error
- func (a *Address) UnmarshalText(input []byte) error
- func (a Address) Value() (driver.Value, error)
- type Base58
- type Hash
- func (h Hash) Base58() string
- func (h Hash) Big() *big.Int
- func (h Hash) Bytes() []byte
- func (h Hash) Cmp(other Hash) int
- func (h Hash) ImplementsGraphQLType(name string) bool
- func (h Hash) MarshalText() ([]byte, error)
- func (h *Hash) Scan(src interface{}) error
- func (h *Hash) SetBytes(b []byte)
- func (h Hash) String() string
- func (h *Hash) UnmarshalGraphQL(input interface{}) error
- func (h *Hash) UnmarshalJSON(input []byte) error
- func (h *Hash) UnmarshalText(input []byte) error
- func (h Hash) Value() (driver.Value, error)
- type Signature
- func (s Signature) Base58() string
- func (s Signature) Big() *big.Int
- func (s Signature) Bytes() []byte
- func (s Signature) Cmp(other Signature) int
- func (s Signature) ImplementsGraphQLType(name string) bool
- func (s Signature) MarshalText() ([]byte, error)
- func (s *Signature) Scan(src interface{}) error
- func (s *Signature) SetBytes(b []byte)
- func (s Signature) Sign(message []byte) []byte
- func (s Signature) String() string
- func (s *Signature) UnmarshalGraphQL(input interface{}) error
- func (s *Signature) UnmarshalJSON(input []byte) error
- func (s *Signature) UnmarshalText(input []byte) error
- func (s Signature) Value() (driver.Value, error)
- type SolData
- func (sd SolData) Base58() string
- func (sd SolData) Base64() string
- func (sd SolData) MarshalText() ([]byte, error)
- func (sd *SolData) SetBytes(input []byte)
- func (sd *SolData) SetSolData(data []byte, encoding string)
- func (sd SolData) String() string
- func (sd *SolData) UnmarshalJSON(input []byte) error
- func (sd *SolData) UnmarshalText(input []byte) error
- func (sd SolData) Value() (driver.Value, error)
Constants ¶
const ( // HashLength is the expected length of the hash HashLength = 32 // AddressLength is the expected length of the address AddressLength = 32 // SignatureLength is the expected length of the signature SignatureLength = 64 )
Lengths of signatures and addresses in bytes.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address [AddressLength]byte
Address The address
func Base58ToAddress ¶
Base58ToAddress returns Address with byte values of b.
func Base64ToAddress ¶ added in v0.0.3
Base64ToAddress returns Address with byte values of b.
func BigToAddress ¶
BigToAddress returns Address with byte values of b.
func BytesToAddress ¶
BytesToAddress returns Address with value b.
func StrToAddress ¶ added in v0.0.3
StrToAddress returns Address with byte values of b. Notice: only support base58/base64 str
func (Address) ImplementsGraphQLType ¶
ImplementsGraphQLType returns true if Hash implements the specified GraphQL type.
func (Address) MarshalText ¶
MarshalText returns base58 str account
func (*Address) UnmarshalGraphQL ¶
UnmarshalGraphQL unmarshals the provided GraphQL query data.
func (*Address) UnmarshalJSON ¶
UnmarshalJSON parses an account in base58 syntax.
func (*Address) UnmarshalText ¶
UnmarshalText parses an account in base58 syntax.
type Base58 ¶ added in v0.1.0
type Base58 []byte
func (Base58) MarshalJSON ¶ added in v0.1.0
func (*Base58) UnmarshalJSON ¶ added in v0.1.0
type Hash ¶
type Hash [HashLength]byte
Hash The Hash
func Base58ToHash ¶
Base58ToHash returns Hash with byte values of b.
func Base64ToHash ¶ added in v0.0.3
Base64ToHash returns Hash with byte values of b.
func StrToHash ¶ added in v0.0.3
StrToHash returns Hash with byte values of b. Notice: only support base58/base64 str
func (Hash) ImplementsGraphQLType ¶
ImplementsGraphQLType returns true if Hash implements the specified GraphQL type.
func (Hash) MarshalText ¶
MarshalText returns base58 str hash
func (*Hash) UnmarshalGraphQL ¶
UnmarshalGraphQL unmarshals the provided GraphQL query data.
func (*Hash) UnmarshalJSON ¶
UnmarshalJSON parses a hash in base58 syntax.
func (*Hash) UnmarshalText ¶
UnmarshalText parses a hash in base58 syntax.
type Signature ¶
type Signature [SignatureLength]byte
Signature The signature
func Base58ToSignature ¶
Base58ToSignature returns Signature with byte values of b.
func BigToSignature ¶
BigToSignature returns Signature with byte values of b.
func BytesToSignature ¶
BytesToSignature returns Signature with value b.
func (Signature) ImplementsGraphQLType ¶
ImplementsGraphQLType returns true if Hash implements the specified GraphQL type.
func (Signature) MarshalText ¶
MarshalText returns base58 str account
func (*Signature) UnmarshalGraphQL ¶
UnmarshalGraphQL unmarshals the provided GraphQL query dats.
func (*Signature) UnmarshalJSON ¶
UnmarshalJSON parses an account in base58 syntax.
func (*Signature) UnmarshalText ¶
UnmarshalText parses an account in base58 syntax.
type SolData ¶
SolData base58, base64 data
func (SolData) MarshalText ¶
MarshalText returns base58/base64 str
func (*SolData) SetSolData ¶
SetSolData sets the SolData
func (*SolData) UnmarshalJSON ¶
UnmarshalJSON parses data in base58 syntax.
func (*SolData) UnmarshalText ¶
UnmarshalText parses data in base58 syntax.