api

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	HashList      []string      `json:"hash_list"`
	Nonce         string        `json:"nonce"`
	PreviousBlock string        `json:"previous_block"`
	Timestamp     int           `json:"timestamp"`
	LastRetarget  int           `json:"last_retarget"`
	Diff          interface{}   `json:"diff"`
	Height        int           `json:"height"`
	Hash          string        `json:"hash"`
	IndepHash     string        `json:"indep_hash"`
	Txs           []interface{} `json:"txs"`
	WalletList    interface{}   `json:"wallet_list"`
	RewardAddr    string        `json:"reward_addr"`
	Tags          []interface{} `json:"tags"`
	RewardPool    interface{}   `json:"reward_pool"`
	WeaveSize     interface{}   `json:"weave_size"`
	BlockSize     interface{}   `json:"block_size"`
}

Block struct

type Client

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

Client struct

func Dial

func Dial(url string) (*Client, error)

Dial creates a new arweave client

func (*Client) Commit

func (c *Client) Commit(ctx context.Context, data []byte) (string, error)

Commit sends a transaction to the weave with a context

func (*Client) GetBalance

func (c *Client) GetBalance(ctx context.Context, address string) (string, error)

GetBalance requests the current balance of an address

func (*Client) GetBlockByHeight

func (c *Client) GetBlockByHeight(ctx context.Context, height int64) (*Block, error)

GetBlockByHeight requests a block by its height

func (*Client) GetBlockByID

func (c *Client) GetBlockByID(ctx context.Context, blockID string) (*Block, error)

GetBlockByID requests a block by its id

func (*Client) GetCurrentBlock

func (c *Client) GetCurrentBlock(ctx context.Context) (*Block, error)

GetCurrentBlock requests the latest block of the weave

func (*Client) GetData

func (c *Client) GetData(ctx context.Context, txID string) (string, error)

GetData requests the data of a transaction

func (*Client) GetInfo

func (c *Client) GetInfo(ctx context.Context) (*NetworkInfo, error)

GetInfo requests the information of a node

func (*Client) GetPeers

func (c *Client) GetPeers(ctx context.Context) ([]string, error)

GetPeers requests the list of peers of a node

func (*Client) GetPendingTransactions

func (c *Client) GetPendingTransactions(ctx context.Context) ([]string, error)

GetTransaction requests the information of a transaction

func (*Client) GetReward

func (c *Client) GetReward(ctx context.Context, data []byte) (string, error)

GetReward requests the current network reward

func (*Client) GetRewardV2

func (c *Client) GetRewardV2(ctx context.Context, data []byte, target string) (string, error)

func (*Client) GetTransaction

func (c *Client) GetTransaction(ctx context.Context, txID string) (*tx.Transaction, error)

GetTransaction requests the information of a transaction

func (*Client) GetTransactionAnchor

func (c *Client) GetTransactionAnchor(ctx context.Context) (string, error)

func (*Client) GetTransactionField

func (c *Client) GetTransactionField(ctx context.Context, txID string, field string) (string, error)

GetTransactionField requests the specific field of a specific transaction

func (*Client) LastTransaction

func (c *Client) LastTransaction(ctx context.Context, address string) (string, error)

LastTransaction requests the last transaction of an account

type NetworkInfo

type NetworkInfo struct {
	Network          string `json:"network"`
	Version          int    `json:"version"`
	Release          int    `json:"release"`
	Height           int    `json:"height"`
	Current          string `json:"current"`
	Blocks           int    `json:"blocks"`
	Peers            int    `json:"peers"`
	QueueLength      int    `json:"queue_length"`
	NodeStateLatency int    `json:"node_state_latency"`
}

NetworkInfo struct

Jump to

Keyboard shortcuts

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