Documentation
¶
Index ¶
- Constants
- type StellarAsset
- type StellarChain
- func (s *StellarChain) BuildSigningInput(sourceAccount string, sequence int64, fee int32, passphrase string, ...) (*stellar.SigningInput, error)
- func (s *StellarChain) BuildSigningInputFromRequest(request *StellarPaymentRequest) (*stellar.SigningInput, error)
- func (s *StellarChain) CompileTransaction(input *chain_abstraction.TransactionInput, signatures [][]byte, ...) ([]byte, error)
- func (s *StellarChain) CreateAndSignTransaction(input interface{}, privateKey []byte) ([]byte, error)
- func (s *StellarChain) GetPreimageHash(input *chain_abstraction.TransactionInput) ([]byte, []byte, error)
- func (s *StellarChain) GetPublicKeyFromPrivateKey(privateKey []byte) ([]byte, error)
- func (s *StellarChain) GetTransactionHash(encodedTx []byte) (string, error)
- func (s *StellarChain) PrepareTransaction(input interface{}) (*chain_abstraction.TransactionInput, error)
- func (s *StellarChain) Sign(preimage []byte, privateKey []byte) ([]byte, error)
- func (s *StellarChain) ValidateTransactionInput(input interface{}) error
- type StellarConfig
- type StellarMemo
- type StellarPaymentRequest
- func (r *StellarPaymentRequest) WithAsset(asset *stellar.Asset) *StellarPaymentRequest
- func (r *StellarPaymentRequest) WithFee(fee int32) *StellarPaymentRequest
- func (r *StellarPaymentRequest) WithMemo(memoType string, memoValue interface{}) *StellarPaymentRequest
- func (r *StellarPaymentRequest) WithPassphrase(passphrase string) *StellarPaymentRequest
- func (r *StellarPaymentRequest) WithSequence(sequence int64) *StellarPaymentRequest
Constants ¶
const ( // DefaultStellarPassphrase is the default network passphrase for mainnet DefaultStellarPassphrase = "Public Global Stellar Network ; September 2015" // DefaultStellarFee is the default fee in stroops (0.00001 XLM) DefaultStellarFee = 100 // Memo types supported by Stellar MemoTypeVoid = "void" MemoTypeText = "text" MemoTypeID = "id" MemoTypeHash = "hash" )
Constants for Stellar configuration
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type StellarAsset ¶
func NewStellarAsset ¶
func NewStellarAsset(assetType, code, issuer string) *StellarAsset
func (*StellarAsset) ToProtoAsset ¶
func (a *StellarAsset) ToProtoAsset() *stellar.Asset
type StellarChain ¶
type StellarChain struct {
*chain_abstraction.BaseChain
}
StellarChain implements the Chain interface for Stellar
func NewStellarChain ¶
func NewStellarChain() *StellarChain
NewStellarChain creates a new Stellar chain instance
func (*StellarChain) BuildSigningInput ¶
func (s *StellarChain) BuildSigningInput( sourceAccount string, sequence int64, fee int32, passphrase string, destination string, amount int64, asset *stellar.Asset, memoType string, memoValue interface{}, ) (*stellar.SigningInput, error)
BuildSigningInput creates a Stellar signing input for payment operations
func (*StellarChain) BuildSigningInputFromRequest ¶
func (s *StellarChain) BuildSigningInputFromRequest(request *StellarPaymentRequest) (*stellar.SigningInput, error)
BuildSigningInputFromRequest creates a Stellar signing input from a payment request
func (*StellarChain) CompileTransaction ¶
func (s *StellarChain) CompileTransaction( input *chain_abstraction.TransactionInput, signatures [][]byte, publicKeys [][]byte, ) ([]byte, error)
CompileTransaction compiles a Stellar transaction with signatures
func (*StellarChain) CreateAndSignTransaction ¶
func (s *StellarChain) CreateAndSignTransaction(input interface{}, privateKey []byte) ([]byte, error)
CreateAndSignTransaction creates and signs a Stellar transaction
func (*StellarChain) GetPreimageHash ¶
func (s *StellarChain) GetPreimageHash(input *chain_abstraction.TransactionInput) ([]byte, []byte, error)
GetPreimageHash gets the preimage hash for external signing
func (*StellarChain) GetPublicKeyFromPrivateKey ¶
func (s *StellarChain) GetPublicKeyFromPrivateKey(privateKey []byte) ([]byte, error)
GetPublicKeyFromPrivateKey derives the public key from a private key
func (*StellarChain) GetTransactionHash ¶
func (s *StellarChain) GetTransactionHash(encodedTx []byte) (string, error)
GetTransactionHash gets the transaction hash
func (*StellarChain) PrepareTransaction ¶
func (s *StellarChain) PrepareTransaction(input interface{}) (*chain_abstraction.TransactionInput, error)
PrepareTransaction prepares a Stellar transaction for external signing
func (*StellarChain) Sign ¶
func (s *StellarChain) Sign(preimage []byte, privateKey []byte) ([]byte, error)
Sign signs a preimage with a private key
func (*StellarChain) ValidateTransactionInput ¶
func (s *StellarChain) ValidateTransactionInput(input interface{}) error
ValidateTransactionInput validates Stellar transaction input
type StellarConfig ¶
StellarConfig holds configuration for Stellar operations
func NewStellarConfig ¶
func NewStellarConfig() *StellarConfig
func (*StellarConfig) WithFee ¶
func (c *StellarConfig) WithFee(fee int32) *StellarConfig
func (*StellarConfig) WithPassphrase ¶
func (c *StellarConfig) WithPassphrase(passphrase string) *StellarConfig
func (*StellarConfig) WithTimeBounds ¶
func (c *StellarConfig) WithTimeBounds(timeBounds int64) *StellarConfig
type StellarMemo ¶
type StellarMemo struct { Type string Value interface{} }
func NewStellarMemo ¶
func NewStellarMemo(memoType string, value interface{}) *StellarMemo
type StellarPaymentRequest ¶
type StellarPaymentRequest struct { SourceAccount string Destination string Amount int64 Asset *stellar.Asset Sequence int64 Fee int32 Passphrase string MemoType string MemoValue interface{} }
func NewStellarPaymentRequest ¶
func NewStellarPaymentRequest(sourceAccount, destination string, amount int64) *StellarPaymentRequest
func (*StellarPaymentRequest) WithAsset ¶
func (r *StellarPaymentRequest) WithAsset(asset *stellar.Asset) *StellarPaymentRequest
func (*StellarPaymentRequest) WithFee ¶
func (r *StellarPaymentRequest) WithFee(fee int32) *StellarPaymentRequest
func (*StellarPaymentRequest) WithMemo ¶
func (r *StellarPaymentRequest) WithMemo(memoType string, memoValue interface{}) *StellarPaymentRequest
func (*StellarPaymentRequest) WithPassphrase ¶
func (r *StellarPaymentRequest) WithPassphrase(passphrase string) *StellarPaymentRequest
func (*StellarPaymentRequest) WithSequence ¶
func (r *StellarPaymentRequest) WithSequence(sequence int64) *StellarPaymentRequest