iota

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2019 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//币种
	Symbol    = "IOTA"
	MasterKey = "Iota seed"
)

Variables

View Source
var (

	// 核心钱包是否只做监听
	CoreWalletWatchOnly = true
)

Functions

func CreateAddresses

func CreateAddresses(seed giota.Trytes, start, count, security int) (string, error)

func GetWalletInfo

func GetWalletInfo(seed string) (giota.Address, []giota.Address, int64, error)

func NewAddressesWithChecksum

func NewAddressesWithChecksum(seed giota.Trytes, start, count, security int) ([]giota.Address, error)

NewAddresses generates new count addresses from seed with a checksum

func SendTransaction

func SendTransaction(seed string, address giota.Address, value int64, tag giota.Trytes) error

func SummaryWallets

func SummaryWallets(seed string, sumAddress giota.Address, tag giota.Trytes) error

SummaryWallets 执行汇总流程

Types

type Block

type Block struct {
	Hash          string
	Confirmations uint64
	Merkleroot    string

	Previousblockhash string
	Height            uint64 `storm:"id"`
	Version           uint64
	Time              uint64
	Fork              bool
	// contains filtered or unexported fields
}

func NewBlock

func NewBlock(json *gjson.Result) *Block

func (*Block) BlockHeader

func (b *Block) BlockHeader() *openwallet.BlockHeader

BlockHeader 区块链头

type BlockchainInfo

type BlockchainInfo struct {
	Chain                string `json:"chain"`
	Blocks               uint64 `json:"blocks"`
	Headers              uint64 `json:"headers"`
	Bestblockhash        string `json:"bestblockhash"`
	Difficulty           string `json:"difficulty"`
	Mediantime           uint64 `json:"mediantime"`
	Verificationprogress string `json:"verificationprogress"`
	Chainwork            string `json:"chainwork"`
	Pruned               bool   `json:"pruned"`
}

BlockchainInfo 本地节点区块链信息

func NewBlockchainInfo

func NewBlockchainInfo(json *gjson.Result) *BlockchainInfo

type Client

type Client struct {
	BaseURL     string
	AccessToken string
	Debug       bool
}

A Client is a iota RPC client. It performs RPCs over HTTP using JSON request and responses. A Client must be configured with a secret token to authenticate with other Cores on the network.

func (*Client) Call

func (c *Client) Call(path string, request []interface{}) (*gjson.Result, error)

Call calls a remote procedure on another node, specified by the path.

type Response

type Response struct {
	Code    int         `json:"code,omitempty"`
	Error   interface{} `json:"error,omitempty"`
	Result  interface{} `json:"result,omitempty"`
	Message string      `json:"message,omitempty"`
	Id      string      `json:"id,omitempty"`
}

type UnscanRecord

type UnscanRecord struct {
	ID          string `storm:"id"` // primary key
	BlockHeight uint64
	TxID        string
	Reason      string
}

UnscanRecords 扫描失败的区块及交易

func NewUnscanRecord

func NewUnscanRecord(height uint64, txID, reason string) *UnscanRecord

type Unspent

type Unspent struct {

	/*
			{
		        "txid" : "d54994ece1d11b19785c7248868696250ab195605b469632b7bd68130e880c9a",
		        "vout" : 1,
		        "address" : "mgnucj8nYqdrPFh2JfZSB1NmUThUGnmsqe",
		        "account" : "test label",
		        "scriptPubKey" : "76a9140dfc8bafc8419853b34d5e072ad37d1a5159f58488ac",
		        "amount" : 0.00010000,
		        "confirmations" : 6210,
		        "spendable" : true,
		        "solvable" : true
		    }
	*/
	Key           string `storm:"id"`
	TxID          string `json:"txid"`
	Vout          uint64 `json:"vout"`
	Address       string `json:"address"`
	AccountID     string `json:"account" storm:"index"`
	ScriptPubKey  string `json:"scriptPubKey"`
	Amount        string `json:"amount"`
	Confirmations uint64 `json:"confirmations"`
	Spendable     bool   `json:"spendable"`
	Solvable      bool   `json:"solvable"`
	HDAddress     openwallet.Address
}

Unspent 未花记录

func NewUnspent

func NewUnspent(json *gjson.Result) *Unspent

type UnspentSort

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

func (UnspentSort) Len

func (s UnspentSort) Len() int

func (UnspentSort) Less

func (s UnspentSort) Less(i, j int) bool

func (UnspentSort) Swap

func (s UnspentSort) Swap(i, j int)

type User

type User struct {
	UserKey string `storm:"id"`     // primary key
	Group   string `storm:"index"`  // this field will be indexed
	Email   string `storm:"unique"` // this field will be indexed with a unique constraint
	Name    string // this field will not be indexed
	Age     int    `storm:"index"`
}

type Wallet

type Wallet struct {
	WalletID string `json:"rootid"`
	Alias    string `json:"alias"`
	Balance  string `json:"balance"`
	Password string `json:"password"`
	RootPub  string `json:"rootpub"`
	KeyFile  string
}

Wallet 钱包模型

func (*Wallet) DBFile

func (w *Wallet) DBFile() string

DBFile 数据库文件

func (*Wallet) FileName

func (w *Wallet) FileName() string

FileName 该钱包定义的文件名规则

func (*Wallet) OpenDB

func (w *Wallet) OpenDB() (*storm.DB, error)

openDB 打开钱包数据库

func (*Wallet) ToOpenWallet

func (w *Wallet) ToOpenWallet() *openwallet.Wallet

ToOpenWallet 转为openwallet.Wallet

type WalletManager

type WalletManager struct{}

func (*WalletManager) BackupWalletFlow

func (w *WalletManager) BackupWalletFlow() error

备份钱包流程

func (*WalletManager) CreateAddressFlow

func (w *WalletManager) CreateAddressFlow() error

创建地址流程

func (*WalletManager) CreateWalletFlow

func (w *WalletManager) CreateWalletFlow() error

创建钱包流程

func (*WalletManager) GetWalletList

func (w *WalletManager) GetWalletList() error

GetWalletList 获取钱包列表

func (*WalletManager) InitConfigFlow

func (w *WalletManager) InitConfigFlow() error

初始化配置流程

func (*WalletManager) RestoreWalletFlow

func (w *WalletManager) RestoreWalletFlow() error

RestoreWalletFlow 恢复钱包流程

func (*WalletManager) ShowConfig

func (w *WalletManager) ShowConfig() error

查看配置信息

func (*WalletManager) SummaryFollow

func (w *WalletManager) SummaryFollow() error

SummaryFollow 汇总流程

func (*WalletManager) TransferFlow

func (w *WalletManager) TransferFlow() error

SendTXFlow 发送交易

Jump to

Keyboard shortcuts

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