network

package
v0.0.0-...-9b281af Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CurrencyArweave    = Currency{"AR", "winston"}
	CurrencyEthereum   = Currency{"ETH", "wei"}
	CurrencySolanaBase = Currency{"SOL", "lamports"}
)
View Source
var (
	ErrorSDK = func(err error) error {
		return fmt.Errorf("SDK Error: %w", err)
	}
)

Functions

This section is empty.

Types

type ArweaveNetwork

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

func Arweave

func Arweave() *ArweaveNetwork

func (*ArweaveNetwork) Base

func (a *ArweaveNetwork) Base() float64

func (*ArweaveNetwork) CreateTransaction

func (a *ArweaveNetwork) CreateTransaction(amount *big.Int, to string) error

func (*ArweaveNetwork) Currency

func (a *ArweaveNetwork) Currency() []string

func (*ArweaveNetwork) CurrentHeight

func (a *ArweaveNetwork) CurrentHeight() int

func (*ArweaveNetwork) Fee

func (a *ArweaveNetwork) Fee() *big.Int

func (*ArweaveNetwork) Name

func (a *ArweaveNetwork) Name() string

func (*ArweaveNetwork) SendTransaction

func (a *ArweaveNetwork) SendTransaction(data interface{}) error

func (*ArweaveNetwork) Tx

func (a *ArweaveNetwork) Tx(transactionID string) (Transaction, error)

type ArweaveNetworkCaller

type ArweaveNetworkCaller interface {
	Transaction(id string) (arweave.Transaction, error)
	TransactionStatus(id string) (arweave.TransactionStatus, error)
	Info() (arweave.Info, error)
}

type Base

type Base float64
const (
	BaseArweave  Base = 1e12
	BaseEthereum Base = 1e18
	BaseSolana   Base = 1e9
)

type Currency

type Currency []string

type EthereumNetwork

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

func Ethereum

func Ethereum() *EthereumNetwork

func (*EthereumNetwork) CreateTransaction

func (a *EthereumNetwork) CreateTransaction(amount *big.Int, to string) error

func (*EthereumNetwork) CurrentHeight

func (a *EthereumNetwork) CurrentHeight() *big.Int

func (*EthereumNetwork) Fee

func (a *EthereumNetwork) Fee() *big.Int

func (*EthereumNetwork) Name

func (a *EthereumNetwork) Name() string

func (*EthereumNetwork) SendTransaction

func (a *EthereumNetwork) SendTransaction(data interface{}) error

func (*EthereumNetwork) Tx

func (a *EthereumNetwork) Tx(transactionID string) (Transaction, error)

type MockArweaveNetworkCaller

type MockArweaveNetworkCaller struct {
	mock.Mock
}

MockArweaveNetworkCaller is an autogenerated mock type for the ArweaveNetworkCaller type

func (*MockArweaveNetworkCaller) Info

Info provides a mock function with given fields:

func (*MockArweaveNetworkCaller) Transaction

func (_m *MockArweaveNetworkCaller) Transaction(id string) (arweave.Transaction, error)

Transaction provides a mock function with given fields: id

func (*MockArweaveNetworkCaller) TransactionStatus

func (_m *MockArweaveNetworkCaller) TransactionStatus(id string) (arweave.TransactionStatus, error)

TransactionStatus provides a mock function with given fields: id

type SolanaNetwork

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

func Solana

func Solana() *SolanaNetwork

func (*SolanaNetwork) CreateTransaction

func (a *SolanaNetwork) CreateTransaction(amount *big.Int, to string) error

func (*SolanaNetwork) CurrentHeight

func (a *SolanaNetwork) CurrentHeight() *big.Int

func (*SolanaNetwork) Fee

func (a *SolanaNetwork) Fee() *big.Int

func (*SolanaNetwork) Name

func (a *SolanaNetwork) Name() string

func (*SolanaNetwork) SendTransaction

func (a *SolanaNetwork) SendTransaction(data interface{}) error

func (*SolanaNetwork) Tx

func (a *SolanaNetwork) Tx(transactionID string) (Transaction, error)

type Transaction

type Transaction struct {
	From        string   `json:"from"`
	To          string   `json:"to"`
	Amount      *big.Int `json:"amount"`
	BlockHeight *big.Int `json:"blockHeight"`
	Pending     bool     `json:"pending"`
	Confirmed   bool     `json:"confirmed"`
}

Jump to

Keyboard shortcuts

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