Documentation ¶
Overview ¶
The stx package provides a compiled go representation of Stellar's XDR data structures. These data structures were generated by goxdr (https://github.com/xdrpp/goxdr/), which is documented at https://xdrpp.github.io/goxdr/pkg/github.com/xdrpp/goxdr/cmd/goxdr/goxdr.1.html. If you wish to bypass the stc library to mashal these structures directly, you will want to import "github.com/xdrpp/goxdr/xdr".
Index ¶
- Constants
- func IsStrKeyChar(c rune) bool
- func RenderAssetCode(bs []byte) string
- func ScanAssetCode(input []byte) ([]byte, error)
- func ToStrKey(ver StrKeyVersionByte, bin []byte) string
- func XdrFromBytes(input []byte, ts ...xdr.XdrType) (err error)
- func XdrToBytes(ts ...xdr.XdrType) []byte
- type IsAccount
- type Signable
- type StrKeyError
- type StrKeyVersionByte
Constants ¶
const (
STRKEY_ALG_ED25519 = 0
)
Variables ¶
This section is empty.
Functions ¶
func IsStrKeyChar ¶
Returns true if c is a valid character in a strkey formatted key.
func RenderAssetCode ¶
func ScanAssetCode ¶
func ToStrKey ¶
func ToStrKey(ver StrKeyVersionByte, bin []byte) string
ToStrKey converts the raw bytes of a key to ASCII strkey format.
func XdrToBytes ¶
Types ¶
type Signable ¶
type Signable interface { // Writes the signature payload *without* the network ID. Be sure // to write the SHA256 hash of the network ID before calling this. WriteTaggedTx(io.Writer) }
Types that can be hashed
type StrKeyError ¶
type StrKeyError string
func (StrKeyError) Error ¶
func (e StrKeyError) Error() string
type StrKeyVersionByte ¶
type StrKeyVersionByte byte
const ( STRKEY_PUBKEY StrKeyVersionByte = 6 << 3 // 'G' STRKEY_MUXED StrKeyVersionByte = 12 << 3 // 'M' STRKEY_PRIVKEY StrKeyVersionByte = 18 << 3 // 'S' STRKEY_PRE_AUTH_TX StrKeyVersionByte = 19 << 3 // 'T', STRKEY_HASH_X StrKeyVersionByte = 23 << 3 // 'X' STRKEY_ERROR StrKeyVersionByte = 255 )
func FromStrKey ¶
func FromStrKey(in []byte) ([]byte, StrKeyVersionByte)
FromStrKey decodes a strkey-format string into the raw bytes of the key and the type of key. Returns the reserved StrKeyVersionByte STRKEY_ERROR if it fails to decode the string.