aidos

package
v0.0.0-...-035eeb2 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PowInfo string

Functions

func DBExists

func DBExists() bool

func Exit

func Exit()

Exit flushs DB and exit.

func GenerateRandomSEED

func GenerateRandomSEED(n int) (string, error)

func Handle

func Handle(conf *Conf, w http.ResponseWriter, r *http.Request)

Handle handles api calls.

func HasValidNonce

func HasValidNonce(t *gadk.Transaction, mwm int) bool

HasValidNonce checks t's hash has valid MinWeightMagnitude.

func InitializeWallet

func InitializeWallet() error

func ListAndSelectAccount

func ListAndSelectAccount(conf *Conf)

func PowTrytes

func PowTrytes(api apis, depth int64, trytes []gadk.Transaction, mwm int64, pow gadk.PowFunc) error

PowTrytes does attachToMesh.

func PrepareTransfers

func PrepareTransfers(api apis, ac *Account, trs []gadk.Transfer) (gadk.Bundle, error)

PrepareTransfers gets an array of transfer objects as input, and then prepare the transfer by generating the correct bundle, as well as choosing and signing the inputs if necessary (if it's a value transfer).

func Recast

func Recast(wallet string) error

Recast assembles unsent txs from public wallets servers and recast them to all wallets servers.

func RefreshAccount

func RefreshAccount(conf *Conf)

RefreshAccount refresh all hashes and accounts from address in address.

func ResetDB

func ResetDB(conf *Conf)

ResetDB reset hashes and balances (basically remove all the hashes and set balances to 0)

func RestoreAddressesFromSeed

func RestoreAddressesFromSeed(conf *Conf, seed gadk.Trytes) error

func ScanAndRestoreAddresses

func ScanAndRestoreAddresses(conf *Conf, seed gadk.Trytes) error

func Send

func Send(conf *Conf, ac *Account, mwm int64, trs []gadk.Transfer) (gadk.Trytes, error)

Send sends token. if you need to pow locally, you must specifiy pow func. otherwirse this calls AttachToMesh API.

func SetLog

func SetLog(verbose bool)

SetLog does log settings.

func SetupNewAddresses

func SetupNewAddresses(conf *Conf, seed gadk.Trytes) error

func ShowSeed

func ShowSeed() error

ShowSeed shows seeds for all accounts.

func UpdateConfirmationState

func UpdateConfirmationState(conf *Conf) error

func UpdateTXs

func UpdateTXs(conf *Conf) error

UpdateTXs update TX db from hashes DB.

func Walletnotify

func Walletnotify(conf *Conf) ([]string, error)

Walletnotify exec walletnotify scripts when receivng tx and tx is confirmed.

Types

type Account

type Account struct {
	Name     string
	Seed     gadk.Trytes `json:"-"`
	EncSeed  []byte
	Balances []Balance
}

Account represents account for bitcoind api.

type Balance

type Balance struct {
	gadk.Balance
	Change int64
}

Balance represents balance, with change value.

type Conf

type Conf struct {
	RPCUser     string
	RPCPassword string
	RPCPort     string
	Notify      string
	Node        string
	Testnet     bool
	PassPhrase  bool
	Tag         string

	V2 bool
	// contains filtered or unexported fields
}

Conf is configuration for aidosd.

func ParseConf

func ParseConf(cfile string) *Conf

ParseConf parses conf file.

func Prepare

func Prepare(cfile string, passwd []byte) (*Conf, error)

Prepare prepares aidosd.

type Err

type Err struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
}

Err represents error struct for response.

type Request

type Request struct {
	JSONRPC string      `json:"jsonrpc"`
	ID      interface{} `json:"id"`
	Method  string      `json:"method"`
	Params  interface{} `json:"params"`
}

Request is for parsing request from client.

type Response

type Response struct {
	Result interface{} `json:"result"`
	Error  *Err        `json:"error"`
	ID     interface{} `json:"id"`
}

Response is for respoding to clinete in jsonrpc.

Jump to

Keyboard shortcuts

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