transactor

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 ClientCaller

type ClientCaller interface {
	LastTransaction(ctx context.Context, address string) (string, error)
	GetReward(ctx context.Context, data []byte) (string, error)
	Commit(ctx context.Context, data []byte) (string, error)
	GetTransaction(ctx context.Context, txID string) (*tx.Transaction, error)
}

ClientCaller is the base interface needed to create a Transactor

type Transactor

type Transactor struct {
	Client ClientCaller
}

Transactor type, allows one to create transactions

func NewTransactor

func NewTransactor(fullURL string) (*Transactor, error)

NewTransactor creates a new arweave transactor. You need to pass in a context and a url If sending an empty string, the default url is localhosts

func (*Transactor) CreateTransaction

func (tr *Transactor) CreateTransaction(ctx context.Context, w arweave_go.WalletSigner, amount string, data []byte, target string) (*tx.Transaction, error)

CreateTransaction creates a brand new transaction

func (*Transactor) SendTransaction

func (tr *Transactor) SendTransaction(ctx context.Context, tx *tx.Transaction) (string, error)

SendTransaction formats the transactions (base64url encodes the necessary fields) marshalls the Json and sends it to the arweave network

func (*Transactor) SendTransactionV2

func (tr *Transactor) SendTransactionV2(ctx context.Context, tx *tx.TransactionV2) (string, error)

SendTransaction formats the transactions (base64url encodes the necessary fields) marshalls the Json and sends it to the arweave network

func (*Transactor) WaitMined

func (tr *Transactor) WaitMined(ctx context.Context, tx *tx.Transaction) (*tx.Transaction, error)

WaitMined waits for the transaction to be mined

Jump to

Keyboard shortcuts

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