Documentation ¶
Index ¶
- Variables
- func CreateNewWallet(name string, password string) (string, error)
- func CreateNewWalletAndAddress(name string, password string) (string, error)
- func GenerateBackup(walletName string, password string) (string, error)
- func GenerateNewAddress(walletID string, name string, password string) (string, error)
- func GetAlgo(walletName string, password string) (string, error)
- func GetBlock(blockNumber uint64) (models.Block, error)
- func GetLatestBlock(status models.NodeStatus) (models.Block, error)
- func GetStatus(Client algod.Client) (models.NodeStatus, error)
- func Init() error
- func InitAlgodClient() (algod.Client, error)
- func InitKmdClient() (kmd.Client, error)
- func SendAlgo(walletName string, password string, amount uint64, fromAddr string, ...) (string, error)
- func SendAlgoToSelf(walletName string, password string, fromAddr string, amount uint64) (string, error)
- func SetConsts(address string, token string, kmdaddress string, kmdtoken string)
- type Wallet
Constants ¶
This section is empty.
Variables ¶
var ( // AlgodAddress is the address of the algod daemon AlgodAddress string // AlgodToken is the auth token needed to call algod's rpc functions AlgodToken string // KmdAddress is the address of the key management daemon KmdAddress string // KmdToken is the auth token needed to call the kmd's rpc functions KmdToken string )
var AlgodClient algod.Client
AlgodClient is a package-level gloabal variable
var KmdClient kmd.Client
KmdClient is a package-level gloabal variable
Functions ¶
func CreateNewWallet ¶
CreateNewWallet creates a new wallet
func CreateNewWalletAndAddress ¶
CreateNewWalletAndAddress creates a new wallet and an address
func GenerateBackup ¶
GenerateBackup gets the seedphrase from the walletName for backup
func GenerateNewAddress ¶
GenerateNewAddress generates a new address associated with the given wallet
func GetAlgo ¶
GetAlgo seeds a given wallet with a specific number of algos similar to what friendbot does on stellar
func GetLatestBlock ¶
func GetLatestBlock(status models.NodeStatus) (models.Block, error)
GetLatestBlock getst the latest block from the blockchain
func GetStatus ¶
func GetStatus(Client algod.Client) (models.NodeStatus, error)
GetStatus gets the status of a given algod client
func InitAlgodClient ¶
InitAlgodClient initializes a new algorand daemon client
func InitKmdClient ¶
InitKmdClient initializes a new key management daemon client
func SendAlgo ¶
func SendAlgo(walletName string, password string, amount uint64, fromAddr string, toAddr string) (string, error)
SendAlgo sends algos to another address from a source account