Documentation ¶
Overview ¶
Package txnbuild implements transactions and operations on the Stellar network. TODO: More explanation + links here
Index ¶
- Constants
- func NewHomeDomain(hd string) *string
- func NewInflationDestination(ai string) *string
- type Account
- type AccountFlag
- type AccountMerge
- type AllowTrust
- type Asset
- type BumpSequence
- type ChangeTrust
- type CreateAccount
- type Inflation
- type ManageData
- type Operation
- type Payment
- type SetOptions
- type Signer
- type Threshold
- type Transaction
Constants ¶
const AuthImmutable = AccountFlag(xdr.AccountFlagsAuthImmutableFlag)
AuthImmutable is a flag that if set prevents any authorization flags from being set, and prevents the account from ever being merged (deleted).
const AuthRequired = AccountFlag(xdr.AccountFlagsAuthRequiredFlag)
AuthRequired is a flag that requires the issuing account to give other accounts permission before they can hold the issuing account's credit.
const AuthRevocable = AccountFlag(xdr.AccountFlagsAuthRevocableFlag)
AuthRevocable is a flag that allows the issuing account to revoke its credit held by other accounts.
Variables ¶
This section is empty.
Functions ¶
func NewHomeDomain ¶
NewHomeDomain is syntactic sugar that makes instantiating SetOptions more convenient.
func NewInflationDestination ¶
NewInflationDestination is syntactic sugar that makes instantiating SetOptions more convenient.
Types ¶
type Account ¶
type Account struct { ID string SequenceNumber xdr.SequenceNumber }
Account represents a Stellar Account from the perspective of a Transaction.
type AccountFlag ¶
type AccountFlag uint32
AccountFlag represents the bitmask flags used to set and clear account authorization options.
type AccountMerge ¶
type AccountMerge struct { Destination string // contains filtered or unexported fields }
AccountMerge represents the Stellar merge account operation. See https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type AllowTrust ¶
type AllowTrust struct { Trustor string Type *Asset Authorize bool // contains filtered or unexported fields }
AllowTrust represents the Stellar allow trust operation. See https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type Asset ¶
Asset represents assets on the Stellar network.
func NewNativeAsset ¶
func NewNativeAsset() *Asset
NewNativeAsset is syntactic sugar that makes instantiating an XLM *Asset more convenient.
func (*Asset) ToXDRAllowTrustOpAsset ¶
func (a *Asset) ToXDRAllowTrustOpAsset() (xdr.AllowTrustOpAsset, error)
ToXDRAllowTrustOpAsset for Asset produces a corresponding XDR "allow trust" asset, used by the XDR allow trust operation.
type BumpSequence ¶
type BumpSequence struct { BumpTo int64 // contains filtered or unexported fields }
BumpSequence represents the Stellar bump sequence operation. See https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type ChangeTrust ¶
ChangeTrust represents the Stellar change trust operation. See https://www.stellar.org/developers/guides/concepts/list-of-operations.html
func NewRemoveTrustlineOp ¶
func NewRemoveTrustlineOp(issuedAsset *Asset) ChangeTrust
NewRemoveTrustlineOp returns a ChangeTrust operation to remove the trustline of the described asset, by setting the limit to "0".
type CreateAccount ¶
type CreateAccount struct { Destination string Amount string Asset string // TODO: Not used yet // contains filtered or unexported fields }
CreateAccount represents the Stellar create account operation. See https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type Inflation ¶
type Inflation struct {
// contains filtered or unexported fields
}
Inflation represents the Stellar inflation operation. See https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type ManageData ¶
ManageData represents the Stellar manage data operation. See https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type Payment ¶
type Payment struct { Destination string Amount string Asset *Asset // contains filtered or unexported fields }
Payment represents the Stellar payment operation. See https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type SetOptions ¶
type SetOptions struct { InflationDestination *string SetFlags []AccountFlag ClearFlags []AccountFlag MasterWeight *Threshold LowThreshold *Threshold MediumThreshold *Threshold HighThreshold *Threshold HomeDomain *string Signer *Signer // contains filtered or unexported fields }
SetOptions represents the Stellar set options operation. See https://www.stellar.org/developers/guides/concepts/list-of-operations.html
type Signer ¶
Signer represents the Signer in a SetOptions operation. If the signer already exists, it is updated. If the weight is 0, the signer is deleted.
type Threshold ¶
type Threshold uint8
Threshold is the datatype for MasterWeight, Signer.Weight, and Thresholds. Each is a number between 0-255 inclusive.
func NewThreshold ¶
NewThreshold is syntactic sugar that makes instantiating SetOptions more convenient.
type Transaction ¶
type Transaction struct { SourceAccount Account Operations []Operation BaseFee uint64 // TODO: Why is this a uint 64? Can it be a plain int? Network string // contains filtered or unexported fields }
Transaction represents a Stellar Transaction.
func (*Transaction) Base64 ¶
func (tx *Transaction) Base64() (string, error)
Base64 returns the base 64 XDR representation of the Transaction.
func (*Transaction) Build ¶
func (tx *Transaction) Build() error
Build for Transaction completely configures the Transaction. After calling Build, the Transaction is ready to be serialised or signed.
func (*Transaction) Hash ¶
func (tx *Transaction) Hash() ([32]byte, error)
Hash provides a signable object representing the Transaction on the specified network.
func (*Transaction) MarshalBinary ¶
func (tx *Transaction) MarshalBinary() ([]byte, error)
MarshalBinary returns the binary XDR representation of the Transaction.
func (*Transaction) SetDefaultFee ¶
func (tx *Transaction) SetDefaultFee()
SetDefaultFee sets a sensible minimum default for the Transaction fee, if one has not already been set. It is a linear function of the number of Operations in the Transaction.