client

package
v0.7.22 Latest Latest
Warning

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

Go to latest
Published: Jan 12, 2026 License: Apache-2.0 Imports: 50 Imported by: 0

Documentation

Overview

Package client defines the types for storage client responses.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EVMEthAddrFromPreimage

func EVMEthAddrFromPreimage(contextIdentifier string, contextVersion int, data []byte) ([]byte, error)

func EthChecksumAddrFromBarePreimage added in v0.4.0

func EthChecksumAddrFromBarePreimage(data []byte) string

EthChecksumAddrFromBarePreimage gives the friendly Ethereum-style mixed-case checksum address (see ERC-55) for an address preimage without checking the preimage context.

func EthChecksumAddrFromPreimage

func EthChecksumAddrFromPreimage(contextIdentifier string, contextVersion int, data []byte) *string

EthChecksumAddrFromPreimage gives the friendly Ethereum-style mixed-case checksum address (see ERC-55) for an address preimage or nil if the preimage context is not AddressV0Secp256k1EthContext.

func EthChecksumAddrPtrFromBarePreimage added in v0.4.0

func EthChecksumAddrPtrFromBarePreimage(data []byte) *string

EthChecksumAddrPtrFromBarePreimage gives the friendly Ethereum-style mixed-case checksum address (see ERC-55) for an address preimage without checking the preimage context. This one returns nil if the input was nil.

Types

type Account

type Account = api.Account

Account is the storage response for GetAccount.

type AccountList

type AccountList = api.AccountList

AccountList is the storage response for ListAccounts.

type AccountStats

type AccountStats = api.AccountStats

type AddressDerivationContext

type AddressDerivationContext = api.AddressDerivationContext

Types that are a part of the storage response for GetRuntimeAccount.

type AddressPreimage

type AddressPreimage = api.AddressPreimage

Types that are a part of the storage response for GetRuntimeAccount.

type Allowance

type Allowance = api.Allowance

type BareTokenHolder

type BareTokenHolder = api.BareTokenHolder

type BigInt

type BigInt = common.BigInt

type Block

type Block = api.Block

Block is the storage response for GetBlock.

type BlockList

type BlockList = api.BlockList

BlockList is the storage response for ListBlocks.

type DailyActiveAccountsList

type DailyActiveAccountsList = api.ActiveAccountsList

DailyActiveAccountsList is the storage response for GetDailyActiveAccounts.

type DebondingDelegation

type DebondingDelegation = api.DebondingDelegation

DebondingDelegation is the storage response for GetDebondingDelegation.

type DebondingDelegationList

type DebondingDelegationList = api.DebondingDelegationList

DebondingDelegationList is the storage response for ListDebondingDelegations.

type Delegation

type Delegation = api.Delegation

Delegation is the storage response for GetDelegation.

type DelegationList

type DelegationList = api.DelegationList

DelegationList is the storage response for ListDelegations.

type EnclaveQuote added in v0.5.3

type EnclaveQuote struct {
	Header     Header     `json:"header"`
	ReportBody ReportBody `json:"report_body"`
}

EnclaveQuote is an Oasis Core v24 `pcs.Quote` with exposed header and report body fields. https://github.com/oasisprotocol/oasis-core/blob/861f035f67089923748f32014810db0f7697fe89/go/common/sgx/pcs/quote.go#L45

type Entity

type Entity = api.Entity

Entity is the storage response for GetEntity.

type EntityList

type EntityList = api.EntityList

EntityList is the storage response for ListEntities.

type Epoch

type Epoch = api.Epoch

Epoch is the storage response for GetEpoch.

type EpochList

type EpochList = api.EpochList

Epoch is the storage response for ListEpochs.

type Event

type Event = api.ConsensusEvent

Event is a consensus event.

type EventList

type EventList = api.ConsensusEventList

EventsList is the storage response for ListEvents.

type EvmNft added in v0.1.17

type EvmNft = api.EvmNft

type EvmNftList added in v0.1.17

type EvmNftList = api.EvmNftList

type EvmToken

type EvmToken = api.EvmToken

type EvmTokenList

type EvmTokenList = api.EvmTokenList
type Header struct {
	Version            uint16                 `json:"version"`
	TeeType            pcs.TeeType            `json:"tee_type"`
	QEVendorID         []byte                 `json:"qe_vendor_id"`
	AttestationKeyType pcs.AttestationKeyType `json:"attestation_key_type"`
}

Header is a struct matching Oasis Core v24 `pcs.QuoteHeader` interface. https://github.com/oasisprotocol/oasis-core/blob/861f035f67089923748f32014810db0f7697fe89/go/common/sgx/pcs/quote.go#L238

type Node

type Node = api.Node

Node is the storage response for GetEntityNode.

type NodeList

type NodeList = api.NodeList

NodeList is the storage response for ListEntityNodes.

type ParsedAttestation added in v0.5.3

type ParsedAttestation struct {
	// Quote is the parsed quote.
	Quote ParsedPCSQuote `json:"quote"`

	// Height is the runtime's view of the consensus layer height at the time of attestation.
	Height uint64 `json:"height"`

	// Signature is the signature of the attestation by the enclave (RAK).
	Signature signature.RawSignature `json:"signature"`
}

ParsedAttestation is an Oasis Core v24 `node.SGXAttestation` with parsed PCS quote. https://github.com/oasisprotocol/oasis-core/blob/861f035f67089923748f32014810db0f7697fe89/go/common/node/sgx.go#L138

type ParsedPCSQuote added in v0.5.3

type ParsedPCSQuote struct {
	PCS *ParsedPSCQuoteBundle `json:"pcs"`
}

ParsedPCSQuote is an Oasis Core v24 `quote.Quote` with parsed PCS quote bundle. https://github.com/oasisprotocol/oasis-core/blob/861f035f67089923748f32014810db0f7697fe89/go/common/sgx/quote/quote.go#L13

type ParsedPSCQuoteBundle added in v0.5.3

type ParsedPSCQuoteBundle struct {
	TCB   pcs.TCBBundle `json:"tcb"`
	Quote EnclaveQuote  `json:"quote"`
}

ParsedPSCQuoteBundle is an Oasis Core v24 `pcs.QuoteBundle` with parsed TCB and enclave quote. https://github.com/oasisprotocol/oasis-core/blob/861f035f67089923748f32014810db0f7697fe89/go/common/sgx/pcs/pcs.go#L41

type Proposal

type Proposal = api.Proposal

Proposal is the storage response for GetProposal.

type ProposalList

type ProposalList = api.ProposalList

ProposalList is the storage response for ListProposals.

type ProposalTarget

type ProposalTarget = api.ProposalTarget

type ProposalVote

type ProposalVote = api.ProposalVote

type ProposalVotes

type ProposalVotes = api.ProposalVotes

ProposalVotes is the storage response for GetProposalVotes.

type RecentBlockList added in v0.7.20

type RecentBlockList = api.RecentBlockList

RecentBlockList is the storage response for RecentBlocks.

type ReportBody added in v0.5.3

type ReportBody struct {
	ReportData      []byte              `json:"report_data"`
	EnclaveIdentity sgx.EnclaveIdentity `json:"enclave_identity"`
}

ReportBody is a struct matching Oasis Core v24 `pcs.ReportBody` interface. https://github.com/oasisprotocol/oasis-core/blob/861f035f67089923748f32014810db0f7697fe89/go/common/sgx/pcs/report.go#L11

type RoflApp added in v0.6.3

type RoflApp = api.RoflApp

RoflApp is the storage response for GetRuntimeRoflApp.

type RoflAppInstanceList added in v0.6.3

type RoflAppInstanceList = api.RoflAppInstanceList

RoflAppInstanceList is the storage response for GetRuntimeRoflAppsIdInstances.

type RoflAppList added in v0.6.3

type RoflAppList = api.RoflAppList

RoflAppList is the storage response for GetRuntimeRoflApps.

type RoflMarketInstanceList added in v0.6.13

type RoflMarketInstanceList = api.RoflMarketInstanceList

RoflMarketInstanceList is the storage response for GetRuntimeRoflmarketProvidersAddressInstances.

type RoflMarketOfferList added in v0.6.13

type RoflMarketOfferList = api.RoflMarketOfferList

RoflMarketOfferList is the storage response for GetRuntimeRoflmarketProvidersAddressOffers.

type RoflMarketProvider added in v0.6.13

type RoflMarketProvider = api.RoflMarketProvider

RoflMarketProvider is the storage response for GetRuntimeRoflmarketProvidersAddress.

type RoflMarketProviderList added in v0.6.13

type RoflMarketProviderList = api.RoflMarketProviderList

RoflMarketProviderList is the storage response for GetRuntimeRoflmarketProviders.

type RoothashMessage added in v0.3.0

type RoothashMessage = api.RoothashMessage

type RoothashMessageList added in v0.3.0

type RoothashMessageList = api.RoothashMessageList

type RuntimeAccount

type RuntimeAccount = api.RuntimeAccount

type RuntimeBlock

type RuntimeBlock = api.RuntimeBlock

Block is the storage response for RuntimeGetBlock.

type RuntimeBlockList

type RuntimeBlockList = api.RuntimeBlockList

RuntimeBlockList is the storage response for RuntimeListBlocks.

type RuntimeEvent

type RuntimeEvent = api.RuntimeEvent

type RuntimeEventList

type RuntimeEventList = api.RuntimeEventList

RuntimeEventList is the storage response for RuntimeEvents.

type RuntimeEventType

type RuntimeEventType = api.RuntimeEventType

type RuntimeEvmBalance

type RuntimeEvmBalance = api.RuntimeEvmBalance

Types that are a part of the storage response for GetRuntimeAccount.

type RuntimeEvmContract

type RuntimeEvmContract = api.RuntimeEvmContract

Types that are a part of the storage response for GetRuntimeAccount.

type RuntimeEvmContractVerification

type RuntimeEvmContractVerification = api.RuntimeEvmContractVerification

Types that are a part of the storage response for GetRuntimeAccount.

type RuntimeSdkBalance

type RuntimeSdkBalance = api.RuntimeSdkBalance

Types that are a part of the storage response for GetRuntimeAccount.

type RuntimeStatus

type RuntimeStatus = api.RuntimeStatus

RuntimeStatus is the storage response for RuntimeStatus.

type RuntimeTransaction

type RuntimeTransaction = api.RuntimeTransaction

RuntimeTransactionList is the storage response for RuntimeTransactions.

type RuntimeTransactionEncryptionEnvelope

type RuntimeTransactionEncryptionEnvelope = api.RuntimeTransactionEncryptionEnvelope

RuntimeTransactionList is the storage response for RuntimeTransactions.

type RuntimeTransactionList

type RuntimeTransactionList = api.RuntimeTransactionList

RuntimeTransactionList is the storage response for RuntimeTransactions.

type Status

type Status = api.Status

Status is the storage response for GetStatus.

type StorageClient

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

StorageClient is a wrapper around a storage.TargetStorage with knowledge of network semantics.

func NewStorageClient

func NewStorageClient(
	cfg *config.ServerConfig,
	db storage.TargetStorage,
	referenceSwaps map[common.Runtime]config.ReferenceSwap,
	networkConfig *oasisConfig.Network,
	l *log.Logger,
) (*StorageClient, error)

NewStorageClient creates a new storage client.

func (*StorageClient) Account

func (c *StorageClient) Account(ctx context.Context, address staking.Address) (*Account, error)

Account returns a consensus account.

func (*StorageClient) Accounts

Accounts returns a list of consensus accounts.

func (*StorageClient) Blocks

Blocks returns a list of consensus blocks.

func (*StorageClient) CirculatingSupply added in v0.6.0

func (c *StorageClient) CirculatingSupply(ctx context.Context) (*common.BigInt, error)

func (*StorageClient) DailyActiveAccounts

DailyActiveAccounts returns a list of daily active accounts.

func (*StorageClient) DebondingDelegations

DebondingDelegations returns a list of debonding delegations.

func (*StorageClient) DebondingDelegationsTo

DebondingDelegationsTo returns a list of debonding delegations to an address.

func (*StorageClient) Delegations

Delegations returns a list of delegations.

func (*StorageClient) DelegationsTo

DelegationsTo returns a list of delegations to an address.

func (*StorageClient) Entities

Entities returns a list of registered entities.

func (*StorageClient) Entity

func (c *StorageClient) Entity(ctx context.Context, address staking.Address) (*Entity, error)

Entity returns a registered entity.

func (*StorageClient) EntityNode

func (c *StorageClient) EntityNode(ctx context.Context, entityAddress staking.Address, nodeID signature.PublicKey) (*Node, error)

EntityNode returns a node controlled by the provided entity.

func (*StorageClient) EntityNodes

EntityNodes returns a list of nodes controlled by the provided entity.

func (*StorageClient) Epoch

func (c *StorageClient) Epoch(ctx context.Context, epoch int64) (*Epoch, error)

Epoch returns a consensus epoch.

func (*StorageClient) Epochs

Epochs returns a list of consensus epochs.

func (*StorageClient) Events

Events returns a list of events.

func (*StorageClient) Proposal

func (c *StorageClient) Proposal(ctx context.Context, proposalID uint64) (*Proposal, error)

Proposal returns a governance proposal.

func (*StorageClient) ProposalVotes

ProposalVotes returns votes for a governance proposal.

func (*StorageClient) Proposals

Proposals returns a list of governance proposals.

func (*StorageClient) RecentBlocks added in v0.7.20

func (c *StorageClient) RecentBlocks(ctx context.Context) (*RecentBlockList, error)

func (*StorageClient) RoothashMessages added in v0.3.0

func (*StorageClient) RuntimeAccount

func (c *StorageClient) RuntimeAccount(ctx context.Context, runtime common.Runtime, address staking.Address) (*RuntimeAccount, error)

func (*StorageClient) RuntimeBlocks

RuntimeBlocks returns a list of runtime blocks.

func (*StorageClient) RuntimeDebondingDelegations added in v0.7.18

func (*StorageClient) RuntimeDelegations added in v0.7.18

func (*StorageClient) RuntimeEVMNFTs added in v0.1.17

func (c *StorageClient) RuntimeEVMNFTs(ctx context.Context, runtime common.Runtime, limit *uint64, offset *uint64, tokenAddress *staking.Address, id *common.BigInt, ownerAddress *staking.Address) (*EvmNftList, error)

func (*StorageClient) RuntimeEvents

RuntimeEvents returns a list of runtime events.

func (*StorageClient) RuntimeRoflAppInstanceTransactions added in v0.6.3

func (c *StorageClient) RuntimeRoflAppInstanceTransactions(ctx context.Context, runtime common.Runtime, method *string, limit *uint64, offset *uint64, appId string, rak *string) (*RuntimeTransactionList, error)

RuntimeRoflAppInstanceTransactions returns a list of ROFL app instance transactions.

func (*StorageClient) RuntimeRoflAppInstances added in v0.6.3

func (c *StorageClient) RuntimeRoflAppInstances(ctx context.Context, runtime common.Runtime, params apiTypes.GetRuntimeRoflAppsIdInstancesParams, id string, rak *string) (*RoflAppInstanceList, error)

RuntimeRoflAppInstances returns a list of ROFL app instances.

func (*StorageClient) RuntimeRoflAppTransactions added in v0.6.3

RuntimeRoflAppTransactions returns a list of ROFL app transactions.

func (*StorageClient) RuntimeRoflApps added in v0.6.3

func (c *StorageClient) RuntimeRoflApps(ctx context.Context, runtime common.Runtime, params apiTypes.GetRuntimeRoflAppsParams, id *string) (*RoflAppList, error)

RuntimeRoflApps returns a list of ROFL apps.

func (*StorageClient) RuntimeRoflmarketInstances added in v0.6.13

func (c *StorageClient) RuntimeRoflmarketInstances(ctx context.Context, runtime common.Runtime, params apiTypes.GetRuntimeRoflmarketInstancesParams, id []byte) (*RoflMarketInstanceList, error)

func (*StorageClient) RuntimeRoflmarketOffers added in v0.6.13

func (*StorageClient) RuntimeRoflmarketProviders added in v0.6.13

func (c *StorageClient) RuntimeRoflmarketProviders(ctx context.Context, runtime common.Runtime, params apiTypes.GetRuntimeRoflmarketProvidersParams, address *staking.Address) (*RoflMarketProviderList, error)

RuntimeRoflmarketProviders returns a list of ROFL market providers.

func (*StorageClient) RuntimeStatus

func (c *StorageClient) RuntimeStatus(ctx context.Context, runtime common.Runtime) (*RuntimeStatus, error)

RuntimeStatus returns runtime status information.

func (*StorageClient) RuntimeTokenHolders

func (*StorageClient) RuntimeTokens

If `address` is non-nil, it is used to filter the results to at most 1 token: the one with the correcponding contract address.

func (*StorageClient) RuntimeTransactions

RuntimeTransactions returns a list of runtime transactions.

func (*StorageClient) Shutdown

func (c *StorageClient) Shutdown()

Shutdown closes the backing TargetStorage.

func (*StorageClient) Status

func (c *StorageClient) Status(ctx context.Context) (*Status, error)

Status returns status information for Oasis Nexus.

func (*StorageClient) TotalSupply added in v0.6.0

func (c *StorageClient) TotalSupply(ctx context.Context) (*common.BigInt, error)

func (*StorageClient) Transactions

Transactions returns a list of consensus transactions.

func (*StorageClient) TxVolumes

TxVolumes returns a list of transaction volumes per time window.

func (*StorageClient) ValidatorHistory added in v0.3.2

func (*StorageClient) Validators

Validators returns a list of validators, or optionally the single validator matching `address`.

type TokenHolderList

type TokenHolderList = api.TokenHolderList

type Transaction

type Transaction = api.Transaction

Transaction is the storage response for GetTransaction.

type TransactionList

type TransactionList = api.TransactionList

TransactionList is the storage response for ListTransactions.

type TxError

type TxError = api.TxError

RuntimeTransactionList is the storage response for RuntimeTransactions.

type TxVolume

type TxVolume = api.TxVolume

TxVolume is the daily transaction volume on the specified day.

type TxVolumeList

type TxVolumeList = api.TxVolumeList

TxVolumeList is the storage response for GetVolumes.

type Validator

type Validator = api.Validator

Validator is the storage response for GetValidator.

type ValidatorAggStats added in v0.3.3

type ValidatorAggStats = api.ValidatorAggStats

ValidatorAggStats holds summary statistics for network validators.

type ValidatorCommissionBound

type ValidatorCommissionBound = api.ValidatorCommissionBound

ValidatorCommissionBound is the commission bound for a validator.

type ValidatorHistory added in v0.3.2

type ValidatorHistory = api.ValidatorHistory

ValidatorHistory is the storage response for GetValidatorHistory.

type ValidatorHistoryPoint added in v0.3.2

type ValidatorHistoryPoint = api.ValidatorHistoryPoint

ValidatorHistoryPoint is the escrow information for a validator at a given epoch.

type ValidatorList

type ValidatorList = api.ValidatorList

ValidatorList is the list of consensus validators.

type ValidatorMedia

type ValidatorMedia = api.ValidatorMedia

ValidatorMedia is the metadata for a validator.

type ValidatorSignedBlock added in v0.4.1

type ValidatorSignedBlock = api.ValidatorSignedBlock

ValidatorSignedBlock is the information weather a validator has signed a specific block.

Directories

Path Synopsis
Package queries defines the SQL queries used by the storage client.
Package queries defines the SQL queries used by the storage client.

Jump to

Keyboard shortcuts

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