Documentation
¶
Overview ¶
Package xrpl provides XRP Ledger wallet functionality for the bridge chain
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AccountInfo ¶
type AccountInfo struct {
Account string
Balance *big.Int
Sequence uint32
PreviousTxnID string
PreviousTxnLgrSeq uint32
}
AccountInfo represents XRP Ledger account information
type Client ¶
type Client interface {
GetAccountInfo(ctx context.Context, account string) (*AccountInfo, error)
SubmitTransaction(ctx context.Context, txBlob string) (string, error)
GetTransaction(ctx context.Context, txHash string) (*Transaction, error)
GetAccountLines(ctx context.Context, account string) ([]*Trustline, error)
}
Client defines the interface for interacting with XRP Ledger
type Transaction ¶
type Transaction struct {
TransactionType string
Account string
Destination string
Amount interface{} // Can be string (XRP) or object (IOU)
Fee string
Sequence uint32
SigningPubKey string
TxnSignature string
Hash string
}
Transaction represents an XRP Ledger transaction
type Trustline ¶
type Trustline struct {
Account string
Currency string
Issuer string
Balance *big.Int
Limit *big.Int
}
Trustline represents a trust line on XRP Ledger
type XRPLWallet ¶
type XRPLWallet interface {
wallet.Wallet
// GetAccountInfo returns account information including sequence number
GetAccountInfo(ctx context.Context) (*AccountInfo, error)
// CreatePayment creates an XRP payment transaction
CreatePayment(ctx context.Context, destination string, amount *big.Int, tag *uint32) (*Transaction, error)
// CreateTrustline creates a trustline for a token
CreateTrustline(ctx context.Context, issuer string, currency string, limit *big.Int) (*Transaction, error)
// GetTrustlines returns all trustlines for the account
GetTrustlines(ctx context.Context) ([]*Trustline, error)
}
Wallet provides XRP Ledger wallet functionality
func NewWallet ¶
func NewWallet(privateKey *ecdsa.PrivateKey, client Client) (XRPLWallet, error)
NewWallet creates a new XRP Ledger wallet
Click to show internal directories.
Click to hide internal directories.