Documentation ¶
Index ¶
- Variables
- func BytesToHex(bytes []byte) string
- type AccountAddress
- type Key
- func (key Key) GetPublic() ed25519.PublicKey
- func (key Key) GoString() string
- func (key Key) ID() string
- func (key Key) PublicKeyStr() string
- func (key Key) Raw() Raw
- func (key Key) Sign(msg []byte) ([]byte, error)
- func (key Key) String() string
- func (key Key) ToEncryptedJSON(password string, scryptParams utils.ScryptParams) (export []byte, err error)
- type Raw
Constants ¶
This section is empty.
Variables ¶
var ErrAddressTooLong = errors.New("AccountAddress too long")
var ErrAddressTooShort = errors.New("AccountAddress too short")
Functions ¶
func BytesToHex ¶
Types ¶
type AccountAddress ¶
type AccountAddress [32]byte
AccountAddress is a 32 byte address on the Aptos blockchain It can represent an Object, an Account, and much more.
AccountAddress is copied from the aptos sdk because:
- There are still breaking changes in sdk and we don't want the dependency.
- AccountAddress is just a wrapper and can be easily extracted out.
https://github.com/aptos-labs/aptos-go-sdk/blob/main/internal/types/account.go
func (*AccountAddress) IsSpecial ¶
func (aa *AccountAddress) IsSpecial() bool
IsSpecial Returns whether the address is a "special" address. Addresses are considered special if the first 63 characters of the hex string are zero. In other words, an address is special if the first 31 bytes are zero and the last byte is smaller than `0b10000` (16). In other words, special is defined as an address that matches the following regex: `^0x0{63}[0-9a-f]$`. In short form this means the addresses in the range from `0x0` to `0xf` (inclusive) are special. For more details see the v1 address standard defined as part of AIP-40: https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-40.md
func (*AccountAddress) ParseStringRelaxed ¶
func (aa *AccountAddress) ParseStringRelaxed(x string) error
ParseStringRelaxed parses a string into an AccountAddress
func (*AccountAddress) String ¶
func (aa *AccountAddress) String() string
String Returns the canonical string representation of the AccountAddress
type Key ¶
type Key struct {
// contains filtered or unexported fields
}
Key represents Aptos key
func FromEncryptedJSON ¶
FromEncryptedJSON gets key from json and password
func MustNewInsecure ¶
MustNewInsecure return Key if no error
func (Key) PublicKeyStr ¶
PublicKeyStr return base58 encoded public key
func (Key) ToEncryptedJSON ¶
func (key Key) ToEncryptedJSON(password string, scryptParams utils.ScryptParams) (export []byte, err error)
ToEncryptedJSON returns encrypted JSON representing key