userjson

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodHealth                jsonrpc.Method = "user.health"
	MethodUserVersion           jsonrpc.Method = "user.version"
	MethodPing                  jsonrpc.Method = "user.ping"
	MethodChainInfo             jsonrpc.Method = "user.chain_info"
	MethodAccount               jsonrpc.Method = "user.account"
	MethodBroadcast             jsonrpc.Method = "user.broadcast"
	MethodCall                  jsonrpc.Method = "user.call"
	MethodDatabases             jsonrpc.Method = "user.databases"
	MethodPrice                 jsonrpc.Method = "user.estimate_price"
	MethodQuery                 jsonrpc.Method = "user.query"
	MethodTxQuery               jsonrpc.Method = "user.tx_query"
	MethodSchema                jsonrpc.Method = "user.schema"
	MethodMigrationStatus       jsonrpc.Method = "user.migration_status"
	MethodListMigrations        jsonrpc.Method = "user.list_migrations"
	MethodLoadChangeset         jsonrpc.Method = "user.changeset"
	MethodLoadChangesetMetadata jsonrpc.Method = "user.changeset_metadata"
	MethodMigrationMetadata     jsonrpc.Method = "user.migration_metadata"
	MethodMigrationGenesisChunk jsonrpc.Method = "user.migration_genesis_chunk"
	MethodChallenge             jsonrpc.Method = "user.challenge"
)

Variables

View Source
var (
	AccountStatusLatest  = types.AccountStatusLatest
	AccountStatusPending = types.AccountStatusPending
)

These are the recognized AccountStatus values used with AccountRequest. AccountStatusLatest reflects confirmed state, while AccountStatusPending includes changes in mempool.

Functions

This section is empty.

Types

type AccountRequest

type AccountRequest struct {
	Identifier types.HexBytes `json:"identifier" desc:"account identifier"`
	Status     *AccountStatus `json:"status,omitempty" desc:"blockchain status (confirmed or unconfirmed)"` // Mapped to URL query parameter `status`.
}

AccountRequest contains the request parameters for MethodAccount.

type AccountResponse

type AccountResponse struct {
	Identifier types.HexBytes `json:"identifier,omitempty"`
	Balance    string         `json:"balance"`
	Nonce      int64          `json:"nonce"`
}

AccountResponse contains the response object for MethodAccount.

type AccountStatus

type AccountStatus = types.AccountStatus

AccountStatus is the type used to enumerate the different account status options recognized in AccountRequest.

type BroadcastError

type BroadcastError struct {
	// TxCode corresponds to a transactions.TxCode, rather than an RPC error code.
	TxCode  uint32 `json:"tx_code,omitempty"`
	Hash    string `json:"hash,omitempty"` // may be empty if it could not even deserialize our tx
	Message string `json:"message,omitempty"`
}

BroadcastError is a structured error object used by MethodBroadcast when creating a Response with this in Error.Data. This error type would typically be in an response with the ErrorTxExecFailure RPC ErrorCode.

func (BroadcastError) Error

func (be BroadcastError) Error() string

type BroadcastRequest

type BroadcastRequest struct {
	Tx   *transactions.Transaction `json:"tx"`
	Sync *BroadcastSync            `json:"sync,omitempty"`
}

BroadcastRequest contains the request parameters for MethodBroadcast.

type BroadcastResponse

type BroadcastResponse struct {
	TxHash types.HexBytes `json:"tx_hash,omitempty"`
}

BroadcastResponse contains the response object for MethodBroadcast.

type BroadcastSync

type BroadcastSync uint8

BroadcastSync is the type used to enumerate the broadcast request synchronization options available to BroadcastRequest.

const (
	// BroadcastSyncAsync does not wait for acceptance into mempool, only
	// computing the transaction hash.
	BroadcastSyncAsync BroadcastSync = 0
	// BroadcastSyncSync ensures the transaction is accepted to mempool before
	// responding. Ths should be preferred to BroadcastSyncAsync in most cases.
	BroadcastSyncSync BroadcastSync = 1
	// BroadcastSyncCommit will wait for the transaction to be included in a
	// block.
	BroadcastSyncCommit BroadcastSync = 2
)

These are the recognized BroadcastSync values used with BroadcastRequest.

type CallRequest

type CallRequest = transactions.CallMessage

CallRequest contains the request parameters for MethodCall.

type CallResponse

type CallResponse struct {
	Result []byte   `json:"result,omitempty"`
	Logs   []string `json:"logs,omitempty"`
}

CallResponse contains the response object for MethodCall.

type ChainInfoRequest

type ChainInfoRequest struct{}

ChainInfoRequest contains the request parameters for MethodChainInfo.

type ChainInfoResponse

type ChainInfoResponse = types.ChainInfo

ChainInfoResponse contains the response object for MethodChainInfo.

type ChallengeRequest added in v0.3.0

type ChallengeRequest struct{}

type ChallengeResponse added in v0.3.0

type ChallengeResponse struct {
	Challenge types.HexBytes `json:"challenge"`
}

type ChangesetMetadataRequest added in v0.3.0

type ChangesetMetadataRequest struct {
	Height int64 `json:"height"`
}

LoadChangesetsRequest contains the request parameters for MethodLoadChangesets.

type ChangesetMetadataResponse added in v0.3.0

type ChangesetMetadataResponse struct {
	Height     int64   `json:"height"`
	Changesets int64   `json:"changesets"`
	ChunkSizes []int64 `json:"chunk_sizes"`
}

type ChangesetRequest added in v0.3.0

type ChangesetRequest struct {
	Height int64 `json:"height"`
	Index  int64 `json:"index"`
}

type ChangesetsResponse added in v0.3.0

type ChangesetsResponse struct {
	Changesets []byte `json:"changesets"`
}

type DatasetInfo

type DatasetInfo = types.DatasetIdentifier

SchemaResponse contains the response object for MethodSchema.

type EstimatePriceRequest

type EstimatePriceRequest struct {
	Tx *transactions.Transaction `json:"tx"`
}

EstimatePriceRequest contains the request parameters for MethodPrice.

type EstimatePriceResponse

type EstimatePriceResponse struct {
	Price string `json:"price,omitempty"`
}

SchemaResponse contains the response object for MethodSchema.

type HealthRequest added in v0.3.0

type HealthRequest struct{}

type HealthResponse added in v0.3.0

type HealthResponse = types.Health

HealthResponse is the response for MethodHealth. This determines the serialized response for the Health method required by the rpcserver.Svc interface. This is the response with which most health checks will be concerned.

type ListDatabasesRequest

type ListDatabasesRequest struct {
	Owner types.HexBytes `json:"owner,omitempty"`
}

ListDatabasesRequest contains the request parameters for MethodDatabases.

type ListDatabasesResponse

type ListDatabasesResponse struct {
	Databases []*DatasetInfo `json:"databases,omitempty"`
}

SchemaResponse contains the response object for MethodSchema.

type ListMigrationsRequest added in v0.3.0

type ListMigrationsRequest struct{}

type ListMigrationsResponse added in v0.3.0

type ListMigrationsResponse struct {
	Migrations []*types.Migration `json:"migrations"`
}

type MigrationMetadataRequest added in v0.3.0

type MigrationMetadataRequest struct{}

type MigrationMetadataResponse added in v0.3.0

type MigrationMetadataResponse struct {
	Metadata *types.MigrationMetadata `json:"metadata"`
}

type MigrationSnapshotChunkRequest added in v0.3.0

type MigrationSnapshotChunkRequest struct {
	Height     uint64 `json:"height"`
	ChunkIndex uint32 `json:"chunk_index"`
}

type MigrationSnapshotChunkResponse added in v0.3.0

type MigrationSnapshotChunkResponse struct {
	Chunk []byte `json:"chunk"`
}

type MigrationStatusRequest added in v0.3.0

type MigrationStatusRequest struct{}

type MigrationStatusResponse added in v0.3.0

type MigrationStatusResponse struct {
	Status *types.MigrationState `json:"status"`
}

type PingRequest

type PingRequest struct {
	Message string `json:"message"`
}

PingRequest contains the request parameters for MethodPing.

type PingResponse

type PingResponse struct {
	Message string `json:"message,omitempty"`
}

SchemaResponse contains the response object for MethodSchema.

type QueryRequest

type QueryRequest struct {
	DBID  string `json:"dbid"`
	Query string `json:"query"`
}

QueryRequest contains the request parameters for MethodQuery.

type QueryResponse

type QueryResponse Result

QueryResponse contains the response object for MethodQuery.

type Result

type Result struct {
	Result []byte `json:"result,omitempty"`
}

type SchemaRequest

type SchemaRequest struct {
	DBID string `json:"dbid"`
}

SchemaRequest contains the request parameters for MethodSchema.

type SchemaResponse

type SchemaResponse struct {
	Schema *types.Schema `json:"schema,omitempty"`
}

SchemaResponse contains the response object for MethodSchema.

type TxQueryRequest

type TxQueryRequest struct {
	TxHash types.HexBytes `json:"tx_hash"`
}

TxQueryRequest contains the request parameters for MethodTxQuery.

type TxQueryResponse

type TxQueryResponse struct {
	Hash     types.HexBytes                  `json:"hash,omitempty"`
	Height   int64                           `json:"height,omitempty"`
	Tx       *transactions.Transaction       `json:"tx,omitempty"`
	TxResult *transactions.TransactionResult `json:"tx_result,omitempty"`
}

TxQueryResponse contains the response object for MethodTxQuery.

type VersionRequest

type VersionRequest struct{}

type VersionResponse

type VersionResponse struct {
	Service     string `json:"service"`
	Version     string `json:"api_ver"`
	Major       uint32 `json:"major"`
	Minor       uint32 `json:"minor"`
	Patch       uint32 `json:"patch"`
	KwilVersion string `json:"kwil_ver"`
}

Jump to

Keyboard shortcuts

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