fdmrpc

package module
v0.0.0-...-a812dba Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2020 License: MIT Imports: 7 Imported by: 0

README

fdmrpc

simple go library for interfacing with fdm and monero wallet rpc

Documentation

Overview

Package fdmrpc interfaces with freedom and monero wallet rpc servers

Index

Constants

View Source
const (
	FDMDec = 10
	XMRDec = 12
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FdmRPC

type FdmRPC struct {
	Url      string
	Decimals int
}

func NewFdmRPC

func NewFdmRPC(server string, dec int) *FdmRPC

NewFdmRPC creates a new fdm rpc client

func (*FdmRPC) CreateAddress

func (fdm *FdmRPC) CreateAddress(account int, label string) (string, error)

CreateAddress creates a new sub address and returns it

func (*FdmRPC) GetAddressIndex

func (fdm *FdmRPC) GetAddressIndex(addr string) int

func (*FdmRPC) GetBalance

func (fdm *FdmRPC) GetBalance() (*decimal.Decimal, *decimal.Decimal, error)

GetBalance returns the total balance and the unlocked balance

func (*FdmRPC) GetIncomingTransfers

func (fdm *FdmRPC) GetIncomingTransfers(index int, min *uint64) ([]*IncomingTransfer, error)

GetIncomingTransfers sends amount to target and returns the tx_hash or the error

func (*FdmRPC) Transfer

func (fdm *FdmRPC) Transfer(amount decimal.Decimal, target string) (string, error)

Transfer sends amount to target and returns the tx_hash or the error

type IncomingTransfer

type IncomingTransfer struct {
	Txid          string
	Height        uint64
	Fee           uint64
	Locked        bool
	Address       string
	Amount        decimal.Decimal
	Confirmations uint64
}

type SubAddressBalance

type SubAddressBalance struct {
	Pending decimal.Decimal
	Balance decimal.Decimal
}

Jump to

Keyboard shortcuts

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