ent

package
v0.0.0-...-1971f33 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: GPL-3.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Operation types.
	OpCreate    = ent.OpCreate
	OpDelete    = ent.OpDelete
	OpDeleteOne = ent.OpDeleteOne
	OpUpdate    = ent.OpUpdate
	OpUpdateOne = ent.OpUpdateOne

	// Node types.
	TypeBalance            = "Balance"
	TypeBlock              = "Block"
	TypeContract           = "Contract"
	TypeEvent              = "Event"
	TypeTransaction        = "Transaction"
	TypeTransactionReceipt = "TransactionReceipt"
)

Variables

View Source
var (
	// BlockOrderFieldBlockNumber orders Block by block_number.
	BlockOrderFieldBlockNumber = &BlockOrderField{
		field: block.FieldBlockNumber,
		toCursor: func(b *Block) Cursor {
			return Cursor{
				ID:    b.ID,
				Value: b.BlockNumber,
			}
		},
	}
	// BlockOrderFieldTimestamp orders Block by timestamp.
	BlockOrderFieldTimestamp = &BlockOrderField{
		field: block.FieldTimestamp,
		toCursor: func(b *Block) Cursor {
			return Cursor{
				ID:    b.ID,
				Value: b.Timestamp,
			}
		},
	}
)
View Source
var (
	// ContractOrderFieldCreatedAt orders Contract by created_at.
	ContractOrderFieldCreatedAt = &ContractOrderField{
		field: contract.FieldCreatedAt,
		toCursor: func(c *Contract) Cursor {
			return Cursor{
				ID:    c.ID,
				Value: c.CreatedAt,
			}
		},
	}
)
View Source
var DefaultBalanceOrder = &BalanceOrder{
	Direction: OrderDirectionAsc,
	Field: &BalanceOrderField{
		field: balance.FieldID,
		toCursor: func(b *Balance) Cursor {
			return Cursor{ID: b.ID}
		},
	},
}

DefaultBalanceOrder is the default ordering of Balance.

View Source
var DefaultBlockOrder = &BlockOrder{
	Direction: OrderDirectionAsc,
	Field: &BlockOrderField{
		field: block.FieldID,
		toCursor: func(b *Block) Cursor {
			return Cursor{ID: b.ID}
		},
	},
}

DefaultBlockOrder is the default ordering of Block.

View Source
var DefaultContractOrder = &ContractOrder{
	Direction: OrderDirectionAsc,
	Field: &ContractOrderField{
		field: contract.FieldID,
		toCursor: func(c *Contract) Cursor {
			return Cursor{ID: c.ID}
		},
	},
}

DefaultContractOrder is the default ordering of Contract.

View Source
var DefaultEventOrder = &EventOrder{
	Direction: OrderDirectionAsc,
	Field: &EventOrderField{
		field: event.FieldID,
		toCursor: func(e *Event) Cursor {
			return Cursor{ID: e.ID}
		},
	},
}

DefaultEventOrder is the default ordering of Event.

View Source
var DefaultTransactionOrder = &TransactionOrder{
	Direction: OrderDirectionAsc,
	Field: &TransactionOrderField{
		field: transaction.FieldID,
		toCursor: func(t *Transaction) Cursor {
			return Cursor{ID: t.ID}
		},
	},
}

DefaultTransactionOrder is the default ordering of Transaction.

View Source
var DefaultTransactionReceiptOrder = &TransactionReceiptOrder{
	Direction: OrderDirectionAsc,
	Field: &TransactionReceiptOrderField{
		field: transactionreceipt.FieldID,
		toCursor: func(tr *TransactionReceipt) Cursor {
			return Cursor{ID: tr.ID}
		},
	},
}

DefaultTransactionReceiptOrder is the default ordering of TransactionReceipt.

View Source
var (
	// TransactionOrderFieldNonce orders Transaction by nonce.
	TransactionOrderFieldNonce = &TransactionOrderField{
		field: transaction.FieldNonce,
		toCursor: func(t *Transaction) Cursor {
			return Cursor{
				ID:    t.ID,
				Value: t.Nonce,
			}
		},
	}
)

Functions

func IsConstraintError

func IsConstraintError(err error) bool

IsConstraintError returns a boolean indicating whether the error is a constraint failure.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound returns a boolean indicating whether the error is a not found error.

func IsNotLoaded

func IsNotLoaded(err error) bool

IsNotLoaded returns a boolean indicating whether the error is a not loaded error.

func IsNotSingular

func IsNotSingular(err error) bool

IsNotSingular returns a boolean indicating whether the error is a not singular error.

func IsValidationError

func IsValidationError(err error) bool

IsValidationError returns a boolean indicating whether the error is a validation error.

func MaskNotFound

func MaskNotFound(err error) error

MaskNotFound masks not found error.

func NewContext

func NewContext(parent context.Context, c *Client) context.Context

NewContext returns a new context with the given Client attached.

func NewTxContext

func NewTxContext(parent context.Context, tx *Tx) context.Context

NewTxContext returns a new context with the given Tx attached.

func OpenTxFromContext

func OpenTxFromContext(ctx context.Context) (context.Context, driver.Tx, error)

OpenTxFromContext open transactions from client stored in context.

func WithTx

func WithTx(ctx context.Context, client *Client, fn func(tx *Tx) error) error

Types

type AggregateFunc

type AggregateFunc func(*sql.Selector) string

AggregateFunc applies an aggregation step on the group-by traversal/selector.

func As

As is a pseudo aggregation function for renaming another other functions with custom names. For example:

GroupBy(field1, field2).
Aggregate(ent.As(ent.Sum(field1), "sum_field1"), (ent.As(ent.Sum(field2), "sum_field2")).
Scan(ctx, &v)

func Count

func Count() AggregateFunc

Count applies the "count" aggregation function on each group.

func Max

func Max(field string) AggregateFunc

Max applies the "max" aggregation function on the given field of each group.

func Mean

func Mean(field string) AggregateFunc

Mean applies the "mean" aggregation function on the given field of each group.

func Min

func Min(field string) AggregateFunc

Min applies the "min" aggregation function on the given field of each group.

func Sum

func Sum(field string) AggregateFunc

Sum applies the "sum" aggregation function on the given field of each group.

type Balance

type Balance struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// TokenId holds the value of the "tokenId" field.
	TokenId big.Int `json:"tokenId,omitempty"`
	// Balance holds the value of the "balance" field.
	Balance big.Int `json:"balance,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BalanceQuery when eager-loading is set.
	Edges BalanceEdges `json:"edges"`
	// contains filtered or unexported fields
}

Balance is the model entity for the Balance schema.

func (*Balance) Account

func (b *Balance) Account(ctx context.Context) (*Contract, error)

func (*Balance) Contract

func (b *Balance) Contract(ctx context.Context) (*Contract, error)

func (*Balance) Node

func (b *Balance) Node(ctx context.Context) (node *Node, err error)

func (*Balance) QueryAccount

func (b *Balance) QueryAccount() *ContractQuery

QueryAccount queries the "account" edge of the Balance entity.

func (*Balance) QueryContract

func (b *Balance) QueryContract() *ContractQuery

QueryContract queries the "contract" edge of the Balance entity.

func (*Balance) String

func (b *Balance) String() string

String implements the fmt.Stringer.

func (*Balance) ToEdge

func (b *Balance) ToEdge(order *BalanceOrder) *BalanceEdge

ToEdge converts Balance into BalanceEdge.

func (*Balance) Unwrap

func (b *Balance) Unwrap() *Balance

Unwrap unwraps the Balance entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Balance) Update

func (b *Balance) Update() *BalanceUpdateOne

Update returns a builder for updating this Balance. Note that you need to call Balance.Unwrap() before calling this method if this Balance was returned from a transaction, and the transaction was committed or rolled back.

type BalanceClient

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

BalanceClient is a client for the Balance schema.

func NewBalanceClient

func NewBalanceClient(c config) *BalanceClient

NewBalanceClient returns a client for the Balance from the given config.

func (*BalanceClient) Create

func (c *BalanceClient) Create() *BalanceCreate

Create returns a builder for creating a Balance entity.

func (*BalanceClient) CreateBulk

func (c *BalanceClient) CreateBulk(builders ...*BalanceCreate) *BalanceCreateBulk

CreateBulk returns a builder for creating a bulk of Balance entities.

func (*BalanceClient) Delete

func (c *BalanceClient) Delete() *BalanceDelete

Delete returns a delete builder for Balance.

func (*BalanceClient) DeleteOne

func (c *BalanceClient) DeleteOne(b *Balance) *BalanceDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BalanceClient) DeleteOneID

func (c *BalanceClient) DeleteOneID(id string) *BalanceDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*BalanceClient) Get

func (c *BalanceClient) Get(ctx context.Context, id string) (*Balance, error)

Get returns a Balance entity by its id.

func (*BalanceClient) GetX

func (c *BalanceClient) GetX(ctx context.Context, id string) *Balance

GetX is like Get, but panics if an error occurs.

func (*BalanceClient) Hooks

func (c *BalanceClient) Hooks() []Hook

Hooks returns the client hooks.

func (*BalanceClient) Query

func (c *BalanceClient) Query() *BalanceQuery

Query returns a query builder for Balance.

func (*BalanceClient) QueryAccount

func (c *BalanceClient) QueryAccount(b *Balance) *ContractQuery

QueryAccount queries the account edge of a Balance.

func (*BalanceClient) QueryContract

func (c *BalanceClient) QueryContract(b *Balance) *ContractQuery

QueryContract queries the contract edge of a Balance.

func (*BalanceClient) Update

func (c *BalanceClient) Update() *BalanceUpdate

Update returns an update builder for Balance.

func (*BalanceClient) UpdateOne

func (c *BalanceClient) UpdateOne(b *Balance) *BalanceUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BalanceClient) UpdateOneID

func (c *BalanceClient) UpdateOneID(id string) *BalanceUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BalanceClient) Use

func (c *BalanceClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `balance.Hooks(f(g(h())))`.

type BalanceConnection

type BalanceConnection struct {
	Edges      []*BalanceEdge `json:"edges"`
	PageInfo   PageInfo       `json:"pageInfo"`
	TotalCount int            `json:"totalCount"`
}

BalanceConnection is the connection containing edges to Balance.

type BalanceCreate

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

BalanceCreate is the builder for creating a Balance entity.

func (*BalanceCreate) Exec

func (bc *BalanceCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BalanceCreate) ExecX

func (bc *BalanceCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BalanceCreate) Mutation

func (bc *BalanceCreate) Mutation() *BalanceMutation

Mutation returns the BalanceMutation object of the builder.

func (*BalanceCreate) OnConflict

func (bc *BalanceCreate) OnConflict(opts ...sql.ConflictOption) *BalanceUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Balance.Create().
	SetTokenId(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.BalanceUpsert) {
		SetTokenId(v+v).
	}).
	Exec(ctx)

func (*BalanceCreate) OnConflictColumns

func (bc *BalanceCreate) OnConflictColumns(columns ...string) *BalanceUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Balance.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*BalanceCreate) Save

func (bc *BalanceCreate) Save(ctx context.Context) (*Balance, error)

Save creates the Balance in the database.

func (*BalanceCreate) SaveX

func (bc *BalanceCreate) SaveX(ctx context.Context) *Balance

SaveX calls Save and panics if Save returns an error.

func (*BalanceCreate) SetAccount

func (bc *BalanceCreate) SetAccount(c *Contract) *BalanceCreate

SetAccount sets the "account" edge to the Contract entity.

func (*BalanceCreate) SetAccountID

func (bc *BalanceCreate) SetAccountID(id string) *BalanceCreate

SetAccountID sets the "account" edge to the Contract entity by ID.

func (*BalanceCreate) SetBalance

func (bc *BalanceCreate) SetBalance(b big.Int) *BalanceCreate

SetBalance sets the "balance" field.

func (*BalanceCreate) SetContract

func (bc *BalanceCreate) SetContract(c *Contract) *BalanceCreate

SetContract sets the "contract" edge to the Contract entity.

func (*BalanceCreate) SetContractID

func (bc *BalanceCreate) SetContractID(id string) *BalanceCreate

SetContractID sets the "contract" edge to the Contract entity by ID.

func (*BalanceCreate) SetID

func (bc *BalanceCreate) SetID(s string) *BalanceCreate

SetID sets the "id" field.

func (*BalanceCreate) SetNillableAccountID

func (bc *BalanceCreate) SetNillableAccountID(id *string) *BalanceCreate

SetNillableAccountID sets the "account" edge to the Contract entity by ID if the given value is not nil.

func (*BalanceCreate) SetNillableBalance

func (bc *BalanceCreate) SetNillableBalance(b *big.Int) *BalanceCreate

SetNillableBalance sets the "balance" field if the given value is not nil.

func (*BalanceCreate) SetNillableContractID

func (bc *BalanceCreate) SetNillableContractID(id *string) *BalanceCreate

SetNillableContractID sets the "contract" edge to the Contract entity by ID if the given value is not nil.

func (*BalanceCreate) SetNillableTokenId

func (bc *BalanceCreate) SetNillableTokenId(b *big.Int) *BalanceCreate

SetNillableTokenId sets the "tokenId" field if the given value is not nil.

func (*BalanceCreate) SetTokenId

func (bc *BalanceCreate) SetTokenId(b big.Int) *BalanceCreate

SetTokenId sets the "tokenId" field.

type BalanceCreateBulk

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

BalanceCreateBulk is the builder for creating many Balance entities in bulk.

func (*BalanceCreateBulk) Exec

func (bcb *BalanceCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BalanceCreateBulk) ExecX

func (bcb *BalanceCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BalanceCreateBulk) OnConflict

func (bcb *BalanceCreateBulk) OnConflict(opts ...sql.ConflictOption) *BalanceUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Balance.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.BalanceUpsert) {
		SetTokenId(v+v).
	}).
	Exec(ctx)

func (*BalanceCreateBulk) OnConflictColumns

func (bcb *BalanceCreateBulk) OnConflictColumns(columns ...string) *BalanceUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Balance.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*BalanceCreateBulk) Save

func (bcb *BalanceCreateBulk) Save(ctx context.Context) ([]*Balance, error)

Save creates the Balance entities in the database.

func (*BalanceCreateBulk) SaveX

func (bcb *BalanceCreateBulk) SaveX(ctx context.Context) []*Balance

SaveX is like Save, but panics if an error occurs.

type BalanceDelete

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

BalanceDelete is the builder for deleting a Balance entity.

func (*BalanceDelete) Exec

func (bd *BalanceDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*BalanceDelete) ExecX

func (bd *BalanceDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*BalanceDelete) Where

func (bd *BalanceDelete) Where(ps ...predicate.Balance) *BalanceDelete

Where appends a list predicates to the BalanceDelete builder.

type BalanceDeleteOne

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

BalanceDeleteOne is the builder for deleting a single Balance entity.

func (*BalanceDeleteOne) Exec

func (bdo *BalanceDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BalanceDeleteOne) ExecX

func (bdo *BalanceDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type BalanceEdge

type BalanceEdge struct {
	Node   *Balance `json:"node"`
	Cursor Cursor   `json:"cursor"`
}

BalanceEdge is the edge representation of Balance.

type BalanceEdges

type BalanceEdges struct {
	// Account holds the value of the account edge.
	Account *Contract `json:"account,omitempty"`
	// Contract holds the value of the contract edge.
	Contract *Contract `json:"contract,omitempty"`
	// contains filtered or unexported fields
}

BalanceEdges holds the relations/edges for other nodes in the graph.

func (BalanceEdges) AccountOrErr

func (e BalanceEdges) AccountOrErr() (*Contract, error)

AccountOrErr returns the Account value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (BalanceEdges) ContractOrErr

func (e BalanceEdges) ContractOrErr() (*Contract, error)

ContractOrErr returns the Contract value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type BalanceGroupBy

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

BalanceGroupBy is the group-by builder for Balance entities.

func (*BalanceGroupBy) Aggregate

func (bgb *BalanceGroupBy) Aggregate(fns ...AggregateFunc) *BalanceGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*BalanceGroupBy) Bool

func (s *BalanceGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*BalanceGroupBy) BoolX

func (s *BalanceGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*BalanceGroupBy) Bools

func (s *BalanceGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*BalanceGroupBy) BoolsX

func (s *BalanceGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*BalanceGroupBy) Float64

func (s *BalanceGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*BalanceGroupBy) Float64X

func (s *BalanceGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*BalanceGroupBy) Float64s

func (s *BalanceGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*BalanceGroupBy) Float64sX

func (s *BalanceGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*BalanceGroupBy) Int

func (s *BalanceGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*BalanceGroupBy) IntX

func (s *BalanceGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*BalanceGroupBy) Ints

func (s *BalanceGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*BalanceGroupBy) IntsX

func (s *BalanceGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*BalanceGroupBy) Scan

func (bgb *BalanceGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*BalanceGroupBy) ScanX

func (s *BalanceGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*BalanceGroupBy) String

func (s *BalanceGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*BalanceGroupBy) StringX

func (s *BalanceGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*BalanceGroupBy) Strings

func (s *BalanceGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*BalanceGroupBy) StringsX

func (s *BalanceGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type BalanceMutation

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

BalanceMutation represents an operation that mutates the Balance nodes in the graph.

func (*BalanceMutation) AccountCleared

func (m *BalanceMutation) AccountCleared() bool

AccountCleared reports if the "account" edge to the Contract entity was cleared.

func (*BalanceMutation) AccountID

func (m *BalanceMutation) AccountID() (id string, exists bool)

AccountID returns the "account" edge ID in the mutation.

func (*BalanceMutation) AccountIDs

func (m *BalanceMutation) AccountIDs() (ids []string)

AccountIDs returns the "account" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use AccountID instead. It exists only for internal usage by the builders.

func (*BalanceMutation) AddBalance

func (m *BalanceMutation) AddBalance(b big.Int)

AddBalance adds b to the "balance" field.

func (*BalanceMutation) AddField

func (m *BalanceMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*BalanceMutation) AddTokenId

func (m *BalanceMutation) AddTokenId(b big.Int)

AddTokenId adds b to the "tokenId" field.

func (*BalanceMutation) AddedBalance

func (m *BalanceMutation) AddedBalance() (r big.Int, exists bool)

AddedBalance returns the value that was added to the "balance" field in this mutation.

func (*BalanceMutation) AddedEdges

func (m *BalanceMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*BalanceMutation) AddedField

func (m *BalanceMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*BalanceMutation) AddedFields

func (m *BalanceMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*BalanceMutation) AddedIDs

func (m *BalanceMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*BalanceMutation) AddedTokenId

func (m *BalanceMutation) AddedTokenId() (r big.Int, exists bool)

AddedTokenId returns the value that was added to the "tokenId" field in this mutation.

func (*BalanceMutation) Balance

func (m *BalanceMutation) Balance() (r big.Int, exists bool)

Balance returns the value of the "balance" field in the mutation.

func (*BalanceMutation) ClearAccount

func (m *BalanceMutation) ClearAccount()

ClearAccount clears the "account" edge to the Contract entity.

func (*BalanceMutation) ClearContract

func (m *BalanceMutation) ClearContract()

ClearContract clears the "contract" edge to the Contract entity.

func (*BalanceMutation) ClearEdge

func (m *BalanceMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*BalanceMutation) ClearField

func (m *BalanceMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*BalanceMutation) ClearTokenId

func (m *BalanceMutation) ClearTokenId()

ClearTokenId clears the value of the "tokenId" field.

func (*BalanceMutation) ClearedEdges

func (m *BalanceMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*BalanceMutation) ClearedFields

func (m *BalanceMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (BalanceMutation) Client

func (m BalanceMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*BalanceMutation) ContractCleared

func (m *BalanceMutation) ContractCleared() bool

ContractCleared reports if the "contract" edge to the Contract entity was cleared.

func (*BalanceMutation) ContractID

func (m *BalanceMutation) ContractID() (id string, exists bool)

ContractID returns the "contract" edge ID in the mutation.

func (*BalanceMutation) ContractIDs

func (m *BalanceMutation) ContractIDs() (ids []string)

ContractIDs returns the "contract" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ContractID instead. It exists only for internal usage by the builders.

func (*BalanceMutation) EdgeCleared

func (m *BalanceMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*BalanceMutation) Field

func (m *BalanceMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*BalanceMutation) FieldCleared

func (m *BalanceMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*BalanceMutation) Fields

func (m *BalanceMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*BalanceMutation) ID

func (m *BalanceMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*BalanceMutation) IDs

func (m *BalanceMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*BalanceMutation) OldBalance

func (m *BalanceMutation) OldBalance(ctx context.Context) (v big.Int, err error)

OldBalance returns the old "balance" field's value of the Balance entity. If the Balance object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BalanceMutation) OldField

func (m *BalanceMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*BalanceMutation) OldTokenId

func (m *BalanceMutation) OldTokenId(ctx context.Context) (v big.Int, err error)

OldTokenId returns the old "tokenId" field's value of the Balance entity. If the Balance object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BalanceMutation) Op

func (m *BalanceMutation) Op() Op

Op returns the operation name.

func (*BalanceMutation) RemovedEdges

func (m *BalanceMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*BalanceMutation) RemovedIDs

func (m *BalanceMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*BalanceMutation) ResetAccount

func (m *BalanceMutation) ResetAccount()

ResetAccount resets all changes to the "account" edge.

func (*BalanceMutation) ResetBalance

func (m *BalanceMutation) ResetBalance()

ResetBalance resets all changes to the "balance" field.

func (*BalanceMutation) ResetContract

func (m *BalanceMutation) ResetContract()

ResetContract resets all changes to the "contract" edge.

func (*BalanceMutation) ResetEdge

func (m *BalanceMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*BalanceMutation) ResetField

func (m *BalanceMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*BalanceMutation) ResetTokenId

func (m *BalanceMutation) ResetTokenId()

ResetTokenId resets all changes to the "tokenId" field.

func (*BalanceMutation) SetAccountID

func (m *BalanceMutation) SetAccountID(id string)

SetAccountID sets the "account" edge to the Contract entity by id.

func (*BalanceMutation) SetBalance

func (m *BalanceMutation) SetBalance(b big.Int)

SetBalance sets the "balance" field.

func (*BalanceMutation) SetContractID

func (m *BalanceMutation) SetContractID(id string)

SetContractID sets the "contract" edge to the Contract entity by id.

func (*BalanceMutation) SetField

func (m *BalanceMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*BalanceMutation) SetID

func (m *BalanceMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Balance entities.

func (*BalanceMutation) SetTokenId

func (m *BalanceMutation) SetTokenId(b big.Int)

SetTokenId sets the "tokenId" field.

func (*BalanceMutation) TokenId

func (m *BalanceMutation) TokenId() (r big.Int, exists bool)

TokenId returns the value of the "tokenId" field in the mutation.

func (*BalanceMutation) TokenIdCleared

func (m *BalanceMutation) TokenIdCleared() bool

TokenIdCleared returns if the "tokenId" field was cleared in this mutation.

func (BalanceMutation) Tx

func (m BalanceMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*BalanceMutation) Type

func (m *BalanceMutation) Type() string

Type returns the node type of this mutation (Balance).

func (*BalanceMutation) Where

func (m *BalanceMutation) Where(ps ...predicate.Balance)

Where appends a list predicates to the BalanceMutation builder.

type BalanceOrder

type BalanceOrder struct {
	Direction OrderDirection     `json:"direction"`
	Field     *BalanceOrderField `json:"field"`
}

BalanceOrder defines the ordering of Balance.

type BalanceOrderField

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

BalanceOrderField defines the ordering field of Balance.

type BalancePaginateOption

type BalancePaginateOption func(*balancePager) error

BalancePaginateOption enables pagination customization.

func WithBalanceFilter

func WithBalanceFilter(filter func(*BalanceQuery) (*BalanceQuery, error)) BalancePaginateOption

WithBalanceFilter configures pagination filter.

func WithBalanceOrder

func WithBalanceOrder(order *BalanceOrder) BalancePaginateOption

WithBalanceOrder configures pagination ordering.

type BalanceQuery

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

BalanceQuery is the builder for querying Balance entities.

func (*BalanceQuery) All

func (bq *BalanceQuery) All(ctx context.Context) ([]*Balance, error)

All executes the query and returns a list of Balances.

func (*BalanceQuery) AllX

func (bq *BalanceQuery) AllX(ctx context.Context) []*Balance

AllX is like All, but panics if an error occurs.

func (*BalanceQuery) Clone

func (bq *BalanceQuery) Clone() *BalanceQuery

Clone returns a duplicate of the BalanceQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*BalanceQuery) CollectFields

func (b *BalanceQuery) CollectFields(ctx context.Context, satisfies ...string) (*BalanceQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*BalanceQuery) Count

func (bq *BalanceQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BalanceQuery) CountX

func (bq *BalanceQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*BalanceQuery) Exist

func (bq *BalanceQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*BalanceQuery) ExistX

func (bq *BalanceQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*BalanceQuery) First

func (bq *BalanceQuery) First(ctx context.Context) (*Balance, error)

First returns the first Balance entity from the query. Returns a *NotFoundError when no Balance was found.

func (*BalanceQuery) FirstID

func (bq *BalanceQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Balance ID from the query. Returns a *NotFoundError when no Balance ID was found.

func (*BalanceQuery) FirstIDX

func (bq *BalanceQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*BalanceQuery) FirstX

func (bq *BalanceQuery) FirstX(ctx context.Context) *Balance

FirstX is like First, but panics if an error occurs.

func (*BalanceQuery) GroupBy

func (bq *BalanceQuery) GroupBy(field string, fields ...string) *BalanceGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	TokenId big.Int `json:"tokenId,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Balance.Query().
	GroupBy(balance.FieldTokenId).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BalanceQuery) IDs

func (bq *BalanceQuery) IDs(ctx context.Context) ([]string, error)

IDs executes the query and returns a list of Balance IDs.

func (*BalanceQuery) IDsX

func (bq *BalanceQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*BalanceQuery) Limit

func (bq *BalanceQuery) Limit(limit int) *BalanceQuery

Limit adds a limit step to the query.

func (*BalanceQuery) Offset

func (bq *BalanceQuery) Offset(offset int) *BalanceQuery

Offset adds an offset step to the query.

func (*BalanceQuery) Only

func (bq *BalanceQuery) Only(ctx context.Context) (*Balance, error)

Only returns a single Balance entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Balance entity is found. Returns a *NotFoundError when no Balance entities are found.

func (*BalanceQuery) OnlyID

func (bq *BalanceQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Balance ID in the query. Returns a *NotSingularError when more than one Balance ID is found. Returns a *NotFoundError when no entities are found.

func (*BalanceQuery) OnlyIDX

func (bq *BalanceQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*BalanceQuery) OnlyX

func (bq *BalanceQuery) OnlyX(ctx context.Context) *Balance

OnlyX is like Only, but panics if an error occurs.

func (*BalanceQuery) Order

func (bq *BalanceQuery) Order(o ...OrderFunc) *BalanceQuery

Order adds an order step to the query.

func (*BalanceQuery) Paginate

func (b *BalanceQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...BalancePaginateOption,
) (*BalanceConnection, error)

Paginate executes the query and returns a relay based cursor connection to Balance.

func (*BalanceQuery) QueryAccount

func (bq *BalanceQuery) QueryAccount() *ContractQuery

QueryAccount chains the current query on the "account" edge.

func (*BalanceQuery) QueryContract

func (bq *BalanceQuery) QueryContract() *ContractQuery

QueryContract chains the current query on the "contract" edge.

func (*BalanceQuery) Select

func (bq *BalanceQuery) Select(fields ...string) *BalanceSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	TokenId big.Int `json:"tokenId,omitempty"`
}

client.Balance.Query().
	Select(balance.FieldTokenId).
	Scan(ctx, &v)

func (*BalanceQuery) Unique

func (bq *BalanceQuery) Unique(unique bool) *BalanceQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*BalanceQuery) Where

func (bq *BalanceQuery) Where(ps ...predicate.Balance) *BalanceQuery

Where adds a new predicate for the BalanceQuery builder.

func (*BalanceQuery) WithAccount

func (bq *BalanceQuery) WithAccount(opts ...func(*ContractQuery)) *BalanceQuery

WithAccount tells the query-builder to eager-load the nodes that are connected to the "account" edge. The optional arguments are used to configure the query builder of the edge.

func (*BalanceQuery) WithContract

func (bq *BalanceQuery) WithContract(opts ...func(*ContractQuery)) *BalanceQuery

WithContract tells the query-builder to eager-load the nodes that are connected to the "contract" edge. The optional arguments are used to configure the query builder of the edge.

type BalanceSelect

type BalanceSelect struct {
	*BalanceQuery
	// contains filtered or unexported fields
}

BalanceSelect is the builder for selecting fields of Balance entities.

func (*BalanceSelect) Bool

func (s *BalanceSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*BalanceSelect) BoolX

func (s *BalanceSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*BalanceSelect) Bools

func (s *BalanceSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*BalanceSelect) BoolsX

func (s *BalanceSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*BalanceSelect) Float64

func (s *BalanceSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*BalanceSelect) Float64X

func (s *BalanceSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*BalanceSelect) Float64s

func (s *BalanceSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*BalanceSelect) Float64sX

func (s *BalanceSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*BalanceSelect) Int

func (s *BalanceSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*BalanceSelect) IntX

func (s *BalanceSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*BalanceSelect) Ints

func (s *BalanceSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*BalanceSelect) IntsX

func (s *BalanceSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*BalanceSelect) Scan

func (bs *BalanceSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*BalanceSelect) ScanX

func (s *BalanceSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*BalanceSelect) String

func (s *BalanceSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*BalanceSelect) StringX

func (s *BalanceSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*BalanceSelect) Strings

func (s *BalanceSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*BalanceSelect) StringsX

func (s *BalanceSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type BalanceUpdate

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

BalanceUpdate is the builder for updating Balance entities.

func (*BalanceUpdate) AddBalance

func (bu *BalanceUpdate) AddBalance(b big.Int) *BalanceUpdate

AddBalance adds b to the "balance" field.

func (*BalanceUpdate) AddTokenId

func (bu *BalanceUpdate) AddTokenId(b big.Int) *BalanceUpdate

AddTokenId adds b to the "tokenId" field.

func (*BalanceUpdate) ClearAccount

func (bu *BalanceUpdate) ClearAccount() *BalanceUpdate

ClearAccount clears the "account" edge to the Contract entity.

func (*BalanceUpdate) ClearContract

func (bu *BalanceUpdate) ClearContract() *BalanceUpdate

ClearContract clears the "contract" edge to the Contract entity.

func (*BalanceUpdate) ClearTokenId

func (bu *BalanceUpdate) ClearTokenId() *BalanceUpdate

ClearTokenId clears the value of the "tokenId" field.

func (*BalanceUpdate) Exec

func (bu *BalanceUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BalanceUpdate) ExecX

func (bu *BalanceUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BalanceUpdate) Mutation

func (bu *BalanceUpdate) Mutation() *BalanceMutation

Mutation returns the BalanceMutation object of the builder.

func (*BalanceUpdate) Save

func (bu *BalanceUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*BalanceUpdate) SaveX

func (bu *BalanceUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*BalanceUpdate) SetAccount

func (bu *BalanceUpdate) SetAccount(c *Contract) *BalanceUpdate

SetAccount sets the "account" edge to the Contract entity.

func (*BalanceUpdate) SetAccountID

func (bu *BalanceUpdate) SetAccountID(id string) *BalanceUpdate

SetAccountID sets the "account" edge to the Contract entity by ID.

func (*BalanceUpdate) SetBalance

func (bu *BalanceUpdate) SetBalance(b big.Int) *BalanceUpdate

SetBalance sets the "balance" field.

func (*BalanceUpdate) SetContract

func (bu *BalanceUpdate) SetContract(c *Contract) *BalanceUpdate

SetContract sets the "contract" edge to the Contract entity.

func (*BalanceUpdate) SetContractID

func (bu *BalanceUpdate) SetContractID(id string) *BalanceUpdate

SetContractID sets the "contract" edge to the Contract entity by ID.

func (*BalanceUpdate) SetNillableAccountID

func (bu *BalanceUpdate) SetNillableAccountID(id *string) *BalanceUpdate

SetNillableAccountID sets the "account" edge to the Contract entity by ID if the given value is not nil.

func (*BalanceUpdate) SetNillableBalance

func (bu *BalanceUpdate) SetNillableBalance(b *big.Int) *BalanceUpdate

SetNillableBalance sets the "balance" field if the given value is not nil.

func (*BalanceUpdate) SetNillableContractID

func (bu *BalanceUpdate) SetNillableContractID(id *string) *BalanceUpdate

SetNillableContractID sets the "contract" edge to the Contract entity by ID if the given value is not nil.

func (*BalanceUpdate) SetNillableTokenId

func (bu *BalanceUpdate) SetNillableTokenId(b *big.Int) *BalanceUpdate

SetNillableTokenId sets the "tokenId" field if the given value is not nil.

func (*BalanceUpdate) SetTokenId

func (bu *BalanceUpdate) SetTokenId(b big.Int) *BalanceUpdate

SetTokenId sets the "tokenId" field.

func (*BalanceUpdate) Where

func (bu *BalanceUpdate) Where(ps ...predicate.Balance) *BalanceUpdate

Where appends a list predicates to the BalanceUpdate builder.

type BalanceUpdateOne

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

BalanceUpdateOne is the builder for updating a single Balance entity.

func (*BalanceUpdateOne) AddBalance

func (buo *BalanceUpdateOne) AddBalance(b big.Int) *BalanceUpdateOne

AddBalance adds b to the "balance" field.

func (*BalanceUpdateOne) AddTokenId

func (buo *BalanceUpdateOne) AddTokenId(b big.Int) *BalanceUpdateOne

AddTokenId adds b to the "tokenId" field.

func (*BalanceUpdateOne) ClearAccount

func (buo *BalanceUpdateOne) ClearAccount() *BalanceUpdateOne

ClearAccount clears the "account" edge to the Contract entity.

func (*BalanceUpdateOne) ClearContract

func (buo *BalanceUpdateOne) ClearContract() *BalanceUpdateOne

ClearContract clears the "contract" edge to the Contract entity.

func (*BalanceUpdateOne) ClearTokenId

func (buo *BalanceUpdateOne) ClearTokenId() *BalanceUpdateOne

ClearTokenId clears the value of the "tokenId" field.

func (*BalanceUpdateOne) Exec

func (buo *BalanceUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BalanceUpdateOne) ExecX

func (buo *BalanceUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BalanceUpdateOne) Mutation

func (buo *BalanceUpdateOne) Mutation() *BalanceMutation

Mutation returns the BalanceMutation object of the builder.

func (*BalanceUpdateOne) Save

func (buo *BalanceUpdateOne) Save(ctx context.Context) (*Balance, error)

Save executes the query and returns the updated Balance entity.

func (*BalanceUpdateOne) SaveX

func (buo *BalanceUpdateOne) SaveX(ctx context.Context) *Balance

SaveX is like Save, but panics if an error occurs.

func (*BalanceUpdateOne) Select

func (buo *BalanceUpdateOne) Select(field string, fields ...string) *BalanceUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*BalanceUpdateOne) SetAccount

func (buo *BalanceUpdateOne) SetAccount(c *Contract) *BalanceUpdateOne

SetAccount sets the "account" edge to the Contract entity.

func (*BalanceUpdateOne) SetAccountID

func (buo *BalanceUpdateOne) SetAccountID(id string) *BalanceUpdateOne

SetAccountID sets the "account" edge to the Contract entity by ID.

func (*BalanceUpdateOne) SetBalance

func (buo *BalanceUpdateOne) SetBalance(b big.Int) *BalanceUpdateOne

SetBalance sets the "balance" field.

func (*BalanceUpdateOne) SetContract

func (buo *BalanceUpdateOne) SetContract(c *Contract) *BalanceUpdateOne

SetContract sets the "contract" edge to the Contract entity.

func (*BalanceUpdateOne) SetContractID

func (buo *BalanceUpdateOne) SetContractID(id string) *BalanceUpdateOne

SetContractID sets the "contract" edge to the Contract entity by ID.

func (*BalanceUpdateOne) SetNillableAccountID

func (buo *BalanceUpdateOne) SetNillableAccountID(id *string) *BalanceUpdateOne

SetNillableAccountID sets the "account" edge to the Contract entity by ID if the given value is not nil.

func (*BalanceUpdateOne) SetNillableBalance

func (buo *BalanceUpdateOne) SetNillableBalance(b *big.Int) *BalanceUpdateOne

SetNillableBalance sets the "balance" field if the given value is not nil.

func (*BalanceUpdateOne) SetNillableContractID

func (buo *BalanceUpdateOne) SetNillableContractID(id *string) *BalanceUpdateOne

SetNillableContractID sets the "contract" edge to the Contract entity by ID if the given value is not nil.

func (*BalanceUpdateOne) SetNillableTokenId

func (buo *BalanceUpdateOne) SetNillableTokenId(b *big.Int) *BalanceUpdateOne

SetNillableTokenId sets the "tokenId" field if the given value is not nil.

func (*BalanceUpdateOne) SetTokenId

func (buo *BalanceUpdateOne) SetTokenId(b big.Int) *BalanceUpdateOne

SetTokenId sets the "tokenId" field.

type BalanceUpsert

type BalanceUpsert struct {
	*sql.UpdateSet
}

BalanceUpsert is the "OnConflict" setter.

func (*BalanceUpsert) AddBalance

func (u *BalanceUpsert) AddBalance(v big.Int) *BalanceUpsert

AddBalance adds v to the "balance" field.

func (*BalanceUpsert) AddTokenId

func (u *BalanceUpsert) AddTokenId(v big.Int) *BalanceUpsert

AddTokenId adds v to the "tokenId" field.

func (*BalanceUpsert) ClearTokenId

func (u *BalanceUpsert) ClearTokenId() *BalanceUpsert

ClearTokenId clears the value of the "tokenId" field.

func (*BalanceUpsert) SetBalance

func (u *BalanceUpsert) SetBalance(v big.Int) *BalanceUpsert

SetBalance sets the "balance" field.

func (*BalanceUpsert) SetTokenId

func (u *BalanceUpsert) SetTokenId(v big.Int) *BalanceUpsert

SetTokenId sets the "tokenId" field.

func (*BalanceUpsert) UpdateBalance

func (u *BalanceUpsert) UpdateBalance() *BalanceUpsert

UpdateBalance sets the "balance" field to the value that was provided on create.

func (*BalanceUpsert) UpdateTokenId

func (u *BalanceUpsert) UpdateTokenId() *BalanceUpsert

UpdateTokenId sets the "tokenId" field to the value that was provided on create.

type BalanceUpsertBulk

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

BalanceUpsertBulk is the builder for "upsert"-ing a bulk of Balance nodes.

func (*BalanceUpsertBulk) AddBalance

func (u *BalanceUpsertBulk) AddBalance(v big.Int) *BalanceUpsertBulk

AddBalance adds v to the "balance" field.

func (*BalanceUpsertBulk) AddTokenId

func (u *BalanceUpsertBulk) AddTokenId(v big.Int) *BalanceUpsertBulk

AddTokenId adds v to the "tokenId" field.

func (*BalanceUpsertBulk) ClearTokenId

func (u *BalanceUpsertBulk) ClearTokenId() *BalanceUpsertBulk

ClearTokenId clears the value of the "tokenId" field.

func (*BalanceUpsertBulk) DoNothing

func (u *BalanceUpsertBulk) DoNothing() *BalanceUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*BalanceUpsertBulk) Exec

func (u *BalanceUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BalanceUpsertBulk) ExecX

func (u *BalanceUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BalanceUpsertBulk) Ignore

func (u *BalanceUpsertBulk) Ignore() *BalanceUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Balance.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*BalanceUpsertBulk) SetBalance

func (u *BalanceUpsertBulk) SetBalance(v big.Int) *BalanceUpsertBulk

SetBalance sets the "balance" field.

func (*BalanceUpsertBulk) SetTokenId

func (u *BalanceUpsertBulk) SetTokenId(v big.Int) *BalanceUpsertBulk

SetTokenId sets the "tokenId" field.

func (*BalanceUpsertBulk) Update

func (u *BalanceUpsertBulk) Update(set func(*BalanceUpsert)) *BalanceUpsertBulk

Update allows overriding fields `UPDATE` values. See the BalanceCreateBulk.OnConflict documentation for more info.

func (*BalanceUpsertBulk) UpdateBalance

func (u *BalanceUpsertBulk) UpdateBalance() *BalanceUpsertBulk

UpdateBalance sets the "balance" field to the value that was provided on create.

func (*BalanceUpsertBulk) UpdateNewValues

func (u *BalanceUpsertBulk) UpdateNewValues() *BalanceUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Balance.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(balance.FieldID)
		}),
	).
	Exec(ctx)

func (*BalanceUpsertBulk) UpdateTokenId

func (u *BalanceUpsertBulk) UpdateTokenId() *BalanceUpsertBulk

UpdateTokenId sets the "tokenId" field to the value that was provided on create.

type BalanceUpsertOne

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

BalanceUpsertOne is the builder for "upsert"-ing

one Balance node.

func (*BalanceUpsertOne) AddBalance

func (u *BalanceUpsertOne) AddBalance(v big.Int) *BalanceUpsertOne

AddBalance adds v to the "balance" field.

func (*BalanceUpsertOne) AddTokenId

func (u *BalanceUpsertOne) AddTokenId(v big.Int) *BalanceUpsertOne

AddTokenId adds v to the "tokenId" field.

func (*BalanceUpsertOne) ClearTokenId

func (u *BalanceUpsertOne) ClearTokenId() *BalanceUpsertOne

ClearTokenId clears the value of the "tokenId" field.

func (*BalanceUpsertOne) DoNothing

func (u *BalanceUpsertOne) DoNothing() *BalanceUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*BalanceUpsertOne) Exec

func (u *BalanceUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*BalanceUpsertOne) ExecX

func (u *BalanceUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BalanceUpsertOne) ID

func (u *BalanceUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*BalanceUpsertOne) IDX

func (u *BalanceUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*BalanceUpsertOne) Ignore

func (u *BalanceUpsertOne) Ignore() *BalanceUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Balance.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*BalanceUpsertOne) SetBalance

func (u *BalanceUpsertOne) SetBalance(v big.Int) *BalanceUpsertOne

SetBalance sets the "balance" field.

func (*BalanceUpsertOne) SetTokenId

func (u *BalanceUpsertOne) SetTokenId(v big.Int) *BalanceUpsertOne

SetTokenId sets the "tokenId" field.

func (*BalanceUpsertOne) Update

func (u *BalanceUpsertOne) Update(set func(*BalanceUpsert)) *BalanceUpsertOne

Update allows overriding fields `UPDATE` values. See the BalanceCreate.OnConflict documentation for more info.

func (*BalanceUpsertOne) UpdateBalance

func (u *BalanceUpsertOne) UpdateBalance() *BalanceUpsertOne

UpdateBalance sets the "balance" field to the value that was provided on create.

func (*BalanceUpsertOne) UpdateNewValues

func (u *BalanceUpsertOne) UpdateNewValues() *BalanceUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Balance.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(balance.FieldID)
		}),
	).
	Exec(ctx)

func (*BalanceUpsertOne) UpdateTokenId

func (u *BalanceUpsertOne) UpdateTokenId() *BalanceUpsertOne

UpdateTokenId sets the "tokenId" field to the value that was provided on create.

type BalanceWhereInput

type BalanceWhereInput struct {
	Not *BalanceWhereInput   `json:"not,omitempty"`
	Or  []*BalanceWhereInput `json:"or,omitempty"`
	And []*BalanceWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *string  `json:"id,omitempty"`
	IDNEQ   *string  `json:"idNEQ,omitempty"`
	IDIn    []string `json:"idIn,omitempty"`
	IDNotIn []string `json:"idNotIn,omitempty"`
	IDGT    *string  `json:"idGT,omitempty"`
	IDGTE   *string  `json:"idGTE,omitempty"`
	IDLT    *string  `json:"idLT,omitempty"`
	IDLTE   *string  `json:"idLTE,omitempty"`

	// "tokenId" field predicates.
	TokenId       *big.Int  `json:"tokenid,omitempty"`
	TokenIdNEQ    *big.Int  `json:"tokenidNEQ,omitempty"`
	TokenIdIn     []big.Int `json:"tokenidIn,omitempty"`
	TokenIdNotIn  []big.Int `json:"tokenidNotIn,omitempty"`
	TokenIdGT     *big.Int  `json:"tokenidGT,omitempty"`
	TokenIdGTE    *big.Int  `json:"tokenidGTE,omitempty"`
	TokenIdLT     *big.Int  `json:"tokenidLT,omitempty"`
	TokenIdLTE    *big.Int  `json:"tokenidLTE,omitempty"`
	TokenIdIsNil  bool      `json:"tokenidIsNil,omitempty"`
	TokenIdNotNil bool      `json:"tokenidNotNil,omitempty"`

	// "balance" field predicates.
	Balance      *big.Int  `json:"balance,omitempty"`
	BalanceNEQ   *big.Int  `json:"balanceNEQ,omitempty"`
	BalanceIn    []big.Int `json:"balanceIn,omitempty"`
	BalanceNotIn []big.Int `json:"balanceNotIn,omitempty"`
	BalanceGT    *big.Int  `json:"balanceGT,omitempty"`
	BalanceGTE   *big.Int  `json:"balanceGTE,omitempty"`
	BalanceLT    *big.Int  `json:"balanceLT,omitempty"`
	BalanceLTE   *big.Int  `json:"balanceLTE,omitempty"`

	// "account" edge predicates.
	HasAccount     *bool                 `json:"hasAccount,omitempty"`
	HasAccountWith []*ContractWhereInput `json:"hasAccountWith,omitempty"`

	// "contract" edge predicates.
	HasContract     *bool                 `json:"hasContract,omitempty"`
	HasContractWith []*ContractWhereInput `json:"hasContractWith,omitempty"`
}

BalanceWhereInput represents a where input for filtering Balance queries.

func (*BalanceWhereInput) Filter

Filter applies the BalanceWhereInput filter on the BalanceQuery builder.

func (*BalanceWhereInput) P

P returns a predicate for filtering balances. An error is returned if the input is empty or invalid.

type Balances

type Balances []*Balance

Balances is a parsable slice of Balance.

type Block

type Block struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// BlockHash holds the value of the "block_hash" field.
	BlockHash string `json:"block_hash,omitempty"`
	// ParentBlockHash holds the value of the "parent_block_hash" field.
	ParentBlockHash string `json:"parent_block_hash,omitempty"`
	// BlockNumber holds the value of the "block_number" field.
	BlockNumber uint64 `json:"block_number,omitempty"`
	// StateRoot holds the value of the "state_root" field.
	StateRoot string `json:"state_root,omitempty"`
	// Status holds the value of the "status" field.
	Status block.Status `json:"status,omitempty"`
	// Timestamp holds the value of the "timestamp" field.
	Timestamp time.Time `json:"timestamp,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the BlockQuery when eager-loading is set.
	Edges BlockEdges `json:"edges"`
	// contains filtered or unexported fields
}

Block is the model entity for the Block schema.

func (*Block) Node

func (b *Block) Node(ctx context.Context) (node *Node, err error)

func (*Block) QueryTransactionReceipts

func (b *Block) QueryTransactionReceipts() *TransactionReceiptQuery

QueryTransactionReceipts queries the "transaction_receipts" edge of the Block entity.

func (*Block) QueryTransactions

func (b *Block) QueryTransactions() *TransactionQuery

QueryTransactions queries the "transactions" edge of the Block entity.

func (*Block) String

func (b *Block) String() string

String implements the fmt.Stringer.

func (*Block) ToEdge

func (b *Block) ToEdge(order *BlockOrder) *BlockEdge

ToEdge converts Block into BlockEdge.

func (*Block) TransactionReceipts

func (b *Block) TransactionReceipts(ctx context.Context) ([]*TransactionReceipt, error)

func (*Block) Transactions

func (b *Block) Transactions(ctx context.Context) ([]*Transaction, error)

func (*Block) Unwrap

func (b *Block) Unwrap() *Block

Unwrap unwraps the Block entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Block) Update

func (b *Block) Update() *BlockUpdateOne

Update returns a builder for updating this Block. Note that you need to call Block.Unwrap() before calling this method if this Block was returned from a transaction, and the transaction was committed or rolled back.

type BlockClient

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

BlockClient is a client for the Block schema.

func NewBlockClient

func NewBlockClient(c config) *BlockClient

NewBlockClient returns a client for the Block from the given config.

func (*BlockClient) Create

func (c *BlockClient) Create() *BlockCreate

Create returns a builder for creating a Block entity.

func (*BlockClient) CreateBulk

func (c *BlockClient) CreateBulk(builders ...*BlockCreate) *BlockCreateBulk

CreateBulk returns a builder for creating a bulk of Block entities.

func (*BlockClient) Delete

func (c *BlockClient) Delete() *BlockDelete

Delete returns a delete builder for Block.

func (*BlockClient) DeleteOne

func (c *BlockClient) DeleteOne(b *Block) *BlockDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*BlockClient) DeleteOneID

func (c *BlockClient) DeleteOneID(id string) *BlockDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*BlockClient) Get

func (c *BlockClient) Get(ctx context.Context, id string) (*Block, error)

Get returns a Block entity by its id.

func (*BlockClient) GetX

func (c *BlockClient) GetX(ctx context.Context, id string) *Block

GetX is like Get, but panics if an error occurs.

func (*BlockClient) Hooks

func (c *BlockClient) Hooks() []Hook

Hooks returns the client hooks.

func (*BlockClient) Query

func (c *BlockClient) Query() *BlockQuery

Query returns a query builder for Block.

func (*BlockClient) QueryTransactionReceipts

func (c *BlockClient) QueryTransactionReceipts(b *Block) *TransactionReceiptQuery

QueryTransactionReceipts queries the transaction_receipts edge of a Block.

func (*BlockClient) QueryTransactions

func (c *BlockClient) QueryTransactions(b *Block) *TransactionQuery

QueryTransactions queries the transactions edge of a Block.

func (*BlockClient) Update

func (c *BlockClient) Update() *BlockUpdate

Update returns an update builder for Block.

func (*BlockClient) UpdateOne

func (c *BlockClient) UpdateOne(b *Block) *BlockUpdateOne

UpdateOne returns an update builder for the given entity.

func (*BlockClient) UpdateOneID

func (c *BlockClient) UpdateOneID(id string) *BlockUpdateOne

UpdateOneID returns an update builder for the given id.

func (*BlockClient) Use

func (c *BlockClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `block.Hooks(f(g(h())))`.

type BlockConnection

type BlockConnection struct {
	Edges      []*BlockEdge `json:"edges"`
	PageInfo   PageInfo     `json:"pageInfo"`
	TotalCount int          `json:"totalCount"`
}

BlockConnection is the connection containing edges to Block.

type BlockCreate

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

BlockCreate is the builder for creating a Block entity.

func (*BlockCreate) AddTransactionIDs

func (bc *BlockCreate) AddTransactionIDs(ids ...string) *BlockCreate

AddTransactionIDs adds the "transactions" edge to the Transaction entity by IDs.

func (*BlockCreate) AddTransactionReceiptIDs

func (bc *BlockCreate) AddTransactionReceiptIDs(ids ...string) *BlockCreate

AddTransactionReceiptIDs adds the "transaction_receipts" edge to the TransactionReceipt entity by IDs.

func (*BlockCreate) AddTransactionReceipts

func (bc *BlockCreate) AddTransactionReceipts(t ...*TransactionReceipt) *BlockCreate

AddTransactionReceipts adds the "transaction_receipts" edges to the TransactionReceipt entity.

func (*BlockCreate) AddTransactions

func (bc *BlockCreate) AddTransactions(t ...*Transaction) *BlockCreate

AddTransactions adds the "transactions" edges to the Transaction entity.

func (*BlockCreate) Exec

func (bc *BlockCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*BlockCreate) ExecX

func (bc *BlockCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BlockCreate) Mutation

func (bc *BlockCreate) Mutation() *BlockMutation

Mutation returns the BlockMutation object of the builder.

func (*BlockCreate) OnConflict

func (bc *BlockCreate) OnConflict(opts ...sql.ConflictOption) *BlockUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Block.Create().
	SetBlockHash(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.BlockUpsert) {
		SetBlockHash(v+v).
	}).
	Exec(ctx)

func (*BlockCreate) OnConflictColumns

func (bc *BlockCreate) OnConflictColumns(columns ...string) *BlockUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Block.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*BlockCreate) Save

func (bc *BlockCreate) Save(ctx context.Context) (*Block, error)

Save creates the Block in the database.

func (*BlockCreate) SaveX

func (bc *BlockCreate) SaveX(ctx context.Context) *Block

SaveX calls Save and panics if Save returns an error.

func (*BlockCreate) SetBlockHash

func (bc *BlockCreate) SetBlockHash(s string) *BlockCreate

SetBlockHash sets the "block_hash" field.

func (*BlockCreate) SetBlockNumber

func (bc *BlockCreate) SetBlockNumber(u uint64) *BlockCreate

SetBlockNumber sets the "block_number" field.

func (*BlockCreate) SetID

func (bc *BlockCreate) SetID(s string) *BlockCreate

SetID sets the "id" field.

func (*BlockCreate) SetParentBlockHash

func (bc *BlockCreate) SetParentBlockHash(s string) *BlockCreate

SetParentBlockHash sets the "parent_block_hash" field.

func (*BlockCreate) SetStateRoot

func (bc *BlockCreate) SetStateRoot(s string) *BlockCreate

SetStateRoot sets the "state_root" field.

func (*BlockCreate) SetStatus

func (bc *BlockCreate) SetStatus(b block.Status) *BlockCreate

SetStatus sets the "status" field.

func (*BlockCreate) SetTimestamp

func (bc *BlockCreate) SetTimestamp(t time.Time) *BlockCreate

SetTimestamp sets the "timestamp" field.

type BlockCreateBulk

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

BlockCreateBulk is the builder for creating many Block entities in bulk.

func (*BlockCreateBulk) Exec

func (bcb *BlockCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BlockCreateBulk) ExecX

func (bcb *BlockCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BlockCreateBulk) OnConflict

func (bcb *BlockCreateBulk) OnConflict(opts ...sql.ConflictOption) *BlockUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Block.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.BlockUpsert) {
		SetBlockHash(v+v).
	}).
	Exec(ctx)

func (*BlockCreateBulk) OnConflictColumns

func (bcb *BlockCreateBulk) OnConflictColumns(columns ...string) *BlockUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Block.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*BlockCreateBulk) Save

func (bcb *BlockCreateBulk) Save(ctx context.Context) ([]*Block, error)

Save creates the Block entities in the database.

func (*BlockCreateBulk) SaveX

func (bcb *BlockCreateBulk) SaveX(ctx context.Context) []*Block

SaveX is like Save, but panics if an error occurs.

type BlockDelete

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

BlockDelete is the builder for deleting a Block entity.

func (*BlockDelete) Exec

func (bd *BlockDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*BlockDelete) ExecX

func (bd *BlockDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*BlockDelete) Where

func (bd *BlockDelete) Where(ps ...predicate.Block) *BlockDelete

Where appends a list predicates to the BlockDelete builder.

type BlockDeleteOne

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

BlockDeleteOne is the builder for deleting a single Block entity.

func (*BlockDeleteOne) Exec

func (bdo *BlockDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*BlockDeleteOne) ExecX

func (bdo *BlockDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type BlockEdge

type BlockEdge struct {
	Node   *Block `json:"node"`
	Cursor Cursor `json:"cursor"`
}

BlockEdge is the edge representation of Block.

type BlockEdges

type BlockEdges struct {
	// Transactions holds the value of the transactions edge.
	Transactions []*Transaction `json:"transactions,omitempty"`
	// TransactionReceipts holds the value of the transaction_receipts edge.
	TransactionReceipts []*TransactionReceipt `json:"transaction_receipts,omitempty"`
	// contains filtered or unexported fields
}

BlockEdges holds the relations/edges for other nodes in the graph.

func (BlockEdges) TransactionReceiptsOrErr

func (e BlockEdges) TransactionReceiptsOrErr() ([]*TransactionReceipt, error)

TransactionReceiptsOrErr returns the TransactionReceipts value or an error if the edge was not loaded in eager-loading.

func (BlockEdges) TransactionsOrErr

func (e BlockEdges) TransactionsOrErr() ([]*Transaction, error)

TransactionsOrErr returns the Transactions value or an error if the edge was not loaded in eager-loading.

type BlockGroupBy

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

BlockGroupBy is the group-by builder for Block entities.

func (*BlockGroupBy) Aggregate

func (bgb *BlockGroupBy) Aggregate(fns ...AggregateFunc) *BlockGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*BlockGroupBy) Bool

func (s *BlockGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*BlockGroupBy) BoolX

func (s *BlockGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*BlockGroupBy) Bools

func (s *BlockGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*BlockGroupBy) BoolsX

func (s *BlockGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*BlockGroupBy) Float64

func (s *BlockGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*BlockGroupBy) Float64X

func (s *BlockGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*BlockGroupBy) Float64s

func (s *BlockGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*BlockGroupBy) Float64sX

func (s *BlockGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*BlockGroupBy) Int

func (s *BlockGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*BlockGroupBy) IntX

func (s *BlockGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*BlockGroupBy) Ints

func (s *BlockGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*BlockGroupBy) IntsX

func (s *BlockGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*BlockGroupBy) Scan

func (bgb *BlockGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*BlockGroupBy) ScanX

func (s *BlockGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*BlockGroupBy) String

func (s *BlockGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*BlockGroupBy) StringX

func (s *BlockGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*BlockGroupBy) Strings

func (s *BlockGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*BlockGroupBy) StringsX

func (s *BlockGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type BlockMutation

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

BlockMutation represents an operation that mutates the Block nodes in the graph.

func (*BlockMutation) AddBlockNumber

func (m *BlockMutation) AddBlockNumber(u int64)

AddBlockNumber adds u to the "block_number" field.

func (*BlockMutation) AddField

func (m *BlockMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*BlockMutation) AddTransactionIDs

func (m *BlockMutation) AddTransactionIDs(ids ...string)

AddTransactionIDs adds the "transactions" edge to the Transaction entity by ids.

func (*BlockMutation) AddTransactionReceiptIDs

func (m *BlockMutation) AddTransactionReceiptIDs(ids ...string)

AddTransactionReceiptIDs adds the "transaction_receipts" edge to the TransactionReceipt entity by ids.

func (*BlockMutation) AddedBlockNumber

func (m *BlockMutation) AddedBlockNumber() (r int64, exists bool)

AddedBlockNumber returns the value that was added to the "block_number" field in this mutation.

func (*BlockMutation) AddedEdges

func (m *BlockMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*BlockMutation) AddedField

func (m *BlockMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*BlockMutation) AddedFields

func (m *BlockMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*BlockMutation) AddedIDs

func (m *BlockMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*BlockMutation) BlockHash

func (m *BlockMutation) BlockHash() (r string, exists bool)

BlockHash returns the value of the "block_hash" field in the mutation.

func (*BlockMutation) BlockNumber

func (m *BlockMutation) BlockNumber() (r uint64, exists bool)

BlockNumber returns the value of the "block_number" field in the mutation.

func (*BlockMutation) ClearEdge

func (m *BlockMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*BlockMutation) ClearField

func (m *BlockMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*BlockMutation) ClearTransactionReceipts

func (m *BlockMutation) ClearTransactionReceipts()

ClearTransactionReceipts clears the "transaction_receipts" edge to the TransactionReceipt entity.

func (*BlockMutation) ClearTransactions

func (m *BlockMutation) ClearTransactions()

ClearTransactions clears the "transactions" edge to the Transaction entity.

func (*BlockMutation) ClearedEdges

func (m *BlockMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*BlockMutation) ClearedFields

func (m *BlockMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (BlockMutation) Client

func (m BlockMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*BlockMutation) EdgeCleared

func (m *BlockMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*BlockMutation) Field

func (m *BlockMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*BlockMutation) FieldCleared

func (m *BlockMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*BlockMutation) Fields

func (m *BlockMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*BlockMutation) ID

func (m *BlockMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*BlockMutation) IDs

func (m *BlockMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*BlockMutation) OldBlockHash

func (m *BlockMutation) OldBlockHash(ctx context.Context) (v string, err error)

OldBlockHash returns the old "block_hash" field's value of the Block entity. If the Block object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BlockMutation) OldBlockNumber

func (m *BlockMutation) OldBlockNumber(ctx context.Context) (v uint64, err error)

OldBlockNumber returns the old "block_number" field's value of the Block entity. If the Block object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BlockMutation) OldField

func (m *BlockMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*BlockMutation) OldParentBlockHash

func (m *BlockMutation) OldParentBlockHash(ctx context.Context) (v string, err error)

OldParentBlockHash returns the old "parent_block_hash" field's value of the Block entity. If the Block object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BlockMutation) OldStateRoot

func (m *BlockMutation) OldStateRoot(ctx context.Context) (v string, err error)

OldStateRoot returns the old "state_root" field's value of the Block entity. If the Block object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BlockMutation) OldStatus

func (m *BlockMutation) OldStatus(ctx context.Context) (v block.Status, err error)

OldStatus returns the old "status" field's value of the Block entity. If the Block object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BlockMutation) OldTimestamp

func (m *BlockMutation) OldTimestamp(ctx context.Context) (v time.Time, err error)

OldTimestamp returns the old "timestamp" field's value of the Block entity. If the Block object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*BlockMutation) Op

func (m *BlockMutation) Op() Op

Op returns the operation name.

func (*BlockMutation) ParentBlockHash

func (m *BlockMutation) ParentBlockHash() (r string, exists bool)

ParentBlockHash returns the value of the "parent_block_hash" field in the mutation.

func (*BlockMutation) RemoveTransactionIDs

func (m *BlockMutation) RemoveTransactionIDs(ids ...string)

RemoveTransactionIDs removes the "transactions" edge to the Transaction entity by IDs.

func (*BlockMutation) RemoveTransactionReceiptIDs

func (m *BlockMutation) RemoveTransactionReceiptIDs(ids ...string)

RemoveTransactionReceiptIDs removes the "transaction_receipts" edge to the TransactionReceipt entity by IDs.

func (*BlockMutation) RemovedEdges

func (m *BlockMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*BlockMutation) RemovedIDs

func (m *BlockMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*BlockMutation) RemovedTransactionReceiptsIDs

func (m *BlockMutation) RemovedTransactionReceiptsIDs() (ids []string)

RemovedTransactionReceipts returns the removed IDs of the "transaction_receipts" edge to the TransactionReceipt entity.

func (*BlockMutation) RemovedTransactionsIDs

func (m *BlockMutation) RemovedTransactionsIDs() (ids []string)

RemovedTransactions returns the removed IDs of the "transactions" edge to the Transaction entity.

func (*BlockMutation) ResetBlockHash

func (m *BlockMutation) ResetBlockHash()

ResetBlockHash resets all changes to the "block_hash" field.

func (*BlockMutation) ResetBlockNumber

func (m *BlockMutation) ResetBlockNumber()

ResetBlockNumber resets all changes to the "block_number" field.

func (*BlockMutation) ResetEdge

func (m *BlockMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*BlockMutation) ResetField

func (m *BlockMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*BlockMutation) ResetParentBlockHash

func (m *BlockMutation) ResetParentBlockHash()

ResetParentBlockHash resets all changes to the "parent_block_hash" field.

func (*BlockMutation) ResetStateRoot

func (m *BlockMutation) ResetStateRoot()

ResetStateRoot resets all changes to the "state_root" field.

func (*BlockMutation) ResetStatus

func (m *BlockMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*BlockMutation) ResetTimestamp

func (m *BlockMutation) ResetTimestamp()

ResetTimestamp resets all changes to the "timestamp" field.

func (*BlockMutation) ResetTransactionReceipts

func (m *BlockMutation) ResetTransactionReceipts()

ResetTransactionReceipts resets all changes to the "transaction_receipts" edge.

func (*BlockMutation) ResetTransactions

func (m *BlockMutation) ResetTransactions()

ResetTransactions resets all changes to the "transactions" edge.

func (*BlockMutation) SetBlockHash

func (m *BlockMutation) SetBlockHash(s string)

SetBlockHash sets the "block_hash" field.

func (*BlockMutation) SetBlockNumber

func (m *BlockMutation) SetBlockNumber(u uint64)

SetBlockNumber sets the "block_number" field.

func (*BlockMutation) SetField

func (m *BlockMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*BlockMutation) SetID

func (m *BlockMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Block entities.

func (*BlockMutation) SetParentBlockHash

func (m *BlockMutation) SetParentBlockHash(s string)

SetParentBlockHash sets the "parent_block_hash" field.

func (*BlockMutation) SetStateRoot

func (m *BlockMutation) SetStateRoot(s string)

SetStateRoot sets the "state_root" field.

func (*BlockMutation) SetStatus

func (m *BlockMutation) SetStatus(b block.Status)

SetStatus sets the "status" field.

func (*BlockMutation) SetTimestamp

func (m *BlockMutation) SetTimestamp(t time.Time)

SetTimestamp sets the "timestamp" field.

func (*BlockMutation) StateRoot

func (m *BlockMutation) StateRoot() (r string, exists bool)

StateRoot returns the value of the "state_root" field in the mutation.

func (*BlockMutation) Status

func (m *BlockMutation) Status() (r block.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*BlockMutation) Timestamp

func (m *BlockMutation) Timestamp() (r time.Time, exists bool)

Timestamp returns the value of the "timestamp" field in the mutation.

func (*BlockMutation) TransactionReceiptsCleared

func (m *BlockMutation) TransactionReceiptsCleared() bool

TransactionReceiptsCleared reports if the "transaction_receipts" edge to the TransactionReceipt entity was cleared.

func (*BlockMutation) TransactionReceiptsIDs

func (m *BlockMutation) TransactionReceiptsIDs() (ids []string)

TransactionReceiptsIDs returns the "transaction_receipts" edge IDs in the mutation.

func (*BlockMutation) TransactionsCleared

func (m *BlockMutation) TransactionsCleared() bool

TransactionsCleared reports if the "transactions" edge to the Transaction entity was cleared.

func (*BlockMutation) TransactionsIDs

func (m *BlockMutation) TransactionsIDs() (ids []string)

TransactionsIDs returns the "transactions" edge IDs in the mutation.

func (BlockMutation) Tx

func (m BlockMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*BlockMutation) Type

func (m *BlockMutation) Type() string

Type returns the node type of this mutation (Block).

func (*BlockMutation) Where

func (m *BlockMutation) Where(ps ...predicate.Block)

Where appends a list predicates to the BlockMutation builder.

type BlockOrder

type BlockOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *BlockOrderField `json:"field"`
}

BlockOrder defines the ordering of Block.

type BlockOrderField

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

BlockOrderField defines the ordering field of Block.

func (BlockOrderField) MarshalGQL

func (f BlockOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (BlockOrderField) String

func (f BlockOrderField) String() string

String implement fmt.Stringer interface.

func (*BlockOrderField) UnmarshalGQL

func (f *BlockOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type BlockPaginateOption

type BlockPaginateOption func(*blockPager) error

BlockPaginateOption enables pagination customization.

func WithBlockFilter

func WithBlockFilter(filter func(*BlockQuery) (*BlockQuery, error)) BlockPaginateOption

WithBlockFilter configures pagination filter.

func WithBlockOrder

func WithBlockOrder(order *BlockOrder) BlockPaginateOption

WithBlockOrder configures pagination ordering.

type BlockQuery

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

BlockQuery is the builder for querying Block entities.

func (*BlockQuery) All

func (bq *BlockQuery) All(ctx context.Context) ([]*Block, error)

All executes the query and returns a list of Blocks.

func (*BlockQuery) AllX

func (bq *BlockQuery) AllX(ctx context.Context) []*Block

AllX is like All, but panics if an error occurs.

func (*BlockQuery) Clone

func (bq *BlockQuery) Clone() *BlockQuery

Clone returns a duplicate of the BlockQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*BlockQuery) CollectFields

func (b *BlockQuery) CollectFields(ctx context.Context, satisfies ...string) (*BlockQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*BlockQuery) Count

func (bq *BlockQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*BlockQuery) CountX

func (bq *BlockQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*BlockQuery) Exist

func (bq *BlockQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*BlockQuery) ExistX

func (bq *BlockQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*BlockQuery) First

func (bq *BlockQuery) First(ctx context.Context) (*Block, error)

First returns the first Block entity from the query. Returns a *NotFoundError when no Block was found.

func (*BlockQuery) FirstID

func (bq *BlockQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Block ID from the query. Returns a *NotFoundError when no Block ID was found.

func (*BlockQuery) FirstIDX

func (bq *BlockQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*BlockQuery) FirstX

func (bq *BlockQuery) FirstX(ctx context.Context) *Block

FirstX is like First, but panics if an error occurs.

func (*BlockQuery) GroupBy

func (bq *BlockQuery) GroupBy(field string, fields ...string) *BlockGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	BlockHash string `json:"block_hash,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Block.Query().
	GroupBy(block.FieldBlockHash).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*BlockQuery) IDs

func (bq *BlockQuery) IDs(ctx context.Context) ([]string, error)

IDs executes the query and returns a list of Block IDs.

func (*BlockQuery) IDsX

func (bq *BlockQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*BlockQuery) Limit

func (bq *BlockQuery) Limit(limit int) *BlockQuery

Limit adds a limit step to the query.

func (*BlockQuery) Offset

func (bq *BlockQuery) Offset(offset int) *BlockQuery

Offset adds an offset step to the query.

func (*BlockQuery) Only

func (bq *BlockQuery) Only(ctx context.Context) (*Block, error)

Only returns a single Block entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Block entity is found. Returns a *NotFoundError when no Block entities are found.

func (*BlockQuery) OnlyID

func (bq *BlockQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Block ID in the query. Returns a *NotSingularError when more than one Block ID is found. Returns a *NotFoundError when no entities are found.

func (*BlockQuery) OnlyIDX

func (bq *BlockQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*BlockQuery) OnlyX

func (bq *BlockQuery) OnlyX(ctx context.Context) *Block

OnlyX is like Only, but panics if an error occurs.

func (*BlockQuery) Order

func (bq *BlockQuery) Order(o ...OrderFunc) *BlockQuery

Order adds an order step to the query.

func (*BlockQuery) Paginate

func (b *BlockQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...BlockPaginateOption,
) (*BlockConnection, error)

Paginate executes the query and returns a relay based cursor connection to Block.

func (*BlockQuery) QueryTransactionReceipts

func (bq *BlockQuery) QueryTransactionReceipts() *TransactionReceiptQuery

QueryTransactionReceipts chains the current query on the "transaction_receipts" edge.

func (*BlockQuery) QueryTransactions

func (bq *BlockQuery) QueryTransactions() *TransactionQuery

QueryTransactions chains the current query on the "transactions" edge.

func (*BlockQuery) Select

func (bq *BlockQuery) Select(fields ...string) *BlockSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	BlockHash string `json:"block_hash,omitempty"`
}

client.Block.Query().
	Select(block.FieldBlockHash).
	Scan(ctx, &v)

func (*BlockQuery) Unique

func (bq *BlockQuery) Unique(unique bool) *BlockQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*BlockQuery) Where

func (bq *BlockQuery) Where(ps ...predicate.Block) *BlockQuery

Where adds a new predicate for the BlockQuery builder.

func (*BlockQuery) WithTransactionReceipts

func (bq *BlockQuery) WithTransactionReceipts(opts ...func(*TransactionReceiptQuery)) *BlockQuery

WithTransactionReceipts tells the query-builder to eager-load the nodes that are connected to the "transaction_receipts" edge. The optional arguments are used to configure the query builder of the edge.

func (*BlockQuery) WithTransactions

func (bq *BlockQuery) WithTransactions(opts ...func(*TransactionQuery)) *BlockQuery

WithTransactions tells the query-builder to eager-load the nodes that are connected to the "transactions" edge. The optional arguments are used to configure the query builder of the edge.

type BlockSelect

type BlockSelect struct {
	*BlockQuery
	// contains filtered or unexported fields
}

BlockSelect is the builder for selecting fields of Block entities.

func (*BlockSelect) Bool

func (s *BlockSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*BlockSelect) BoolX

func (s *BlockSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*BlockSelect) Bools

func (s *BlockSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*BlockSelect) BoolsX

func (s *BlockSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*BlockSelect) Float64

func (s *BlockSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*BlockSelect) Float64X

func (s *BlockSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*BlockSelect) Float64s

func (s *BlockSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*BlockSelect) Float64sX

func (s *BlockSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*BlockSelect) Int

func (s *BlockSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*BlockSelect) IntX

func (s *BlockSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*BlockSelect) Ints

func (s *BlockSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*BlockSelect) IntsX

func (s *BlockSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*BlockSelect) Scan

func (bs *BlockSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*BlockSelect) ScanX

func (s *BlockSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*BlockSelect) String

func (s *BlockSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*BlockSelect) StringX

func (s *BlockSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*BlockSelect) Strings

func (s *BlockSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*BlockSelect) StringsX

func (s *BlockSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type BlockUpdate

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

BlockUpdate is the builder for updating Block entities.

func (*BlockUpdate) AddBlockNumber

func (bu *BlockUpdate) AddBlockNumber(u int64) *BlockUpdate

AddBlockNumber adds u to the "block_number" field.

func (*BlockUpdate) AddTransactionIDs

func (bu *BlockUpdate) AddTransactionIDs(ids ...string) *BlockUpdate

AddTransactionIDs adds the "transactions" edge to the Transaction entity by IDs.

func (*BlockUpdate) AddTransactionReceiptIDs

func (bu *BlockUpdate) AddTransactionReceiptIDs(ids ...string) *BlockUpdate

AddTransactionReceiptIDs adds the "transaction_receipts" edge to the TransactionReceipt entity by IDs.

func (*BlockUpdate) AddTransactionReceipts

func (bu *BlockUpdate) AddTransactionReceipts(t ...*TransactionReceipt) *BlockUpdate

AddTransactionReceipts adds the "transaction_receipts" edges to the TransactionReceipt entity.

func (*BlockUpdate) AddTransactions

func (bu *BlockUpdate) AddTransactions(t ...*Transaction) *BlockUpdate

AddTransactions adds the "transactions" edges to the Transaction entity.

func (*BlockUpdate) ClearTransactionReceipts

func (bu *BlockUpdate) ClearTransactionReceipts() *BlockUpdate

ClearTransactionReceipts clears all "transaction_receipts" edges to the TransactionReceipt entity.

func (*BlockUpdate) ClearTransactions

func (bu *BlockUpdate) ClearTransactions() *BlockUpdate

ClearTransactions clears all "transactions" edges to the Transaction entity.

func (*BlockUpdate) Exec

func (bu *BlockUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*BlockUpdate) ExecX

func (bu *BlockUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BlockUpdate) Mutation

func (bu *BlockUpdate) Mutation() *BlockMutation

Mutation returns the BlockMutation object of the builder.

func (*BlockUpdate) RemoveTransactionIDs

func (bu *BlockUpdate) RemoveTransactionIDs(ids ...string) *BlockUpdate

RemoveTransactionIDs removes the "transactions" edge to Transaction entities by IDs.

func (*BlockUpdate) RemoveTransactionReceiptIDs

func (bu *BlockUpdate) RemoveTransactionReceiptIDs(ids ...string) *BlockUpdate

RemoveTransactionReceiptIDs removes the "transaction_receipts" edge to TransactionReceipt entities by IDs.

func (*BlockUpdate) RemoveTransactionReceipts

func (bu *BlockUpdate) RemoveTransactionReceipts(t ...*TransactionReceipt) *BlockUpdate

RemoveTransactionReceipts removes "transaction_receipts" edges to TransactionReceipt entities.

func (*BlockUpdate) RemoveTransactions

func (bu *BlockUpdate) RemoveTransactions(t ...*Transaction) *BlockUpdate

RemoveTransactions removes "transactions" edges to Transaction entities.

func (*BlockUpdate) Save

func (bu *BlockUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*BlockUpdate) SaveX

func (bu *BlockUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*BlockUpdate) SetBlockHash

func (bu *BlockUpdate) SetBlockHash(s string) *BlockUpdate

SetBlockHash sets the "block_hash" field.

func (*BlockUpdate) SetBlockNumber

func (bu *BlockUpdate) SetBlockNumber(u uint64) *BlockUpdate

SetBlockNumber sets the "block_number" field.

func (*BlockUpdate) SetParentBlockHash

func (bu *BlockUpdate) SetParentBlockHash(s string) *BlockUpdate

SetParentBlockHash sets the "parent_block_hash" field.

func (*BlockUpdate) SetStateRoot

func (bu *BlockUpdate) SetStateRoot(s string) *BlockUpdate

SetStateRoot sets the "state_root" field.

func (*BlockUpdate) SetStatus

func (bu *BlockUpdate) SetStatus(b block.Status) *BlockUpdate

SetStatus sets the "status" field.

func (*BlockUpdate) Where

func (bu *BlockUpdate) Where(ps ...predicate.Block) *BlockUpdate

Where appends a list predicates to the BlockUpdate builder.

type BlockUpdateOne

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

BlockUpdateOne is the builder for updating a single Block entity.

func (*BlockUpdateOne) AddBlockNumber

func (buo *BlockUpdateOne) AddBlockNumber(u int64) *BlockUpdateOne

AddBlockNumber adds u to the "block_number" field.

func (*BlockUpdateOne) AddTransactionIDs

func (buo *BlockUpdateOne) AddTransactionIDs(ids ...string) *BlockUpdateOne

AddTransactionIDs adds the "transactions" edge to the Transaction entity by IDs.

func (*BlockUpdateOne) AddTransactionReceiptIDs

func (buo *BlockUpdateOne) AddTransactionReceiptIDs(ids ...string) *BlockUpdateOne

AddTransactionReceiptIDs adds the "transaction_receipts" edge to the TransactionReceipt entity by IDs.

func (*BlockUpdateOne) AddTransactionReceipts

func (buo *BlockUpdateOne) AddTransactionReceipts(t ...*TransactionReceipt) *BlockUpdateOne

AddTransactionReceipts adds the "transaction_receipts" edges to the TransactionReceipt entity.

func (*BlockUpdateOne) AddTransactions

func (buo *BlockUpdateOne) AddTransactions(t ...*Transaction) *BlockUpdateOne

AddTransactions adds the "transactions" edges to the Transaction entity.

func (*BlockUpdateOne) ClearTransactionReceipts

func (buo *BlockUpdateOne) ClearTransactionReceipts() *BlockUpdateOne

ClearTransactionReceipts clears all "transaction_receipts" edges to the TransactionReceipt entity.

func (*BlockUpdateOne) ClearTransactions

func (buo *BlockUpdateOne) ClearTransactions() *BlockUpdateOne

ClearTransactions clears all "transactions" edges to the Transaction entity.

func (*BlockUpdateOne) Exec

func (buo *BlockUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*BlockUpdateOne) ExecX

func (buo *BlockUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BlockUpdateOne) Mutation

func (buo *BlockUpdateOne) Mutation() *BlockMutation

Mutation returns the BlockMutation object of the builder.

func (*BlockUpdateOne) RemoveTransactionIDs

func (buo *BlockUpdateOne) RemoveTransactionIDs(ids ...string) *BlockUpdateOne

RemoveTransactionIDs removes the "transactions" edge to Transaction entities by IDs.

func (*BlockUpdateOne) RemoveTransactionReceiptIDs

func (buo *BlockUpdateOne) RemoveTransactionReceiptIDs(ids ...string) *BlockUpdateOne

RemoveTransactionReceiptIDs removes the "transaction_receipts" edge to TransactionReceipt entities by IDs.

func (*BlockUpdateOne) RemoveTransactionReceipts

func (buo *BlockUpdateOne) RemoveTransactionReceipts(t ...*TransactionReceipt) *BlockUpdateOne

RemoveTransactionReceipts removes "transaction_receipts" edges to TransactionReceipt entities.

func (*BlockUpdateOne) RemoveTransactions

func (buo *BlockUpdateOne) RemoveTransactions(t ...*Transaction) *BlockUpdateOne

RemoveTransactions removes "transactions" edges to Transaction entities.

func (*BlockUpdateOne) Save

func (buo *BlockUpdateOne) Save(ctx context.Context) (*Block, error)

Save executes the query and returns the updated Block entity.

func (*BlockUpdateOne) SaveX

func (buo *BlockUpdateOne) SaveX(ctx context.Context) *Block

SaveX is like Save, but panics if an error occurs.

func (*BlockUpdateOne) Select

func (buo *BlockUpdateOne) Select(field string, fields ...string) *BlockUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*BlockUpdateOne) SetBlockHash

func (buo *BlockUpdateOne) SetBlockHash(s string) *BlockUpdateOne

SetBlockHash sets the "block_hash" field.

func (*BlockUpdateOne) SetBlockNumber

func (buo *BlockUpdateOne) SetBlockNumber(u uint64) *BlockUpdateOne

SetBlockNumber sets the "block_number" field.

func (*BlockUpdateOne) SetParentBlockHash

func (buo *BlockUpdateOne) SetParentBlockHash(s string) *BlockUpdateOne

SetParentBlockHash sets the "parent_block_hash" field.

func (*BlockUpdateOne) SetStateRoot

func (buo *BlockUpdateOne) SetStateRoot(s string) *BlockUpdateOne

SetStateRoot sets the "state_root" field.

func (*BlockUpdateOne) SetStatus

func (buo *BlockUpdateOne) SetStatus(b block.Status) *BlockUpdateOne

SetStatus sets the "status" field.

type BlockUpsert

type BlockUpsert struct {
	*sql.UpdateSet
}

BlockUpsert is the "OnConflict" setter.

func (*BlockUpsert) AddBlockNumber

func (u *BlockUpsert) AddBlockNumber(v uint64) *BlockUpsert

AddBlockNumber adds v to the "block_number" field.

func (*BlockUpsert) SetBlockHash

func (u *BlockUpsert) SetBlockHash(v string) *BlockUpsert

SetBlockHash sets the "block_hash" field.

func (*BlockUpsert) SetBlockNumber

func (u *BlockUpsert) SetBlockNumber(v uint64) *BlockUpsert

SetBlockNumber sets the "block_number" field.

func (*BlockUpsert) SetParentBlockHash

func (u *BlockUpsert) SetParentBlockHash(v string) *BlockUpsert

SetParentBlockHash sets the "parent_block_hash" field.

func (*BlockUpsert) SetStateRoot

func (u *BlockUpsert) SetStateRoot(v string) *BlockUpsert

SetStateRoot sets the "state_root" field.

func (*BlockUpsert) SetStatus

func (u *BlockUpsert) SetStatus(v block.Status) *BlockUpsert

SetStatus sets the "status" field.

func (*BlockUpsert) SetTimestamp

func (u *BlockUpsert) SetTimestamp(v time.Time) *BlockUpsert

SetTimestamp sets the "timestamp" field.

func (*BlockUpsert) UpdateBlockHash

func (u *BlockUpsert) UpdateBlockHash() *BlockUpsert

UpdateBlockHash sets the "block_hash" field to the value that was provided on create.

func (*BlockUpsert) UpdateBlockNumber

func (u *BlockUpsert) UpdateBlockNumber() *BlockUpsert

UpdateBlockNumber sets the "block_number" field to the value that was provided on create.

func (*BlockUpsert) UpdateParentBlockHash

func (u *BlockUpsert) UpdateParentBlockHash() *BlockUpsert

UpdateParentBlockHash sets the "parent_block_hash" field to the value that was provided on create.

func (*BlockUpsert) UpdateStateRoot

func (u *BlockUpsert) UpdateStateRoot() *BlockUpsert

UpdateStateRoot sets the "state_root" field to the value that was provided on create.

func (*BlockUpsert) UpdateStatus

func (u *BlockUpsert) UpdateStatus() *BlockUpsert

UpdateStatus sets the "status" field to the value that was provided on create.

func (*BlockUpsert) UpdateTimestamp

func (u *BlockUpsert) UpdateTimestamp() *BlockUpsert

UpdateTimestamp sets the "timestamp" field to the value that was provided on create.

type BlockUpsertBulk

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

BlockUpsertBulk is the builder for "upsert"-ing a bulk of Block nodes.

func (*BlockUpsertBulk) AddBlockNumber

func (u *BlockUpsertBulk) AddBlockNumber(v uint64) *BlockUpsertBulk

AddBlockNumber adds v to the "block_number" field.

func (*BlockUpsertBulk) DoNothing

func (u *BlockUpsertBulk) DoNothing() *BlockUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*BlockUpsertBulk) Exec

func (u *BlockUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*BlockUpsertBulk) ExecX

func (u *BlockUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BlockUpsertBulk) Ignore

func (u *BlockUpsertBulk) Ignore() *BlockUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Block.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*BlockUpsertBulk) SetBlockHash

func (u *BlockUpsertBulk) SetBlockHash(v string) *BlockUpsertBulk

SetBlockHash sets the "block_hash" field.

func (*BlockUpsertBulk) SetBlockNumber

func (u *BlockUpsertBulk) SetBlockNumber(v uint64) *BlockUpsertBulk

SetBlockNumber sets the "block_number" field.

func (*BlockUpsertBulk) SetParentBlockHash

func (u *BlockUpsertBulk) SetParentBlockHash(v string) *BlockUpsertBulk

SetParentBlockHash sets the "parent_block_hash" field.

func (*BlockUpsertBulk) SetStateRoot

func (u *BlockUpsertBulk) SetStateRoot(v string) *BlockUpsertBulk

SetStateRoot sets the "state_root" field.

func (*BlockUpsertBulk) SetStatus

func (u *BlockUpsertBulk) SetStatus(v block.Status) *BlockUpsertBulk

SetStatus sets the "status" field.

func (*BlockUpsertBulk) SetTimestamp

func (u *BlockUpsertBulk) SetTimestamp(v time.Time) *BlockUpsertBulk

SetTimestamp sets the "timestamp" field.

func (*BlockUpsertBulk) Update

func (u *BlockUpsertBulk) Update(set func(*BlockUpsert)) *BlockUpsertBulk

Update allows overriding fields `UPDATE` values. See the BlockCreateBulk.OnConflict documentation for more info.

func (*BlockUpsertBulk) UpdateBlockHash

func (u *BlockUpsertBulk) UpdateBlockHash() *BlockUpsertBulk

UpdateBlockHash sets the "block_hash" field to the value that was provided on create.

func (*BlockUpsertBulk) UpdateBlockNumber

func (u *BlockUpsertBulk) UpdateBlockNumber() *BlockUpsertBulk

UpdateBlockNumber sets the "block_number" field to the value that was provided on create.

func (*BlockUpsertBulk) UpdateNewValues

func (u *BlockUpsertBulk) UpdateNewValues() *BlockUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Block.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(block.FieldID)
		}),
	).
	Exec(ctx)

func (*BlockUpsertBulk) UpdateParentBlockHash

func (u *BlockUpsertBulk) UpdateParentBlockHash() *BlockUpsertBulk

UpdateParentBlockHash sets the "parent_block_hash" field to the value that was provided on create.

func (*BlockUpsertBulk) UpdateStateRoot

func (u *BlockUpsertBulk) UpdateStateRoot() *BlockUpsertBulk

UpdateStateRoot sets the "state_root" field to the value that was provided on create.

func (*BlockUpsertBulk) UpdateStatus

func (u *BlockUpsertBulk) UpdateStatus() *BlockUpsertBulk

UpdateStatus sets the "status" field to the value that was provided on create.

func (*BlockUpsertBulk) UpdateTimestamp

func (u *BlockUpsertBulk) UpdateTimestamp() *BlockUpsertBulk

UpdateTimestamp sets the "timestamp" field to the value that was provided on create.

type BlockUpsertOne

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

BlockUpsertOne is the builder for "upsert"-ing

one Block node.

func (*BlockUpsertOne) AddBlockNumber

func (u *BlockUpsertOne) AddBlockNumber(v uint64) *BlockUpsertOne

AddBlockNumber adds v to the "block_number" field.

func (*BlockUpsertOne) DoNothing

func (u *BlockUpsertOne) DoNothing() *BlockUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*BlockUpsertOne) Exec

func (u *BlockUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*BlockUpsertOne) ExecX

func (u *BlockUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*BlockUpsertOne) ID

func (u *BlockUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*BlockUpsertOne) IDX

func (u *BlockUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*BlockUpsertOne) Ignore

func (u *BlockUpsertOne) Ignore() *BlockUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Block.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*BlockUpsertOne) SetBlockHash

func (u *BlockUpsertOne) SetBlockHash(v string) *BlockUpsertOne

SetBlockHash sets the "block_hash" field.

func (*BlockUpsertOne) SetBlockNumber

func (u *BlockUpsertOne) SetBlockNumber(v uint64) *BlockUpsertOne

SetBlockNumber sets the "block_number" field.

func (*BlockUpsertOne) SetParentBlockHash

func (u *BlockUpsertOne) SetParentBlockHash(v string) *BlockUpsertOne

SetParentBlockHash sets the "parent_block_hash" field.

func (*BlockUpsertOne) SetStateRoot

func (u *BlockUpsertOne) SetStateRoot(v string) *BlockUpsertOne

SetStateRoot sets the "state_root" field.

func (*BlockUpsertOne) SetStatus

func (u *BlockUpsertOne) SetStatus(v block.Status) *BlockUpsertOne

SetStatus sets the "status" field.

func (*BlockUpsertOne) SetTimestamp

func (u *BlockUpsertOne) SetTimestamp(v time.Time) *BlockUpsertOne

SetTimestamp sets the "timestamp" field.

func (*BlockUpsertOne) Update

func (u *BlockUpsertOne) Update(set func(*BlockUpsert)) *BlockUpsertOne

Update allows overriding fields `UPDATE` values. See the BlockCreate.OnConflict documentation for more info.

func (*BlockUpsertOne) UpdateBlockHash

func (u *BlockUpsertOne) UpdateBlockHash() *BlockUpsertOne

UpdateBlockHash sets the "block_hash" field to the value that was provided on create.

func (*BlockUpsertOne) UpdateBlockNumber

func (u *BlockUpsertOne) UpdateBlockNumber() *BlockUpsertOne

UpdateBlockNumber sets the "block_number" field to the value that was provided on create.

func (*BlockUpsertOne) UpdateNewValues

func (u *BlockUpsertOne) UpdateNewValues() *BlockUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Block.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(block.FieldID)
		}),
	).
	Exec(ctx)

func (*BlockUpsertOne) UpdateParentBlockHash

func (u *BlockUpsertOne) UpdateParentBlockHash() *BlockUpsertOne

UpdateParentBlockHash sets the "parent_block_hash" field to the value that was provided on create.

func (*BlockUpsertOne) UpdateStateRoot

func (u *BlockUpsertOne) UpdateStateRoot() *BlockUpsertOne

UpdateStateRoot sets the "state_root" field to the value that was provided on create.

func (*BlockUpsertOne) UpdateStatus

func (u *BlockUpsertOne) UpdateStatus() *BlockUpsertOne

UpdateStatus sets the "status" field to the value that was provided on create.

func (*BlockUpsertOne) UpdateTimestamp

func (u *BlockUpsertOne) UpdateTimestamp() *BlockUpsertOne

UpdateTimestamp sets the "timestamp" field to the value that was provided on create.

type BlockWhereInput

type BlockWhereInput struct {
	Not *BlockWhereInput   `json:"not,omitempty"`
	Or  []*BlockWhereInput `json:"or,omitempty"`
	And []*BlockWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *string  `json:"id,omitempty"`
	IDNEQ   *string  `json:"idNEQ,omitempty"`
	IDIn    []string `json:"idIn,omitempty"`
	IDNotIn []string `json:"idNotIn,omitempty"`
	IDGT    *string  `json:"idGT,omitempty"`
	IDGTE   *string  `json:"idGTE,omitempty"`
	IDLT    *string  `json:"idLT,omitempty"`
	IDLTE   *string  `json:"idLTE,omitempty"`

	// "block_hash" field predicates.
	BlockHash             *string  `json:"blockHash,omitempty"`
	BlockHashNEQ          *string  `json:"blockHashNEQ,omitempty"`
	BlockHashIn           []string `json:"blockHashIn,omitempty"`
	BlockHashNotIn        []string `json:"blockHashNotIn,omitempty"`
	BlockHashGT           *string  `json:"blockHashGT,omitempty"`
	BlockHashGTE          *string  `json:"blockHashGTE,omitempty"`
	BlockHashLT           *string  `json:"blockHashLT,omitempty"`
	BlockHashLTE          *string  `json:"blockHashLTE,omitempty"`
	BlockHashContains     *string  `json:"blockHashContains,omitempty"`
	BlockHashHasPrefix    *string  `json:"blockHashHasPrefix,omitempty"`
	BlockHashHasSuffix    *string  `json:"blockHashHasSuffix,omitempty"`
	BlockHashEqualFold    *string  `json:"blockHashEqualFold,omitempty"`
	BlockHashContainsFold *string  `json:"blockHashContainsFold,omitempty"`

	// "parent_block_hash" field predicates.
	ParentBlockHash             *string  `json:"parentBlockHash,omitempty"`
	ParentBlockHashNEQ          *string  `json:"parentBlockHashNEQ,omitempty"`
	ParentBlockHashIn           []string `json:"parentBlockHashIn,omitempty"`
	ParentBlockHashNotIn        []string `json:"parentBlockHashNotIn,omitempty"`
	ParentBlockHashGT           *string  `json:"parentBlockHashGT,omitempty"`
	ParentBlockHashGTE          *string  `json:"parentBlockHashGTE,omitempty"`
	ParentBlockHashLT           *string  `json:"parentBlockHashLT,omitempty"`
	ParentBlockHashLTE          *string  `json:"parentBlockHashLTE,omitempty"`
	ParentBlockHashContains     *string  `json:"parentBlockHashContains,omitempty"`
	ParentBlockHashHasPrefix    *string  `json:"parentBlockHashHasPrefix,omitempty"`
	ParentBlockHashHasSuffix    *string  `json:"parentBlockHashHasSuffix,omitempty"`
	ParentBlockHashEqualFold    *string  `json:"parentBlockHashEqualFold,omitempty"`
	ParentBlockHashContainsFold *string  `json:"parentBlockHashContainsFold,omitempty"`

	// "block_number" field predicates.
	BlockNumber      *uint64  `json:"blockNumber,omitempty"`
	BlockNumberNEQ   *uint64  `json:"blockNumberNEQ,omitempty"`
	BlockNumberIn    []uint64 `json:"blockNumberIn,omitempty"`
	BlockNumberNotIn []uint64 `json:"blockNumberNotIn,omitempty"`
	BlockNumberGT    *uint64  `json:"blockNumberGT,omitempty"`
	BlockNumberGTE   *uint64  `json:"blockNumberGTE,omitempty"`
	BlockNumberLT    *uint64  `json:"blockNumberLT,omitempty"`
	BlockNumberLTE   *uint64  `json:"blockNumberLTE,omitempty"`

	// "state_root" field predicates.
	StateRoot             *string  `json:"stateRoot,omitempty"`
	StateRootNEQ          *string  `json:"stateRootNEQ,omitempty"`
	StateRootIn           []string `json:"stateRootIn,omitempty"`
	StateRootNotIn        []string `json:"stateRootNotIn,omitempty"`
	StateRootGT           *string  `json:"stateRootGT,omitempty"`
	StateRootGTE          *string  `json:"stateRootGTE,omitempty"`
	StateRootLT           *string  `json:"stateRootLT,omitempty"`
	StateRootLTE          *string  `json:"stateRootLTE,omitempty"`
	StateRootContains     *string  `json:"stateRootContains,omitempty"`
	StateRootHasPrefix    *string  `json:"stateRootHasPrefix,omitempty"`
	StateRootHasSuffix    *string  `json:"stateRootHasSuffix,omitempty"`
	StateRootEqualFold    *string  `json:"stateRootEqualFold,omitempty"`
	StateRootContainsFold *string  `json:"stateRootContainsFold,omitempty"`

	// "status" field predicates.
	Status      *block.Status  `json:"status,omitempty"`
	StatusNEQ   *block.Status  `json:"statusNEQ,omitempty"`
	StatusIn    []block.Status `json:"statusIn,omitempty"`
	StatusNotIn []block.Status `json:"statusNotIn,omitempty"`

	// "timestamp" field predicates.
	Timestamp      *time.Time  `json:"timestamp,omitempty"`
	TimestampNEQ   *time.Time  `json:"timestampNEQ,omitempty"`
	TimestampIn    []time.Time `json:"timestampIn,omitempty"`
	TimestampNotIn []time.Time `json:"timestampNotIn,omitempty"`
	TimestampGT    *time.Time  `json:"timestampGT,omitempty"`
	TimestampGTE   *time.Time  `json:"timestampGTE,omitempty"`
	TimestampLT    *time.Time  `json:"timestampLT,omitempty"`
	TimestampLTE   *time.Time  `json:"timestampLTE,omitempty"`

	// "transactions" edge predicates.
	HasTransactions     *bool                    `json:"hasTransactions,omitempty"`
	HasTransactionsWith []*TransactionWhereInput `json:"hasTransactionsWith,omitempty"`

	// "transaction_receipts" edge predicates.
	HasTransactionReceipts     *bool                           `json:"hasTransactionReceipts,omitempty"`
	HasTransactionReceiptsWith []*TransactionReceiptWhereInput `json:"hasTransactionReceiptsWith,omitempty"`
}

BlockWhereInput represents a where input for filtering Block queries.

func (*BlockWhereInput) Filter

func (i *BlockWhereInput) Filter(q *BlockQuery) (*BlockQuery, error)

Filter applies the BlockWhereInput filter on the BlockQuery builder.

func (*BlockWhereInput) P

P returns a predicate for filtering blocks. An error is returned if the input is empty or invalid.

type Blocks

type Blocks []*Block

Blocks is a parsable slice of Block.

type Client

type Client struct {

	// Schema is the client for creating, migrating and dropping schema.
	Schema *migrate.Schema
	// Balance is the client for interacting with the Balance builders.
	Balance *BalanceClient
	// Block is the client for interacting with the Block builders.
	Block *BlockClient
	// Contract is the client for interacting with the Contract builders.
	Contract *ContractClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// Transaction is the client for interacting with the Transaction builders.
	Transaction *TransactionClient
	// TransactionReceipt is the client for interacting with the TransactionReceipt builders.
	TransactionReceipt *TransactionReceiptClient
	// contains filtered or unexported fields
}

Client is the client that holds all ent builders.

func FromContext

func FromContext(ctx context.Context) *Client

FromContext returns a Client stored inside a context, or nil if there isn't one.

func NewClient

func NewClient(opts ...Option) *Client

NewClient creates a new client configured with the given options.

func Open

func Open(driverName, dataSourceName string, options ...Option) (*Client, error)

Open opens a database/sql.DB specified by the driver name and the data source name, and returns a new client attached to it. Optional parameters can be added for configuring the client.

func (*Client) BeginTx

func (c *Client) BeginTx(ctx context.Context, opts *sql.TxOptions) (*Tx, error)

BeginTx returns a transactional client with specified options.

func (*Client) Close

func (c *Client) Close() error

Close closes the database connection and prevents new queries from starting.

func (*Client) Debug

func (c *Client) Debug() *Client

Debug returns a new debug-client. It's used to get verbose logging on specific operations.

client.Debug().
	Balance.
	Query().
	Count(ctx)

func (*Client) Node

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

func (*Client) Noder

func (c *Client) Noder(ctx context.Context, id string, opts ...NodeOption) (_ Noder, err error)

Noder returns a Node by its id. If the NodeType was not provided, it will be derived from the id value according to the universal-id configuration.

c.Noder(ctx, id)
c.Noder(ctx, id, ent.WithNodeType(pet.Table))

func (*Client) Noders

func (c *Client) Noders(ctx context.Context, ids []string, opts ...NodeOption) ([]Noder, error)

func (*Client) OpenTx

func (c *Client) OpenTx(ctx context.Context) (context.Context, driver.Tx, error)

OpenTx opens a transaction and returns a transactional context along with the created transaction.

func (*Client) Tx

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

Tx returns a new transactional client. The provided context is used until the transaction is committed or rolled back.

func (*Client) Use

func (c *Client) Use(hooks ...Hook)

Use adds the mutation hooks to all the entity clients. In order to add hooks to a specific client, call: `client.Node.Use(...)`.

type CommitFunc

type CommitFunc func(context.Context, *Tx) error

The CommitFunc type is an adapter to allow the use of ordinary function as a Committer. If f is a function with the appropriate signature, CommitFunc(f) is a Committer that calls f.

func (CommitFunc) Commit

func (f CommitFunc) Commit(ctx context.Context, tx *Tx) error

Commit calls f(ctx, m).

type CommitHook

type CommitHook func(Committer) Committer

CommitHook defines the "commit middleware". A function that gets a Committer and returns a Committer. For example:

hook := func(next ent.Committer) ent.Committer {
	return ent.CommitFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Commit(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Committer

type Committer interface {
	Commit(context.Context, *Tx) error
}

Committer is the interface that wraps the Commit method.

type ConstraintError

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

ConstraintError returns when trying to create/update one or more entities and one or more of their constraints failed. For example, violation of edge or field uniqueness.

func (ConstraintError) Error

func (e ConstraintError) Error() string

Error implements the error interface.

func (*ConstraintError) Unwrap

func (e *ConstraintError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Contract

type Contract struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// Type holds the value of the "type" field.
	Type contract.Type `json:"type,omitempty"`
	// CreatedAt holds the value of the "created_at" field.
	CreatedAt time.Time `json:"created_at,omitempty"`
	// UpdatedAt holds the value of the "updated_at" field.
	UpdatedAt time.Time `json:"updated_at,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the ContractQuery when eager-loading is set.
	Edges ContractEdges `json:"edges"`
	// contains filtered or unexported fields
}

Contract is the model entity for the Contract schema.

func (*Contract) Node

func (c *Contract) Node(ctx context.Context) (node *Node, err error)

func (*Contract) QueryTransactions

func (c *Contract) QueryTransactions() *TransactionQuery

QueryTransactions queries the "transactions" edge of the Contract entity.

func (*Contract) String

func (c *Contract) String() string

String implements the fmt.Stringer.

func (*Contract) ToEdge

func (c *Contract) ToEdge(order *ContractOrder) *ContractEdge

ToEdge converts Contract into ContractEdge.

func (*Contract) Transactions

func (c *Contract) Transactions(ctx context.Context) ([]*Transaction, error)

func (*Contract) Unwrap

func (c *Contract) Unwrap() *Contract

Unwrap unwraps the Contract entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Contract) Update

func (c *Contract) Update() *ContractUpdateOne

Update returns a builder for updating this Contract. Note that you need to call Contract.Unwrap() before calling this method if this Contract was returned from a transaction, and the transaction was committed or rolled back.

type ContractClient

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

ContractClient is a client for the Contract schema.

func NewContractClient

func NewContractClient(c config) *ContractClient

NewContractClient returns a client for the Contract from the given config.

func (*ContractClient) Create

func (c *ContractClient) Create() *ContractCreate

Create returns a builder for creating a Contract entity.

func (*ContractClient) CreateBulk

func (c *ContractClient) CreateBulk(builders ...*ContractCreate) *ContractCreateBulk

CreateBulk returns a builder for creating a bulk of Contract entities.

func (*ContractClient) Delete

func (c *ContractClient) Delete() *ContractDelete

Delete returns a delete builder for Contract.

func (*ContractClient) DeleteOne

func (c *ContractClient) DeleteOne(co *Contract) *ContractDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*ContractClient) DeleteOneID

func (c *ContractClient) DeleteOneID(id string) *ContractDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*ContractClient) Get

func (c *ContractClient) Get(ctx context.Context, id string) (*Contract, error)

Get returns a Contract entity by its id.

func (*ContractClient) GetX

func (c *ContractClient) GetX(ctx context.Context, id string) *Contract

GetX is like Get, but panics if an error occurs.

func (*ContractClient) Hooks

func (c *ContractClient) Hooks() []Hook

Hooks returns the client hooks.

func (*ContractClient) Query

func (c *ContractClient) Query() *ContractQuery

Query returns a query builder for Contract.

func (*ContractClient) QueryTransactions

func (c *ContractClient) QueryTransactions(co *Contract) *TransactionQuery

QueryTransactions queries the transactions edge of a Contract.

func (*ContractClient) Update

func (c *ContractClient) Update() *ContractUpdate

Update returns an update builder for Contract.

func (*ContractClient) UpdateOne

func (c *ContractClient) UpdateOne(co *Contract) *ContractUpdateOne

UpdateOne returns an update builder for the given entity.

func (*ContractClient) UpdateOneID

func (c *ContractClient) UpdateOneID(id string) *ContractUpdateOne

UpdateOneID returns an update builder for the given id.

func (*ContractClient) Use

func (c *ContractClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `contract.Hooks(f(g(h())))`.

type ContractConnection

type ContractConnection struct {
	Edges      []*ContractEdge `json:"edges"`
	PageInfo   PageInfo        `json:"pageInfo"`
	TotalCount int             `json:"totalCount"`
}

ContractConnection is the connection containing edges to Contract.

type ContractCreate

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

ContractCreate is the builder for creating a Contract entity.

func (*ContractCreate) AddTransactionIDs

func (cc *ContractCreate) AddTransactionIDs(ids ...string) *ContractCreate

AddTransactionIDs adds the "transactions" edge to the Transaction entity by IDs.

func (*ContractCreate) AddTransactions

func (cc *ContractCreate) AddTransactions(t ...*Transaction) *ContractCreate

AddTransactions adds the "transactions" edges to the Transaction entity.

func (*ContractCreate) Exec

func (cc *ContractCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*ContractCreate) ExecX

func (cc *ContractCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ContractCreate) Mutation

func (cc *ContractCreate) Mutation() *ContractMutation

Mutation returns the ContractMutation object of the builder.

func (*ContractCreate) OnConflict

func (cc *ContractCreate) OnConflict(opts ...sql.ConflictOption) *ContractUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Contract.Create().
	SetType(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ContractUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*ContractCreate) OnConflictColumns

func (cc *ContractCreate) OnConflictColumns(columns ...string) *ContractUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Contract.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ContractCreate) Save

func (cc *ContractCreate) Save(ctx context.Context) (*Contract, error)

Save creates the Contract in the database.

func (*ContractCreate) SaveX

func (cc *ContractCreate) SaveX(ctx context.Context) *Contract

SaveX calls Save and panics if Save returns an error.

func (*ContractCreate) SetCreatedAt

func (cc *ContractCreate) SetCreatedAt(t time.Time) *ContractCreate

SetCreatedAt sets the "created_at" field.

func (*ContractCreate) SetID

func (cc *ContractCreate) SetID(s string) *ContractCreate

SetID sets the "id" field.

func (*ContractCreate) SetNillableCreatedAt

func (cc *ContractCreate) SetNillableCreatedAt(t *time.Time) *ContractCreate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ContractCreate) SetNillableType

func (cc *ContractCreate) SetNillableType(c *contract.Type) *ContractCreate

SetNillableType sets the "type" field if the given value is not nil.

func (*ContractCreate) SetNillableUpdatedAt

func (cc *ContractCreate) SetNillableUpdatedAt(t *time.Time) *ContractCreate

SetNillableUpdatedAt sets the "updated_at" field if the given value is not nil.

func (*ContractCreate) SetType

func (cc *ContractCreate) SetType(c contract.Type) *ContractCreate

SetType sets the "type" field.

func (*ContractCreate) SetUpdatedAt

func (cc *ContractCreate) SetUpdatedAt(t time.Time) *ContractCreate

SetUpdatedAt sets the "updated_at" field.

type ContractCreateBulk

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

ContractCreateBulk is the builder for creating many Contract entities in bulk.

func (*ContractCreateBulk) Exec

func (ccb *ContractCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ContractCreateBulk) ExecX

func (ccb *ContractCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ContractCreateBulk) OnConflict

func (ccb *ContractCreateBulk) OnConflict(opts ...sql.ConflictOption) *ContractUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Contract.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.ContractUpsert) {
		SetType(v+v).
	}).
	Exec(ctx)

func (*ContractCreateBulk) OnConflictColumns

func (ccb *ContractCreateBulk) OnConflictColumns(columns ...string) *ContractUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Contract.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*ContractCreateBulk) Save

func (ccb *ContractCreateBulk) Save(ctx context.Context) ([]*Contract, error)

Save creates the Contract entities in the database.

func (*ContractCreateBulk) SaveX

func (ccb *ContractCreateBulk) SaveX(ctx context.Context) []*Contract

SaveX is like Save, but panics if an error occurs.

type ContractDelete

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

ContractDelete is the builder for deleting a Contract entity.

func (*ContractDelete) Exec

func (cd *ContractDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*ContractDelete) ExecX

func (cd *ContractDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*ContractDelete) Where

func (cd *ContractDelete) Where(ps ...predicate.Contract) *ContractDelete

Where appends a list predicates to the ContractDelete builder.

type ContractDeleteOne

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

ContractDeleteOne is the builder for deleting a single Contract entity.

func (*ContractDeleteOne) Exec

func (cdo *ContractDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*ContractDeleteOne) ExecX

func (cdo *ContractDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type ContractEdge

type ContractEdge struct {
	Node   *Contract `json:"node"`
	Cursor Cursor    `json:"cursor"`
}

ContractEdge is the edge representation of Contract.

type ContractEdges

type ContractEdges struct {
	// Transactions holds the value of the transactions edge.
	Transactions []*Transaction `json:"transactions,omitempty"`
	// contains filtered or unexported fields
}

ContractEdges holds the relations/edges for other nodes in the graph.

func (ContractEdges) TransactionsOrErr

func (e ContractEdges) TransactionsOrErr() ([]*Transaction, error)

TransactionsOrErr returns the Transactions value or an error if the edge was not loaded in eager-loading.

type ContractGroupBy

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

ContractGroupBy is the group-by builder for Contract entities.

func (*ContractGroupBy) Aggregate

func (cgb *ContractGroupBy) Aggregate(fns ...AggregateFunc) *ContractGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*ContractGroupBy) Bool

func (s *ContractGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ContractGroupBy) BoolX

func (s *ContractGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ContractGroupBy) Bools

func (s *ContractGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ContractGroupBy) BoolsX

func (s *ContractGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ContractGroupBy) Float64

func (s *ContractGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ContractGroupBy) Float64X

func (s *ContractGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ContractGroupBy) Float64s

func (s *ContractGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ContractGroupBy) Float64sX

func (s *ContractGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ContractGroupBy) Int

func (s *ContractGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ContractGroupBy) IntX

func (s *ContractGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ContractGroupBy) Ints

func (s *ContractGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ContractGroupBy) IntsX

func (s *ContractGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ContractGroupBy) Scan

func (cgb *ContractGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*ContractGroupBy) ScanX

func (s *ContractGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ContractGroupBy) String

func (s *ContractGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ContractGroupBy) StringX

func (s *ContractGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ContractGroupBy) Strings

func (s *ContractGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ContractGroupBy) StringsX

func (s *ContractGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ContractMutation

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

ContractMutation represents an operation that mutates the Contract nodes in the graph.

func (*ContractMutation) AddField

func (m *ContractMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ContractMutation) AddTransactionIDs

func (m *ContractMutation) AddTransactionIDs(ids ...string)

AddTransactionIDs adds the "transactions" edge to the Transaction entity by ids.

func (*ContractMutation) AddedEdges

func (m *ContractMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*ContractMutation) AddedField

func (m *ContractMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ContractMutation) AddedFields

func (m *ContractMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*ContractMutation) AddedIDs

func (m *ContractMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*ContractMutation) ClearEdge

func (m *ContractMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*ContractMutation) ClearField

func (m *ContractMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*ContractMutation) ClearTransactions

func (m *ContractMutation) ClearTransactions()

ClearTransactions clears the "transactions" edge to the Transaction entity.

func (*ContractMutation) ClearedEdges

func (m *ContractMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*ContractMutation) ClearedFields

func (m *ContractMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (ContractMutation) Client

func (m ContractMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*ContractMutation) CreatedAt

func (m *ContractMutation) CreatedAt() (r time.Time, exists bool)

CreatedAt returns the value of the "created_at" field in the mutation.

func (*ContractMutation) EdgeCleared

func (m *ContractMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*ContractMutation) Field

func (m *ContractMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*ContractMutation) FieldCleared

func (m *ContractMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*ContractMutation) Fields

func (m *ContractMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*ContractMutation) GetType

func (m *ContractMutation) GetType() (r contract.Type, exists bool)

GetType returns the value of the "type" field in the mutation.

func (*ContractMutation) ID

func (m *ContractMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*ContractMutation) IDs

func (m *ContractMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*ContractMutation) OldCreatedAt

func (m *ContractMutation) OldCreatedAt(ctx context.Context) (v time.Time, err error)

OldCreatedAt returns the old "created_at" field's value of the Contract entity. If the Contract object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ContractMutation) OldField

func (m *ContractMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*ContractMutation) OldType

func (m *ContractMutation) OldType(ctx context.Context) (v contract.Type, err error)

OldType returns the old "type" field's value of the Contract entity. If the Contract object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ContractMutation) OldUpdatedAt

func (m *ContractMutation) OldUpdatedAt(ctx context.Context) (v time.Time, err error)

OldUpdatedAt returns the old "updated_at" field's value of the Contract entity. If the Contract object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*ContractMutation) Op

func (m *ContractMutation) Op() Op

Op returns the operation name.

func (*ContractMutation) RemoveTransactionIDs

func (m *ContractMutation) RemoveTransactionIDs(ids ...string)

RemoveTransactionIDs removes the "transactions" edge to the Transaction entity by IDs.

func (*ContractMutation) RemovedEdges

func (m *ContractMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*ContractMutation) RemovedIDs

func (m *ContractMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*ContractMutation) RemovedTransactionsIDs

func (m *ContractMutation) RemovedTransactionsIDs() (ids []string)

RemovedTransactions returns the removed IDs of the "transactions" edge to the Transaction entity.

func (*ContractMutation) ResetCreatedAt

func (m *ContractMutation) ResetCreatedAt()

ResetCreatedAt resets all changes to the "created_at" field.

func (*ContractMutation) ResetEdge

func (m *ContractMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*ContractMutation) ResetField

func (m *ContractMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*ContractMutation) ResetTransactions

func (m *ContractMutation) ResetTransactions()

ResetTransactions resets all changes to the "transactions" edge.

func (*ContractMutation) ResetType

func (m *ContractMutation) ResetType()

ResetType resets all changes to the "type" field.

func (*ContractMutation) ResetUpdatedAt

func (m *ContractMutation) ResetUpdatedAt()

ResetUpdatedAt resets all changes to the "updated_at" field.

func (*ContractMutation) SetCreatedAt

func (m *ContractMutation) SetCreatedAt(t time.Time)

SetCreatedAt sets the "created_at" field.

func (*ContractMutation) SetField

func (m *ContractMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*ContractMutation) SetID

func (m *ContractMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Contract entities.

func (*ContractMutation) SetType

func (m *ContractMutation) SetType(c contract.Type)

SetType sets the "type" field.

func (*ContractMutation) SetUpdatedAt

func (m *ContractMutation) SetUpdatedAt(t time.Time)

SetUpdatedAt sets the "updated_at" field.

func (*ContractMutation) TransactionsCleared

func (m *ContractMutation) TransactionsCleared() bool

TransactionsCleared reports if the "transactions" edge to the Transaction entity was cleared.

func (*ContractMutation) TransactionsIDs

func (m *ContractMutation) TransactionsIDs() (ids []string)

TransactionsIDs returns the "transactions" edge IDs in the mutation.

func (ContractMutation) Tx

func (m ContractMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*ContractMutation) Type

func (m *ContractMutation) Type() string

Type returns the node type of this mutation (Contract).

func (*ContractMutation) UpdatedAt

func (m *ContractMutation) UpdatedAt() (r time.Time, exists bool)

UpdatedAt returns the value of the "updated_at" field in the mutation.

func (*ContractMutation) Where

func (m *ContractMutation) Where(ps ...predicate.Contract)

Where appends a list predicates to the ContractMutation builder.

type ContractOrder

type ContractOrder struct {
	Direction OrderDirection      `json:"direction"`
	Field     *ContractOrderField `json:"field"`
}

ContractOrder defines the ordering of Contract.

type ContractOrderField

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

ContractOrderField defines the ordering field of Contract.

func (ContractOrderField) MarshalGQL

func (f ContractOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (ContractOrderField) String

func (f ContractOrderField) String() string

String implement fmt.Stringer interface.

func (*ContractOrderField) UnmarshalGQL

func (f *ContractOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type ContractPaginateOption

type ContractPaginateOption func(*contractPager) error

ContractPaginateOption enables pagination customization.

func WithContractFilter

func WithContractFilter(filter func(*ContractQuery) (*ContractQuery, error)) ContractPaginateOption

WithContractFilter configures pagination filter.

func WithContractOrder

func WithContractOrder(order *ContractOrder) ContractPaginateOption

WithContractOrder configures pagination ordering.

type ContractQuery

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

ContractQuery is the builder for querying Contract entities.

func (*ContractQuery) All

func (cq *ContractQuery) All(ctx context.Context) ([]*Contract, error)

All executes the query and returns a list of Contracts.

func (*ContractQuery) AllX

func (cq *ContractQuery) AllX(ctx context.Context) []*Contract

AllX is like All, but panics if an error occurs.

func (*ContractQuery) Clone

func (cq *ContractQuery) Clone() *ContractQuery

Clone returns a duplicate of the ContractQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*ContractQuery) CollectFields

func (c *ContractQuery) CollectFields(ctx context.Context, satisfies ...string) (*ContractQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*ContractQuery) Count

func (cq *ContractQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*ContractQuery) CountX

func (cq *ContractQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*ContractQuery) Exist

func (cq *ContractQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*ContractQuery) ExistX

func (cq *ContractQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*ContractQuery) First

func (cq *ContractQuery) First(ctx context.Context) (*Contract, error)

First returns the first Contract entity from the query. Returns a *NotFoundError when no Contract was found.

func (*ContractQuery) FirstID

func (cq *ContractQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Contract ID from the query. Returns a *NotFoundError when no Contract ID was found.

func (*ContractQuery) FirstIDX

func (cq *ContractQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*ContractQuery) FirstX

func (cq *ContractQuery) FirstX(ctx context.Context) *Contract

FirstX is like First, but panics if an error occurs.

func (*ContractQuery) GroupBy

func (cq *ContractQuery) GroupBy(field string, fields ...string) *ContractGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	Type contract.Type `json:"type,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Contract.Query().
	GroupBy(contract.FieldType).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*ContractQuery) IDs

func (cq *ContractQuery) IDs(ctx context.Context) ([]string, error)

IDs executes the query and returns a list of Contract IDs.

func (*ContractQuery) IDsX

func (cq *ContractQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*ContractQuery) Limit

func (cq *ContractQuery) Limit(limit int) *ContractQuery

Limit adds a limit step to the query.

func (*ContractQuery) Offset

func (cq *ContractQuery) Offset(offset int) *ContractQuery

Offset adds an offset step to the query.

func (*ContractQuery) Only

func (cq *ContractQuery) Only(ctx context.Context) (*Contract, error)

Only returns a single Contract entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Contract entity is found. Returns a *NotFoundError when no Contract entities are found.

func (*ContractQuery) OnlyID

func (cq *ContractQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Contract ID in the query. Returns a *NotSingularError when more than one Contract ID is found. Returns a *NotFoundError when no entities are found.

func (*ContractQuery) OnlyIDX

func (cq *ContractQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*ContractQuery) OnlyX

func (cq *ContractQuery) OnlyX(ctx context.Context) *Contract

OnlyX is like Only, but panics if an error occurs.

func (*ContractQuery) Order

func (cq *ContractQuery) Order(o ...OrderFunc) *ContractQuery

Order adds an order step to the query.

func (*ContractQuery) Paginate

func (c *ContractQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...ContractPaginateOption,
) (*ContractConnection, error)

Paginate executes the query and returns a relay based cursor connection to Contract.

func (*ContractQuery) QueryTransactions

func (cq *ContractQuery) QueryTransactions() *TransactionQuery

QueryTransactions chains the current query on the "transactions" edge.

func (*ContractQuery) Select

func (cq *ContractQuery) Select(fields ...string) *ContractSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	Type contract.Type `json:"type,omitempty"`
}

client.Contract.Query().
	Select(contract.FieldType).
	Scan(ctx, &v)

func (*ContractQuery) Unique

func (cq *ContractQuery) Unique(unique bool) *ContractQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*ContractQuery) Where

func (cq *ContractQuery) Where(ps ...predicate.Contract) *ContractQuery

Where adds a new predicate for the ContractQuery builder.

func (*ContractQuery) WithTransactions

func (cq *ContractQuery) WithTransactions(opts ...func(*TransactionQuery)) *ContractQuery

WithTransactions tells the query-builder to eager-load the nodes that are connected to the "transactions" edge. The optional arguments are used to configure the query builder of the edge.

type ContractSelect

type ContractSelect struct {
	*ContractQuery
	// contains filtered or unexported fields
}

ContractSelect is the builder for selecting fields of Contract entities.

func (*ContractSelect) Bool

func (s *ContractSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*ContractSelect) BoolX

func (s *ContractSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*ContractSelect) Bools

func (s *ContractSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*ContractSelect) BoolsX

func (s *ContractSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*ContractSelect) Float64

func (s *ContractSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*ContractSelect) Float64X

func (s *ContractSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*ContractSelect) Float64s

func (s *ContractSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*ContractSelect) Float64sX

func (s *ContractSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*ContractSelect) Int

func (s *ContractSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*ContractSelect) IntX

func (s *ContractSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*ContractSelect) Ints

func (s *ContractSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*ContractSelect) IntsX

func (s *ContractSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*ContractSelect) Scan

func (cs *ContractSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*ContractSelect) ScanX

func (s *ContractSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*ContractSelect) String

func (s *ContractSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*ContractSelect) StringX

func (s *ContractSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*ContractSelect) Strings

func (s *ContractSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*ContractSelect) StringsX

func (s *ContractSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type ContractUpdate

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

ContractUpdate is the builder for updating Contract entities.

func (*ContractUpdate) AddTransactionIDs

func (cu *ContractUpdate) AddTransactionIDs(ids ...string) *ContractUpdate

AddTransactionIDs adds the "transactions" edge to the Transaction entity by IDs.

func (*ContractUpdate) AddTransactions

func (cu *ContractUpdate) AddTransactions(t ...*Transaction) *ContractUpdate

AddTransactions adds the "transactions" edges to the Transaction entity.

func (*ContractUpdate) ClearTransactions

func (cu *ContractUpdate) ClearTransactions() *ContractUpdate

ClearTransactions clears all "transactions" edges to the Transaction entity.

func (*ContractUpdate) Exec

func (cu *ContractUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*ContractUpdate) ExecX

func (cu *ContractUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ContractUpdate) Mutation

func (cu *ContractUpdate) Mutation() *ContractMutation

Mutation returns the ContractMutation object of the builder.

func (*ContractUpdate) RemoveTransactionIDs

func (cu *ContractUpdate) RemoveTransactionIDs(ids ...string) *ContractUpdate

RemoveTransactionIDs removes the "transactions" edge to Transaction entities by IDs.

func (*ContractUpdate) RemoveTransactions

func (cu *ContractUpdate) RemoveTransactions(t ...*Transaction) *ContractUpdate

RemoveTransactions removes "transactions" edges to Transaction entities.

func (*ContractUpdate) Save

func (cu *ContractUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*ContractUpdate) SaveX

func (cu *ContractUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*ContractUpdate) SetCreatedAt

func (cu *ContractUpdate) SetCreatedAt(t time.Time) *ContractUpdate

SetCreatedAt sets the "created_at" field.

func (*ContractUpdate) SetNillableCreatedAt

func (cu *ContractUpdate) SetNillableCreatedAt(t *time.Time) *ContractUpdate

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ContractUpdate) SetNillableType

func (cu *ContractUpdate) SetNillableType(c *contract.Type) *ContractUpdate

SetNillableType sets the "type" field if the given value is not nil.

func (*ContractUpdate) SetType

func (cu *ContractUpdate) SetType(c contract.Type) *ContractUpdate

SetType sets the "type" field.

func (*ContractUpdate) SetUpdatedAt

func (cu *ContractUpdate) SetUpdatedAt(t time.Time) *ContractUpdate

SetUpdatedAt sets the "updated_at" field.

func (*ContractUpdate) Where

func (cu *ContractUpdate) Where(ps ...predicate.Contract) *ContractUpdate

Where appends a list predicates to the ContractUpdate builder.

type ContractUpdateOne

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

ContractUpdateOne is the builder for updating a single Contract entity.

func (*ContractUpdateOne) AddTransactionIDs

func (cuo *ContractUpdateOne) AddTransactionIDs(ids ...string) *ContractUpdateOne

AddTransactionIDs adds the "transactions" edge to the Transaction entity by IDs.

func (*ContractUpdateOne) AddTransactions

func (cuo *ContractUpdateOne) AddTransactions(t ...*Transaction) *ContractUpdateOne

AddTransactions adds the "transactions" edges to the Transaction entity.

func (*ContractUpdateOne) ClearTransactions

func (cuo *ContractUpdateOne) ClearTransactions() *ContractUpdateOne

ClearTransactions clears all "transactions" edges to the Transaction entity.

func (*ContractUpdateOne) Exec

func (cuo *ContractUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*ContractUpdateOne) ExecX

func (cuo *ContractUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ContractUpdateOne) Mutation

func (cuo *ContractUpdateOne) Mutation() *ContractMutation

Mutation returns the ContractMutation object of the builder.

func (*ContractUpdateOne) RemoveTransactionIDs

func (cuo *ContractUpdateOne) RemoveTransactionIDs(ids ...string) *ContractUpdateOne

RemoveTransactionIDs removes the "transactions" edge to Transaction entities by IDs.

func (*ContractUpdateOne) RemoveTransactions

func (cuo *ContractUpdateOne) RemoveTransactions(t ...*Transaction) *ContractUpdateOne

RemoveTransactions removes "transactions" edges to Transaction entities.

func (*ContractUpdateOne) Save

func (cuo *ContractUpdateOne) Save(ctx context.Context) (*Contract, error)

Save executes the query and returns the updated Contract entity.

func (*ContractUpdateOne) SaveX

func (cuo *ContractUpdateOne) SaveX(ctx context.Context) *Contract

SaveX is like Save, but panics if an error occurs.

func (*ContractUpdateOne) Select

func (cuo *ContractUpdateOne) Select(field string, fields ...string) *ContractUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*ContractUpdateOne) SetCreatedAt

func (cuo *ContractUpdateOne) SetCreatedAt(t time.Time) *ContractUpdateOne

SetCreatedAt sets the "created_at" field.

func (*ContractUpdateOne) SetNillableCreatedAt

func (cuo *ContractUpdateOne) SetNillableCreatedAt(t *time.Time) *ContractUpdateOne

SetNillableCreatedAt sets the "created_at" field if the given value is not nil.

func (*ContractUpdateOne) SetNillableType

func (cuo *ContractUpdateOne) SetNillableType(c *contract.Type) *ContractUpdateOne

SetNillableType sets the "type" field if the given value is not nil.

func (*ContractUpdateOne) SetType

SetType sets the "type" field.

func (*ContractUpdateOne) SetUpdatedAt

func (cuo *ContractUpdateOne) SetUpdatedAt(t time.Time) *ContractUpdateOne

SetUpdatedAt sets the "updated_at" field.

type ContractUpsert

type ContractUpsert struct {
	*sql.UpdateSet
}

ContractUpsert is the "OnConflict" setter.

func (*ContractUpsert) SetCreatedAt

func (u *ContractUpsert) SetCreatedAt(v time.Time) *ContractUpsert

SetCreatedAt sets the "created_at" field.

func (*ContractUpsert) SetType

func (u *ContractUpsert) SetType(v contract.Type) *ContractUpsert

SetType sets the "type" field.

func (*ContractUpsert) SetUpdatedAt

func (u *ContractUpsert) SetUpdatedAt(v time.Time) *ContractUpsert

SetUpdatedAt sets the "updated_at" field.

func (*ContractUpsert) UpdateCreatedAt

func (u *ContractUpsert) UpdateCreatedAt() *ContractUpsert

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ContractUpsert) UpdateType

func (u *ContractUpsert) UpdateType() *ContractUpsert

UpdateType sets the "type" field to the value that was provided on create.

func (*ContractUpsert) UpdateUpdatedAt

func (u *ContractUpsert) UpdateUpdatedAt() *ContractUpsert

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ContractUpsertBulk

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

ContractUpsertBulk is the builder for "upsert"-ing a bulk of Contract nodes.

func (*ContractUpsertBulk) DoNothing

func (u *ContractUpsertBulk) DoNothing() *ContractUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ContractUpsertBulk) Exec

func (u *ContractUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*ContractUpsertBulk) ExecX

func (u *ContractUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ContractUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Contract.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*ContractUpsertBulk) SetCreatedAt

func (u *ContractUpsertBulk) SetCreatedAt(v time.Time) *ContractUpsertBulk

SetCreatedAt sets the "created_at" field.

func (*ContractUpsertBulk) SetType

SetType sets the "type" field.

func (*ContractUpsertBulk) SetUpdatedAt

func (u *ContractUpsertBulk) SetUpdatedAt(v time.Time) *ContractUpsertBulk

SetUpdatedAt sets the "updated_at" field.

func (*ContractUpsertBulk) Update

func (u *ContractUpsertBulk) Update(set func(*ContractUpsert)) *ContractUpsertBulk

Update allows overriding fields `UPDATE` values. See the ContractCreateBulk.OnConflict documentation for more info.

func (*ContractUpsertBulk) UpdateCreatedAt

func (u *ContractUpsertBulk) UpdateCreatedAt() *ContractUpsertBulk

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ContractUpsertBulk) UpdateNewValues

func (u *ContractUpsertBulk) UpdateNewValues() *ContractUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Contract.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(contract.FieldID)
		}),
	).
	Exec(ctx)

func (*ContractUpsertBulk) UpdateType

func (u *ContractUpsertBulk) UpdateType() *ContractUpsertBulk

UpdateType sets the "type" field to the value that was provided on create.

func (*ContractUpsertBulk) UpdateUpdatedAt

func (u *ContractUpsertBulk) UpdateUpdatedAt() *ContractUpsertBulk

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ContractUpsertOne

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

ContractUpsertOne is the builder for "upsert"-ing

one Contract node.

func (*ContractUpsertOne) DoNothing

func (u *ContractUpsertOne) DoNothing() *ContractUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*ContractUpsertOne) Exec

func (u *ContractUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*ContractUpsertOne) ExecX

func (u *ContractUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*ContractUpsertOne) ID

func (u *ContractUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*ContractUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*ContractUpsertOne) Ignore

func (u *ContractUpsertOne) Ignore() *ContractUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Contract.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*ContractUpsertOne) SetCreatedAt

func (u *ContractUpsertOne) SetCreatedAt(v time.Time) *ContractUpsertOne

SetCreatedAt sets the "created_at" field.

func (*ContractUpsertOne) SetType

SetType sets the "type" field.

func (*ContractUpsertOne) SetUpdatedAt

func (u *ContractUpsertOne) SetUpdatedAt(v time.Time) *ContractUpsertOne

SetUpdatedAt sets the "updated_at" field.

func (*ContractUpsertOne) Update

func (u *ContractUpsertOne) Update(set func(*ContractUpsert)) *ContractUpsertOne

Update allows overriding fields `UPDATE` values. See the ContractCreate.OnConflict documentation for more info.

func (*ContractUpsertOne) UpdateCreatedAt

func (u *ContractUpsertOne) UpdateCreatedAt() *ContractUpsertOne

UpdateCreatedAt sets the "created_at" field to the value that was provided on create.

func (*ContractUpsertOne) UpdateNewValues

func (u *ContractUpsertOne) UpdateNewValues() *ContractUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Contract.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(contract.FieldID)
		}),
	).
	Exec(ctx)

func (*ContractUpsertOne) UpdateType

func (u *ContractUpsertOne) UpdateType() *ContractUpsertOne

UpdateType sets the "type" field to the value that was provided on create.

func (*ContractUpsertOne) UpdateUpdatedAt

func (u *ContractUpsertOne) UpdateUpdatedAt() *ContractUpsertOne

UpdateUpdatedAt sets the "updated_at" field to the value that was provided on create.

type ContractWhereInput

type ContractWhereInput struct {
	Not *ContractWhereInput   `json:"not,omitempty"`
	Or  []*ContractWhereInput `json:"or,omitempty"`
	And []*ContractWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *string  `json:"id,omitempty"`
	IDNEQ   *string  `json:"idNEQ,omitempty"`
	IDIn    []string `json:"idIn,omitempty"`
	IDNotIn []string `json:"idNotIn,omitempty"`
	IDGT    *string  `json:"idGT,omitempty"`
	IDGTE   *string  `json:"idGTE,omitempty"`
	IDLT    *string  `json:"idLT,omitempty"`
	IDLTE   *string  `json:"idLTE,omitempty"`

	// "type" field predicates.
	Type      *contract.Type  `json:"type,omitempty"`
	TypeNEQ   *contract.Type  `json:"typeNEQ,omitempty"`
	TypeIn    []contract.Type `json:"typeIn,omitempty"`
	TypeNotIn []contract.Type `json:"typeNotIn,omitempty"`

	// "created_at" field predicates.
	CreatedAt      *time.Time  `json:"createdAt,omitempty"`
	CreatedAtNEQ   *time.Time  `json:"createdAtNEQ,omitempty"`
	CreatedAtIn    []time.Time `json:"createdAtIn,omitempty"`
	CreatedAtNotIn []time.Time `json:"createdAtNotIn,omitempty"`
	CreatedAtGT    *time.Time  `json:"createdAtGT,omitempty"`
	CreatedAtGTE   *time.Time  `json:"createdAtGTE,omitempty"`
	CreatedAtLT    *time.Time  `json:"createdAtLT,omitempty"`
	CreatedAtLTE   *time.Time  `json:"createdAtLTE,omitempty"`

	// "updated_at" field predicates.
	UpdatedAt      *time.Time  `json:"updatedAt,omitempty"`
	UpdatedAtNEQ   *time.Time  `json:"updatedAtNEQ,omitempty"`
	UpdatedAtIn    []time.Time `json:"updatedAtIn,omitempty"`
	UpdatedAtNotIn []time.Time `json:"updatedAtNotIn,omitempty"`
	UpdatedAtGT    *time.Time  `json:"updatedAtGT,omitempty"`
	UpdatedAtGTE   *time.Time  `json:"updatedAtGTE,omitempty"`
	UpdatedAtLT    *time.Time  `json:"updatedAtLT,omitempty"`
	UpdatedAtLTE   *time.Time  `json:"updatedAtLTE,omitempty"`

	// "transactions" edge predicates.
	HasTransactions     *bool                    `json:"hasTransactions,omitempty"`
	HasTransactionsWith []*TransactionWhereInput `json:"hasTransactionsWith,omitempty"`
}

ContractWhereInput represents a where input for filtering Contract queries.

func (*ContractWhereInput) Filter

Filter applies the ContractWhereInput filter on the ContractQuery builder.

func (*ContractWhereInput) P

P returns a predicate for filtering contracts. An error is returned if the input is empty or invalid.

type Contracts

type Contracts []*Contract

Contracts is a parsable slice of Contract.

type Cursor

type Cursor struct {
	ID    string `msgpack:"i"`
	Value Value  `msgpack:"v,omitempty"`
}

Cursor of an edge type.

func (Cursor) MarshalGQL

func (c Cursor) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (*Cursor) UnmarshalGQL

func (c *Cursor) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type Edge

type Edge struct {
	Type string   `json:"type,omitempty"` // edge type.
	Name string   `json:"name,omitempty"` // edge name.
	IDs  []string `json:"ids,omitempty"`  // node ids (where this edge point to).
}

Edges between two nodes.

type Event

type Event struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// From holds the value of the "from" field.
	From string `json:"from,omitempty"`
	// Keys holds the value of the "keys" field.
	Keys []*types.Felt `json:"keys,omitempty"`
	// Data holds the value of the "data" field.
	Data []*types.Felt `json:"data,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the EventQuery when eager-loading is set.
	Edges EventEdges `json:"edges"`
	// contains filtered or unexported fields
}

Event is the model entity for the Event schema.

func (*Event) Node

func (e *Event) Node(ctx context.Context) (node *Node, err error)

func (*Event) QueryTransaction

func (e *Event) QueryTransaction() *TransactionQuery

QueryTransaction queries the "transaction" edge of the Event entity.

func (*Event) String

func (e *Event) String() string

String implements the fmt.Stringer.

func (*Event) ToEdge

func (e *Event) ToEdge(order *EventOrder) *EventEdge

ToEdge converts Event into EventEdge.

func (*Event) Transaction

func (e *Event) Transaction(ctx context.Context) (*Transaction, error)

func (*Event) Unwrap

func (e *Event) Unwrap() *Event

Unwrap unwraps the Event entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Event) Update

func (e *Event) Update() *EventUpdateOne

Update returns a builder for updating this Event. Note that you need to call Event.Unwrap() before calling this method if this Event was returned from a transaction, and the transaction was committed or rolled back.

type EventClient

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

EventClient is a client for the Event schema.

func NewEventClient

func NewEventClient(c config) *EventClient

NewEventClient returns a client for the Event from the given config.

func (*EventClient) Create

func (c *EventClient) Create() *EventCreate

Create returns a builder for creating a Event entity.

func (*EventClient) CreateBulk

func (c *EventClient) CreateBulk(builders ...*EventCreate) *EventCreateBulk

CreateBulk returns a builder for creating a bulk of Event entities.

func (*EventClient) Delete

func (c *EventClient) Delete() *EventDelete

Delete returns a delete builder for Event.

func (*EventClient) DeleteOne

func (c *EventClient) DeleteOne(e *Event) *EventDeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*EventClient) DeleteOneID

func (c *EventClient) DeleteOneID(id string) *EventDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*EventClient) Get

func (c *EventClient) Get(ctx context.Context, id string) (*Event, error)

Get returns a Event entity by its id.

func (*EventClient) GetX

func (c *EventClient) GetX(ctx context.Context, id string) *Event

GetX is like Get, but panics if an error occurs.

func (*EventClient) Hooks

func (c *EventClient) Hooks() []Hook

Hooks returns the client hooks.

func (*EventClient) Query

func (c *EventClient) Query() *EventQuery

Query returns a query builder for Event.

func (*EventClient) QueryTransaction

func (c *EventClient) QueryTransaction(e *Event) *TransactionQuery

QueryTransaction queries the transaction edge of a Event.

func (*EventClient) Update

func (c *EventClient) Update() *EventUpdate

Update returns an update builder for Event.

func (*EventClient) UpdateOne

func (c *EventClient) UpdateOne(e *Event) *EventUpdateOne

UpdateOne returns an update builder for the given entity.

func (*EventClient) UpdateOneID

func (c *EventClient) UpdateOneID(id string) *EventUpdateOne

UpdateOneID returns an update builder for the given id.

func (*EventClient) Use

func (c *EventClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `event.Hooks(f(g(h())))`.

type EventConnection

type EventConnection struct {
	Edges      []*EventEdge `json:"edges"`
	PageInfo   PageInfo     `json:"pageInfo"`
	TotalCount int          `json:"totalCount"`
}

EventConnection is the connection containing edges to Event.

type EventCreate

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

EventCreate is the builder for creating a Event entity.

func (*EventCreate) Exec

func (ec *EventCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventCreate) ExecX

func (ec *EventCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventCreate) Mutation

func (ec *EventCreate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventCreate) OnConflict

func (ec *EventCreate) OnConflict(opts ...sql.ConflictOption) *EventUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Event.Create().
	SetFrom(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.EventUpsert) {
		SetFrom(v+v).
	}).
	Exec(ctx)

func (*EventCreate) OnConflictColumns

func (ec *EventCreate) OnConflictColumns(columns ...string) *EventUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Event.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*EventCreate) Save

func (ec *EventCreate) Save(ctx context.Context) (*Event, error)

Save creates the Event in the database.

func (*EventCreate) SaveX

func (ec *EventCreate) SaveX(ctx context.Context) *Event

SaveX calls Save and panics if Save returns an error.

func (*EventCreate) SetData

func (ec *EventCreate) SetData(t []*types.Felt) *EventCreate

SetData sets the "data" field.

func (*EventCreate) SetFrom

func (ec *EventCreate) SetFrom(s string) *EventCreate

SetFrom sets the "from" field.

func (*EventCreate) SetID

func (ec *EventCreate) SetID(s string) *EventCreate

SetID sets the "id" field.

func (*EventCreate) SetKeys

func (ec *EventCreate) SetKeys(t []*types.Felt) *EventCreate

SetKeys sets the "keys" field.

func (*EventCreate) SetNillableTransactionID

func (ec *EventCreate) SetNillableTransactionID(id *string) *EventCreate

SetNillableTransactionID sets the "transaction" edge to the Transaction entity by ID if the given value is not nil.

func (*EventCreate) SetTransaction

func (ec *EventCreate) SetTransaction(t *Transaction) *EventCreate

SetTransaction sets the "transaction" edge to the Transaction entity.

func (*EventCreate) SetTransactionID

func (ec *EventCreate) SetTransactionID(id string) *EventCreate

SetTransactionID sets the "transaction" edge to the Transaction entity by ID.

type EventCreateBulk

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

EventCreateBulk is the builder for creating many Event entities in bulk.

func (*EventCreateBulk) Exec

func (ecb *EventCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EventCreateBulk) ExecX

func (ecb *EventCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventCreateBulk) OnConflict

func (ecb *EventCreateBulk) OnConflict(opts ...sql.ConflictOption) *EventUpsertBulk

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Event.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.EventUpsert) {
		SetFrom(v+v).
	}).
	Exec(ctx)

func (*EventCreateBulk) OnConflictColumns

func (ecb *EventCreateBulk) OnConflictColumns(columns ...string) *EventUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Event.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*EventCreateBulk) Save

func (ecb *EventCreateBulk) Save(ctx context.Context) ([]*Event, error)

Save creates the Event entities in the database.

func (*EventCreateBulk) SaveX

func (ecb *EventCreateBulk) SaveX(ctx context.Context) []*Event

SaveX is like Save, but panics if an error occurs.

type EventDelete

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

EventDelete is the builder for deleting a Event entity.

func (*EventDelete) Exec

func (ed *EventDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*EventDelete) ExecX

func (ed *EventDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*EventDelete) Where

func (ed *EventDelete) Where(ps ...predicate.Event) *EventDelete

Where appends a list predicates to the EventDelete builder.

type EventDeleteOne

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

EventDeleteOne is the builder for deleting a single Event entity.

func (*EventDeleteOne) Exec

func (edo *EventDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*EventDeleteOne) ExecX

func (edo *EventDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type EventEdge

type EventEdge struct {
	Node   *Event `json:"node"`
	Cursor Cursor `json:"cursor"`
}

EventEdge is the edge representation of Event.

type EventEdges

type EventEdges struct {
	// Transaction holds the value of the transaction edge.
	Transaction *Transaction `json:"transaction,omitempty"`
	// contains filtered or unexported fields
}

EventEdges holds the relations/edges for other nodes in the graph.

func (EventEdges) TransactionOrErr

func (e EventEdges) TransactionOrErr() (*Transaction, error)

TransactionOrErr returns the Transaction value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type EventGroupBy

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

EventGroupBy is the group-by builder for Event entities.

func (*EventGroupBy) Aggregate

func (egb *EventGroupBy) Aggregate(fns ...AggregateFunc) *EventGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*EventGroupBy) Bool

func (s *EventGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) BoolX

func (s *EventGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EventGroupBy) Bools

func (s *EventGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) BoolsX

func (s *EventGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EventGroupBy) Float64

func (s *EventGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) Float64X

func (s *EventGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EventGroupBy) Float64s

func (s *EventGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) Float64sX

func (s *EventGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EventGroupBy) Int

func (s *EventGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) IntX

func (s *EventGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EventGroupBy) Ints

func (s *EventGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) IntsX

func (s *EventGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EventGroupBy) Scan

func (egb *EventGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*EventGroupBy) ScanX

func (s *EventGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*EventGroupBy) String

func (s *EventGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) StringX

func (s *EventGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EventGroupBy) Strings

func (s *EventGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EventGroupBy) StringsX

func (s *EventGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EventMutation

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

EventMutation represents an operation that mutates the Event nodes in the graph.

func (*EventMutation) AddField

func (m *EventMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*EventMutation) AddedEdges

func (m *EventMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*EventMutation) AddedField

func (m *EventMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*EventMutation) AddedFields

func (m *EventMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*EventMutation) AddedIDs

func (m *EventMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*EventMutation) ClearEdge

func (m *EventMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*EventMutation) ClearField

func (m *EventMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*EventMutation) ClearTransaction

func (m *EventMutation) ClearTransaction()

ClearTransaction clears the "transaction" edge to the Transaction entity.

func (*EventMutation) ClearedEdges

func (m *EventMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*EventMutation) ClearedFields

func (m *EventMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (EventMutation) Client

func (m EventMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*EventMutation) Data

func (m *EventMutation) Data() (r []*types.Felt, exists bool)

Data returns the value of the "data" field in the mutation.

func (*EventMutation) EdgeCleared

func (m *EventMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*EventMutation) Field

func (m *EventMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*EventMutation) FieldCleared

func (m *EventMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*EventMutation) Fields

func (m *EventMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*EventMutation) From

func (m *EventMutation) From() (r string, exists bool)

From returns the value of the "from" field in the mutation.

func (*EventMutation) ID

func (m *EventMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*EventMutation) IDs

func (m *EventMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*EventMutation) Keys

func (m *EventMutation) Keys() (r []*types.Felt, exists bool)

Keys returns the value of the "keys" field in the mutation.

func (*EventMutation) OldData

func (m *EventMutation) OldData(ctx context.Context) (v []*types.Felt, err error)

OldData returns the old "data" field's value of the Event entity. If the Event object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EventMutation) OldField

func (m *EventMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*EventMutation) OldFrom

func (m *EventMutation) OldFrom(ctx context.Context) (v string, err error)

OldFrom returns the old "from" field's value of the Event entity. If the Event object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EventMutation) OldKeys

func (m *EventMutation) OldKeys(ctx context.Context) (v []*types.Felt, err error)

OldKeys returns the old "keys" field's value of the Event entity. If the Event object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*EventMutation) Op

func (m *EventMutation) Op() Op

Op returns the operation name.

func (*EventMutation) RemovedEdges

func (m *EventMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*EventMutation) RemovedIDs

func (m *EventMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*EventMutation) ResetData

func (m *EventMutation) ResetData()

ResetData resets all changes to the "data" field.

func (*EventMutation) ResetEdge

func (m *EventMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*EventMutation) ResetField

func (m *EventMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*EventMutation) ResetFrom

func (m *EventMutation) ResetFrom()

ResetFrom resets all changes to the "from" field.

func (*EventMutation) ResetKeys

func (m *EventMutation) ResetKeys()

ResetKeys resets all changes to the "keys" field.

func (*EventMutation) ResetTransaction

func (m *EventMutation) ResetTransaction()

ResetTransaction resets all changes to the "transaction" edge.

func (*EventMutation) SetData

func (m *EventMutation) SetData(t []*types.Felt)

SetData sets the "data" field.

func (*EventMutation) SetField

func (m *EventMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*EventMutation) SetFrom

func (m *EventMutation) SetFrom(s string)

SetFrom sets the "from" field.

func (*EventMutation) SetID

func (m *EventMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Event entities.

func (*EventMutation) SetKeys

func (m *EventMutation) SetKeys(t []*types.Felt)

SetKeys sets the "keys" field.

func (*EventMutation) SetTransactionID

func (m *EventMutation) SetTransactionID(id string)

SetTransactionID sets the "transaction" edge to the Transaction entity by id.

func (*EventMutation) TransactionCleared

func (m *EventMutation) TransactionCleared() bool

TransactionCleared reports if the "transaction" edge to the Transaction entity was cleared.

func (*EventMutation) TransactionID

func (m *EventMutation) TransactionID() (id string, exists bool)

TransactionID returns the "transaction" edge ID in the mutation.

func (*EventMutation) TransactionIDs

func (m *EventMutation) TransactionIDs() (ids []string)

TransactionIDs returns the "transaction" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TransactionID instead. It exists only for internal usage by the builders.

func (EventMutation) Tx

func (m EventMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*EventMutation) Type

func (m *EventMutation) Type() string

Type returns the node type of this mutation (Event).

func (*EventMutation) Where

func (m *EventMutation) Where(ps ...predicate.Event)

Where appends a list predicates to the EventMutation builder.

type EventOrder

type EventOrder struct {
	Direction OrderDirection   `json:"direction"`
	Field     *EventOrderField `json:"field"`
}

EventOrder defines the ordering of Event.

type EventOrderField

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

EventOrderField defines the ordering field of Event.

type EventPaginateOption

type EventPaginateOption func(*eventPager) error

EventPaginateOption enables pagination customization.

func WithEventFilter

func WithEventFilter(filter func(*EventQuery) (*EventQuery, error)) EventPaginateOption

WithEventFilter configures pagination filter.

func WithEventOrder

func WithEventOrder(order *EventOrder) EventPaginateOption

WithEventOrder configures pagination ordering.

type EventQuery

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

EventQuery is the builder for querying Event entities.

func (*EventQuery) All

func (eq *EventQuery) All(ctx context.Context) ([]*Event, error)

All executes the query and returns a list of Events.

func (*EventQuery) AllX

func (eq *EventQuery) AllX(ctx context.Context) []*Event

AllX is like All, but panics if an error occurs.

func (*EventQuery) Clone

func (eq *EventQuery) Clone() *EventQuery

Clone returns a duplicate of the EventQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*EventQuery) CollectFields

func (e *EventQuery) CollectFields(ctx context.Context, satisfies ...string) (*EventQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*EventQuery) Count

func (eq *EventQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*EventQuery) CountX

func (eq *EventQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*EventQuery) Exist

func (eq *EventQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*EventQuery) ExistX

func (eq *EventQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*EventQuery) First

func (eq *EventQuery) First(ctx context.Context) (*Event, error)

First returns the first Event entity from the query. Returns a *NotFoundError when no Event was found.

func (*EventQuery) FirstID

func (eq *EventQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Event ID from the query. Returns a *NotFoundError when no Event ID was found.

func (*EventQuery) FirstIDX

func (eq *EventQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*EventQuery) FirstX

func (eq *EventQuery) FirstX(ctx context.Context) *Event

FirstX is like First, but panics if an error occurs.

func (*EventQuery) GroupBy

func (eq *EventQuery) GroupBy(field string, fields ...string) *EventGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	From string `json:"from,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Event.Query().
	GroupBy(event.FieldFrom).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*EventQuery) IDs

func (eq *EventQuery) IDs(ctx context.Context) ([]string, error)

IDs executes the query and returns a list of Event IDs.

func (*EventQuery) IDsX

func (eq *EventQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*EventQuery) Limit

func (eq *EventQuery) Limit(limit int) *EventQuery

Limit adds a limit step to the query.

func (*EventQuery) Offset

func (eq *EventQuery) Offset(offset int) *EventQuery

Offset adds an offset step to the query.

func (*EventQuery) Only

func (eq *EventQuery) Only(ctx context.Context) (*Event, error)

Only returns a single Event entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Event entity is found. Returns a *NotFoundError when no Event entities are found.

func (*EventQuery) OnlyID

func (eq *EventQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Event ID in the query. Returns a *NotSingularError when more than one Event ID is found. Returns a *NotFoundError when no entities are found.

func (*EventQuery) OnlyIDX

func (eq *EventQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*EventQuery) OnlyX

func (eq *EventQuery) OnlyX(ctx context.Context) *Event

OnlyX is like Only, but panics if an error occurs.

func (*EventQuery) Order

func (eq *EventQuery) Order(o ...OrderFunc) *EventQuery

Order adds an order step to the query.

func (*EventQuery) Paginate

func (e *EventQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...EventPaginateOption,
) (*EventConnection, error)

Paginate executes the query and returns a relay based cursor connection to Event.

func (*EventQuery) QueryTransaction

func (eq *EventQuery) QueryTransaction() *TransactionQuery

QueryTransaction chains the current query on the "transaction" edge.

func (*EventQuery) Select

func (eq *EventQuery) Select(fields ...string) *EventSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	From string `json:"from,omitempty"`
}

client.Event.Query().
	Select(event.FieldFrom).
	Scan(ctx, &v)

func (*EventQuery) Unique

func (eq *EventQuery) Unique(unique bool) *EventQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*EventQuery) Where

func (eq *EventQuery) Where(ps ...predicate.Event) *EventQuery

Where adds a new predicate for the EventQuery builder.

func (*EventQuery) WithTransaction

func (eq *EventQuery) WithTransaction(opts ...func(*TransactionQuery)) *EventQuery

WithTransaction tells the query-builder to eager-load the nodes that are connected to the "transaction" edge. The optional arguments are used to configure the query builder of the edge.

type EventSelect

type EventSelect struct {
	*EventQuery
	// contains filtered or unexported fields
}

EventSelect is the builder for selecting fields of Event entities.

func (*EventSelect) Bool

func (s *EventSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*EventSelect) BoolX

func (s *EventSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*EventSelect) Bools

func (s *EventSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*EventSelect) BoolsX

func (s *EventSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*EventSelect) Float64

func (s *EventSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*EventSelect) Float64X

func (s *EventSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*EventSelect) Float64s

func (s *EventSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*EventSelect) Float64sX

func (s *EventSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*EventSelect) Int

func (s *EventSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*EventSelect) IntX

func (s *EventSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*EventSelect) Ints

func (s *EventSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*EventSelect) IntsX

func (s *EventSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*EventSelect) Scan

func (es *EventSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*EventSelect) ScanX

func (s *EventSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*EventSelect) String

func (s *EventSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*EventSelect) StringX

func (s *EventSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*EventSelect) Strings

func (s *EventSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*EventSelect) StringsX

func (s *EventSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type EventUpdate

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

EventUpdate is the builder for updating Event entities.

func (*EventUpdate) ClearTransaction

func (eu *EventUpdate) ClearTransaction() *EventUpdate

ClearTransaction clears the "transaction" edge to the Transaction entity.

func (*EventUpdate) Exec

func (eu *EventUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*EventUpdate) ExecX

func (eu *EventUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventUpdate) Mutation

func (eu *EventUpdate) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdate) Save

func (eu *EventUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*EventUpdate) SaveX

func (eu *EventUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*EventUpdate) SetData

func (eu *EventUpdate) SetData(t []*types.Felt) *EventUpdate

SetData sets the "data" field.

func (*EventUpdate) SetFrom

func (eu *EventUpdate) SetFrom(s string) *EventUpdate

SetFrom sets the "from" field.

func (*EventUpdate) SetKeys

func (eu *EventUpdate) SetKeys(t []*types.Felt) *EventUpdate

SetKeys sets the "keys" field.

func (*EventUpdate) SetNillableTransactionID

func (eu *EventUpdate) SetNillableTransactionID(id *string) *EventUpdate

SetNillableTransactionID sets the "transaction" edge to the Transaction entity by ID if the given value is not nil.

func (*EventUpdate) SetTransaction

func (eu *EventUpdate) SetTransaction(t *Transaction) *EventUpdate

SetTransaction sets the "transaction" edge to the Transaction entity.

func (*EventUpdate) SetTransactionID

func (eu *EventUpdate) SetTransactionID(id string) *EventUpdate

SetTransactionID sets the "transaction" edge to the Transaction entity by ID.

func (*EventUpdate) Where

func (eu *EventUpdate) Where(ps ...predicate.Event) *EventUpdate

Where appends a list predicates to the EventUpdate builder.

type EventUpdateOne

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

EventUpdateOne is the builder for updating a single Event entity.

func (*EventUpdateOne) ClearTransaction

func (euo *EventUpdateOne) ClearTransaction() *EventUpdateOne

ClearTransaction clears the "transaction" edge to the Transaction entity.

func (*EventUpdateOne) Exec

func (euo *EventUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*EventUpdateOne) ExecX

func (euo *EventUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventUpdateOne) Mutation

func (euo *EventUpdateOne) Mutation() *EventMutation

Mutation returns the EventMutation object of the builder.

func (*EventUpdateOne) Save

func (euo *EventUpdateOne) Save(ctx context.Context) (*Event, error)

Save executes the query and returns the updated Event entity.

func (*EventUpdateOne) SaveX

func (euo *EventUpdateOne) SaveX(ctx context.Context) *Event

SaveX is like Save, but panics if an error occurs.

func (*EventUpdateOne) Select

func (euo *EventUpdateOne) Select(field string, fields ...string) *EventUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*EventUpdateOne) SetData

func (euo *EventUpdateOne) SetData(t []*types.Felt) *EventUpdateOne

SetData sets the "data" field.

func (*EventUpdateOne) SetFrom

func (euo *EventUpdateOne) SetFrom(s string) *EventUpdateOne

SetFrom sets the "from" field.

func (*EventUpdateOne) SetKeys

func (euo *EventUpdateOne) SetKeys(t []*types.Felt) *EventUpdateOne

SetKeys sets the "keys" field.

func (*EventUpdateOne) SetNillableTransactionID

func (euo *EventUpdateOne) SetNillableTransactionID(id *string) *EventUpdateOne

SetNillableTransactionID sets the "transaction" edge to the Transaction entity by ID if the given value is not nil.

func (*EventUpdateOne) SetTransaction

func (euo *EventUpdateOne) SetTransaction(t *Transaction) *EventUpdateOne

SetTransaction sets the "transaction" edge to the Transaction entity.

func (*EventUpdateOne) SetTransactionID

func (euo *EventUpdateOne) SetTransactionID(id string) *EventUpdateOne

SetTransactionID sets the "transaction" edge to the Transaction entity by ID.

type EventUpsert

type EventUpsert struct {
	*sql.UpdateSet
}

EventUpsert is the "OnConflict" setter.

func (*EventUpsert) SetData

func (u *EventUpsert) SetData(v []*types.Felt) *EventUpsert

SetData sets the "data" field.

func (*EventUpsert) SetFrom

func (u *EventUpsert) SetFrom(v string) *EventUpsert

SetFrom sets the "from" field.

func (*EventUpsert) SetKeys

func (u *EventUpsert) SetKeys(v []*types.Felt) *EventUpsert

SetKeys sets the "keys" field.

func (*EventUpsert) UpdateData

func (u *EventUpsert) UpdateData() *EventUpsert

UpdateData sets the "data" field to the value that was provided on create.

func (*EventUpsert) UpdateFrom

func (u *EventUpsert) UpdateFrom() *EventUpsert

UpdateFrom sets the "from" field to the value that was provided on create.

func (*EventUpsert) UpdateKeys

func (u *EventUpsert) UpdateKeys() *EventUpsert

UpdateKeys sets the "keys" field to the value that was provided on create.

type EventUpsertBulk

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

EventUpsertBulk is the builder for "upsert"-ing a bulk of Event nodes.

func (*EventUpsertBulk) DoNothing

func (u *EventUpsertBulk) DoNothing() *EventUpsertBulk

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*EventUpsertBulk) Exec

func (u *EventUpsertBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*EventUpsertBulk) ExecX

func (u *EventUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventUpsertBulk) Ignore

func (u *EventUpsertBulk) Ignore() *EventUpsertBulk

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Event.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*EventUpsertBulk) SetData

func (u *EventUpsertBulk) SetData(v []*types.Felt) *EventUpsertBulk

SetData sets the "data" field.

func (*EventUpsertBulk) SetFrom

func (u *EventUpsertBulk) SetFrom(v string) *EventUpsertBulk

SetFrom sets the "from" field.

func (*EventUpsertBulk) SetKeys

func (u *EventUpsertBulk) SetKeys(v []*types.Felt) *EventUpsertBulk

SetKeys sets the "keys" field.

func (*EventUpsertBulk) Update

func (u *EventUpsertBulk) Update(set func(*EventUpsert)) *EventUpsertBulk

Update allows overriding fields `UPDATE` values. See the EventCreateBulk.OnConflict documentation for more info.

func (*EventUpsertBulk) UpdateData

func (u *EventUpsertBulk) UpdateData() *EventUpsertBulk

UpdateData sets the "data" field to the value that was provided on create.

func (*EventUpsertBulk) UpdateFrom

func (u *EventUpsertBulk) UpdateFrom() *EventUpsertBulk

UpdateFrom sets the "from" field to the value that was provided on create.

func (*EventUpsertBulk) UpdateKeys

func (u *EventUpsertBulk) UpdateKeys() *EventUpsertBulk

UpdateKeys sets the "keys" field to the value that was provided on create.

func (*EventUpsertBulk) UpdateNewValues

func (u *EventUpsertBulk) UpdateNewValues() *EventUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Event.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(event.FieldID)
		}),
	).
	Exec(ctx)

type EventUpsertOne

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

EventUpsertOne is the builder for "upsert"-ing

one Event node.

func (*EventUpsertOne) DoNothing

func (u *EventUpsertOne) DoNothing() *EventUpsertOne

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*EventUpsertOne) Exec

func (u *EventUpsertOne) Exec(ctx context.Context) error

Exec executes the query.

func (*EventUpsertOne) ExecX

func (u *EventUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*EventUpsertOne) ID

func (u *EventUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*EventUpsertOne) IDX

func (u *EventUpsertOne) IDX(ctx context.Context) string

IDX is like ID, but panics if an error occurs.

func (*EventUpsertOne) Ignore

func (u *EventUpsertOne) Ignore() *EventUpsertOne

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Event.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*EventUpsertOne) SetData

func (u *EventUpsertOne) SetData(v []*types.Felt) *EventUpsertOne

SetData sets the "data" field.

func (*EventUpsertOne) SetFrom

func (u *EventUpsertOne) SetFrom(v string) *EventUpsertOne

SetFrom sets the "from" field.

func (*EventUpsertOne) SetKeys

func (u *EventUpsertOne) SetKeys(v []*types.Felt) *EventUpsertOne

SetKeys sets the "keys" field.

func (*EventUpsertOne) Update

func (u *EventUpsertOne) Update(set func(*EventUpsert)) *EventUpsertOne

Update allows overriding fields `UPDATE` values. See the EventCreate.OnConflict documentation for more info.

func (*EventUpsertOne) UpdateData

func (u *EventUpsertOne) UpdateData() *EventUpsertOne

UpdateData sets the "data" field to the value that was provided on create.

func (*EventUpsertOne) UpdateFrom

func (u *EventUpsertOne) UpdateFrom() *EventUpsertOne

UpdateFrom sets the "from" field to the value that was provided on create.

func (*EventUpsertOne) UpdateKeys

func (u *EventUpsertOne) UpdateKeys() *EventUpsertOne

UpdateKeys sets the "keys" field to the value that was provided on create.

func (*EventUpsertOne) UpdateNewValues

func (u *EventUpsertOne) UpdateNewValues() *EventUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Event.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(event.FieldID)
		}),
	).
	Exec(ctx)

type EventWhereInput

type EventWhereInput struct {
	Not *EventWhereInput   `json:"not,omitempty"`
	Or  []*EventWhereInput `json:"or,omitempty"`
	And []*EventWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *string  `json:"id,omitempty"`
	IDNEQ   *string  `json:"idNEQ,omitempty"`
	IDIn    []string `json:"idIn,omitempty"`
	IDNotIn []string `json:"idNotIn,omitempty"`
	IDGT    *string  `json:"idGT,omitempty"`
	IDGTE   *string  `json:"idGTE,omitempty"`
	IDLT    *string  `json:"idLT,omitempty"`
	IDLTE   *string  `json:"idLTE,omitempty"`

	// "from" field predicates.
	From             *string  `json:"from,omitempty"`
	FromNEQ          *string  `json:"fromNEQ,omitempty"`
	FromIn           []string `json:"fromIn,omitempty"`
	FromNotIn        []string `json:"fromNotIn,omitempty"`
	FromGT           *string  `json:"fromGT,omitempty"`
	FromGTE          *string  `json:"fromGTE,omitempty"`
	FromLT           *string  `json:"fromLT,omitempty"`
	FromLTE          *string  `json:"fromLTE,omitempty"`
	FromContains     *string  `json:"fromContains,omitempty"`
	FromHasPrefix    *string  `json:"fromHasPrefix,omitempty"`
	FromHasSuffix    *string  `json:"fromHasSuffix,omitempty"`
	FromEqualFold    *string  `json:"fromEqualFold,omitempty"`
	FromContainsFold *string  `json:"fromContainsFold,omitempty"`

	// "transaction" edge predicates.
	HasTransaction     *bool                    `json:"hasTransaction,omitempty"`
	HasTransactionWith []*TransactionWhereInput `json:"hasTransactionWith,omitempty"`
}

EventWhereInput represents a where input for filtering Event queries.

func (*EventWhereInput) Filter

func (i *EventWhereInput) Filter(q *EventQuery) (*EventQuery, error)

Filter applies the EventWhereInput filter on the EventQuery builder.

func (*EventWhereInput) P

P returns a predicate for filtering events. An error is returned if the input is empty or invalid.

type Events

type Events []*Event

Events is a parsable slice of Event.

type Field

type Field struct {
	Type  string `json:"type,omitempty"`  // field type.
	Name  string `json:"name,omitempty"`  // field name (as in struct).
	Value string `json:"value,omitempty"` // stringified value.
}

Field of a node.

type Hook

type Hook = ent.Hook

ent aliases to avoid import conflicts in user's code.

type MutateFunc

type MutateFunc = ent.MutateFunc

ent aliases to avoid import conflicts in user's code.

type Mutation

type Mutation = ent.Mutation

ent aliases to avoid import conflicts in user's code.

type Mutator

type Mutator = ent.Mutator

ent aliases to avoid import conflicts in user's code.

type Node

type Node struct {
	ID     string   `json:"id,omitempty"`     // node id.
	Type   string   `json:"type,omitempty"`   // node type.
	Fields []*Field `json:"fields,omitempty"` // node fields.
	Edges  []*Edge  `json:"edges,omitempty"`  // node edges.
}

Node in the graph.

type NodeOption

type NodeOption func(*nodeOptions)

NodeOption allows configuring the Noder execution using functional options.

func WithFixedNodeType

func WithFixedNodeType(t string) NodeOption

WithFixedNodeType sets the Type of the node to a fixed value.

func WithNodeType

func WithNodeType(f func(context.Context, string) (string, error)) NodeOption

WithNodeType sets the node Type resolver function (i.e. the table to query). If was not provided, the table will be derived from the universal-id configuration as described in: https://entgo.io/docs/migrate/#universal-ids.

type Noder

type Noder interface {
	Node(context.Context) (*Node, error)
}

Noder wraps the basic Node method.

type NotFoundError

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

NotFoundError returns when trying to fetch a specific entity and it was not found in the database.

func (*NotFoundError) Error

func (e *NotFoundError) Error() string

Error implements the error interface.

type NotLoadedError

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

NotLoadedError returns when trying to get a node that was not loaded by the query.

func (*NotLoadedError) Error

func (e *NotLoadedError) Error() string

Error implements the error interface.

type NotSingularError

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

NotSingularError returns when trying to fetch a singular entity and more then one was found in the database.

func (*NotSingularError) Error

func (e *NotSingularError) Error() string

Error implements the error interface.

type Op

type Op = ent.Op

ent aliases to avoid import conflicts in user's code.

type Option

type Option func(*config)

Option function to configure the client.

func Debug

func Debug() Option

Debug enables debug logging on the ent.Driver.

func Driver

func Driver(driver dialect.Driver) Option

Driver configures the client driver.

func Log

func Log(fn func(...interface{})) Option

Log sets the logging function for debug mode.

type OrderDirection

type OrderDirection string

OrderDirection defines the directions in which to order a list of items.

const (
	// OrderDirectionAsc specifies an ascending order.
	OrderDirectionAsc OrderDirection = "ASC"
	// OrderDirectionDesc specifies a descending order.
	OrderDirectionDesc OrderDirection = "DESC"
)

func (OrderDirection) MarshalGQL

func (o OrderDirection) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (OrderDirection) String

func (o OrderDirection) String() string

String implements fmt.Stringer interface.

func (*OrderDirection) UnmarshalGQL

func (o *OrderDirection) UnmarshalGQL(val interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

func (OrderDirection) Validate

func (o OrderDirection) Validate() error

Validate the order direction value.

type OrderFunc

type OrderFunc func(*sql.Selector)

OrderFunc applies an ordering on the sql selector.

func Asc

func Asc(fields ...string) OrderFunc

Asc applies the given fields in ASC order.

func Desc

func Desc(fields ...string) OrderFunc

Desc applies the given fields in DESC order.

type PageInfo

type PageInfo struct {
	HasNextPage     bool    `json:"hasNextPage"`
	HasPreviousPage bool    `json:"hasPreviousPage"`
	StartCursor     *Cursor `json:"startCursor"`
	EndCursor       *Cursor `json:"endCursor"`
}

PageInfo of a connection type.

type Policy

type Policy = ent.Policy

ent aliases to avoid import conflicts in user's code.

type Query

type Query = ent.Query

ent aliases to avoid import conflicts in user's code.

type RollbackFunc

type RollbackFunc func(context.Context, *Tx) error

The RollbackFunc type is an adapter to allow the use of ordinary function as a Rollbacker. If f is a function with the appropriate signature, RollbackFunc(f) is a Rollbacker that calls f.

func (RollbackFunc) Rollback

func (f RollbackFunc) Rollback(ctx context.Context, tx *Tx) error

Rollback calls f(ctx, m).

type RollbackHook

type RollbackHook func(Rollbacker) Rollbacker

RollbackHook defines the "rollback middleware". A function that gets a Rollbacker and returns a Rollbacker. For example:

hook := func(next ent.Rollbacker) ent.Rollbacker {
	return ent.RollbackFunc(func(ctx context.Context, tx *ent.Tx) error {
		// Do some stuff before.
		if err := next.Rollback(ctx, tx); err != nil {
			return err
		}
		// Do some stuff after.
		return nil
	})
}

type Rollbacker

type Rollbacker interface {
	Rollback(context.Context, *Tx) error
}

Rollbacker is the interface that wraps the Rollback method.

type Transaction

type Transaction struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// ContractAddress holds the value of the "contract_address" field.
	ContractAddress string `json:"contract_address,omitempty"`
	// EntryPointSelector holds the value of the "entry_point_selector" field.
	EntryPointSelector string `json:"entry_point_selector,omitempty"`
	// TransactionHash holds the value of the "transaction_hash" field.
	TransactionHash string `json:"transaction_hash,omitempty"`
	// Calldata holds the value of the "calldata" field.
	Calldata []string `json:"calldata,omitempty"`
	// Signature holds the value of the "signature" field.
	Signature []string `json:"signature,omitempty"`
	// Nonce holds the value of the "nonce" field.
	Nonce string `json:"nonce,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TransactionQuery when eager-loading is set.
	Edges TransactionEdges `json:"edges"`
	// contains filtered or unexported fields
}

Transaction is the model entity for the Transaction schema.

func (*Transaction) Block

func (t *Transaction) Block(ctx context.Context) (*Block, error)

func (*Transaction) Events

func (t *Transaction) Events(ctx context.Context) ([]*Event, error)

func (*Transaction) Node

func (t *Transaction) Node(ctx context.Context) (node *Node, err error)

func (*Transaction) QueryBlock

func (t *Transaction) QueryBlock() *BlockQuery

QueryBlock queries the "block" edge of the Transaction entity.

func (*Transaction) QueryEvents

func (t *Transaction) QueryEvents() *EventQuery

QueryEvents queries the "events" edge of the Transaction entity.

func (*Transaction) QueryReceipt

func (t *Transaction) QueryReceipt() *TransactionReceiptQuery

QueryReceipt queries the "receipt" edge of the Transaction entity.

func (*Transaction) Receipt

func (t *Transaction) Receipt(ctx context.Context) (*TransactionReceipt, error)

func (*Transaction) String

func (t *Transaction) String() string

String implements the fmt.Stringer.

func (*Transaction) ToEdge

func (t *Transaction) ToEdge(order *TransactionOrder) *TransactionEdge

ToEdge converts Transaction into TransactionEdge.

func (*Transaction) Unwrap

func (t *Transaction) Unwrap() *Transaction

Unwrap unwraps the Transaction entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*Transaction) Update

func (t *Transaction) Update() *TransactionUpdateOne

Update returns a builder for updating this Transaction. Note that you need to call Transaction.Unwrap() before calling this method if this Transaction was returned from a transaction, and the transaction was committed or rolled back.

type TransactionClient

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

TransactionClient is a client for the Transaction schema.

func NewTransactionClient

func NewTransactionClient(c config) *TransactionClient

NewTransactionClient returns a client for the Transaction from the given config.

func (*TransactionClient) Create

func (c *TransactionClient) Create() *TransactionCreate

Create returns a builder for creating a Transaction entity.

func (*TransactionClient) CreateBulk

func (c *TransactionClient) CreateBulk(builders ...*TransactionCreate) *TransactionCreateBulk

CreateBulk returns a builder for creating a bulk of Transaction entities.

func (*TransactionClient) Delete

func (c *TransactionClient) Delete() *TransactionDelete

Delete returns a delete builder for Transaction.

func (*TransactionClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TransactionClient) DeleteOneID

func (c *TransactionClient) DeleteOneID(id string) *TransactionDeleteOne

DeleteOne returns a builder for deleting the given entity by its id.

func (*TransactionClient) Get

Get returns a Transaction entity by its id.

func (*TransactionClient) GetX

GetX is like Get, but panics if an error occurs.

func (*TransactionClient) Hooks

func (c *TransactionClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TransactionClient) Query

func (c *TransactionClient) Query() *TransactionQuery

Query returns a query builder for Transaction.

func (*TransactionClient) QueryBlock

func (c *TransactionClient) QueryBlock(t *Transaction) *BlockQuery

QueryBlock queries the block edge of a Transaction.

func (*TransactionClient) QueryEvents

func (c *TransactionClient) QueryEvents(t *Transaction) *EventQuery

QueryEvents queries the events edge of a Transaction.

func (*TransactionClient) QueryReceipt

QueryReceipt queries the receipt edge of a Transaction.

func (*TransactionClient) Update

func (c *TransactionClient) Update() *TransactionUpdate

Update returns an update builder for Transaction.

func (*TransactionClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TransactionClient) UpdateOneID

func (c *TransactionClient) UpdateOneID(id string) *TransactionUpdateOne

UpdateOneID returns an update builder for the given id.

func (*TransactionClient) Use

func (c *TransactionClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `transaction.Hooks(f(g(h())))`.

type TransactionConnection

type TransactionConnection struct {
	Edges      []*TransactionEdge `json:"edges"`
	PageInfo   PageInfo           `json:"pageInfo"`
	TotalCount int                `json:"totalCount"`
}

TransactionConnection is the connection containing edges to Transaction.

type TransactionCreate

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

TransactionCreate is the builder for creating a Transaction entity.

func (*TransactionCreate) AddEventIDs

func (tc *TransactionCreate) AddEventIDs(ids ...string) *TransactionCreate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*TransactionCreate) AddEvents

func (tc *TransactionCreate) AddEvents(e ...*Event) *TransactionCreate

AddEvents adds the "events" edges to the Event entity.

func (*TransactionCreate) Exec

func (tc *TransactionCreate) Exec(ctx context.Context) error

Exec executes the query.

func (*TransactionCreate) ExecX

func (tc *TransactionCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionCreate) Mutation

func (tc *TransactionCreate) Mutation() *TransactionMutation

Mutation returns the TransactionMutation object of the builder.

func (*TransactionCreate) OnConflict

func (tc *TransactionCreate) OnConflict(opts ...sql.ConflictOption) *TransactionUpsertOne

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Transaction.Create().
	SetContractAddress(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TransactionUpsert) {
		SetContractAddress(v+v).
	}).
	Exec(ctx)

func (*TransactionCreate) OnConflictColumns

func (tc *TransactionCreate) OnConflictColumns(columns ...string) *TransactionUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Transaction.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TransactionCreate) Save

Save creates the Transaction in the database.

func (*TransactionCreate) SaveX

func (tc *TransactionCreate) SaveX(ctx context.Context) *Transaction

SaveX calls Save and panics if Save returns an error.

func (*TransactionCreate) SetBlock

func (tc *TransactionCreate) SetBlock(b *Block) *TransactionCreate

SetBlock sets the "block" edge to the Block entity.

func (*TransactionCreate) SetBlockID

func (tc *TransactionCreate) SetBlockID(id string) *TransactionCreate

SetBlockID sets the "block" edge to the Block entity by ID.

func (*TransactionCreate) SetCalldata

func (tc *TransactionCreate) SetCalldata(s []string) *TransactionCreate

SetCalldata sets the "calldata" field.

func (*TransactionCreate) SetContractAddress

func (tc *TransactionCreate) SetContractAddress(s string) *TransactionCreate

SetContractAddress sets the "contract_address" field.

func (*TransactionCreate) SetEntryPointSelector

func (tc *TransactionCreate) SetEntryPointSelector(s string) *TransactionCreate

SetEntryPointSelector sets the "entry_point_selector" field.

func (*TransactionCreate) SetID

SetID sets the "id" field.

func (*TransactionCreate) SetNillableBlockID

func (tc *TransactionCreate) SetNillableBlockID(id *string) *TransactionCreate

SetNillableBlockID sets the "block" edge to the Block entity by ID if the given value is not nil.

func (*TransactionCreate) SetNillableEntryPointSelector

func (tc *TransactionCreate) SetNillableEntryPointSelector(s *string) *TransactionCreate

SetNillableEntryPointSelector sets the "entry_point_selector" field if the given value is not nil.

func (*TransactionCreate) SetNillableNonce

func (tc *TransactionCreate) SetNillableNonce(s *string) *TransactionCreate

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*TransactionCreate) SetNillableReceiptID

func (tc *TransactionCreate) SetNillableReceiptID(id *string) *TransactionCreate

SetNillableReceiptID sets the "receipt" edge to the TransactionReceipt entity by ID if the given value is not nil.

func (*TransactionCreate) SetNonce

func (tc *TransactionCreate) SetNonce(s string) *TransactionCreate

SetNonce sets the "nonce" field.

func (*TransactionCreate) SetReceipt

SetReceipt sets the "receipt" edge to the TransactionReceipt entity.

func (*TransactionCreate) SetReceiptID

func (tc *TransactionCreate) SetReceiptID(id string) *TransactionCreate

SetReceiptID sets the "receipt" edge to the TransactionReceipt entity by ID.

func (*TransactionCreate) SetSignature

func (tc *TransactionCreate) SetSignature(s []string) *TransactionCreate

SetSignature sets the "signature" field.

func (*TransactionCreate) SetTransactionHash

func (tc *TransactionCreate) SetTransactionHash(s string) *TransactionCreate

SetTransactionHash sets the "transaction_hash" field.

type TransactionCreateBulk

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

TransactionCreateBulk is the builder for creating many Transaction entities in bulk.

func (*TransactionCreateBulk) Exec

func (tcb *TransactionCreateBulk) Exec(ctx context.Context) error

Exec executes the query.

func (*TransactionCreateBulk) ExecX

func (tcb *TransactionCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.Transaction.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TransactionUpsert) {
		SetContractAddress(v+v).
	}).
	Exec(ctx)

func (*TransactionCreateBulk) OnConflictColumns

func (tcb *TransactionCreateBulk) OnConflictColumns(columns ...string) *TransactionUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.Transaction.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TransactionCreateBulk) Save

func (tcb *TransactionCreateBulk) Save(ctx context.Context) ([]*Transaction, error)

Save creates the Transaction entities in the database.

func (*TransactionCreateBulk) SaveX

func (tcb *TransactionCreateBulk) SaveX(ctx context.Context) []*Transaction

SaveX is like Save, but panics if an error occurs.

type TransactionDelete

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

TransactionDelete is the builder for deleting a Transaction entity.

func (*TransactionDelete) Exec

func (td *TransactionDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TransactionDelete) ExecX

func (td *TransactionDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TransactionDelete) Where

Where appends a list predicates to the TransactionDelete builder.

type TransactionDeleteOne

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

TransactionDeleteOne is the builder for deleting a single Transaction entity.

func (*TransactionDeleteOne) Exec

func (tdo *TransactionDeleteOne) Exec(ctx context.Context) error

Exec executes the deletion query.

func (*TransactionDeleteOne) ExecX

func (tdo *TransactionDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TransactionEdge

type TransactionEdge struct {
	Node   *Transaction `json:"node"`
	Cursor Cursor       `json:"cursor"`
}

TransactionEdge is the edge representation of Transaction.

type TransactionEdges

type TransactionEdges struct {
	// Block holds the value of the block edge.
	Block *Block `json:"block,omitempty"`
	// Receipt holds the value of the receipt edge.
	Receipt *TransactionReceipt `json:"receipt,omitempty"`
	// Events holds the value of the events edge.
	Events []*Event `json:"events,omitempty"`
	// contains filtered or unexported fields
}

TransactionEdges holds the relations/edges for other nodes in the graph.

func (TransactionEdges) BlockOrErr

func (e TransactionEdges) BlockOrErr() (*Block, error)

BlockOrErr returns the Block value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TransactionEdges) EventsOrErr

func (e TransactionEdges) EventsOrErr() ([]*Event, error)

EventsOrErr returns the Events value or an error if the edge was not loaded in eager-loading.

func (TransactionEdges) ReceiptOrErr

func (e TransactionEdges) ReceiptOrErr() (*TransactionReceipt, error)

ReceiptOrErr returns the Receipt value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TransactionGroupBy

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

TransactionGroupBy is the group-by builder for Transaction entities.

func (*TransactionGroupBy) Aggregate

func (tgb *TransactionGroupBy) Aggregate(fns ...AggregateFunc) *TransactionGroupBy

Aggregate adds the given aggregation functions to the group-by query.

func (*TransactionGroupBy) Bool

func (s *TransactionGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) BoolX

func (s *TransactionGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TransactionGroupBy) Bools

func (s *TransactionGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) BoolsX

func (s *TransactionGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TransactionGroupBy) Float64

func (s *TransactionGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) Float64X

func (s *TransactionGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TransactionGroupBy) Float64s

func (s *TransactionGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) Float64sX

func (s *TransactionGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TransactionGroupBy) Int

func (s *TransactionGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) IntX

func (s *TransactionGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TransactionGroupBy) Ints

func (s *TransactionGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) IntsX

func (s *TransactionGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TransactionGroupBy) Scan

func (tgb *TransactionGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TransactionGroupBy) ScanX

func (s *TransactionGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TransactionGroupBy) String

func (s *TransactionGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) StringX

func (s *TransactionGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TransactionGroupBy) Strings

func (s *TransactionGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TransactionGroupBy) StringsX

func (s *TransactionGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TransactionMutation

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

TransactionMutation represents an operation that mutates the Transaction nodes in the graph.

func (*TransactionMutation) AddEventIDs

func (m *TransactionMutation) AddEventIDs(ids ...string)

AddEventIDs adds the "events" edge to the Event entity by ids.

func (*TransactionMutation) AddField

func (m *TransactionMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TransactionMutation) AddedEdges

func (m *TransactionMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TransactionMutation) AddedField

func (m *TransactionMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TransactionMutation) AddedFields

func (m *TransactionMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TransactionMutation) AddedIDs

func (m *TransactionMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TransactionMutation) BlockCleared

func (m *TransactionMutation) BlockCleared() bool

BlockCleared reports if the "block" edge to the Block entity was cleared.

func (*TransactionMutation) BlockID

func (m *TransactionMutation) BlockID() (id string, exists bool)

BlockID returns the "block" edge ID in the mutation.

func (*TransactionMutation) BlockIDs

func (m *TransactionMutation) BlockIDs() (ids []string)

BlockIDs returns the "block" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BlockID instead. It exists only for internal usage by the builders.

func (*TransactionMutation) Calldata

func (m *TransactionMutation) Calldata() (r []string, exists bool)

Calldata returns the value of the "calldata" field in the mutation.

func (*TransactionMutation) ClearBlock

func (m *TransactionMutation) ClearBlock()

ClearBlock clears the "block" edge to the Block entity.

func (*TransactionMutation) ClearEdge

func (m *TransactionMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*TransactionMutation) ClearEntryPointSelector

func (m *TransactionMutation) ClearEntryPointSelector()

ClearEntryPointSelector clears the value of the "entry_point_selector" field.

func (*TransactionMutation) ClearEvents

func (m *TransactionMutation) ClearEvents()

ClearEvents clears the "events" edge to the Event entity.

func (*TransactionMutation) ClearField

func (m *TransactionMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*TransactionMutation) ClearNonce

func (m *TransactionMutation) ClearNonce()

ClearNonce clears the value of the "nonce" field.

func (*TransactionMutation) ClearReceipt

func (m *TransactionMutation) ClearReceipt()

ClearReceipt clears the "receipt" edge to the TransactionReceipt entity.

func (*TransactionMutation) ClearSignature

func (m *TransactionMutation) ClearSignature()

ClearSignature clears the value of the "signature" field.

func (*TransactionMutation) ClearedEdges

func (m *TransactionMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TransactionMutation) ClearedFields

func (m *TransactionMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TransactionMutation) Client

func (m TransactionMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*TransactionMutation) ContractAddress

func (m *TransactionMutation) ContractAddress() (r string, exists bool)

ContractAddress returns the value of the "contract_address" field in the mutation.

func (*TransactionMutation) EdgeCleared

func (m *TransactionMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TransactionMutation) EntryPointSelector

func (m *TransactionMutation) EntryPointSelector() (r string, exists bool)

EntryPointSelector returns the value of the "entry_point_selector" field in the mutation.

func (*TransactionMutation) EntryPointSelectorCleared

func (m *TransactionMutation) EntryPointSelectorCleared() bool

EntryPointSelectorCleared returns if the "entry_point_selector" field was cleared in this mutation.

func (*TransactionMutation) EventsCleared

func (m *TransactionMutation) EventsCleared() bool

EventsCleared reports if the "events" edge to the Event entity was cleared.

func (*TransactionMutation) EventsIDs

func (m *TransactionMutation) EventsIDs() (ids []string)

EventsIDs returns the "events" edge IDs in the mutation.

func (*TransactionMutation) Field

func (m *TransactionMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TransactionMutation) FieldCleared

func (m *TransactionMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TransactionMutation) Fields

func (m *TransactionMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*TransactionMutation) ID

func (m *TransactionMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TransactionMutation) IDs

func (m *TransactionMutation) IDs(ctx context.Context) ([]string, error)

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*TransactionMutation) Nonce

func (m *TransactionMutation) Nonce() (r string, exists bool)

Nonce returns the value of the "nonce" field in the mutation.

func (*TransactionMutation) NonceCleared

func (m *TransactionMutation) NonceCleared() bool

NonceCleared returns if the "nonce" field was cleared in this mutation.

func (*TransactionMutation) OldCalldata

func (m *TransactionMutation) OldCalldata(ctx context.Context) (v []string, err error)

OldCalldata returns the old "calldata" field's value of the Transaction entity. If the Transaction object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionMutation) OldContractAddress

func (m *TransactionMutation) OldContractAddress(ctx context.Context) (v string, err error)

OldContractAddress returns the old "contract_address" field's value of the Transaction entity. If the Transaction object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionMutation) OldEntryPointSelector

func (m *TransactionMutation) OldEntryPointSelector(ctx context.Context) (v string, err error)

OldEntryPointSelector returns the old "entry_point_selector" field's value of the Transaction entity. If the Transaction object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionMutation) OldField

func (m *TransactionMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*TransactionMutation) OldNonce

func (m *TransactionMutation) OldNonce(ctx context.Context) (v string, err error)

OldNonce returns the old "nonce" field's value of the Transaction entity. If the Transaction object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionMutation) OldSignature

func (m *TransactionMutation) OldSignature(ctx context.Context) (v []string, err error)

OldSignature returns the old "signature" field's value of the Transaction entity. If the Transaction object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionMutation) OldTransactionHash

func (m *TransactionMutation) OldTransactionHash(ctx context.Context) (v string, err error)

OldTransactionHash returns the old "transaction_hash" field's value of the Transaction entity. If the Transaction object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionMutation) Op

func (m *TransactionMutation) Op() Op

Op returns the operation name.

func (*TransactionMutation) ReceiptCleared

func (m *TransactionMutation) ReceiptCleared() bool

ReceiptCleared reports if the "receipt" edge to the TransactionReceipt entity was cleared.

func (*TransactionMutation) ReceiptID

func (m *TransactionMutation) ReceiptID() (id string, exists bool)

ReceiptID returns the "receipt" edge ID in the mutation.

func (*TransactionMutation) ReceiptIDs

func (m *TransactionMutation) ReceiptIDs() (ids []string)

ReceiptIDs returns the "receipt" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use ReceiptID instead. It exists only for internal usage by the builders.

func (*TransactionMutation) RemoveEventIDs

func (m *TransactionMutation) RemoveEventIDs(ids ...string)

RemoveEventIDs removes the "events" edge to the Event entity by IDs.

func (*TransactionMutation) RemovedEdges

func (m *TransactionMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TransactionMutation) RemovedEventsIDs

func (m *TransactionMutation) RemovedEventsIDs() (ids []string)

RemovedEvents returns the removed IDs of the "events" edge to the Event entity.

func (*TransactionMutation) RemovedIDs

func (m *TransactionMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*TransactionMutation) ResetBlock

func (m *TransactionMutation) ResetBlock()

ResetBlock resets all changes to the "block" edge.

func (*TransactionMutation) ResetCalldata

func (m *TransactionMutation) ResetCalldata()

ResetCalldata resets all changes to the "calldata" field.

func (*TransactionMutation) ResetContractAddress

func (m *TransactionMutation) ResetContractAddress()

ResetContractAddress resets all changes to the "contract_address" field.

func (*TransactionMutation) ResetEdge

func (m *TransactionMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*TransactionMutation) ResetEntryPointSelector

func (m *TransactionMutation) ResetEntryPointSelector()

ResetEntryPointSelector resets all changes to the "entry_point_selector" field.

func (*TransactionMutation) ResetEvents

func (m *TransactionMutation) ResetEvents()

ResetEvents resets all changes to the "events" edge.

func (*TransactionMutation) ResetField

func (m *TransactionMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*TransactionMutation) ResetNonce

func (m *TransactionMutation) ResetNonce()

ResetNonce resets all changes to the "nonce" field.

func (*TransactionMutation) ResetReceipt

func (m *TransactionMutation) ResetReceipt()

ResetReceipt resets all changes to the "receipt" edge.

func (*TransactionMutation) ResetSignature

func (m *TransactionMutation) ResetSignature()

ResetSignature resets all changes to the "signature" field.

func (*TransactionMutation) ResetTransactionHash

func (m *TransactionMutation) ResetTransactionHash()

ResetTransactionHash resets all changes to the "transaction_hash" field.

func (*TransactionMutation) SetBlockID

func (m *TransactionMutation) SetBlockID(id string)

SetBlockID sets the "block" edge to the Block entity by id.

func (*TransactionMutation) SetCalldata

func (m *TransactionMutation) SetCalldata(s []string)

SetCalldata sets the "calldata" field.

func (*TransactionMutation) SetContractAddress

func (m *TransactionMutation) SetContractAddress(s string)

SetContractAddress sets the "contract_address" field.

func (*TransactionMutation) SetEntryPointSelector

func (m *TransactionMutation) SetEntryPointSelector(s string)

SetEntryPointSelector sets the "entry_point_selector" field.

func (*TransactionMutation) SetField

func (m *TransactionMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TransactionMutation) SetID

func (m *TransactionMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of Transaction entities.

func (*TransactionMutation) SetNonce

func (m *TransactionMutation) SetNonce(s string)

SetNonce sets the "nonce" field.

func (*TransactionMutation) SetReceiptID

func (m *TransactionMutation) SetReceiptID(id string)

SetReceiptID sets the "receipt" edge to the TransactionReceipt entity by id.

func (*TransactionMutation) SetSignature

func (m *TransactionMutation) SetSignature(s []string)

SetSignature sets the "signature" field.

func (*TransactionMutation) SetTransactionHash

func (m *TransactionMutation) SetTransactionHash(s string)

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionMutation) Signature

func (m *TransactionMutation) Signature() (r []string, exists bool)

Signature returns the value of the "signature" field in the mutation.

func (*TransactionMutation) SignatureCleared

func (m *TransactionMutation) SignatureCleared() bool

SignatureCleared returns if the "signature" field was cleared in this mutation.

func (*TransactionMutation) TransactionHash

func (m *TransactionMutation) TransactionHash() (r string, exists bool)

TransactionHash returns the value of the "transaction_hash" field in the mutation.

func (TransactionMutation) Tx

func (m TransactionMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TransactionMutation) Type

func (m *TransactionMutation) Type() string

Type returns the node type of this mutation (Transaction).

func (*TransactionMutation) Where

func (m *TransactionMutation) Where(ps ...predicate.Transaction)

Where appends a list predicates to the TransactionMutation builder.

type TransactionOrder

type TransactionOrder struct {
	Direction OrderDirection         `json:"direction"`
	Field     *TransactionOrderField `json:"field"`
}

TransactionOrder defines the ordering of Transaction.

type TransactionOrderField

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

TransactionOrderField defines the ordering field of Transaction.

func (TransactionOrderField) MarshalGQL

func (f TransactionOrderField) MarshalGQL(w io.Writer)

MarshalGQL implements graphql.Marshaler interface.

func (TransactionOrderField) String

func (f TransactionOrderField) String() string

String implement fmt.Stringer interface.

func (*TransactionOrderField) UnmarshalGQL

func (f *TransactionOrderField) UnmarshalGQL(v interface{}) error

UnmarshalGQL implements graphql.Unmarshaler interface.

type TransactionPaginateOption

type TransactionPaginateOption func(*transactionPager) error

TransactionPaginateOption enables pagination customization.

func WithTransactionFilter

func WithTransactionFilter(filter func(*TransactionQuery) (*TransactionQuery, error)) TransactionPaginateOption

WithTransactionFilter configures pagination filter.

func WithTransactionOrder

func WithTransactionOrder(order *TransactionOrder) TransactionPaginateOption

WithTransactionOrder configures pagination ordering.

type TransactionQuery

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

TransactionQuery is the builder for querying Transaction entities.

func (*TransactionQuery) All

func (tq *TransactionQuery) All(ctx context.Context) ([]*Transaction, error)

All executes the query and returns a list of Transactions.

func (*TransactionQuery) AllX

func (tq *TransactionQuery) AllX(ctx context.Context) []*Transaction

AllX is like All, but panics if an error occurs.

func (*TransactionQuery) Clone

func (tq *TransactionQuery) Clone() *TransactionQuery

Clone returns a duplicate of the TransactionQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TransactionQuery) CollectFields

func (t *TransactionQuery) CollectFields(ctx context.Context, satisfies ...string) (*TransactionQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*TransactionQuery) Count

func (tq *TransactionQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TransactionQuery) CountX

func (tq *TransactionQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TransactionQuery) Exist

func (tq *TransactionQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TransactionQuery) ExistX

func (tq *TransactionQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TransactionQuery) First

func (tq *TransactionQuery) First(ctx context.Context) (*Transaction, error)

First returns the first Transaction entity from the query. Returns a *NotFoundError when no Transaction was found.

func (*TransactionQuery) FirstID

func (tq *TransactionQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first Transaction ID from the query. Returns a *NotFoundError when no Transaction ID was found.

func (*TransactionQuery) FirstIDX

func (tq *TransactionQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*TransactionQuery) FirstX

func (tq *TransactionQuery) FirstX(ctx context.Context) *Transaction

FirstX is like First, but panics if an error occurs.

func (*TransactionQuery) GroupBy

func (tq *TransactionQuery) GroupBy(field string, fields ...string) *TransactionGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	ContractAddress string `json:"contract_address,omitempty"`
	Count int `json:"count,omitempty"`
}

client.Transaction.Query().
	GroupBy(transaction.FieldContractAddress).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TransactionQuery) IDs

func (tq *TransactionQuery) IDs(ctx context.Context) ([]string, error)

IDs executes the query and returns a list of Transaction IDs.

func (*TransactionQuery) IDsX

func (tq *TransactionQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*TransactionQuery) Limit

func (tq *TransactionQuery) Limit(limit int) *TransactionQuery

Limit adds a limit step to the query.

func (*TransactionQuery) Offset

func (tq *TransactionQuery) Offset(offset int) *TransactionQuery

Offset adds an offset step to the query.

func (*TransactionQuery) Only

func (tq *TransactionQuery) Only(ctx context.Context) (*Transaction, error)

Only returns a single Transaction entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one Transaction entity is found. Returns a *NotFoundError when no Transaction entities are found.

func (*TransactionQuery) OnlyID

func (tq *TransactionQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only Transaction ID in the query. Returns a *NotSingularError when more than one Transaction ID is found. Returns a *NotFoundError when no entities are found.

func (*TransactionQuery) OnlyIDX

func (tq *TransactionQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TransactionQuery) OnlyX

func (tq *TransactionQuery) OnlyX(ctx context.Context) *Transaction

OnlyX is like Only, but panics if an error occurs.

func (*TransactionQuery) Order

func (tq *TransactionQuery) Order(o ...OrderFunc) *TransactionQuery

Order adds an order step to the query.

func (*TransactionQuery) Paginate

func (t *TransactionQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...TransactionPaginateOption,
) (*TransactionConnection, error)

Paginate executes the query and returns a relay based cursor connection to Transaction.

func (*TransactionQuery) QueryBlock

func (tq *TransactionQuery) QueryBlock() *BlockQuery

QueryBlock chains the current query on the "block" edge.

func (*TransactionQuery) QueryEvents

func (tq *TransactionQuery) QueryEvents() *EventQuery

QueryEvents chains the current query on the "events" edge.

func (*TransactionQuery) QueryReceipt

func (tq *TransactionQuery) QueryReceipt() *TransactionReceiptQuery

QueryReceipt chains the current query on the "receipt" edge.

func (*TransactionQuery) Select

func (tq *TransactionQuery) Select(fields ...string) *TransactionSelect

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	ContractAddress string `json:"contract_address,omitempty"`
}

client.Transaction.Query().
	Select(transaction.FieldContractAddress).
	Scan(ctx, &v)

func (*TransactionQuery) Unique

func (tq *TransactionQuery) Unique(unique bool) *TransactionQuery

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*TransactionQuery) Where

Where adds a new predicate for the TransactionQuery builder.

func (*TransactionQuery) WithBlock

func (tq *TransactionQuery) WithBlock(opts ...func(*BlockQuery)) *TransactionQuery

WithBlock tells the query-builder to eager-load the nodes that are connected to the "block" edge. The optional arguments are used to configure the query builder of the edge.

func (*TransactionQuery) WithEvents

func (tq *TransactionQuery) WithEvents(opts ...func(*EventQuery)) *TransactionQuery

WithEvents tells the query-builder to eager-load the nodes that are connected to the "events" edge. The optional arguments are used to configure the query builder of the edge.

func (*TransactionQuery) WithReceipt

func (tq *TransactionQuery) WithReceipt(opts ...func(*TransactionReceiptQuery)) *TransactionQuery

WithReceipt tells the query-builder to eager-load the nodes that are connected to the "receipt" edge. The optional arguments are used to configure the query builder of the edge.

type TransactionReceipt

type TransactionReceipt struct {

	// ID of the ent.
	ID string `json:"id,omitempty"`
	// TransactionHash holds the value of the "transaction_hash" field.
	TransactionHash string `json:"transaction_hash,omitempty"`
	// Status holds the value of the "status" field.
	Status transactionreceipt.Status `json:"status,omitempty"`
	// StatusData holds the value of the "status_data" field.
	StatusData string `json:"status_data,omitempty"`
	// MessagesSent holds the value of the "messages_sent" field.
	MessagesSent []*types.L1Message `json:"messages_sent,omitempty"`
	// L1OriginMessage holds the value of the "l1_origin_message" field.
	L1OriginMessage *types.L2Message `json:"l1_origin_message,omitempty"`
	// Edges holds the relations/edges for other nodes in the graph.
	// The values are being populated by the TransactionReceiptQuery when eager-loading is set.
	Edges TransactionReceiptEdges `json:"edges"`
	// contains filtered or unexported fields
}

TransactionReceipt is the model entity for the TransactionReceipt schema.

func (*TransactionReceipt) Block

func (tr *TransactionReceipt) Block(ctx context.Context) (*Block, error)

func (*TransactionReceipt) Node

func (tr *TransactionReceipt) Node(ctx context.Context) (node *Node, err error)

func (*TransactionReceipt) QueryBlock

func (tr *TransactionReceipt) QueryBlock() *BlockQuery

QueryBlock queries the "block" edge of the TransactionReceipt entity.

func (*TransactionReceipt) QueryTransaction

func (tr *TransactionReceipt) QueryTransaction() *TransactionQuery

QueryTransaction queries the "transaction" edge of the TransactionReceipt entity.

func (*TransactionReceipt) String

func (tr *TransactionReceipt) String() string

String implements the fmt.Stringer.

func (*TransactionReceipt) ToEdge

ToEdge converts TransactionReceipt into TransactionReceiptEdge.

func (*TransactionReceipt) Transaction

func (tr *TransactionReceipt) Transaction(ctx context.Context) (*Transaction, error)

func (*TransactionReceipt) Unwrap

func (tr *TransactionReceipt) Unwrap() *TransactionReceipt

Unwrap unwraps the TransactionReceipt entity that was returned from a transaction after it was closed, so that all future queries will be executed through the driver which created the transaction.

func (*TransactionReceipt) Update

Update returns a builder for updating this TransactionReceipt. Note that you need to call TransactionReceipt.Unwrap() before calling this method if this TransactionReceipt was returned from a transaction, and the transaction was committed or rolled back.

type TransactionReceiptClient

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

TransactionReceiptClient is a client for the TransactionReceipt schema.

func NewTransactionReceiptClient

func NewTransactionReceiptClient(c config) *TransactionReceiptClient

NewTransactionReceiptClient returns a client for the TransactionReceipt from the given config.

func (*TransactionReceiptClient) Create

Create returns a builder for creating a TransactionReceipt entity.

func (*TransactionReceiptClient) CreateBulk

CreateBulk returns a builder for creating a bulk of TransactionReceipt entities.

func (*TransactionReceiptClient) Delete

Delete returns a delete builder for TransactionReceipt.

func (*TransactionReceiptClient) DeleteOne

DeleteOne returns a builder for deleting the given entity.

func (*TransactionReceiptClient) DeleteOneID

DeleteOne returns a builder for deleting the given entity by its id.

func (*TransactionReceiptClient) Get

Get returns a TransactionReceipt entity by its id.

func (*TransactionReceiptClient) GetX

GetX is like Get, but panics if an error occurs.

func (*TransactionReceiptClient) Hooks

func (c *TransactionReceiptClient) Hooks() []Hook

Hooks returns the client hooks.

func (*TransactionReceiptClient) Query

Query returns a query builder for TransactionReceipt.

func (*TransactionReceiptClient) QueryBlock

QueryBlock queries the block edge of a TransactionReceipt.

func (*TransactionReceiptClient) QueryTransaction

QueryTransaction queries the transaction edge of a TransactionReceipt.

func (*TransactionReceiptClient) Update

Update returns an update builder for TransactionReceipt.

func (*TransactionReceiptClient) UpdateOne

UpdateOne returns an update builder for the given entity.

func (*TransactionReceiptClient) UpdateOneID

UpdateOneID returns an update builder for the given id.

func (*TransactionReceiptClient) Use

func (c *TransactionReceiptClient) Use(hooks ...Hook)

Use adds a list of mutation hooks to the hooks stack. A call to `Use(f, g, h)` equals to `transactionreceipt.Hooks(f(g(h())))`.

type TransactionReceiptConnection

type TransactionReceiptConnection struct {
	Edges      []*TransactionReceiptEdge `json:"edges"`
	PageInfo   PageInfo                  `json:"pageInfo"`
	TotalCount int                       `json:"totalCount"`
}

TransactionReceiptConnection is the connection containing edges to TransactionReceipt.

type TransactionReceiptCreate

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

TransactionReceiptCreate is the builder for creating a TransactionReceipt entity.

func (*TransactionReceiptCreate) Exec

Exec executes the query.

func (*TransactionReceiptCreate) ExecX

func (trc *TransactionReceiptCreate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionReceiptCreate) Mutation

Mutation returns the TransactionReceiptMutation object of the builder.

func (*TransactionReceiptCreate) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.TransactionReceipt.Create().
	SetTransactionHash(v).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TransactionReceiptUpsert) {
		SetTransactionHash(v+v).
	}).
	Exec(ctx)

func (*TransactionReceiptCreate) OnConflictColumns

func (trc *TransactionReceiptCreate) OnConflictColumns(columns ...string) *TransactionReceiptUpsertOne

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.TransactionReceipt.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TransactionReceiptCreate) Save

Save creates the TransactionReceipt in the database.

func (*TransactionReceiptCreate) SaveX

SaveX calls Save and panics if Save returns an error.

func (*TransactionReceiptCreate) SetBlock

SetBlock sets the "block" edge to the Block entity.

func (*TransactionReceiptCreate) SetBlockID

SetBlockID sets the "block" edge to the Block entity by ID.

func (*TransactionReceiptCreate) SetID

SetID sets the "id" field.

func (*TransactionReceiptCreate) SetL1OriginMessage

SetL1OriginMessage sets the "l1_origin_message" field.

func (*TransactionReceiptCreate) SetMessagesSent

SetMessagesSent sets the "messages_sent" field.

func (*TransactionReceiptCreate) SetNillableBlockID

func (trc *TransactionReceiptCreate) SetNillableBlockID(id *string) *TransactionReceiptCreate

SetNillableBlockID sets the "block" edge to the Block entity by ID if the given value is not nil.

func (*TransactionReceiptCreate) SetStatus

SetStatus sets the "status" field.

func (*TransactionReceiptCreate) SetStatusData

SetStatusData sets the "status_data" field.

func (*TransactionReceiptCreate) SetTransaction

SetTransaction sets the "transaction" edge to the Transaction entity.

func (*TransactionReceiptCreate) SetTransactionHash

func (trc *TransactionReceiptCreate) SetTransactionHash(s string) *TransactionReceiptCreate

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionReceiptCreate) SetTransactionID

func (trc *TransactionReceiptCreate) SetTransactionID(id string) *TransactionReceiptCreate

SetTransactionID sets the "transaction" edge to the Transaction entity by ID.

type TransactionReceiptCreateBulk

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

TransactionReceiptCreateBulk is the builder for creating many TransactionReceipt entities in bulk.

func (*TransactionReceiptCreateBulk) Exec

Exec executes the query.

func (*TransactionReceiptCreateBulk) ExecX

func (trcb *TransactionReceiptCreateBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionReceiptCreateBulk) OnConflict

OnConflict allows configuring the `ON CONFLICT` / `ON DUPLICATE KEY` clause of the `INSERT` statement. For example:

client.TransactionReceipt.CreateBulk(builders...).
	OnConflict(
		// Update the row with the new values
		// the was proposed for insertion.
		sql.ResolveWithNewValues(),
	).
	// Override some of the fields with custom
	// update values.
	Update(func(u *ent.TransactionReceiptUpsert) {
		SetTransactionHash(v+v).
	}).
	Exec(ctx)

func (*TransactionReceiptCreateBulk) OnConflictColumns

func (trcb *TransactionReceiptCreateBulk) OnConflictColumns(columns ...string) *TransactionReceiptUpsertBulk

OnConflictColumns calls `OnConflict` and configures the columns as conflict target. Using this option is equivalent to using:

client.TransactionReceipt.Create().
	OnConflict(sql.ConflictColumns(columns...)).
	Exec(ctx)

func (*TransactionReceiptCreateBulk) Save

Save creates the TransactionReceipt entities in the database.

func (*TransactionReceiptCreateBulk) SaveX

SaveX is like Save, but panics if an error occurs.

type TransactionReceiptDelete

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

TransactionReceiptDelete is the builder for deleting a TransactionReceipt entity.

func (*TransactionReceiptDelete) Exec

func (trd *TransactionReceiptDelete) Exec(ctx context.Context) (int, error)

Exec executes the deletion query and returns how many vertices were deleted.

func (*TransactionReceiptDelete) ExecX

func (trd *TransactionReceiptDelete) ExecX(ctx context.Context) int

ExecX is like Exec, but panics if an error occurs.

func (*TransactionReceiptDelete) Where

Where appends a list predicates to the TransactionReceiptDelete builder.

type TransactionReceiptDeleteOne

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

TransactionReceiptDeleteOne is the builder for deleting a single TransactionReceipt entity.

func (*TransactionReceiptDeleteOne) Exec

Exec executes the deletion query.

func (*TransactionReceiptDeleteOne) ExecX

func (trdo *TransactionReceiptDeleteOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

type TransactionReceiptEdge

type TransactionReceiptEdge struct {
	Node   *TransactionReceipt `json:"node"`
	Cursor Cursor              `json:"cursor"`
}

TransactionReceiptEdge is the edge representation of TransactionReceipt.

type TransactionReceiptEdges

type TransactionReceiptEdges struct {
	// Block holds the value of the block edge.
	Block *Block `json:"block,omitempty"`
	// Transaction holds the value of the transaction edge.
	Transaction *Transaction `json:"transaction,omitempty"`
	// contains filtered or unexported fields
}

TransactionReceiptEdges holds the relations/edges for other nodes in the graph.

func (TransactionReceiptEdges) BlockOrErr

func (e TransactionReceiptEdges) BlockOrErr() (*Block, error)

BlockOrErr returns the Block value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

func (TransactionReceiptEdges) TransactionOrErr

func (e TransactionReceiptEdges) TransactionOrErr() (*Transaction, error)

TransactionOrErr returns the Transaction value or an error if the edge was not loaded in eager-loading, or loaded but was not found.

type TransactionReceiptGroupBy

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

TransactionReceiptGroupBy is the group-by builder for TransactionReceipt entities.

func (*TransactionReceiptGroupBy) Aggregate

Aggregate adds the given aggregation functions to the group-by query.

func (*TransactionReceiptGroupBy) Bool

func (s *TransactionReceiptGroupBy) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptGroupBy) BoolX

func (s *TransactionReceiptGroupBy) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TransactionReceiptGroupBy) Bools

func (s *TransactionReceiptGroupBy) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptGroupBy) BoolsX

func (s *TransactionReceiptGroupBy) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TransactionReceiptGroupBy) Float64

func (s *TransactionReceiptGroupBy) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptGroupBy) Float64X

func (s *TransactionReceiptGroupBy) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TransactionReceiptGroupBy) Float64s

func (s *TransactionReceiptGroupBy) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptGroupBy) Float64sX

func (s *TransactionReceiptGroupBy) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TransactionReceiptGroupBy) Int

func (s *TransactionReceiptGroupBy) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptGroupBy) IntX

func (s *TransactionReceiptGroupBy) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TransactionReceiptGroupBy) Ints

func (s *TransactionReceiptGroupBy) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptGroupBy) IntsX

func (s *TransactionReceiptGroupBy) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TransactionReceiptGroupBy) Scan

func (trgb *TransactionReceiptGroupBy) Scan(ctx context.Context, v interface{}) error

Scan applies the group-by query and scans the result into the given value.

func (*TransactionReceiptGroupBy) ScanX

func (s *TransactionReceiptGroupBy) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TransactionReceiptGroupBy) String

func (s *TransactionReceiptGroupBy) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptGroupBy) StringX

func (s *TransactionReceiptGroupBy) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TransactionReceiptGroupBy) Strings

func (s *TransactionReceiptGroupBy) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptGroupBy) StringsX

func (s *TransactionReceiptGroupBy) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TransactionReceiptMutation

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

TransactionReceiptMutation represents an operation that mutates the TransactionReceipt nodes in the graph.

func (*TransactionReceiptMutation) AddField

func (m *TransactionReceiptMutation) AddField(name string, value ent.Value) error

AddField adds the value to the field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TransactionReceiptMutation) AddedEdges

func (m *TransactionReceiptMutation) AddedEdges() []string

AddedEdges returns all edge names that were set/added in this mutation.

func (*TransactionReceiptMutation) AddedField

func (m *TransactionReceiptMutation) AddedField(name string) (ent.Value, bool)

AddedField returns the numeric value that was incremented/decremented on a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TransactionReceiptMutation) AddedFields

func (m *TransactionReceiptMutation) AddedFields() []string

AddedFields returns all numeric fields that were incremented/decremented during this mutation.

func (*TransactionReceiptMutation) AddedIDs

func (m *TransactionReceiptMutation) AddedIDs(name string) []ent.Value

AddedIDs returns all IDs (to other nodes) that were added for the given edge name in this mutation.

func (*TransactionReceiptMutation) BlockCleared

func (m *TransactionReceiptMutation) BlockCleared() bool

BlockCleared reports if the "block" edge to the Block entity was cleared.

func (*TransactionReceiptMutation) BlockID

func (m *TransactionReceiptMutation) BlockID() (id string, exists bool)

BlockID returns the "block" edge ID in the mutation.

func (*TransactionReceiptMutation) BlockIDs

func (m *TransactionReceiptMutation) BlockIDs() (ids []string)

BlockIDs returns the "block" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use BlockID instead. It exists only for internal usage by the builders.

func (*TransactionReceiptMutation) ClearBlock

func (m *TransactionReceiptMutation) ClearBlock()

ClearBlock clears the "block" edge to the Block entity.

func (*TransactionReceiptMutation) ClearEdge

func (m *TransactionReceiptMutation) ClearEdge(name string) error

ClearEdge clears the value of the edge with the given name. It returns an error if that edge is not defined in the schema.

func (*TransactionReceiptMutation) ClearField

func (m *TransactionReceiptMutation) ClearField(name string) error

ClearField clears the value of the field with the given name. It returns an error if the field is not defined in the schema.

func (*TransactionReceiptMutation) ClearTransaction

func (m *TransactionReceiptMutation) ClearTransaction()

ClearTransaction clears the "transaction" edge to the Transaction entity.

func (*TransactionReceiptMutation) ClearedEdges

func (m *TransactionReceiptMutation) ClearedEdges() []string

ClearedEdges returns all edge names that were cleared in this mutation.

func (*TransactionReceiptMutation) ClearedFields

func (m *TransactionReceiptMutation) ClearedFields() []string

ClearedFields returns all nullable fields that were cleared during this mutation.

func (TransactionReceiptMutation) Client

func (m TransactionReceiptMutation) Client() *Client

Client returns a new `ent.Client` from the mutation. If the mutation was executed in a transaction (ent.Tx), a transactional client is returned.

func (*TransactionReceiptMutation) EdgeCleared

func (m *TransactionReceiptMutation) EdgeCleared(name string) bool

EdgeCleared returns a boolean which indicates if the edge with the given name was cleared in this mutation.

func (*TransactionReceiptMutation) Field

func (m *TransactionReceiptMutation) Field(name string) (ent.Value, bool)

Field returns the value of a field with the given name. The second boolean return value indicates that this field was not set, or was not defined in the schema.

func (*TransactionReceiptMutation) FieldCleared

func (m *TransactionReceiptMutation) FieldCleared(name string) bool

FieldCleared returns a boolean indicating if a field with the given name was cleared in this mutation.

func (*TransactionReceiptMutation) Fields

func (m *TransactionReceiptMutation) Fields() []string

Fields returns all fields that were changed during this mutation. Note that in order to get all numeric fields that were incremented/decremented, call AddedFields().

func (*TransactionReceiptMutation) ID

func (m *TransactionReceiptMutation) ID() (id string, exists bool)

ID returns the ID value in the mutation. Note that the ID is only available if it was provided to the builder or after it was returned from the database.

func (*TransactionReceiptMutation) IDs

IDs queries the database and returns the entity ids that match the mutation's predicate. That means, if the mutation is applied within a transaction with an isolation level such as sql.LevelSerializable, the returned ids match the ids of the rows that will be updated or updated by the mutation.

func (*TransactionReceiptMutation) L1OriginMessage

func (m *TransactionReceiptMutation) L1OriginMessage() (r *types.L2Message, exists bool)

L1OriginMessage returns the value of the "l1_origin_message" field in the mutation.

func (*TransactionReceiptMutation) MessagesSent

func (m *TransactionReceiptMutation) MessagesSent() (r []*types.L1Message, exists bool)

MessagesSent returns the value of the "messages_sent" field in the mutation.

func (*TransactionReceiptMutation) OldField

func (m *TransactionReceiptMutation) OldField(ctx context.Context, name string) (ent.Value, error)

OldField returns the old value of the field from the database. An error is returned if the mutation operation is not UpdateOne, or the query to the database failed.

func (*TransactionReceiptMutation) OldL1OriginMessage

func (m *TransactionReceiptMutation) OldL1OriginMessage(ctx context.Context) (v *types.L2Message, err error)

OldL1OriginMessage returns the old "l1_origin_message" field's value of the TransactionReceipt entity. If the TransactionReceipt object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionReceiptMutation) OldMessagesSent

func (m *TransactionReceiptMutation) OldMessagesSent(ctx context.Context) (v []*types.L1Message, err error)

OldMessagesSent returns the old "messages_sent" field's value of the TransactionReceipt entity. If the TransactionReceipt object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionReceiptMutation) OldStatus

OldStatus returns the old "status" field's value of the TransactionReceipt entity. If the TransactionReceipt object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionReceiptMutation) OldStatusData

func (m *TransactionReceiptMutation) OldStatusData(ctx context.Context) (v string, err error)

OldStatusData returns the old "status_data" field's value of the TransactionReceipt entity. If the TransactionReceipt object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionReceiptMutation) OldTransactionHash

func (m *TransactionReceiptMutation) OldTransactionHash(ctx context.Context) (v string, err error)

OldTransactionHash returns the old "transaction_hash" field's value of the TransactionReceipt entity. If the TransactionReceipt object wasn't provided to the builder, the object is fetched from the database. An error is returned if the mutation operation is not UpdateOne, or the database query fails.

func (*TransactionReceiptMutation) Op

Op returns the operation name.

func (*TransactionReceiptMutation) RemovedEdges

func (m *TransactionReceiptMutation) RemovedEdges() []string

RemovedEdges returns all edge names that were removed in this mutation.

func (*TransactionReceiptMutation) RemovedIDs

func (m *TransactionReceiptMutation) RemovedIDs(name string) []ent.Value

RemovedIDs returns all IDs (to other nodes) that were removed for the edge with the given name in this mutation.

func (*TransactionReceiptMutation) ResetBlock

func (m *TransactionReceiptMutation) ResetBlock()

ResetBlock resets all changes to the "block" edge.

func (*TransactionReceiptMutation) ResetEdge

func (m *TransactionReceiptMutation) ResetEdge(name string) error

ResetEdge resets all changes to the edge with the given name in this mutation. It returns an error if the edge is not defined in the schema.

func (*TransactionReceiptMutation) ResetField

func (m *TransactionReceiptMutation) ResetField(name string) error

ResetField resets all changes in the mutation for the field with the given name. It returns an error if the field is not defined in the schema.

func (*TransactionReceiptMutation) ResetL1OriginMessage

func (m *TransactionReceiptMutation) ResetL1OriginMessage()

ResetL1OriginMessage resets all changes to the "l1_origin_message" field.

func (*TransactionReceiptMutation) ResetMessagesSent

func (m *TransactionReceiptMutation) ResetMessagesSent()

ResetMessagesSent resets all changes to the "messages_sent" field.

func (*TransactionReceiptMutation) ResetStatus

func (m *TransactionReceiptMutation) ResetStatus()

ResetStatus resets all changes to the "status" field.

func (*TransactionReceiptMutation) ResetStatusData

func (m *TransactionReceiptMutation) ResetStatusData()

ResetStatusData resets all changes to the "status_data" field.

func (*TransactionReceiptMutation) ResetTransaction

func (m *TransactionReceiptMutation) ResetTransaction()

ResetTransaction resets all changes to the "transaction" edge.

func (*TransactionReceiptMutation) ResetTransactionHash

func (m *TransactionReceiptMutation) ResetTransactionHash()

ResetTransactionHash resets all changes to the "transaction_hash" field.

func (*TransactionReceiptMutation) SetBlockID

func (m *TransactionReceiptMutation) SetBlockID(id string)

SetBlockID sets the "block" edge to the Block entity by id.

func (*TransactionReceiptMutation) SetField

func (m *TransactionReceiptMutation) SetField(name string, value ent.Value) error

SetField sets the value of a field with the given name. It returns an error if the field is not defined in the schema, or if the type mismatched the field type.

func (*TransactionReceiptMutation) SetID

func (m *TransactionReceiptMutation) SetID(id string)

SetID sets the value of the id field. Note that this operation is only accepted on creation of TransactionReceipt entities.

func (*TransactionReceiptMutation) SetL1OriginMessage

func (m *TransactionReceiptMutation) SetL1OriginMessage(t *types.L2Message)

SetL1OriginMessage sets the "l1_origin_message" field.

func (*TransactionReceiptMutation) SetMessagesSent

func (m *TransactionReceiptMutation) SetMessagesSent(t []*types.L1Message)

SetMessagesSent sets the "messages_sent" field.

func (*TransactionReceiptMutation) SetStatus

SetStatus sets the "status" field.

func (*TransactionReceiptMutation) SetStatusData

func (m *TransactionReceiptMutation) SetStatusData(s string)

SetStatusData sets the "status_data" field.

func (*TransactionReceiptMutation) SetTransactionHash

func (m *TransactionReceiptMutation) SetTransactionHash(s string)

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionReceiptMutation) SetTransactionID

func (m *TransactionReceiptMutation) SetTransactionID(id string)

SetTransactionID sets the "transaction" edge to the Transaction entity by id.

func (*TransactionReceiptMutation) Status

func (m *TransactionReceiptMutation) Status() (r transactionreceipt.Status, exists bool)

Status returns the value of the "status" field in the mutation.

func (*TransactionReceiptMutation) StatusData

func (m *TransactionReceiptMutation) StatusData() (r string, exists bool)

StatusData returns the value of the "status_data" field in the mutation.

func (*TransactionReceiptMutation) TransactionCleared

func (m *TransactionReceiptMutation) TransactionCleared() bool

TransactionCleared reports if the "transaction" edge to the Transaction entity was cleared.

func (*TransactionReceiptMutation) TransactionHash

func (m *TransactionReceiptMutation) TransactionHash() (r string, exists bool)

TransactionHash returns the value of the "transaction_hash" field in the mutation.

func (*TransactionReceiptMutation) TransactionID

func (m *TransactionReceiptMutation) TransactionID() (id string, exists bool)

TransactionID returns the "transaction" edge ID in the mutation.

func (*TransactionReceiptMutation) TransactionIDs

func (m *TransactionReceiptMutation) TransactionIDs() (ids []string)

TransactionIDs returns the "transaction" edge IDs in the mutation. Note that IDs always returns len(IDs) <= 1 for unique edges, and you should use TransactionID instead. It exists only for internal usage by the builders.

func (TransactionReceiptMutation) Tx

func (m TransactionReceiptMutation) Tx() (*Tx, error)

Tx returns an `ent.Tx` for mutations that were executed in transactions; it returns an error otherwise.

func (*TransactionReceiptMutation) Type

Type returns the node type of this mutation (TransactionReceipt).

func (*TransactionReceiptMutation) Where

Where appends a list predicates to the TransactionReceiptMutation builder.

type TransactionReceiptOrder

type TransactionReceiptOrder struct {
	Direction OrderDirection                `json:"direction"`
	Field     *TransactionReceiptOrderField `json:"field"`
}

TransactionReceiptOrder defines the ordering of TransactionReceipt.

type TransactionReceiptOrderField

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

TransactionReceiptOrderField defines the ordering field of TransactionReceipt.

type TransactionReceiptPaginateOption

type TransactionReceiptPaginateOption func(*transactionreceiptPager) error

TransactionReceiptPaginateOption enables pagination customization.

func WithTransactionReceiptFilter

func WithTransactionReceiptFilter(filter func(*TransactionReceiptQuery) (*TransactionReceiptQuery, error)) TransactionReceiptPaginateOption

WithTransactionReceiptFilter configures pagination filter.

func WithTransactionReceiptOrder

func WithTransactionReceiptOrder(order *TransactionReceiptOrder) TransactionReceiptPaginateOption

WithTransactionReceiptOrder configures pagination ordering.

type TransactionReceiptQuery

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

TransactionReceiptQuery is the builder for querying TransactionReceipt entities.

func (*TransactionReceiptQuery) All

All executes the query and returns a list of TransactionReceipts.

func (*TransactionReceiptQuery) AllX

AllX is like All, but panics if an error occurs.

func (*TransactionReceiptQuery) Clone

Clone returns a duplicate of the TransactionReceiptQuery builder, including all associated steps. It can be used to prepare common query builders and use them differently after the clone is made.

func (*TransactionReceiptQuery) CollectFields

func (tr *TransactionReceiptQuery) CollectFields(ctx context.Context, satisfies ...string) (*TransactionReceiptQuery, error)

CollectFields tells the query-builder to eagerly load connected nodes by resolver context.

func (*TransactionReceiptQuery) Count

func (trq *TransactionReceiptQuery) Count(ctx context.Context) (int, error)

Count returns the count of the given query.

func (*TransactionReceiptQuery) CountX

func (trq *TransactionReceiptQuery) CountX(ctx context.Context) int

CountX is like Count, but panics if an error occurs.

func (*TransactionReceiptQuery) Exist

func (trq *TransactionReceiptQuery) Exist(ctx context.Context) (bool, error)

Exist returns true if the query has elements in the graph.

func (*TransactionReceiptQuery) ExistX

func (trq *TransactionReceiptQuery) ExistX(ctx context.Context) bool

ExistX is like Exist, but panics if an error occurs.

func (*TransactionReceiptQuery) First

First returns the first TransactionReceipt entity from the query. Returns a *NotFoundError when no TransactionReceipt was found.

func (*TransactionReceiptQuery) FirstID

func (trq *TransactionReceiptQuery) FirstID(ctx context.Context) (id string, err error)

FirstID returns the first TransactionReceipt ID from the query. Returns a *NotFoundError when no TransactionReceipt ID was found.

func (*TransactionReceiptQuery) FirstIDX

func (trq *TransactionReceiptQuery) FirstIDX(ctx context.Context) string

FirstIDX is like FirstID, but panics if an error occurs.

func (*TransactionReceiptQuery) FirstX

FirstX is like First, but panics if an error occurs.

func (*TransactionReceiptQuery) GroupBy

func (trq *TransactionReceiptQuery) GroupBy(field string, fields ...string) *TransactionReceiptGroupBy

GroupBy is used to group vertices by one or more fields/columns. It is often used with aggregate functions, like: count, max, mean, min, sum.

Example:

var v []struct {
	TransactionHash string `json:"transaction_hash,omitempty"`
	Count int `json:"count,omitempty"`
}

client.TransactionReceipt.Query().
	GroupBy(transactionreceipt.FieldTransactionHash).
	Aggregate(ent.Count()).
	Scan(ctx, &v)

func (*TransactionReceiptQuery) IDs

func (trq *TransactionReceiptQuery) IDs(ctx context.Context) ([]string, error)

IDs executes the query and returns a list of TransactionReceipt IDs.

func (*TransactionReceiptQuery) IDsX

func (trq *TransactionReceiptQuery) IDsX(ctx context.Context) []string

IDsX is like IDs, but panics if an error occurs.

func (*TransactionReceiptQuery) Limit

Limit adds a limit step to the query.

func (*TransactionReceiptQuery) Offset

Offset adds an offset step to the query.

func (*TransactionReceiptQuery) Only

Only returns a single TransactionReceipt entity found by the query, ensuring it only returns one. Returns a *NotSingularError when more than one TransactionReceipt entity is found. Returns a *NotFoundError when no TransactionReceipt entities are found.

func (*TransactionReceiptQuery) OnlyID

func (trq *TransactionReceiptQuery) OnlyID(ctx context.Context) (id string, err error)

OnlyID is like Only, but returns the only TransactionReceipt ID in the query. Returns a *NotSingularError when more than one TransactionReceipt ID is found. Returns a *NotFoundError when no entities are found.

func (*TransactionReceiptQuery) OnlyIDX

func (trq *TransactionReceiptQuery) OnlyIDX(ctx context.Context) string

OnlyIDX is like OnlyID, but panics if an error occurs.

func (*TransactionReceiptQuery) OnlyX

OnlyX is like Only, but panics if an error occurs.

func (*TransactionReceiptQuery) Order

Order adds an order step to the query.

func (*TransactionReceiptQuery) Paginate

func (tr *TransactionReceiptQuery) Paginate(
	ctx context.Context, after *Cursor, first *int,
	before *Cursor, last *int, opts ...TransactionReceiptPaginateOption,
) (*TransactionReceiptConnection, error)

Paginate executes the query and returns a relay based cursor connection to TransactionReceipt.

func (*TransactionReceiptQuery) QueryBlock

func (trq *TransactionReceiptQuery) QueryBlock() *BlockQuery

QueryBlock chains the current query on the "block" edge.

func (*TransactionReceiptQuery) QueryTransaction

func (trq *TransactionReceiptQuery) QueryTransaction() *TransactionQuery

QueryTransaction chains the current query on the "transaction" edge.

func (*TransactionReceiptQuery) Select

Select allows the selection one or more fields/columns for the given query, instead of selecting all fields in the entity.

Example:

var v []struct {
	TransactionHash string `json:"transaction_hash,omitempty"`
}

client.TransactionReceipt.Query().
	Select(transactionreceipt.FieldTransactionHash).
	Scan(ctx, &v)

func (*TransactionReceiptQuery) Unique

Unique configures the query builder to filter duplicate records on query. By default, unique is set to true, and can be disabled using this method.

func (*TransactionReceiptQuery) Where

Where adds a new predicate for the TransactionReceiptQuery builder.

func (*TransactionReceiptQuery) WithBlock

func (trq *TransactionReceiptQuery) WithBlock(opts ...func(*BlockQuery)) *TransactionReceiptQuery

WithBlock tells the query-builder to eager-load the nodes that are connected to the "block" edge. The optional arguments are used to configure the query builder of the edge.

func (*TransactionReceiptQuery) WithTransaction

func (trq *TransactionReceiptQuery) WithTransaction(opts ...func(*TransactionQuery)) *TransactionReceiptQuery

WithTransaction tells the query-builder to eager-load the nodes that are connected to the "transaction" edge. The optional arguments are used to configure the query builder of the edge.

type TransactionReceiptSelect

type TransactionReceiptSelect struct {
	*TransactionReceiptQuery
	// contains filtered or unexported fields
}

TransactionReceiptSelect is the builder for selecting fields of TransactionReceipt entities.

func (*TransactionReceiptSelect) Bool

func (s *TransactionReceiptSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptSelect) BoolX

func (s *TransactionReceiptSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TransactionReceiptSelect) Bools

func (s *TransactionReceiptSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptSelect) BoolsX

func (s *TransactionReceiptSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TransactionReceiptSelect) Float64

func (s *TransactionReceiptSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptSelect) Float64X

func (s *TransactionReceiptSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TransactionReceiptSelect) Float64s

func (s *TransactionReceiptSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptSelect) Float64sX

func (s *TransactionReceiptSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TransactionReceiptSelect) Int

func (s *TransactionReceiptSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptSelect) IntX

func (s *TransactionReceiptSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TransactionReceiptSelect) Ints

func (s *TransactionReceiptSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptSelect) IntsX

func (s *TransactionReceiptSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TransactionReceiptSelect) Scan

func (trs *TransactionReceiptSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TransactionReceiptSelect) ScanX

func (s *TransactionReceiptSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TransactionReceiptSelect) String

func (s *TransactionReceiptSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptSelect) StringX

func (s *TransactionReceiptSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TransactionReceiptSelect) Strings

func (s *TransactionReceiptSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TransactionReceiptSelect) StringsX

func (s *TransactionReceiptSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TransactionReceiptUpdate

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

TransactionReceiptUpdate is the builder for updating TransactionReceipt entities.

func (*TransactionReceiptUpdate) ClearBlock

ClearBlock clears the "block" edge to the Block entity.

func (*TransactionReceiptUpdate) ClearTransaction

func (tru *TransactionReceiptUpdate) ClearTransaction() *TransactionReceiptUpdate

ClearTransaction clears the "transaction" edge to the Transaction entity.

func (*TransactionReceiptUpdate) Exec

Exec executes the query.

func (*TransactionReceiptUpdate) ExecX

func (tru *TransactionReceiptUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionReceiptUpdate) Mutation

Mutation returns the TransactionReceiptMutation object of the builder.

func (*TransactionReceiptUpdate) Save

func (tru *TransactionReceiptUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TransactionReceiptUpdate) SaveX

func (tru *TransactionReceiptUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TransactionReceiptUpdate) SetBlock

SetBlock sets the "block" edge to the Block entity.

func (*TransactionReceiptUpdate) SetBlockID

SetBlockID sets the "block" edge to the Block entity by ID.

func (*TransactionReceiptUpdate) SetL1OriginMessage

SetL1OriginMessage sets the "l1_origin_message" field.

func (*TransactionReceiptUpdate) SetMessagesSent

SetMessagesSent sets the "messages_sent" field.

func (*TransactionReceiptUpdate) SetNillableBlockID

func (tru *TransactionReceiptUpdate) SetNillableBlockID(id *string) *TransactionReceiptUpdate

SetNillableBlockID sets the "block" edge to the Block entity by ID if the given value is not nil.

func (*TransactionReceiptUpdate) SetStatus

SetStatus sets the "status" field.

func (*TransactionReceiptUpdate) SetStatusData

SetStatusData sets the "status_data" field.

func (*TransactionReceiptUpdate) SetTransaction

SetTransaction sets the "transaction" edge to the Transaction entity.

func (*TransactionReceiptUpdate) SetTransactionHash

func (tru *TransactionReceiptUpdate) SetTransactionHash(s string) *TransactionReceiptUpdate

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionReceiptUpdate) SetTransactionID

func (tru *TransactionReceiptUpdate) SetTransactionID(id string) *TransactionReceiptUpdate

SetTransactionID sets the "transaction" edge to the Transaction entity by ID.

func (*TransactionReceiptUpdate) Where

Where appends a list predicates to the TransactionReceiptUpdate builder.

type TransactionReceiptUpdateOne

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

TransactionReceiptUpdateOne is the builder for updating a single TransactionReceipt entity.

func (*TransactionReceiptUpdateOne) ClearBlock

ClearBlock clears the "block" edge to the Block entity.

func (*TransactionReceiptUpdateOne) ClearTransaction

func (truo *TransactionReceiptUpdateOne) ClearTransaction() *TransactionReceiptUpdateOne

ClearTransaction clears the "transaction" edge to the Transaction entity.

func (*TransactionReceiptUpdateOne) Exec

Exec executes the query on the entity.

func (*TransactionReceiptUpdateOne) ExecX

func (truo *TransactionReceiptUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionReceiptUpdateOne) Mutation

Mutation returns the TransactionReceiptMutation object of the builder.

func (*TransactionReceiptUpdateOne) Save

Save executes the query and returns the updated TransactionReceipt entity.

func (*TransactionReceiptUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*TransactionReceiptUpdateOne) Select

func (truo *TransactionReceiptUpdateOne) Select(field string, fields ...string) *TransactionReceiptUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TransactionReceiptUpdateOne) SetBlock

SetBlock sets the "block" edge to the Block entity.

func (*TransactionReceiptUpdateOne) SetBlockID

SetBlockID sets the "block" edge to the Block entity by ID.

func (*TransactionReceiptUpdateOne) SetL1OriginMessage

SetL1OriginMessage sets the "l1_origin_message" field.

func (*TransactionReceiptUpdateOne) SetMessagesSent

SetMessagesSent sets the "messages_sent" field.

func (*TransactionReceiptUpdateOne) SetNillableBlockID

func (truo *TransactionReceiptUpdateOne) SetNillableBlockID(id *string) *TransactionReceiptUpdateOne

SetNillableBlockID sets the "block" edge to the Block entity by ID if the given value is not nil.

func (*TransactionReceiptUpdateOne) SetStatus

SetStatus sets the "status" field.

func (*TransactionReceiptUpdateOne) SetStatusData

SetStatusData sets the "status_data" field.

func (*TransactionReceiptUpdateOne) SetTransaction

SetTransaction sets the "transaction" edge to the Transaction entity.

func (*TransactionReceiptUpdateOne) SetTransactionHash

func (truo *TransactionReceiptUpdateOne) SetTransactionHash(s string) *TransactionReceiptUpdateOne

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionReceiptUpdateOne) SetTransactionID

SetTransactionID sets the "transaction" edge to the Transaction entity by ID.

type TransactionReceiptUpsert

type TransactionReceiptUpsert struct {
	*sql.UpdateSet
}

TransactionReceiptUpsert is the "OnConflict" setter.

func (*TransactionReceiptUpsert) SetL1OriginMessage

SetL1OriginMessage sets the "l1_origin_message" field.

func (*TransactionReceiptUpsert) SetMessagesSent

SetMessagesSent sets the "messages_sent" field.

func (*TransactionReceiptUpsert) SetStatus

SetStatus sets the "status" field.

func (*TransactionReceiptUpsert) SetStatusData

SetStatusData sets the "status_data" field.

func (*TransactionReceiptUpsert) SetTransactionHash

func (u *TransactionReceiptUpsert) SetTransactionHash(v string) *TransactionReceiptUpsert

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionReceiptUpsert) UpdateL1OriginMessage

func (u *TransactionReceiptUpsert) UpdateL1OriginMessage() *TransactionReceiptUpsert

UpdateL1OriginMessage sets the "l1_origin_message" field to the value that was provided on create.

func (*TransactionReceiptUpsert) UpdateMessagesSent

func (u *TransactionReceiptUpsert) UpdateMessagesSent() *TransactionReceiptUpsert

UpdateMessagesSent sets the "messages_sent" field to the value that was provided on create.

func (*TransactionReceiptUpsert) UpdateStatus

UpdateStatus sets the "status" field to the value that was provided on create.

func (*TransactionReceiptUpsert) UpdateStatusData

func (u *TransactionReceiptUpsert) UpdateStatusData() *TransactionReceiptUpsert

UpdateStatusData sets the "status_data" field to the value that was provided on create.

func (*TransactionReceiptUpsert) UpdateTransactionHash

func (u *TransactionReceiptUpsert) UpdateTransactionHash() *TransactionReceiptUpsert

UpdateTransactionHash sets the "transaction_hash" field to the value that was provided on create.

type TransactionReceiptUpsertBulk

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

TransactionReceiptUpsertBulk is the builder for "upsert"-ing a bulk of TransactionReceipt nodes.

func (*TransactionReceiptUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TransactionReceiptUpsertBulk) Exec

Exec executes the query.

func (*TransactionReceiptUpsertBulk) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*TransactionReceiptUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.TransactionReceipt.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TransactionReceiptUpsertBulk) SetL1OriginMessage

SetL1OriginMessage sets the "l1_origin_message" field.

func (*TransactionReceiptUpsertBulk) SetMessagesSent

SetMessagesSent sets the "messages_sent" field.

func (*TransactionReceiptUpsertBulk) SetStatus

SetStatus sets the "status" field.

func (*TransactionReceiptUpsertBulk) SetStatusData

SetStatusData sets the "status_data" field.

func (*TransactionReceiptUpsertBulk) SetTransactionHash

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionReceiptUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the TransactionReceiptCreateBulk.OnConflict documentation for more info.

func (*TransactionReceiptUpsertBulk) UpdateL1OriginMessage

func (u *TransactionReceiptUpsertBulk) UpdateL1OriginMessage() *TransactionReceiptUpsertBulk

UpdateL1OriginMessage sets the "l1_origin_message" field to the value that was provided on create.

func (*TransactionReceiptUpsertBulk) UpdateMessagesSent

UpdateMessagesSent sets the "messages_sent" field to the value that was provided on create.

func (*TransactionReceiptUpsertBulk) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.TransactionReceipt.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(transactionreceipt.FieldID)
		}),
	).
	Exec(ctx)

func (*TransactionReceiptUpsertBulk) UpdateStatus

UpdateStatus sets the "status" field to the value that was provided on create.

func (*TransactionReceiptUpsertBulk) UpdateStatusData

UpdateStatusData sets the "status_data" field to the value that was provided on create.

func (*TransactionReceiptUpsertBulk) UpdateTransactionHash

func (u *TransactionReceiptUpsertBulk) UpdateTransactionHash() *TransactionReceiptUpsertBulk

UpdateTransactionHash sets the "transaction_hash" field to the value that was provided on create.

type TransactionReceiptUpsertOne

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

TransactionReceiptUpsertOne is the builder for "upsert"-ing

one TransactionReceipt node.

func (*TransactionReceiptUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TransactionReceiptUpsertOne) Exec

Exec executes the query.

func (*TransactionReceiptUpsertOne) ExecX

ExecX is like Exec, but panics if an error occurs.

func (*TransactionReceiptUpsertOne) ID

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TransactionReceiptUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*TransactionReceiptUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.TransactionReceipt.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TransactionReceiptUpsertOne) SetL1OriginMessage

SetL1OriginMessage sets the "l1_origin_message" field.

func (*TransactionReceiptUpsertOne) SetMessagesSent

SetMessagesSent sets the "messages_sent" field.

func (*TransactionReceiptUpsertOne) SetStatus

SetStatus sets the "status" field.

func (*TransactionReceiptUpsertOne) SetStatusData

SetStatusData sets the "status_data" field.

func (*TransactionReceiptUpsertOne) SetTransactionHash

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionReceiptUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the TransactionReceiptCreate.OnConflict documentation for more info.

func (*TransactionReceiptUpsertOne) UpdateL1OriginMessage

func (u *TransactionReceiptUpsertOne) UpdateL1OriginMessage() *TransactionReceiptUpsertOne

UpdateL1OriginMessage sets the "l1_origin_message" field to the value that was provided on create.

func (*TransactionReceiptUpsertOne) UpdateMessagesSent

UpdateMessagesSent sets the "messages_sent" field to the value that was provided on create.

func (*TransactionReceiptUpsertOne) UpdateNewValues

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.TransactionReceipt.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(transactionreceipt.FieldID)
		}),
	).
	Exec(ctx)

func (*TransactionReceiptUpsertOne) UpdateStatus

UpdateStatus sets the "status" field to the value that was provided on create.

func (*TransactionReceiptUpsertOne) UpdateStatusData

UpdateStatusData sets the "status_data" field to the value that was provided on create.

func (*TransactionReceiptUpsertOne) UpdateTransactionHash

func (u *TransactionReceiptUpsertOne) UpdateTransactionHash() *TransactionReceiptUpsertOne

UpdateTransactionHash sets the "transaction_hash" field to the value that was provided on create.

type TransactionReceiptWhereInput

type TransactionReceiptWhereInput struct {
	Not *TransactionReceiptWhereInput   `json:"not,omitempty"`
	Or  []*TransactionReceiptWhereInput `json:"or,omitempty"`
	And []*TransactionReceiptWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *string  `json:"id,omitempty"`
	IDNEQ   *string  `json:"idNEQ,omitempty"`
	IDIn    []string `json:"idIn,omitempty"`
	IDNotIn []string `json:"idNotIn,omitempty"`
	IDGT    *string  `json:"idGT,omitempty"`
	IDGTE   *string  `json:"idGTE,omitempty"`
	IDLT    *string  `json:"idLT,omitempty"`
	IDLTE   *string  `json:"idLTE,omitempty"`

	// "transaction_hash" field predicates.
	TransactionHash             *string  `json:"transactionHash,omitempty"`
	TransactionHashNEQ          *string  `json:"transactionHashNEQ,omitempty"`
	TransactionHashIn           []string `json:"transactionHashIn,omitempty"`
	TransactionHashNotIn        []string `json:"transactionHashNotIn,omitempty"`
	TransactionHashGT           *string  `json:"transactionHashGT,omitempty"`
	TransactionHashGTE          *string  `json:"transactionHashGTE,omitempty"`
	TransactionHashLT           *string  `json:"transactionHashLT,omitempty"`
	TransactionHashLTE          *string  `json:"transactionHashLTE,omitempty"`
	TransactionHashContains     *string  `json:"transactionHashContains,omitempty"`
	TransactionHashHasPrefix    *string  `json:"transactionHashHasPrefix,omitempty"`
	TransactionHashHasSuffix    *string  `json:"transactionHashHasSuffix,omitempty"`
	TransactionHashEqualFold    *string  `json:"transactionHashEqualFold,omitempty"`
	TransactionHashContainsFold *string  `json:"transactionHashContainsFold,omitempty"`

	// "status" field predicates.
	Status      *transactionreceipt.Status  `json:"status,omitempty"`
	StatusNEQ   *transactionreceipt.Status  `json:"statusNEQ,omitempty"`
	StatusIn    []transactionreceipt.Status `json:"statusIn,omitempty"`
	StatusNotIn []transactionreceipt.Status `json:"statusNotIn,omitempty"`

	// "status_data" field predicates.
	StatusData             *string  `json:"statusData,omitempty"`
	StatusDataNEQ          *string  `json:"statusDataNEQ,omitempty"`
	StatusDataIn           []string `json:"statusDataIn,omitempty"`
	StatusDataNotIn        []string `json:"statusDataNotIn,omitempty"`
	StatusDataGT           *string  `json:"statusDataGT,omitempty"`
	StatusDataGTE          *string  `json:"statusDataGTE,omitempty"`
	StatusDataLT           *string  `json:"statusDataLT,omitempty"`
	StatusDataLTE          *string  `json:"statusDataLTE,omitempty"`
	StatusDataContains     *string  `json:"statusDataContains,omitempty"`
	StatusDataHasPrefix    *string  `json:"statusDataHasPrefix,omitempty"`
	StatusDataHasSuffix    *string  `json:"statusDataHasSuffix,omitempty"`
	StatusDataEqualFold    *string  `json:"statusDataEqualFold,omitempty"`
	StatusDataContainsFold *string  `json:"statusDataContainsFold,omitempty"`

	// "block" edge predicates.
	HasBlock     *bool              `json:"hasBlock,omitempty"`
	HasBlockWith []*BlockWhereInput `json:"hasBlockWith,omitempty"`

	// "transaction" edge predicates.
	HasTransaction     *bool                    `json:"hasTransaction,omitempty"`
	HasTransactionWith []*TransactionWhereInput `json:"hasTransactionWith,omitempty"`
}

TransactionReceiptWhereInput represents a where input for filtering TransactionReceipt queries.

func (*TransactionReceiptWhereInput) Filter

Filter applies the TransactionReceiptWhereInput filter on the TransactionReceiptQuery builder.

func (*TransactionReceiptWhereInput) P

P returns a predicate for filtering transactionreceipts. An error is returned if the input is empty or invalid.

type TransactionReceipts

type TransactionReceipts []*TransactionReceipt

TransactionReceipts is a parsable slice of TransactionReceipt.

type TransactionSelect

type TransactionSelect struct {
	*TransactionQuery
	// contains filtered or unexported fields
}

TransactionSelect is the builder for selecting fields of Transaction entities.

func (*TransactionSelect) Bool

func (s *TransactionSelect) Bool(ctx context.Context) (_ bool, err error)

Bool returns a single bool from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) BoolX

func (s *TransactionSelect) BoolX(ctx context.Context) bool

BoolX is like Bool, but panics if an error occurs.

func (*TransactionSelect) Bools

func (s *TransactionSelect) Bools(ctx context.Context) ([]bool, error)

Bools returns list of bools from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) BoolsX

func (s *TransactionSelect) BoolsX(ctx context.Context) []bool

BoolsX is like Bools, but panics if an error occurs.

func (*TransactionSelect) Float64

func (s *TransactionSelect) Float64(ctx context.Context) (_ float64, err error)

Float64 returns a single float64 from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) Float64X

func (s *TransactionSelect) Float64X(ctx context.Context) float64

Float64X is like Float64, but panics if an error occurs.

func (*TransactionSelect) Float64s

func (s *TransactionSelect) Float64s(ctx context.Context) ([]float64, error)

Float64s returns list of float64s from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) Float64sX

func (s *TransactionSelect) Float64sX(ctx context.Context) []float64

Float64sX is like Float64s, but panics if an error occurs.

func (*TransactionSelect) Int

func (s *TransactionSelect) Int(ctx context.Context) (_ int, err error)

Int returns a single int from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) IntX

func (s *TransactionSelect) IntX(ctx context.Context) int

IntX is like Int, but panics if an error occurs.

func (*TransactionSelect) Ints

func (s *TransactionSelect) Ints(ctx context.Context) ([]int, error)

Ints returns list of ints from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) IntsX

func (s *TransactionSelect) IntsX(ctx context.Context) []int

IntsX is like Ints, but panics if an error occurs.

func (*TransactionSelect) Scan

func (ts *TransactionSelect) Scan(ctx context.Context, v interface{}) error

Scan applies the selector query and scans the result into the given value.

func (*TransactionSelect) ScanX

func (s *TransactionSelect) ScanX(ctx context.Context, v interface{})

ScanX is like Scan, but panics if an error occurs.

func (*TransactionSelect) String

func (s *TransactionSelect) String(ctx context.Context) (_ string, err error)

String returns a single string from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) StringX

func (s *TransactionSelect) StringX(ctx context.Context) string

StringX is like String, but panics if an error occurs.

func (*TransactionSelect) Strings

func (s *TransactionSelect) Strings(ctx context.Context) ([]string, error)

Strings returns list of strings from a selector. It is only allowed when selecting one field.

func (*TransactionSelect) StringsX

func (s *TransactionSelect) StringsX(ctx context.Context) []string

StringsX is like Strings, but panics if an error occurs.

type TransactionUpdate

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

TransactionUpdate is the builder for updating Transaction entities.

func (*TransactionUpdate) AddEventIDs

func (tu *TransactionUpdate) AddEventIDs(ids ...string) *TransactionUpdate

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*TransactionUpdate) AddEvents

func (tu *TransactionUpdate) AddEvents(e ...*Event) *TransactionUpdate

AddEvents adds the "events" edges to the Event entity.

func (*TransactionUpdate) ClearBlock

func (tu *TransactionUpdate) ClearBlock() *TransactionUpdate

ClearBlock clears the "block" edge to the Block entity.

func (*TransactionUpdate) ClearEntryPointSelector

func (tu *TransactionUpdate) ClearEntryPointSelector() *TransactionUpdate

ClearEntryPointSelector clears the value of the "entry_point_selector" field.

func (*TransactionUpdate) ClearEvents

func (tu *TransactionUpdate) ClearEvents() *TransactionUpdate

ClearEvents clears all "events" edges to the Event entity.

func (*TransactionUpdate) ClearNonce

func (tu *TransactionUpdate) ClearNonce() *TransactionUpdate

ClearNonce clears the value of the "nonce" field.

func (*TransactionUpdate) ClearReceipt

func (tu *TransactionUpdate) ClearReceipt() *TransactionUpdate

ClearReceipt clears the "receipt" edge to the TransactionReceipt entity.

func (*TransactionUpdate) ClearSignature

func (tu *TransactionUpdate) ClearSignature() *TransactionUpdate

ClearSignature clears the value of the "signature" field.

func (*TransactionUpdate) Exec

func (tu *TransactionUpdate) Exec(ctx context.Context) error

Exec executes the query.

func (*TransactionUpdate) ExecX

func (tu *TransactionUpdate) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionUpdate) Mutation

func (tu *TransactionUpdate) Mutation() *TransactionMutation

Mutation returns the TransactionMutation object of the builder.

func (*TransactionUpdate) RemoveEventIDs

func (tu *TransactionUpdate) RemoveEventIDs(ids ...string) *TransactionUpdate

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*TransactionUpdate) RemoveEvents

func (tu *TransactionUpdate) RemoveEvents(e ...*Event) *TransactionUpdate

RemoveEvents removes "events" edges to Event entities.

func (*TransactionUpdate) Save

func (tu *TransactionUpdate) Save(ctx context.Context) (int, error)

Save executes the query and returns the number of nodes affected by the update operation.

func (*TransactionUpdate) SaveX

func (tu *TransactionUpdate) SaveX(ctx context.Context) int

SaveX is like Save, but panics if an error occurs.

func (*TransactionUpdate) SetBlock

func (tu *TransactionUpdate) SetBlock(b *Block) *TransactionUpdate

SetBlock sets the "block" edge to the Block entity.

func (*TransactionUpdate) SetBlockID

func (tu *TransactionUpdate) SetBlockID(id string) *TransactionUpdate

SetBlockID sets the "block" edge to the Block entity by ID.

func (*TransactionUpdate) SetCalldata

func (tu *TransactionUpdate) SetCalldata(s []string) *TransactionUpdate

SetCalldata sets the "calldata" field.

func (*TransactionUpdate) SetContractAddress

func (tu *TransactionUpdate) SetContractAddress(s string) *TransactionUpdate

SetContractAddress sets the "contract_address" field.

func (*TransactionUpdate) SetEntryPointSelector

func (tu *TransactionUpdate) SetEntryPointSelector(s string) *TransactionUpdate

SetEntryPointSelector sets the "entry_point_selector" field.

func (*TransactionUpdate) SetNillableBlockID

func (tu *TransactionUpdate) SetNillableBlockID(id *string) *TransactionUpdate

SetNillableBlockID sets the "block" edge to the Block entity by ID if the given value is not nil.

func (*TransactionUpdate) SetNillableEntryPointSelector

func (tu *TransactionUpdate) SetNillableEntryPointSelector(s *string) *TransactionUpdate

SetNillableEntryPointSelector sets the "entry_point_selector" field if the given value is not nil.

func (*TransactionUpdate) SetNillableNonce

func (tu *TransactionUpdate) SetNillableNonce(s *string) *TransactionUpdate

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*TransactionUpdate) SetNillableReceiptID

func (tu *TransactionUpdate) SetNillableReceiptID(id *string) *TransactionUpdate

SetNillableReceiptID sets the "receipt" edge to the TransactionReceipt entity by ID if the given value is not nil.

func (*TransactionUpdate) SetNonce

func (tu *TransactionUpdate) SetNonce(s string) *TransactionUpdate

SetNonce sets the "nonce" field.

func (*TransactionUpdate) SetReceipt

SetReceipt sets the "receipt" edge to the TransactionReceipt entity.

func (*TransactionUpdate) SetReceiptID

func (tu *TransactionUpdate) SetReceiptID(id string) *TransactionUpdate

SetReceiptID sets the "receipt" edge to the TransactionReceipt entity by ID.

func (*TransactionUpdate) SetSignature

func (tu *TransactionUpdate) SetSignature(s []string) *TransactionUpdate

SetSignature sets the "signature" field.

func (*TransactionUpdate) SetTransactionHash

func (tu *TransactionUpdate) SetTransactionHash(s string) *TransactionUpdate

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionUpdate) Where

Where appends a list predicates to the TransactionUpdate builder.

type TransactionUpdateOne

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

TransactionUpdateOne is the builder for updating a single Transaction entity.

func (*TransactionUpdateOne) AddEventIDs

func (tuo *TransactionUpdateOne) AddEventIDs(ids ...string) *TransactionUpdateOne

AddEventIDs adds the "events" edge to the Event entity by IDs.

func (*TransactionUpdateOne) AddEvents

func (tuo *TransactionUpdateOne) AddEvents(e ...*Event) *TransactionUpdateOne

AddEvents adds the "events" edges to the Event entity.

func (*TransactionUpdateOne) ClearBlock

func (tuo *TransactionUpdateOne) ClearBlock() *TransactionUpdateOne

ClearBlock clears the "block" edge to the Block entity.

func (*TransactionUpdateOne) ClearEntryPointSelector

func (tuo *TransactionUpdateOne) ClearEntryPointSelector() *TransactionUpdateOne

ClearEntryPointSelector clears the value of the "entry_point_selector" field.

func (*TransactionUpdateOne) ClearEvents

func (tuo *TransactionUpdateOne) ClearEvents() *TransactionUpdateOne

ClearEvents clears all "events" edges to the Event entity.

func (*TransactionUpdateOne) ClearNonce

func (tuo *TransactionUpdateOne) ClearNonce() *TransactionUpdateOne

ClearNonce clears the value of the "nonce" field.

func (*TransactionUpdateOne) ClearReceipt

func (tuo *TransactionUpdateOne) ClearReceipt() *TransactionUpdateOne

ClearReceipt clears the "receipt" edge to the TransactionReceipt entity.

func (*TransactionUpdateOne) ClearSignature

func (tuo *TransactionUpdateOne) ClearSignature() *TransactionUpdateOne

ClearSignature clears the value of the "signature" field.

func (*TransactionUpdateOne) Exec

func (tuo *TransactionUpdateOne) Exec(ctx context.Context) error

Exec executes the query on the entity.

func (*TransactionUpdateOne) ExecX

func (tuo *TransactionUpdateOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionUpdateOne) Mutation

func (tuo *TransactionUpdateOne) Mutation() *TransactionMutation

Mutation returns the TransactionMutation object of the builder.

func (*TransactionUpdateOne) RemoveEventIDs

func (tuo *TransactionUpdateOne) RemoveEventIDs(ids ...string) *TransactionUpdateOne

RemoveEventIDs removes the "events" edge to Event entities by IDs.

func (*TransactionUpdateOne) RemoveEvents

func (tuo *TransactionUpdateOne) RemoveEvents(e ...*Event) *TransactionUpdateOne

RemoveEvents removes "events" edges to Event entities.

func (*TransactionUpdateOne) Save

Save executes the query and returns the updated Transaction entity.

func (*TransactionUpdateOne) SaveX

SaveX is like Save, but panics if an error occurs.

func (*TransactionUpdateOne) Select

func (tuo *TransactionUpdateOne) Select(field string, fields ...string) *TransactionUpdateOne

Select allows selecting one or more fields (columns) of the returned entity. The default is selecting all fields defined in the entity schema.

func (*TransactionUpdateOne) SetBlock

func (tuo *TransactionUpdateOne) SetBlock(b *Block) *TransactionUpdateOne

SetBlock sets the "block" edge to the Block entity.

func (*TransactionUpdateOne) SetBlockID

func (tuo *TransactionUpdateOne) SetBlockID(id string) *TransactionUpdateOne

SetBlockID sets the "block" edge to the Block entity by ID.

func (*TransactionUpdateOne) SetCalldata

func (tuo *TransactionUpdateOne) SetCalldata(s []string) *TransactionUpdateOne

SetCalldata sets the "calldata" field.

func (*TransactionUpdateOne) SetContractAddress

func (tuo *TransactionUpdateOne) SetContractAddress(s string) *TransactionUpdateOne

SetContractAddress sets the "contract_address" field.

func (*TransactionUpdateOne) SetEntryPointSelector

func (tuo *TransactionUpdateOne) SetEntryPointSelector(s string) *TransactionUpdateOne

SetEntryPointSelector sets the "entry_point_selector" field.

func (*TransactionUpdateOne) SetNillableBlockID

func (tuo *TransactionUpdateOne) SetNillableBlockID(id *string) *TransactionUpdateOne

SetNillableBlockID sets the "block" edge to the Block entity by ID if the given value is not nil.

func (*TransactionUpdateOne) SetNillableEntryPointSelector

func (tuo *TransactionUpdateOne) SetNillableEntryPointSelector(s *string) *TransactionUpdateOne

SetNillableEntryPointSelector sets the "entry_point_selector" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableNonce

func (tuo *TransactionUpdateOne) SetNillableNonce(s *string) *TransactionUpdateOne

SetNillableNonce sets the "nonce" field if the given value is not nil.

func (*TransactionUpdateOne) SetNillableReceiptID

func (tuo *TransactionUpdateOne) SetNillableReceiptID(id *string) *TransactionUpdateOne

SetNillableReceiptID sets the "receipt" edge to the TransactionReceipt entity by ID if the given value is not nil.

func (*TransactionUpdateOne) SetNonce

SetNonce sets the "nonce" field.

func (*TransactionUpdateOne) SetReceipt

SetReceipt sets the "receipt" edge to the TransactionReceipt entity.

func (*TransactionUpdateOne) SetReceiptID

func (tuo *TransactionUpdateOne) SetReceiptID(id string) *TransactionUpdateOne

SetReceiptID sets the "receipt" edge to the TransactionReceipt entity by ID.

func (*TransactionUpdateOne) SetSignature

func (tuo *TransactionUpdateOne) SetSignature(s []string) *TransactionUpdateOne

SetSignature sets the "signature" field.

func (*TransactionUpdateOne) SetTransactionHash

func (tuo *TransactionUpdateOne) SetTransactionHash(s string) *TransactionUpdateOne

SetTransactionHash sets the "transaction_hash" field.

type TransactionUpsert

type TransactionUpsert struct {
	*sql.UpdateSet
}

TransactionUpsert is the "OnConflict" setter.

func (*TransactionUpsert) ClearEntryPointSelector

func (u *TransactionUpsert) ClearEntryPointSelector() *TransactionUpsert

ClearEntryPointSelector clears the value of the "entry_point_selector" field.

func (*TransactionUpsert) ClearNonce

func (u *TransactionUpsert) ClearNonce() *TransactionUpsert

ClearNonce clears the value of the "nonce" field.

func (*TransactionUpsert) ClearSignature

func (u *TransactionUpsert) ClearSignature() *TransactionUpsert

ClearSignature clears the value of the "signature" field.

func (*TransactionUpsert) SetCalldata

func (u *TransactionUpsert) SetCalldata(v []string) *TransactionUpsert

SetCalldata sets the "calldata" field.

func (*TransactionUpsert) SetContractAddress

func (u *TransactionUpsert) SetContractAddress(v string) *TransactionUpsert

SetContractAddress sets the "contract_address" field.

func (*TransactionUpsert) SetEntryPointSelector

func (u *TransactionUpsert) SetEntryPointSelector(v string) *TransactionUpsert

SetEntryPointSelector sets the "entry_point_selector" field.

func (*TransactionUpsert) SetNonce

func (u *TransactionUpsert) SetNonce(v string) *TransactionUpsert

SetNonce sets the "nonce" field.

func (*TransactionUpsert) SetSignature

func (u *TransactionUpsert) SetSignature(v []string) *TransactionUpsert

SetSignature sets the "signature" field.

func (*TransactionUpsert) SetTransactionHash

func (u *TransactionUpsert) SetTransactionHash(v string) *TransactionUpsert

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionUpsert) UpdateCalldata

func (u *TransactionUpsert) UpdateCalldata() *TransactionUpsert

UpdateCalldata sets the "calldata" field to the value that was provided on create.

func (*TransactionUpsert) UpdateContractAddress

func (u *TransactionUpsert) UpdateContractAddress() *TransactionUpsert

UpdateContractAddress sets the "contract_address" field to the value that was provided on create.

func (*TransactionUpsert) UpdateEntryPointSelector

func (u *TransactionUpsert) UpdateEntryPointSelector() *TransactionUpsert

UpdateEntryPointSelector sets the "entry_point_selector" field to the value that was provided on create.

func (*TransactionUpsert) UpdateNonce

func (u *TransactionUpsert) UpdateNonce() *TransactionUpsert

UpdateNonce sets the "nonce" field to the value that was provided on create.

func (*TransactionUpsert) UpdateSignature

func (u *TransactionUpsert) UpdateSignature() *TransactionUpsert

UpdateSignature sets the "signature" field to the value that was provided on create.

func (*TransactionUpsert) UpdateTransactionHash

func (u *TransactionUpsert) UpdateTransactionHash() *TransactionUpsert

UpdateTransactionHash sets the "transaction_hash" field to the value that was provided on create.

type TransactionUpsertBulk

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

TransactionUpsertBulk is the builder for "upsert"-ing a bulk of Transaction nodes.

func (*TransactionUpsertBulk) ClearEntryPointSelector

func (u *TransactionUpsertBulk) ClearEntryPointSelector() *TransactionUpsertBulk

ClearEntryPointSelector clears the value of the "entry_point_selector" field.

func (*TransactionUpsertBulk) ClearNonce

ClearNonce clears the value of the "nonce" field.

func (*TransactionUpsertBulk) ClearSignature

func (u *TransactionUpsertBulk) ClearSignature() *TransactionUpsertBulk

ClearSignature clears the value of the "signature" field.

func (*TransactionUpsertBulk) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TransactionUpsertBulk) Exec

Exec executes the query.

func (*TransactionUpsertBulk) ExecX

func (u *TransactionUpsertBulk) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionUpsertBulk) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Transaction.Create().
	OnConflict(sql.ResolveWithIgnore()).
	Exec(ctx)

func (*TransactionUpsertBulk) SetCalldata

func (u *TransactionUpsertBulk) SetCalldata(v []string) *TransactionUpsertBulk

SetCalldata sets the "calldata" field.

func (*TransactionUpsertBulk) SetContractAddress

func (u *TransactionUpsertBulk) SetContractAddress(v string) *TransactionUpsertBulk

SetContractAddress sets the "contract_address" field.

func (*TransactionUpsertBulk) SetEntryPointSelector

func (u *TransactionUpsertBulk) SetEntryPointSelector(v string) *TransactionUpsertBulk

SetEntryPointSelector sets the "entry_point_selector" field.

func (*TransactionUpsertBulk) SetNonce

SetNonce sets the "nonce" field.

func (*TransactionUpsertBulk) SetSignature

func (u *TransactionUpsertBulk) SetSignature(v []string) *TransactionUpsertBulk

SetSignature sets the "signature" field.

func (*TransactionUpsertBulk) SetTransactionHash

func (u *TransactionUpsertBulk) SetTransactionHash(v string) *TransactionUpsertBulk

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionUpsertBulk) Update

Update allows overriding fields `UPDATE` values. See the TransactionCreateBulk.OnConflict documentation for more info.

func (*TransactionUpsertBulk) UpdateCalldata

func (u *TransactionUpsertBulk) UpdateCalldata() *TransactionUpsertBulk

UpdateCalldata sets the "calldata" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateContractAddress

func (u *TransactionUpsertBulk) UpdateContractAddress() *TransactionUpsertBulk

UpdateContractAddress sets the "contract_address" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateEntryPointSelector

func (u *TransactionUpsertBulk) UpdateEntryPointSelector() *TransactionUpsertBulk

UpdateEntryPointSelector sets the "entry_point_selector" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateNewValues

func (u *TransactionUpsertBulk) UpdateNewValues() *TransactionUpsertBulk

UpdateNewValues updates the mutable fields using the new values that were set on create. Using this option is equivalent to using:

client.Transaction.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(transaction.FieldID)
		}),
	).
	Exec(ctx)

func (*TransactionUpsertBulk) UpdateNonce

func (u *TransactionUpsertBulk) UpdateNonce() *TransactionUpsertBulk

UpdateNonce sets the "nonce" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateSignature

func (u *TransactionUpsertBulk) UpdateSignature() *TransactionUpsertBulk

UpdateSignature sets the "signature" field to the value that was provided on create.

func (*TransactionUpsertBulk) UpdateTransactionHash

func (u *TransactionUpsertBulk) UpdateTransactionHash() *TransactionUpsertBulk

UpdateTransactionHash sets the "transaction_hash" field to the value that was provided on create.

type TransactionUpsertOne

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

TransactionUpsertOne is the builder for "upsert"-ing

one Transaction node.

func (*TransactionUpsertOne) ClearEntryPointSelector

func (u *TransactionUpsertOne) ClearEntryPointSelector() *TransactionUpsertOne

ClearEntryPointSelector clears the value of the "entry_point_selector" field.

func (*TransactionUpsertOne) ClearNonce

func (u *TransactionUpsertOne) ClearNonce() *TransactionUpsertOne

ClearNonce clears the value of the "nonce" field.

func (*TransactionUpsertOne) ClearSignature

func (u *TransactionUpsertOne) ClearSignature() *TransactionUpsertOne

ClearSignature clears the value of the "signature" field.

func (*TransactionUpsertOne) DoNothing

DoNothing configures the conflict_action to `DO NOTHING`. Supported only by SQLite and PostgreSQL.

func (*TransactionUpsertOne) Exec

Exec executes the query.

func (*TransactionUpsertOne) ExecX

func (u *TransactionUpsertOne) ExecX(ctx context.Context)

ExecX is like Exec, but panics if an error occurs.

func (*TransactionUpsertOne) ID

func (u *TransactionUpsertOne) ID(ctx context.Context) (id string, err error)

Exec executes the UPSERT query and returns the inserted/updated ID.

func (*TransactionUpsertOne) IDX

IDX is like ID, but panics if an error occurs.

func (*TransactionUpsertOne) Ignore

Ignore sets each column to itself in case of conflict. Using this option is equivalent to using:

client.Transaction.Create().
    OnConflict(sql.ResolveWithIgnore()).
    Exec(ctx)

func (*TransactionUpsertOne) SetCalldata

func (u *TransactionUpsertOne) SetCalldata(v []string) *TransactionUpsertOne

SetCalldata sets the "calldata" field.

func (*TransactionUpsertOne) SetContractAddress

func (u *TransactionUpsertOne) SetContractAddress(v string) *TransactionUpsertOne

SetContractAddress sets the "contract_address" field.

func (*TransactionUpsertOne) SetEntryPointSelector

func (u *TransactionUpsertOne) SetEntryPointSelector(v string) *TransactionUpsertOne

SetEntryPointSelector sets the "entry_point_selector" field.

func (*TransactionUpsertOne) SetNonce

SetNonce sets the "nonce" field.

func (*TransactionUpsertOne) SetSignature

func (u *TransactionUpsertOne) SetSignature(v []string) *TransactionUpsertOne

SetSignature sets the "signature" field.

func (*TransactionUpsertOne) SetTransactionHash

func (u *TransactionUpsertOne) SetTransactionHash(v string) *TransactionUpsertOne

SetTransactionHash sets the "transaction_hash" field.

func (*TransactionUpsertOne) Update

Update allows overriding fields `UPDATE` values. See the TransactionCreate.OnConflict documentation for more info.

func (*TransactionUpsertOne) UpdateCalldata

func (u *TransactionUpsertOne) UpdateCalldata() *TransactionUpsertOne

UpdateCalldata sets the "calldata" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateContractAddress

func (u *TransactionUpsertOne) UpdateContractAddress() *TransactionUpsertOne

UpdateContractAddress sets the "contract_address" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateEntryPointSelector

func (u *TransactionUpsertOne) UpdateEntryPointSelector() *TransactionUpsertOne

UpdateEntryPointSelector sets the "entry_point_selector" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateNewValues

func (u *TransactionUpsertOne) UpdateNewValues() *TransactionUpsertOne

UpdateNewValues updates the mutable fields using the new values that were set on create except the ID field. Using this option is equivalent to using:

client.Transaction.Create().
	OnConflict(
		sql.ResolveWithNewValues(),
		sql.ResolveWith(func(u *sql.UpdateSet) {
			u.SetIgnore(transaction.FieldID)
		}),
	).
	Exec(ctx)

func (*TransactionUpsertOne) UpdateNonce

func (u *TransactionUpsertOne) UpdateNonce() *TransactionUpsertOne

UpdateNonce sets the "nonce" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateSignature

func (u *TransactionUpsertOne) UpdateSignature() *TransactionUpsertOne

UpdateSignature sets the "signature" field to the value that was provided on create.

func (*TransactionUpsertOne) UpdateTransactionHash

func (u *TransactionUpsertOne) UpdateTransactionHash() *TransactionUpsertOne

UpdateTransactionHash sets the "transaction_hash" field to the value that was provided on create.

type TransactionWhereInput

type TransactionWhereInput struct {
	Not *TransactionWhereInput   `json:"not,omitempty"`
	Or  []*TransactionWhereInput `json:"or,omitempty"`
	And []*TransactionWhereInput `json:"and,omitempty"`

	// "id" field predicates.
	ID      *string  `json:"id,omitempty"`
	IDNEQ   *string  `json:"idNEQ,omitempty"`
	IDIn    []string `json:"idIn,omitempty"`
	IDNotIn []string `json:"idNotIn,omitempty"`
	IDGT    *string  `json:"idGT,omitempty"`
	IDGTE   *string  `json:"idGTE,omitempty"`
	IDLT    *string  `json:"idLT,omitempty"`
	IDLTE   *string  `json:"idLTE,omitempty"`

	// "contract_address" field predicates.
	ContractAddress             *string  `json:"contractAddress,omitempty"`
	ContractAddressNEQ          *string  `json:"contractAddressNEQ,omitempty"`
	ContractAddressIn           []string `json:"contractAddressIn,omitempty"`
	ContractAddressNotIn        []string `json:"contractAddressNotIn,omitempty"`
	ContractAddressGT           *string  `json:"contractAddressGT,omitempty"`
	ContractAddressGTE          *string  `json:"contractAddressGTE,omitempty"`
	ContractAddressLT           *string  `json:"contractAddressLT,omitempty"`
	ContractAddressLTE          *string  `json:"contractAddressLTE,omitempty"`
	ContractAddressContains     *string  `json:"contractAddressContains,omitempty"`
	ContractAddressHasPrefix    *string  `json:"contractAddressHasPrefix,omitempty"`
	ContractAddressHasSuffix    *string  `json:"contractAddressHasSuffix,omitempty"`
	ContractAddressEqualFold    *string  `json:"contractAddressEqualFold,omitempty"`
	ContractAddressContainsFold *string  `json:"contractAddressContainsFold,omitempty"`

	// "entry_point_selector" field predicates.
	EntryPointSelector             *string  `json:"entryPointSelector,omitempty"`
	EntryPointSelectorNEQ          *string  `json:"entryPointSelectorNEQ,omitempty"`
	EntryPointSelectorIn           []string `json:"entryPointSelectorIn,omitempty"`
	EntryPointSelectorNotIn        []string `json:"entryPointSelectorNotIn,omitempty"`
	EntryPointSelectorGT           *string  `json:"entryPointSelectorGT,omitempty"`
	EntryPointSelectorGTE          *string  `json:"entryPointSelectorGTE,omitempty"`
	EntryPointSelectorLT           *string  `json:"entryPointSelectorLT,omitempty"`
	EntryPointSelectorLTE          *string  `json:"entryPointSelectorLTE,omitempty"`
	EntryPointSelectorContains     *string  `json:"entryPointSelectorContains,omitempty"`
	EntryPointSelectorHasPrefix    *string  `json:"entryPointSelectorHasPrefix,omitempty"`
	EntryPointSelectorHasSuffix    *string  `json:"entryPointSelectorHasSuffix,omitempty"`
	EntryPointSelectorIsNil        bool     `json:"entryPointSelectorIsNil,omitempty"`
	EntryPointSelectorNotNil       bool     `json:"entryPointSelectorNotNil,omitempty"`
	EntryPointSelectorEqualFold    *string  `json:"entryPointSelectorEqualFold,omitempty"`
	EntryPointSelectorContainsFold *string  `json:"entryPointSelectorContainsFold,omitempty"`

	// "transaction_hash" field predicates.
	TransactionHash             *string  `json:"transactionHash,omitempty"`
	TransactionHashNEQ          *string  `json:"transactionHashNEQ,omitempty"`
	TransactionHashIn           []string `json:"transactionHashIn,omitempty"`
	TransactionHashNotIn        []string `json:"transactionHashNotIn,omitempty"`
	TransactionHashGT           *string  `json:"transactionHashGT,omitempty"`
	TransactionHashGTE          *string  `json:"transactionHashGTE,omitempty"`
	TransactionHashLT           *string  `json:"transactionHashLT,omitempty"`
	TransactionHashLTE          *string  `json:"transactionHashLTE,omitempty"`
	TransactionHashContains     *string  `json:"transactionHashContains,omitempty"`
	TransactionHashHasPrefix    *string  `json:"transactionHashHasPrefix,omitempty"`
	TransactionHashHasSuffix    *string  `json:"transactionHashHasSuffix,omitempty"`
	TransactionHashEqualFold    *string  `json:"transactionHashEqualFold,omitempty"`
	TransactionHashContainsFold *string  `json:"transactionHashContainsFold,omitempty"`

	// "nonce" field predicates.
	Nonce             *string  `json:"nonce,omitempty"`
	NonceNEQ          *string  `json:"nonceNEQ,omitempty"`
	NonceIn           []string `json:"nonceIn,omitempty"`
	NonceNotIn        []string `json:"nonceNotIn,omitempty"`
	NonceGT           *string  `json:"nonceGT,omitempty"`
	NonceGTE          *string  `json:"nonceGTE,omitempty"`
	NonceLT           *string  `json:"nonceLT,omitempty"`
	NonceLTE          *string  `json:"nonceLTE,omitempty"`
	NonceContains     *string  `json:"nonceContains,omitempty"`
	NonceHasPrefix    *string  `json:"nonceHasPrefix,omitempty"`
	NonceHasSuffix    *string  `json:"nonceHasSuffix,omitempty"`
	NonceIsNil        bool     `json:"nonceIsNil,omitempty"`
	NonceNotNil       bool     `json:"nonceNotNil,omitempty"`
	NonceEqualFold    *string  `json:"nonceEqualFold,omitempty"`
	NonceContainsFold *string  `json:"nonceContainsFold,omitempty"`

	// "block" edge predicates.
	HasBlock     *bool              `json:"hasBlock,omitempty"`
	HasBlockWith []*BlockWhereInput `json:"hasBlockWith,omitempty"`

	// "receipt" edge predicates.
	HasReceipt     *bool                           `json:"hasReceipt,omitempty"`
	HasReceiptWith []*TransactionReceiptWhereInput `json:"hasReceiptWith,omitempty"`

	// "events" edge predicates.
	HasEvents     *bool              `json:"hasEvents,omitempty"`
	HasEventsWith []*EventWhereInput `json:"hasEventsWith,omitempty"`
}

TransactionWhereInput represents a where input for filtering Transaction queries.

func (*TransactionWhereInput) Filter

Filter applies the TransactionWhereInput filter on the TransactionQuery builder.

func (*TransactionWhereInput) P

P returns a predicate for filtering transactions. An error is returned if the input is empty or invalid.

type Transactions

type Transactions []*Transaction

Transactions is a parsable slice of Transaction.

type Tx

type Tx struct {

	// Balance is the client for interacting with the Balance builders.
	Balance *BalanceClient
	// Block is the client for interacting with the Block builders.
	Block *BlockClient
	// Contract is the client for interacting with the Contract builders.
	Contract *ContractClient
	// Event is the client for interacting with the Event builders.
	Event *EventClient
	// Transaction is the client for interacting with the Transaction builders.
	Transaction *TransactionClient
	// TransactionReceipt is the client for interacting with the TransactionReceipt builders.
	TransactionReceipt *TransactionReceiptClient
	// contains filtered or unexported fields
}

Tx is a transactional client that is created by calling Client.Tx().

func TxFromContext

func TxFromContext(ctx context.Context) *Tx

TxFromContext returns a Tx stored inside a context, or nil if there isn't one.

func (*Tx) Client

func (tx *Tx) Client() *Client

Client returns a Client that binds to current transaction.

func (*Tx) Commit

func (tx *Tx) Commit() error

Commit commits the transaction.

func (*Tx) OnCommit

func (tx *Tx) OnCommit(f CommitHook)

OnCommit adds a hook to call on commit.

func (*Tx) OnRollback

func (tx *Tx) OnRollback(f RollbackHook)

OnRollback adds a hook to call on rollback.

func (*Tx) Rollback

func (tx *Tx) Rollback() error

Rollback rollbacks the transaction.

type ValidationError

type ValidationError struct {
	Name string // Field or edge name.
	// contains filtered or unexported fields
}

ValidationError returns when validating a field or edge fails.

func (*ValidationError) Error

func (e *ValidationError) Error() string

Error implements the error interface.

func (*ValidationError) Unwrap

func (e *ValidationError) Unwrap() error

Unwrap implements the errors.Wrapper interface.

type Value

type Value = ent.Value

ent aliases to avoid import conflicts in user's code.

Jump to

Keyboard shortcuts

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