tables

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: MIT, Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultRunSQLConfig = RunSQLConfig{
	SuggestedGasPriceMultiplier: 1.0,
	EstimatedGasLimitMultiplier: 1.0,
}

DefaultRunSQLConfig is the default configuration for RunSQL if no options are passed.

Functions

This section is empty.

Types

type RunSQLConfig added in v1.0.1

type RunSQLConfig struct {
	SuggestedGasPriceMultiplier float64
	EstimatedGasLimitMultiplier float64
}

RunSQLConfig contains configuration attributes to call Write.

type RunSQLOption added in v1.0.1

type RunSQLOption func(*RunSQLConfig) error

RunSQLOption changes the behavior of the Write method.

func WithEstimatedGasLimitMultiplier added in v1.0.1

func WithEstimatedGasLimitMultiplier(m float64) RunSQLOption

WithEstimatedGasLimitMultiplier allows to modify the gas limit to be used with respect with the estimated gas. For example, if `m=1.2` then the gas limit to be used will be `estimatedGas * 1.2`.

func WithSuggestedPriceMultiplier added in v1.0.1

func WithSuggestedPriceMultiplier(m float64) RunSQLOption

WithSuggestedPriceMultiplier allows to modify the gas priced to be used with respect with the suggested gas price. For example, if `m=1.2` then the gas price to be used will be `suggestedGasPrice * 1.2`.

type TableID

type TableID big.Int

TableID is the ID of a Table.

func NewTableID

func NewTableID(strID string) (TableID, error)

NewTableID creates a TableID from a string representation of the uint256.

func NewTableIDFromInt64

func NewTableIDFromInt64(intID int64) (TableID, error)

NewTableIDFromInt64 returns a TableID from a int64.

func (TableID) String

func (tid TableID) String() string

String returns a string representation of the TableID.

func (TableID) ToBigInt

func (tid TableID) ToBigInt() *big.Int

ToBigInt returns a *big.Int representation of the TableID.

type TableIDs added in v1.3.2

type TableIDs []TableID

TableIDs is a list of TableID.

func (TableIDs) String added in v1.3.2

func (ids TableIDs) String() string

String transform a list of TableIds into a string.

type TablelandTables

type TablelandTables interface {
	// CreateTable mints a new table NFT.
	CreateTable(context.Context, common.Address, string) (Transaction, error)

	// IsOwner checks if the provided address is the owner of the provided table.
	IsOwner(context.Context, common.Address, *big.Int) (bool, error)

	// RunSQL sends a transaction with a SQL statement to the Tabeland Smart Contract.
	RunSQL(context.Context, common.Address, TableID, string, ...RunSQLOption) (Transaction, error)

	// SetController sends a transaction that sets the controller for a token id in Smart Contract.
	SetController(context.Context, common.Address, TableID, common.Address) (Transaction, error)
}

TablelandTables defines the interface for interaction with the TablelandTables smart contract.

type Transaction

type Transaction interface {
	Hash() common.Hash
}

Transaction represents a Smart Contract transaction.

Jump to

Keyboard shortcuts

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