aidos

package
v0.0.0-...-f939b10 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AddressMap map[gadk.Address]int64
View Source
var AddressMapByIndex map[int]gadk.Address
View Source
var Api gadk.API
View Source
var GlobalAccountName string
View Source
var LastUsedAddressIndex int
View Source
var Password []byte
View Source
var Seed string
View Source
var SeedEncrypted []byte

Functions

func AddressInList

func AddressInList(a gadk.Address, list []gadk.Address) bool

func AskConfirm

func AskConfirm() bool

func CLImain

func CLImain(passwd []byte, doimport bool, generate bool)

func Decrypt

func Decrypt(key, data []byte) ([]byte, error)

func DeriveKey

func DeriveKey(password, salt []byte) ([]byte, []byte, error)

func Encrypt

func Encrypt(key, data []byte) ([]byte, error)

func Exit

func Exit()

Exit flushs DB and exit.

func GenerateRandomSEED

func GenerateRandomSEED(n int) (string, error)

func GenerateSeed

func GenerateSeed()

func GetIndexForAddress

func GetIndexForAddress(a gadk.Address) int

func GetNewAddress

func GetNewAddress() gadk.Address

func GetPasswd

func GetPasswd() []byte

func GetPwdAndStoreSeed

func GetPwdAndStoreSeed()

func Handle

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

Handle handles api calls.

func ImportSeed

func ImportSeed(importseed string)

func LoadSeedAPIUnlock

func LoadSeedAPIUnlock(passwd []byte) bool

func LoadSeedFromFile

func LoadSeedFromFile(passwd []byte)

func MakeBackup

func MakeBackup(filename string)

func OpenWallet

func OpenWallet(passwd []byte)

func Pcheck

func Pcheck(err error)

func ReadAddressesFromFile

func ReadAddressesFromFile() (addressBalances map[gadk.Address]int64, addressListByIndex map[int]gadk.Address, lastKnownAddressIndex int)

func ReadFileIntoSlice

func ReadFileIntoSlice(fpath string) []string

func ReadSeedUser

func ReadSeedUser() string

func ScanAddressesForBalanceChanges

func ScanAddressesForBalanceChanges(scanAdditional int)

func ScanStoreAddressesAndBalancesINIT

func ScanStoreAddressesAndBalancesINIT(generatedNewSeed bool)

func SetLog

func SetLog(verbose bool)

SetLog does log settings.

func StoreBalances

func StoreBalances(addressBalances map[gadk.Address]int64, addressListByIndex map[int]gadk.Address, lastKnownAddressIndex int)

func StoreConfirmedTransactions

func StoreConfirmedTransactions(addressBalances map[gadk.Address]int64, addressListByIndex map[int]gadk.Address) []gadk.Trytes

func TransactionScanner

func TransactionScanner()

func Walletnotify

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

Types

type Account

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

type Balance

type Balance struct {
	gadk.Balance
	Change int64
}

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.

var Aconf *Conf

func ParseConf

func ParseConf(cfile string) *Conf

ParseConf parses conf file.

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