stx

package
v0.0.0-...-3770177 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: Apache-2.0, GPL-3.0-or-later Imports: 6 Imported by: 0

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

View Source
const (
	STRKEY_ALG_ED25519 = 0
)

Variables

This section is empty.

Functions

func IsStrKeyChar

func IsStrKeyChar(c rune) bool

Returns true if c is a valid character in a strkey formatted key.

func RenderAssetCode

func RenderAssetCode(bs []byte) string

func ScanAssetCode

func ScanAssetCode(input []byte) ([]byte, error)

func ToStrKey

func ToStrKey(ver StrKeyVersionByte, bin []byte) string

ToStrKey converts the raw bytes of a key to ASCII strkey format.

func XdrFromBytes

func XdrFromBytes(t xdr.XdrType, input []byte) (err error)

func XdrToBytes

func XdrToBytes(t xdr.XdrType) []byte

Types

type AllowTrustAsset

type AllowTrustAsset = XdrAnon_AllowTrustOp_Asset

Alias for the asset code required in AllowTrustOp. Since the issuer is the operation source, an AllowTrustAsset only includes the code, not the issuer.

func (AllowTrustAsset) ToAllowTrustAsset

func (code AllowTrustAsset) ToAllowTrustAsset() AllowTrustAsset

type IsAccount

type IsAccount interface {
	String() string
	ToMuxedAccount() *MuxedAccount
}

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.

Jump to

Keyboard shortcuts

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