xlm

package
v1.3.4 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2020 License: GPL-2.0, GPL-3.0 Imports: 11 Imported by: 11

README

Xlm

Package xlm contains all the packages that are exclusive to the Stellar Lumens Network.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Passphrase defines the stellar network passphrase
	Passphrase string
	// Mainnet is a bool which decides which chain to connect to
	Mainnet bool
	// TestNetClient defines the horizon client to connect to
	TestNetClient *horizon.Client
)
View Source
var RefillAmount float64

RefillAmount defines the default stellar refill amount

Functions

func AccountExists

func AccountExists(publicKey string) bool

AccountExists checks whether an account exists

func FreezeAccount

func FreezeAccount(seed string) (int32, string, error)

FreezeAccount freezes an account

func GetAccountData

func GetAccountData(a string) ([]byte, error)

GetAccountData gets the account data

func GetAllBalances

func GetAllBalances(publicKey string) ([]protocols.Balance, error)

GetAllBalances gets all the balances associated with a certain account.

func GetAssetBalance

func GetAssetBalance(publicKey string, assetName string) float64

GetAssetBalance gets the balance of the user in the specific asset

func GetAssetTrustLimit

func GetAssetTrustLimit(publicKey string, assetName string) float64

GetAssetTrustLimit gets the trust limit that the user has with an issuer

func GetBlockHash

func GetBlockHash(blockNumber int) (string, error)

GetBlockHash gets the block hash corresponding to a block number

func GetKeyPair

func GetKeyPair() (string, string, error)

GetKeyPair gets a keypair that can be used to interact with the stellar blockchain

func GetLatestBlock

func GetLatestBlock() (int32, error)

GetLatestBlock fetches the latest block from the blockchain

func GetLatestBlockHash

func GetLatestBlockHash() (string, error)

GetLatestBlockHash gets the lastest block hash

func GetLedgerData

func GetLedgerData(blockNumberx int) ([]byte, error)

GetLedgerData gets the latest data from the ledger

func GetNativeBalance

func GetNativeBalance(publicKey string) float64

GetNativeBalance gets the xlm balance of a specific account

func GetTransactionData

func GetTransactionData(txhash string) ([]byte, error)

GetTransactionData gets tx data

func GetTransactionHeight

func GetTransactionHeight(txhash string) (int, error)

GetTransactionHeight gets height at which a tx was confirmed

func GetXLM

func GetXLM(PublicKey string) error

GetXLM makes an API call to the stellar friendbot, which gives 10000 testnet XLM

func HasStableCoin

func HasStableCoin(publicKey string) bool

HasStableCoin checks whether the PublicKey has a stablecoin balance

func RefillAccount

func RefillAccount(publicKey string, refillSeed string) error

RefillAccount refills an account

func ReturnSourceAccount

func ReturnSourceAccount(seed string) (horizonprotocol.Account, keypair.KP, error)

ReturnSourceAccount returns the source account of the seed

func ReturnSourceAccountPubkey

func ReturnSourceAccountPubkey(pubkey string) (horizonprotocol.Account, error)

ReturnSourceAccountPubkey returns the source account of the pubkey

func SendTx

func SendTx(mykp keypair.KP, sourceAccount *horizonprotocol.Account,
	memo string, ops ...build.Operation) (int32, string, error)

SendTx signs and broadcasts a given stellar tx

func SendXLM

func SendXLM(destination string, amountx float64, seed string, memo string) (int32, string, error)

SendXLM sends xlm to a destination address

func SendXLMCreateAccount

func SendXLMCreateAccount(destination string, amountx float64, seed string) (int32, string, error)

SendXLMCreateAccount creates and sends XLM to a new account

func SetAuthImmutable

func SetAuthImmutable(seed string) (int32, string, error)

SetAuthImmutable sets the auth_immutable flag on an account

func SetConsts

func SetConsts(amount float64, mainnet bool)

SetConsts XLM consts

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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