Documentation ¶
Index ¶
- type ClientCaller
- type Transactor
- func (tr *Transactor) CreateTransaction(ctx context.Context, w arweave_go.WalletSigner, amount string, data []byte, ...) (*tx.Transaction, error)
- func (tr *Transactor) SendTransaction(ctx context.Context, tx *tx.Transaction) (string, error)
- func (tr *Transactor) SendTransactionV2(ctx context.Context, tx *tx.TransactionV2) (string, error)
- func (tr *Transactor) WaitMined(ctx context.Context, tx *tx.Transaction) (*tx.Transaction, error)
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