blockchain

package
v0.0.0-...-43db901 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2018 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectClient

func ConnectClient() *ethclient.Client

ConnectClient - Main Connection function

func ConnectMarket

func ConnectMarket() *generated.Market

ConnectMarket - Connect and return configured market

func ConnectPool

func ConnectPool(poolAddress common.Address) *generated.Pool

ConnectNode - Connect and grab node

func MarketCreatePool

func MarketCreatePool(passphrase string, ga *GladiusAccountManager) (*types.Transaction, error)

MarketCreatePool - Create new pool

func PoolRetrieveApplicationServerUrl

func PoolRetrieveApplicationServerUrl(poolAddress string, ga *GladiusAccountManager) (string, error)

func PoolSetApplicationServerUrl

func PoolSetApplicationServerUrl(passphrase, poolAddress, url string) (*types.Transaction, error)

func Tx

func Tx(txHash common.Hash) (tx *types.Transaction, isPending bool, err error)

Tx - Get Transaction

func TxReceipt

func TxReceipt(txHash common.Hash) (*types.Receipt, error)

TxReceipt - Get Receipt of Transaction

Types

type Balance

type Balance struct {
	Value  uint64 `json:"value"`
	Symbol string `json:"symbol"`
}

func GetAccountBalance

func GetAccountBalance(address common.Address, symbol BalanceType) (Balance, error)

type BalanceType

type BalanceType int32
const (
	ETH BalanceType = 0
	GLA BalanceType = 1
)

type EtherscanTransaction

type EtherscanTransaction struct {
	BlockNumber       string `json:"blockNumber"`
	TimeStamp         string `json:"timeStamp"`
	Hash              string `json:"hash"`
	Nonce             string `json:"nonce"`
	BlockHash         string `json:"blockHash"`
	TransactionIndex  string `json:"transactionIndex"`
	From              string `json:"from"`
	To                string `json:"to"`
	Value             string `json:"value"`
	Gas               string `json:"gas"`
	GasPrice          string `json:"gasPrice"`
	IsError           string `json:"isError"`
	TxReceiptStatus   string `json:"txreceipt_status"`
	Input             string `json:"input"`
	ContractAddress   string `json:"contractAddress"`
	CumulativeGasUsed string `json:"cumulativeGasUsed"`
	GasUsed           string `json:"gasUsed"`
	Confirmations     string `json:"confirmations"`
}

type EtherscanTransactionsResponse

type EtherscanTransactionsResponse struct {
	Status       string                 `json:"status"`
	Message      string                 `json:"message"`
	Transactions []EtherscanTransaction `json:"result"`
}

func GetAccountTransactions

func GetAccountTransactions(address common.Address, options TransactionOptions) (EtherscanTransactionsResponse, error)

type GladiusAccountManager

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

GladiusAccountManager is a type that allows the user to create a keystore file, create an in it, and preform actions on the first account stored.

func NewGladiusAccountManager

func NewGladiusAccountManager() *GladiusAccountManager

NewGladiusAccountManager creates a new gladius account manager

func (GladiusAccountManager) CreateAccount

func (ga GladiusAccountManager) CreateAccount(passphrase string) (accounts.Account, error)

CreateAccount will create an account if there isn't one already

func (GladiusAccountManager) GetAccount

func (ga GladiusAccountManager) GetAccount() (*accounts.Account, error)

GetAccount gets the actual account type

func (GladiusAccountManager) GetAccountAddress

func (ga GladiusAccountManager) GetAccountAddress() (*common.Address, error)

GetAccountAddress gets the account address

func (GladiusAccountManager) GetAuth

func (ga GladiusAccountManager) GetAuth(passphrase string) (*bind.TransactOpts, error)

GetAuth gets the authenticator for the go bindings of our smart contracts

func (GladiusAccountManager) HasAccount

func (ga GladiusAccountManager) HasAccount() bool

Checks if AccountManager has an account

func (GladiusAccountManager) Keystore

func (ga GladiusAccountManager) Keystore() *keystore.KeyStore

Keystore gets the keystore associated with the account manager

func (GladiusAccountManager) UnlockAccount

func (ga GladiusAccountManager) UnlockAccount(passphrase string) (bool, error)

UnlockAccount Unlocks the account

func (GladiusAccountManager) Unlocked

func (ga GladiusAccountManager) Unlocked() bool

Determines if account is unlocked by signing a blank hash

type PoolArrayResponse

type PoolArrayResponse struct {
	Pools []PoolResponse `json:"pools"`
}

func MarketPoolAddressesToArrayResponse

func MarketPoolAddressesToArrayResponse(poolAddresses []common.Address, includeData bool, ga *GladiusAccountManager) (PoolArrayResponse, error)

func MarketPools

func MarketPools(includeData bool, ga *GladiusAccountManager) (PoolArrayResponse, error)

func MarketPoolsOwnedByUser

func MarketPoolsOwnedByUser(includeData bool, ga *GladiusAccountManager) (PoolArrayResponse, error)

type PoolResponse

type PoolResponse struct {
	Address string                 `json:"address"`
	Url     string                 `json:"url,omitempty"`
	Data    models.PoolInformation `json:"data,omitempty"`
}

func (*PoolResponse) String

func (d *PoolResponse) String() string

type TransactionFilter

type TransactionFilter struct {
	EthTransfer bool `json:"eth_transfer"`
}

type TransactionOptions

type TransactionOptions struct {
	Filters *TransactionFilter `json:"filters"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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