account

package
v2.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const MUTEZ = 1000000

Variables

This section is empty.

Functions

This section is empty.

Types

type AccountService

type AccountService struct {
	// contains filtered or unexported fields
}

AccountService is a struct wrapper for account functions

func NewAccountService

func NewAccountService(tzclient tzc.TezosClient, blockService block.TezosBlockService, snapshotService snapshot.TezosSnapshotService) *AccountService

NewAccountService returns a new AccountService

func (*AccountService) CreateWallet

func (s *AccountService) CreateWallet(mnenomic string, password string) (Wallet, error)

CreateWallet returns Wallet with the mnemonic and password provided

func (*AccountService) GetBalance

func (s *AccountService) GetBalance(tezosAddr string) (float64, error)

GetBalance gets the balance of a public key hash at a specific snapshot for a cycle.

func (*AccountService) GetBalanceAtBlock

func (s *AccountService) GetBalanceAtBlock(tezosAddr string, id interface{}) (float64, error)

GetBalanceAtBlock get the balance of an address at a specific hash

func (*AccountService) GetBalanceAtSnapshot

func (s *AccountService) GetBalanceAtSnapshot(tezosAddr string, cycle int) (float64, error)

GetBalanceAtSnapshot gets the balance of a public key hash at a specific snapshot for a cycle.

func (*AccountService) ImportEncryptedWallet

func (s *AccountService) ImportEncryptedWallet(pw, encKey string) (Wallet, error)

ImportEncryptedWallet imports an encrypted wallet using password provided by caller. Caller should remove any 'encrypted:' scheme prefix.

func (*AccountService) ImportWallet

func (s *AccountService) ImportWallet(address, public, secret string) (Wallet, error)

ImportWallet returns an imported Wallet

type FrozenBalance

type FrozenBalance struct {
	Deposits string `json:"deposits"`
	Fees     string `json:"fees"`
	Rewards  string `json:"rewards"`
}

FrozenBalance is representation of frozen balance on the Tezos network

type TezosAccountService

type TezosAccountService interface {
	GetBalanceAtSnapshot(tezosAddr string, cycle int) (float64, error)
	GetBalance(tezosAddr string) (float64, error)
	GetBalanceAtBlock(tezosAddr string, id interface{}) (float64, error)
	CreateWallet(mnenomic string, password string) (Wallet, error)
	ImportWallet(address, public, secret string) (Wallet, error)
	ImportEncryptedWallet(pw, encKey string) (Wallet, error)
}

type Wallet

type Wallet struct {
	Address  string
	Mnemonic string
	Seed     []byte
	Kp       keyPair
	Sk       string
	Pk       string
}

Wallet needed for signing operations

Jump to

Keyboard shortcuts

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