wallet-api-go: github.com/anonanonymous/wallet-api-go Index | Files

package walletapi

import "github.com/anonanonymous/wallet-api-go"


Package Files

addresses.go balance.go errors.go keys.go misc.go node.go transactions.go utils.go wallet-api.go wallet.go


const (
    MIXIN = 3
    FEE   = 10



var ERRORS = map[int]string{
    400: "A parse error occurred, or an error occurred processing your request.",
    401: "API key is missing or invalid.",
    403: "This operation requires a wallet to be open, and one has not been opened.",
    404: "The transaction hash was not found.",
    500: "An exception was thrown whilst processing the request.",

ERRORS - wallet-api errors

type AddressInfo Uses

type AddressInfo struct {
    IsIntegrated   bool
    PaymentID      string
    ActualAddress  string
    PublicSpendKey string
    PublicViewKey  string

AddressInfo - response from validate address

type Balance Uses

type Balance struct {
    Unlocked uint64 `json:"unlocked"`
    Locked   uint64 `json:"locked"`
    Address  string `json:"address"`

Balance - represents a wallet balance

type NodeInfo Uses

type NodeInfo struct {
    DaemonHost  string `json:"daemonHost"`
    DaemonPort  int64  `json:"daemonPort"`
    NodeFee     int64  `json:"nodeFee"`
    NodeAddress string `json:"nodeAddress"`

NodeInfo - node response

type Status Uses

type Status struct {
    NetworkBlockCount uint64 `json:"networkBlockCount"`
    WalletBlockCount  uint64 `json:"walletBlockCount"`
    LocalBlockCount   uint64 `json:"localDaemonBlockCount"`
    PeerCount         uint64 `json:"peerCount"`
    Hashrate          uint64 `json:"hashrate"`
    IsViewWallet      bool   `json:"isViewWallet"`
    SubWalletCount    uint64 `json:"subWalletCount"`

Status - represents a status object

type Transaction Uses

type Transaction struct {
    BlockHeight           uint64     `json:"blockHeight"`
    Fee                   uint64     `json:"fee"`
    FeePerByte            uint64     `json:"feePerByte"`
    Hash                  string     `json:"hash"`
    IsCoinbaseTransaction bool       `json:"isCoinbaseTransaction"`
    PaymentID             string     `json:"paymentID"`
    Timestamp             uint64     `json:"timestamp"`
    UnlockTime            uint64     `json:"unlockTime"`
    Transfers             []Transfer `json:"transfers"`

Transaction - represents a transaction object

type TransactionResult Uses

type TransactionResult struct {
    TransactionHash  string `json:"transactionHash"`
    Fee              uint64 `json:"fee"`
    RelayedToNetwork bool   `json:"relayedToNetwork"`

TransactionResult - represents the result of a sent / prepared transaction

type Transactions Uses

type Transactions struct {
    Transactions []Transaction `json:"transactions"`
    Transaction  Transaction   `json:"transaction"`

Transactions - represents a transactions object

type Transfer Uses

type Transfer struct {
    Address string `json:"address"`
    Amount  int64  `json:"amount"`

Transfer - represents a transfer object

type Wallet Uses

type Wallet struct {
    DaemonHost string
    DaemonPort int
    Filename   string
    Password   string

Wallet - holds wallet configuration

type WalletAPI Uses

type WalletAPI struct {
    APIKey string
    Host   string
    Port   string

WalletAPI - communicates with wallet-api

func InitWalletAPI Uses

func InitWalletAPI(apiKey, host, port string) *WalletAPI

InitWalletAPI - initializes wallet-api connection

func (WalletAPI) Addresses Uses

func (wAPI WalletAPI) Addresses() ([]string, error)

Addresses - gets all the addresses in the wallet container

func (WalletAPI) CloseWallet Uses

func (wAPI WalletAPI) CloseWallet() error

CloseWallet - saves and closes the wallet

func (WalletAPI) CreateAddress Uses

func (wAPI WalletAPI) CreateAddress() (map[string]string, error)

CreateAddress - creates a new random address in the wallet container

func (WalletAPI) CreateIntegratedAddress Uses

func (wAPI WalletAPI) CreateIntegratedAddress(address, paymentID string) (string, error)

CreateIntegratedAddress - creates an integrated address from and address and paymentID

func (WalletAPI) CreateWallet Uses

func (wAPI WalletAPI) CreateWallet(wallet *Wallet) error

CreateWallet - creates a new wallet

func (WalletAPI) DeleteAddress Uses

func (wAPI WalletAPI) DeleteAddress(address string) error

DeleteAddress - deletes a subwallet in the wallet container

func (WalletAPI) DeletePreparedTransaction Uses

func (wAPI WalletAPI) DeletePreparedTransaction(hash string) error

DeletePreparedTransaction - removes a previously created prepared transaction

func (WalletAPI) GetAddressBalance Uses

func (wAPI WalletAPI) GetAddressBalance(address string) (bal *Balance, err error)

GetAddressBalance - gets the balance for the specified wallet address

func (WalletAPI) GetAddressTransactionsByStartHeight Uses

func (wAPI WalletAPI) GetAddressTransactionsByStartHeight(address string, startHeight uint64) (txs *[]Transaction, err error)

GetAddressTransactionsByStartHeight - gets 1000 transactions for the address starting at startHeight

func (WalletAPI) GetAddressTransactionsInRange Uses

func (wAPI WalletAPI) GetAddressTransactionsInRange(address string, start, end uint64) (txs *[]Transaction, err error)

GetAddressTransactionsInRange - gets transactions for the address given a range of block heights

func (WalletAPI) GetAllTransactions Uses

func (wAPI WalletAPI) GetAllTransactions() (txs *[]Transaction, err error)

GetAllTransactions - gets all the transactions in the wallet container

func (WalletAPI) GetBalance Uses

func (wAPI WalletAPI) GetBalance() (unlocked, locked uint64, err error)

GetBalance - gets the balance for the entire wallet container

func (WalletAPI) GetBalances Uses

func (wAPI WalletAPI) GetBalances() ([]Balance, error)

GetBalances - gets the balance for the every wallet address

func (WalletAPI) GetKeys Uses

func (wAPI WalletAPI) GetKeys(address string) (publicSpendKey, privateSpendKey string, err error)

GetKeys - gets the public and private view key for the given address

func (WalletAPI) GetMnemonic Uses

func (wAPI WalletAPI) GetMnemonic(address string) (string, error)

GetMnemonic - gets the mnemonic seed for the given address

func (WalletAPI) GetTransactionByHash Uses

func (wAPI WalletAPI) GetTransactionByHash(hash string) (tx *Transaction, err error)

GetTransactionByHash - gets the transaction with the given hash in the wallet container

func (WalletAPI) GetTransactionPrivateKey Uses

func (wAPI WalletAPI) GetTransactionPrivateKey(hash string) (string, error)

GetTransactionPrivateKey - gets the private key of a transaction with the given hash

func (WalletAPI) GetTransactionsByStartHeight Uses

func (wAPI WalletAPI) GetTransactionsByStartHeight(startHeight uint64) (txs *[]Transaction, err error)

GetTransactionsByStartHeight - gets 1000 transactions for the wallet starting at startHeight

func (WalletAPI) GetTransactionsInRange Uses

func (wAPI WalletAPI) GetTransactionsInRange(start, end uint64) (txs *[]Transaction, err error)

GetTransactionsInRange - gets transactions for the wallet given a range of block heights

func (WalletAPI) GetUnconfirmedTransactions Uses

func (wAPI WalletAPI) GetUnconfirmedTransactions() (txs *[]Transaction, err error)

GetUnconfirmedTransactions - gets all unconfirmed outgoing transactions

func (WalletAPI) GetUnconfirmedTransactionsByAddress Uses

func (wAPI WalletAPI) GetUnconfirmedTransactionsByAddress(address string) (txs *[]Transaction, err error)

GetUnconfirmedTransactionsByAddress - gets all unconfirmed outgoing transactions for a given address

func (WalletAPI) ImportAddress Uses

func (wAPI WalletAPI) ImportAddress(spendKey string, scanHeight uint64) (string, error)

ImportAddress - import a subwallet with the given private spend key

func (WalletAPI) ImportKey Uses

func (wAPI WalletAPI) ImportKey(wallet *Wallet, viewKey, spendKey string, scanHeight uint64) error

ImportKey - imports a wallet with a private spend and view key

func (WalletAPI) ImportSeed Uses

func (wAPI WalletAPI) ImportSeed(wallet *Wallet, mnemonicSeed string, scanHeight uint64) error

ImportSeed - imports a wallet using a mnemonic seed

func (WalletAPI) ImportView Uses

func (wAPI WalletAPI) ImportView(wallet *Wallet, viewKey, address string, scanHeight uint64) error

ImportView - imports a view only wallet using

func (WalletAPI) ImportViewAddress Uses

func (wAPI WalletAPI) ImportViewAddress(spendKey string, scanHeight uint64) (string, error)

ImportViewAddress - import a view only subwallet with the given public spend key

func (WalletAPI) Node Uses

func (wAPI WalletAPI) Node() (*NodeInfo, error)

Node - gets the node address, port, fee, and fee address

func (WalletAPI) OpenWallet Uses

func (wAPI WalletAPI) OpenWallet(wallet *Wallet) error

OpenWallet - opens an existing wallet

func (WalletAPI) PrepareTransactionAdvanced Uses

func (wAPI WalletAPI) PrepareTransactionAdvanced(
    destinations []map[string]interface{},
    mixin, fee, feePerByte, sourceAddresses, paymentID, changeAddress, unlockTime interface{}) (tx *TransactionResult, err error)

PrepareTransactionAdvanced - creates a transaction but does not relay it to the network

func (WalletAPI) PrepareTransactionBasic Uses

func (wAPI WalletAPI) PrepareTransactionBasic(destination string, amount uint64, paymentID string) (*TransactionResult, error)

PrepareTransactionBasic - creates a transaction but does not relay it to the network

func (WalletAPI) PrimaryAddress Uses

func (wAPI WalletAPI) PrimaryAddress() (string, error)

PrimaryAddress - gets the primary address in the wallet container

func (WalletAPI) Reset Uses

func (wAPI WalletAPI) Reset(scanHeight uint64) error

Reset - resets and saves the wallet

func (WalletAPI) Save Uses

func (wAPI WalletAPI) Save() error

Save - saves wallet container

func (WalletAPI) SendFusionAdvanced Uses

func (wAPI WalletAPI) SendFusionAdvanced(sourceAddresses []string, destination string) (string, error)

SendFusionAdvanced - sends a fusion transaction

func (WalletAPI) SendFusionBasic Uses

func (wAPI WalletAPI) SendFusionBasic() (string, error)

SendFusionBasic - sends a fusion transaction

func (WalletAPI) SendPreparedTransaction Uses

func (wAPI WalletAPI) SendPreparedTransaction(hash string) (string, error)

SendPreparedTransaction - sends a previously created prepared transaction

func (WalletAPI) SendTransactionAdvanced Uses

func (wAPI WalletAPI) SendTransactionAdvanced(
    destinations []map[string]interface{},
    mixin, fee, feePerByte, sourceAddresses, paymentID, changeAddress, unlockTime interface{}) (tx *TransactionResult, err error)

SendTransactionAdvanced - sends a transaction

func (WalletAPI) SendTransactionBasic Uses

func (wAPI WalletAPI) SendTransactionBasic(destination, paymentID string, amount uint64) (string, error)

SendTransactionBasic - sends a transaction

func (WalletAPI) SetNode Uses

func (wAPI WalletAPI) SetNode(daemonHost string, daemonPort int) error

SetNode - sets the node address and port

func (WalletAPI) Status Uses

func (wAPI WalletAPI) Status() (*Status, error)

Status - gets the wallet status

func (WalletAPI) ValidateAddress Uses

func (wAPI WalletAPI) ValidateAddress(address string) (*AddressInfo, error)

ValidateAddress - validates an address

func (WalletAPI) ViewKey Uses

func (wAPI WalletAPI) ViewKey() (string, error)

ViewKey - gets the private view key of the wallet container

Package walletapi imports 6 packages (graph). Updated 2020-03-29. Refresh now. Tools for package owners.