Documentation
¶
Index ¶
- Constants
- Variables
- func EthAddressFromTopia(a Address) ([]byte, error)
- func IsEth(a string) bool
- func IsNativeContractAddress(contractAddr Address) bool
- type Address
- func CreateNativeContractAddress(id uint64) Address
- func CreateUserContractAddress(fromAddr Address, nonce uint64) Address
- func NewAddress(cryptType CryptType, payload []byte) (Address, error)
- func NewFromBytes(addr []byte) Address
- func NewFromString(addr string) Address
- func TopiaAddressFromEth(a string) (Address, error)
- func (a Address) Bytes() []byte
- func (a Address) CryptType() (CryptType, error)
- func (a Address) HexString() (string, error)
- func (a Address) IsHexs() bool
- func (a Address) IsPayable() bool
- func (a Address) IsValid(netType tpcmm.NetworkType) bool
- func (a Address) NetworkType() (tpcmm.NetworkType, error)
- func (a Address) Payload() ([]byte, error)
- type CryptType
- type PrivateKey
- type ProtocolID
- type PublicKey
- type Signature
- type SignatureInfo
Constants ¶
View Source
const ( AddressLen_ETH = 20 //20 bytes AddressLen_Secp256 = 20 //20 bytes AddressLen_BLS12381 = 48 //48 bytes AddressLen_ED25519 = 32 //32 bytes )
View Source
const ( MainnetPrefix = "m" TestnetPrefix = "t" )
Variables ¶
View Source
var UndefAddress = Address("<empty>")
Functions ¶
func EthAddressFromTopia ¶
func IsNativeContractAddress ¶
Types ¶
type Address ¶
type Address string
A Full address contains: netType(1 byte) + cryptType(1 byte) + payload(different size as different cryptType + checkSum(4 byte)
var NativeContractAddr_Account Address
func NewFromBytes ¶
func NewFromString ¶
func TopiaAddressFromEth ¶
func (Address) NetworkType ¶
func (a Address) NetworkType() (tpcmm.NetworkType, error)
type PrivateKey ¶
type PrivateKey []byte
type ProtocolID ¶
type ProtocolID byte
type SignatureInfo ¶
Click to show internal directories.
Click to hide internal directories.