adapters

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: Apache-2.0 Imports: 22 Imported by: 12 modules, 11 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertCCFEventsToJsonEvents added in v0.50.4

func ConvertCCFEventsToJsonEvents(events []flowgo.Event) ([]flowgo.Event, error)

Types

type AccessAdapter

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

AccessAdapter wraps the emulator adapters to be compatible with accessmodel.API.

func NewAccessAdapter

func NewAccessAdapter(logger *zerolog.Logger, emulator emulator.Emulator) *AccessAdapter

NewAccessAdapter returns a new AccessAdapter.

func (*AccessAdapter) ExecuteScriptAtBlockHeight

func (a *AccessAdapter) ExecuteScriptAtBlockHeight(
	_ context.Context,
	blockHeight uint64,
	script []byte,
	arguments [][]byte,
) ([]byte, error)

func (*AccessAdapter) ExecuteScriptAtBlockID

func (a *AccessAdapter) ExecuteScriptAtBlockID(
	_ context.Context,
	blockID flowgo.Identifier,
	script []byte,
	arguments [][]byte,
) ([]byte, error)

func (*AccessAdapter) ExecuteScriptAtLatestBlock

func (a *AccessAdapter) ExecuteScriptAtLatestBlock(
	_ context.Context,
	script []byte,
	arguments [][]byte,
) ([]byte, error)

func (*AccessAdapter) GetAccount

func (a *AccessAdapter) GetAccount(_ context.Context, address flowgo.Address) (*flowgo.Account, error)

func (*AccessAdapter) GetAccountAtBlockHeight

func (a *AccessAdapter) GetAccountAtBlockHeight(
	_ context.Context,
	address flowgo.Address,
	height uint64,
) (*flowgo.Account, error)

func (*AccessAdapter) GetAccountAtLatestBlock

func (a *AccessAdapter) GetAccountAtLatestBlock(ctx context.Context, address flowgo.Address) (*flowgo.Account, error)

func (*AccessAdapter) GetAccountBalanceAtBlockHeight added in v1.0.0

func (a *AccessAdapter) GetAccountBalanceAtBlockHeight(_ context.Context, address flowgo.Address, height uint64) (uint64, error)

func (*AccessAdapter) GetAccountBalanceAtLatestBlock added in v1.0.0

func (a *AccessAdapter) GetAccountBalanceAtLatestBlock(_ context.Context, address flowgo.Address) (uint64, error)

func (*AccessAdapter) GetAccountKeyAtBlockHeight added in v1.0.0

func (a *AccessAdapter) GetAccountKeyAtBlockHeight(_ context.Context, address flowgo.Address, keyIndex uint32, height uint64) (*flowgo.AccountPublicKey, error)

func (*AccessAdapter) GetAccountKeyAtLatestBlock added in v1.0.0

func (a *AccessAdapter) GetAccountKeyAtLatestBlock(_ context.Context, address flowgo.Address, keyIndex uint32) (*flowgo.AccountPublicKey, error)

func (*AccessAdapter) GetAccountKeysAtBlockHeight added in v1.0.0

func (a *AccessAdapter) GetAccountKeysAtBlockHeight(_ context.Context, address flowgo.Address, height uint64) ([]flowgo.AccountPublicKey, error)

func (*AccessAdapter) GetAccountKeysAtLatestBlock added in v1.0.0

func (a *AccessAdapter) GetAccountKeysAtLatestBlock(_ context.Context, address flowgo.Address) ([]flowgo.AccountPublicKey, error)

func (*AccessAdapter) GetBlockByHeight

func (a *AccessAdapter) GetBlockByHeight(_ context.Context, height uint64) (*flowgo.Block, flowgo.BlockStatus, error)

func (*AccessAdapter) GetBlockByID

func (*AccessAdapter) GetBlockHeaderByHeight

func (a *AccessAdapter) GetBlockHeaderByHeight(_ context.Context, height uint64) (*flowgo.Header, flowgo.BlockStatus, error)

func (*AccessAdapter) GetBlockHeaderByID

func (a *AccessAdapter) GetBlockHeaderByID(_ context.Context, id flowgo.Identifier) (*flowgo.Header, flowgo.BlockStatus, error)

func (*AccessAdapter) GetCollectionByID

func (a *AccessAdapter) GetCollectionByID(_ context.Context, id flowgo.Identifier) (*flowgo.LightCollection, error)

func (*AccessAdapter) GetEventsForBlockIDs

func (a *AccessAdapter) GetEventsForBlockIDs(
	_ context.Context,
	eventType string,
	blockIDs []flowgo.Identifier,
	requiredEventEncodingVersion entities.EventEncodingVersion,
) ([]flowgo.BlockEvents, error)

func (*AccessAdapter) GetEventsForHeightRange

func (a *AccessAdapter) GetEventsForHeightRange(
	_ context.Context,
	eventType string,
	startHeight, endHeight uint64,
	requiredEventEncodingVersion entities.EventEncodingVersion,
) ([]flowgo.BlockEvents, error)

func (*AccessAdapter) GetExecutionReceiptsByBlockID added in v1.18.0

func (a *AccessAdapter) GetExecutionReceiptsByBlockID(
	_ context.Context,
	_ flowgo.Identifier,
) ([]*flowgo.ExecutionReceipt, error)

func (*AccessAdapter) GetExecutionReceiptsByResultID added in v1.18.0

func (a *AccessAdapter) GetExecutionReceiptsByResultID(
	_ context.Context,
	_ flowgo.Identifier,
) ([]*flowgo.ExecutionReceipt, error)

func (*AccessAdapter) GetExecutionResultByID

func (a *AccessAdapter) GetExecutionResultByID(_ context.Context, _ flowgo.Identifier) (*flowgo.ExecutionResult, error)

func (*AccessAdapter) GetExecutionResultForBlockID

func (a *AccessAdapter) GetExecutionResultForBlockID(_ context.Context, _ flowgo.Identifier) (*flowgo.ExecutionResult, error)

func (*AccessAdapter) GetFullCollectionByID added in v0.59.1

func (a *AccessAdapter) GetFullCollectionByID(_ context.Context, id flowgo.Identifier) (*flowgo.Collection, error)

func (*AccessAdapter) GetLatestBlock

func (a *AccessAdapter) GetLatestBlock(_ context.Context, _ bool) (*flowgo.Block, flowgo.BlockStatus, error)

func (*AccessAdapter) GetLatestBlockHeader

func (a *AccessAdapter) GetLatestBlockHeader(_ context.Context, _ bool) (*flowgo.Header, flowgo.BlockStatus, error)

func (*AccessAdapter) GetLatestProtocolStateSnapshot

func (a *AccessAdapter) GetLatestProtocolStateSnapshot(_ context.Context) ([]byte, error)

func (*AccessAdapter) GetNetworkParameters

func (a *AccessAdapter) GetNetworkParameters(_ context.Context) accessmodel.NetworkParameters

func (*AccessAdapter) GetNodeVersionInfo

func (a *AccessAdapter) GetNodeVersionInfo(
	_ context.Context,
) (
	*accessmodel.NodeVersionInfo,
	error,
)

func (*AccessAdapter) GetProtocolStateSnapshotByBlockID added in v0.59.0

func (a *AccessAdapter) GetProtocolStateSnapshotByBlockID(_ context.Context, _ flowgo.Identifier) ([]byte, error)

func (*AccessAdapter) GetProtocolStateSnapshotByHeight added in v0.59.0

func (a *AccessAdapter) GetProtocolStateSnapshotByHeight(_ context.Context, _ uint64) ([]byte, error)

func (*AccessAdapter) GetScheduledTransaction added in v1.10.4

func (a *AccessAdapter) GetScheduledTransaction(_ context.Context, scheduledTxID uint64) (*flowgo.TransactionBody, error)

func (*AccessAdapter) GetScheduledTransactionResult added in v1.10.4

func (a *AccessAdapter) GetScheduledTransactionResult(_ context.Context, scheduledTxID uint64, encodingVersion entities.EventEncodingVersion) (*accessmodel.TransactionResult, error)

func (*AccessAdapter) GetSystemTransaction added in v0.59.0

func (a *AccessAdapter) GetSystemTransaction(_ context.Context, txID flowgo.Identifier, blockID flowgo.Identifier) (*flowgo.TransactionBody, error)

func (*AccessAdapter) GetSystemTransactionResult added in v0.59.0

func (a *AccessAdapter) GetSystemTransactionResult(_ context.Context, txID flowgo.Identifier, blockID flowgo.Identifier, encodingVersion entities.EventEncodingVersion) (*accessmodel.TransactionResult, error)

func (*AccessAdapter) GetTransaction

func (*AccessAdapter) GetTransactionResult

func (a *AccessAdapter) GetTransactionResult(
	_ context.Context,
	id flowgo.Identifier,
	blockID flowgo.Identifier,
	_ flowgo.Identifier,
	requiredEventEncodingVersion entities.EventEncodingVersion,
) (
	*accessmodel.TransactionResult,
	error,
)

func (*AccessAdapter) GetTransactionResultByIndex

func (a *AccessAdapter) GetTransactionResultByIndex(
	_ context.Context,
	blockID flowgo.Identifier,
	index uint32,
	requiredEventEncodingVersion entities.EventEncodingVersion,
) (*accessmodel.TransactionResult, error)

func (*AccessAdapter) GetTransactionResultsByBlockID

func (a *AccessAdapter) GetTransactionResultsByBlockID(
	_ context.Context,
	blockID flowgo.Identifier,
	requiredEventEncodingVersion entities.EventEncodingVersion,
) ([]*accessmodel.TransactionResult, error)

func (*AccessAdapter) GetTransactionsByBlockID

func (a *AccessAdapter) GetTransactionsByBlockID(_ context.Context, blockID flowgo.Identifier) ([]*flowgo.TransactionBody, error)

func (*AccessAdapter) Ping

func (a *AccessAdapter) Ping(_ context.Context) error

func (*AccessAdapter) SendAndSubscribeTransactionStatuses added in v1.2.0

func (a *AccessAdapter) SendAndSubscribeTransactionStatuses(ctx context.Context, tx *flowgo.TransactionBody, requiredEventEncodingVersion entities.EventEncodingVersion) subscription.Subscription

func (*AccessAdapter) SendTransaction

func (a *AccessAdapter) SendTransaction(_ context.Context, tx *flowgo.TransactionBody) error

func (*AccessAdapter) SubscribeBlockDigestsFromLatest added in v0.62.0

func (a *AccessAdapter) SubscribeBlockDigestsFromLatest(ctx context.Context, blockStatus flowgo.BlockStatus) subscription.Subscription

func (*AccessAdapter) SubscribeBlockDigestsFromStartBlockID added in v0.62.0

func (a *AccessAdapter) SubscribeBlockDigestsFromStartBlockID(ctx context.Context, startBlockID flowgo.Identifier, blockStatus flowgo.BlockStatus) subscription.Subscription

func (*AccessAdapter) SubscribeBlockDigestsFromStartHeight added in v0.62.0

func (a *AccessAdapter) SubscribeBlockDigestsFromStartHeight(ctx context.Context, startHeight uint64, blockStatus flowgo.BlockStatus) subscription.Subscription

func (*AccessAdapter) SubscribeBlockHeadersFromLatest added in v0.62.0

func (a *AccessAdapter) SubscribeBlockHeadersFromLatest(ctx context.Context, blockStatus flowgo.BlockStatus) subscription.Subscription

func (*AccessAdapter) SubscribeBlockHeadersFromStartBlockID added in v0.62.0

func (a *AccessAdapter) SubscribeBlockHeadersFromStartBlockID(ctx context.Context, startBlockID flowgo.Identifier, blockStatus flowgo.BlockStatus) subscription.Subscription

func (*AccessAdapter) SubscribeBlockHeadersFromStartHeight added in v0.62.0

func (a *AccessAdapter) SubscribeBlockHeadersFromStartHeight(ctx context.Context, startHeight uint64, blockStatus flowgo.BlockStatus) subscription.Subscription

func (*AccessAdapter) SubscribeBlocksFromLatest added in v0.62.0

func (a *AccessAdapter) SubscribeBlocksFromLatest(ctx context.Context, blockStatus flowgo.BlockStatus) subscription.Subscription

func (*AccessAdapter) SubscribeBlocksFromStartBlockID added in v0.62.0

func (a *AccessAdapter) SubscribeBlocksFromStartBlockID(ctx context.Context, startBlockID flowgo.Identifier, blockStatus flowgo.BlockStatus) subscription.Subscription

func (*AccessAdapter) SubscribeBlocksFromStartHeight added in v0.62.0

func (a *AccessAdapter) SubscribeBlocksFromStartHeight(ctx context.Context, startHeight uint64, blockStatus flowgo.BlockStatus) subscription.Subscription

func (*AccessAdapter) SubscribeTransactionStatuses added in v0.62.0

func (a *AccessAdapter) SubscribeTransactionStatuses(ctx context.Context, txID flowgo.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) subscription.Subscription

func (*AccessAdapter) SubscribeTransactionStatusesFromLatest added in v1.2.0

func (a *AccessAdapter) SubscribeTransactionStatusesFromLatest(ctx context.Context, txID flowgo.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) subscription.Subscription

func (*AccessAdapter) SubscribeTransactionStatusesFromStartBlockID added in v1.2.0

func (a *AccessAdapter) SubscribeTransactionStatusesFromStartBlockID(ctx context.Context, txID flowgo.Identifier, startBlockID flowgo.Identifier, requiredEventEncodingVersion entities.EventEncodingVersion) subscription.Subscription

func (*AccessAdapter) SubscribeTransactionStatusesFromStartHeight added in v1.2.0

func (a *AccessAdapter) SubscribeTransactionStatusesFromStartHeight(ctx context.Context, txID flowgo.Identifier, startHeight uint64, requiredEventEncodingVersion entities.EventEncodingVersion) subscription.Subscription

type SDKAdapter

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

SDKAdapter wraps an emulated emulator and implements the RPC handlers required by the Access API.

func NewSDKAdapter

func NewSDKAdapter(logger *zerolog.Logger, emulator emulator.Emulator) *SDKAdapter

NewSDKAdapter returns a new SDKAdapter.

func (*SDKAdapter) CreateAccount

func (b *SDKAdapter) CreateAccount(ctx context.Context, publicKeys []*flowsdk.AccountKey, contracts []templates.Contract) (flowsdk.Address, error)

CreateAccount submits a transaction to create a new account with the given account keys and contracts. The transaction is paid by the service account.

func (*SDKAdapter) DisableAutoMine

func (b *SDKAdapter) DisableAutoMine()

func (*SDKAdapter) Emulator

func (b *SDKAdapter) Emulator() emulator.Emulator

func (*SDKAdapter) EnableAutoMine

func (b *SDKAdapter) EnableAutoMine()

func (*SDKAdapter) ExecuteScriptAtBlockHeight

func (b *SDKAdapter) ExecuteScriptAtBlockHeight(
	ctx context.Context,
	blockHeight uint64,
	script []byte,
	arguments [][]byte,
) ([]byte, error)

ExecuteScriptAtBlockHeight executes a script at a specific block height

func (*SDKAdapter) ExecuteScriptAtBlockID

func (b *SDKAdapter) ExecuteScriptAtBlockID(
	ctx context.Context,
	blockID flowsdk.Identifier,
	script []byte,
	arguments [][]byte,
) ([]byte, error)

ExecuteScriptAtBlockID executes a script at a specific block ID

func (*SDKAdapter) ExecuteScriptAtLatestBlock

func (b *SDKAdapter) ExecuteScriptAtLatestBlock(
	ctx context.Context,
	script []byte,
	arguments [][]byte,
) ([]byte, error)

ExecuteScriptAtLatestBlock executes a script at the latest block

func (*SDKAdapter) GetAccount

func (b *SDKAdapter) GetAccount(
	ctx context.Context,
	address flowsdk.Address,
) (*flowsdk.Account, error)

GetAccount returns an account by address at the latest sealed block.

func (*SDKAdapter) GetAccountAtBlockHeight

func (b *SDKAdapter) GetAccountAtBlockHeight(
	ctx context.Context,
	address flowsdk.Address,
	height uint64,
) (*flowsdk.Account, error)

func (*SDKAdapter) GetAccountAtLatestBlock

func (b *SDKAdapter) GetAccountAtLatestBlock(
	ctx context.Context,
	address flowsdk.Address,
) (*flowsdk.Account, error)

GetAccountAtLatestBlock returns an account by address at the latest sealed block.

func (*SDKAdapter) GetBlockByHeight

func (b *SDKAdapter) GetBlockByHeight(
	ctx context.Context,
	height uint64,
) (
	*flowsdk.Block,
	flowsdk.BlockStatus,
	error,
)

GetBlockByHeight gets a block by height.

func (*SDKAdapter) GetBlockByID

func (b *SDKAdapter) GetBlockByID(
	_ context.Context,
	id flowsdk.Identifier,
) (
	*flowsdk.Block,
	flowsdk.BlockStatus,
	error,
)

GetBlockByID gets a block by ID.

func (*SDKAdapter) GetBlockHeaderByHeight

func (b *SDKAdapter) GetBlockHeaderByHeight(
	_ context.Context,
	height uint64,
) (
	*flowsdk.BlockHeader,
	flowsdk.BlockStatus,
	error,
)

GetBlockHeaderByHeight gets a block header by height.

func (*SDKAdapter) GetBlockHeaderByID

func (b *SDKAdapter) GetBlockHeaderByID(
	_ context.Context,
	id flowsdk.Identifier,
) (
	*flowsdk.BlockHeader,
	flowsdk.BlockStatus,
	error,
)

GetBlockHeaderByID gets a block header by ID.

func (*SDKAdapter) GetChainID

func (b *SDKAdapter) GetChainID(ctx context.Context) flowsdk.ChainID

func (*SDKAdapter) GetCollectionByID

func (b *SDKAdapter) GetCollectionByID(
	_ context.Context,
	id flowsdk.Identifier,
) (*flowsdk.Collection, error)

GetCollectionByID gets a collection by ID.

func (*SDKAdapter) GetEventsForBlockIDs

func (b *SDKAdapter) GetEventsForBlockIDs(ctx context.Context, eventType string, blockIDs []flowsdk.Identifier) ([]*flowsdk.BlockEvents, error)

func (*SDKAdapter) GetEventsForHeightRange

func (b *SDKAdapter) GetEventsForHeightRange(ctx context.Context, eventType string, startHeight, endHeight uint64) ([]*flowsdk.BlockEvents, error)

func (*SDKAdapter) GetExecutionResultForBlockID

func (b *SDKAdapter) GetExecutionResultForBlockID(_ context.Context, _ flowsdk.Identifier) (*flowsdk.ExecutionResult, error)

func (*SDKAdapter) GetLatestBlock

func (b *SDKAdapter) GetLatestBlock(
	_ context.Context,
	_ bool,
) (
	*flowsdk.Block,
	flowsdk.BlockStatus,
	error,
)

GetLatestBlock gets the latest sealed block.

func (*SDKAdapter) GetLatestBlockHeader

func (b *SDKAdapter) GetLatestBlockHeader(
	_ context.Context,
	_ bool,
) (
	*flowsdk.BlockHeader,
	flowsdk.BlockStatus,
	error,
)

GetLatestBlockHeader gets the latest sealed block header.

func (*SDKAdapter) GetLatestProtocolStateSnapshot

func (b *SDKAdapter) GetLatestProtocolStateSnapshot(_ context.Context) ([]byte, error)

func (*SDKAdapter) GetProtocolStateSnapshotByBlockID added in v0.59.0

func (a *SDKAdapter) GetProtocolStateSnapshotByBlockID(_ context.Context, _ flowgo.Identifier) ([]byte, error)

func (*SDKAdapter) GetProtocolStateSnapshotByHeight added in v0.59.0

func (a *SDKAdapter) GetProtocolStateSnapshotByHeight(_ context.Context, _ uint64) ([]byte, error)

func (*SDKAdapter) GetSystemTransaction added in v0.59.0

func (b *SDKAdapter) GetSystemTransaction(_ context.Context, _ flowgo.Identifier) (*flowgo.TransactionBody, error)

func (*SDKAdapter) GetSystemTransactionResult added in v0.59.0

func (*SDKAdapter) GetTransaction

func (b *SDKAdapter) GetTransaction(
	ctx context.Context,
	id flowsdk.Identifier,
) (*flowsdk.Transaction, error)

GetTransaction gets a transaction by ID.

func (*SDKAdapter) GetTransactionResult

func (b *SDKAdapter) GetTransactionResult(
	ctx context.Context,
	id flowsdk.Identifier,
) (*flowsdk.TransactionResult, error)

GetTransactionResult gets a transaction by ID.

func (*SDKAdapter) GetTransactionResultsByBlockID

func (b *SDKAdapter) GetTransactionResultsByBlockID(ctx context.Context, id flowsdk.Identifier) ([]*flowsdk.TransactionResult, error)

func (*SDKAdapter) GetTransactionsByBlockID

func (b *SDKAdapter) GetTransactionsByBlockID(ctx context.Context, id flowsdk.Identifier) ([]*flowsdk.Transaction, error)

func (*SDKAdapter) Ping

func (b *SDKAdapter) Ping(ctx context.Context) error

func (*SDKAdapter) SendTransaction

func (b *SDKAdapter) SendTransaction(ctx context.Context, tx flowsdk.Transaction) error

Jump to

Keyboard shortcuts

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