address

package
v0.0.0-...-3b3e013 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2025 License: Apache-2.0, MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const VersionByte byte = 6 << 3

base32 encodes to G

Variables

View Source
var XlmCrc16Tab = [256]uint16{}/* 256 elements not displayed */

Functions

func Checksum

func Checksum(data []byte) uint16

func NewAddressBuilder

func NewAddressBuilder(cfg *xc.ChainBaseConfig) (xc.AddressBuilder, error)

Types

type AddressBuilder

type AddressBuilder struct{}

func (AddressBuilder) GetAddressFromPublicKey

func (ab AddressBuilder) GetAddressFromPublicKey(publicKeyBytes []byte) (xc.Address, error)

GetAddressFromPublicKey generates an Address from a given public key. The method takes a public key in the form of a byte slice and returns a corresponding Address after encoding it with a version byte and a checksum. The public key must be 32 bytes long.

func (AddressBuilder) GetAllPossibleAddressesFromPublicKey

func (ab AddressBuilder) GetAllPossibleAddressesFromPublicKey(publicKeyBytes []byte) ([]xc.PossibleAddress, error)

GetAllPossibleAddressesFromPublicKey returns all PossubleAddress(es) given a public key TODO: Consider listing all federation accounts for given public key [Stellar federation documentation]: https://developers.stellar.org/docs/learn/encyclopedia/network-configuration/federation#:~:text=Stellar%20federated%20addresses%20are%20divided,stellar.org%20is%20the%20domain

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL