api

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 34 Imported by: 0

README

API

Execute Dispatch

Execute TX requests can be handled locally, if the API has a local node and if a given request routes to that node. Otherwise, requests must be dispatched to the appropriate node. This is done at the API level, by dispatching JSON-RPC requests.

To avoid excessive network traffic, execute requests are not dispatched immediately. If no current dispatch routine is running, the execute routine will spawn a new dispatch routine, queue up requests for a specified length of time or a specified number of requests, and then dispatch all the requests in one batch for each remote API. For example, if the queue duration is 1 second and the queue depth is 100, requests will be dispatched 1 second after the request that started the queue, or after the queue reaches 100 requests, which ever comes first.

Migrating from v1

  • Query methods are now prefixed with query.
  • version and metrics are unchanged.
  • Query methods are general - you can query any TX with query-tx, etc.
  • There is a general execute method that will accept arbitrary already-marshalled transaction blobs.
  • All transaction methods are {action}-{noun}, e.g. create-adi.
  • token-tx-create is now send-tokens.
  • facuet has not been reimplemented (yet).
  • Transactions are queued for up to 1/4 second or 100 transactions before they are dispatched.

Documentation

Index

Constants

View Source
const (
	ErrCodeInternal = -32800 - iota
	ErrCodeDispatch
	ErrCodeValidation
	ErrCodeSubmission
	ErrCodeAccumulate
	ErrCodeNotLiteAccount
	ErrCodeNotAcmeAccount
	ErrCodeNotFound
	ErrCodeCanceled
)

General Errors

View Source
const (
	ErrCodeMetricsQuery = -32900 - iota
	ErrCodeMetricsNotAVector
	ErrCodeMetricsVectorEmpty
)

Metrics errors

View Source
const (
	ErrCodeProtocolBase = -33000 - iota
)

Custom errors

Variables

View Source
var (
	ErrInternal           = jsonrpc2.NewError(ErrCodeInternal, "Internal Error", "An internal error occurred")
	ErrCanceled           = jsonrpc2.NewError(ErrCodeCanceled, "Canceled", "The request was canceled")
	ErrMetricsNotAVector  = jsonrpc2.NewError(ErrCodeMetricsNotAVector, "Metrics Query Error", "response is not a vector")
	ErrMetricsVectorEmpty = jsonrpc2.NewError(ErrCodeMetricsVectorEmpty, "Metrics Query Error", "response vector is empty")
)
View Source
var ErrInvalidUrl = errors.BadRequest.With("invalid URL")

Functions

This section is empty.

Types

type BlockFilterMode added in v1.1.0

type BlockFilterMode uint64

BlockFilterMode specifies which blocks should be excluded

const BlockFilterModeExcludeEmpty BlockFilterMode = 1

BlockFilterModeExcludeEmpty exclude empty blocks.

const BlockFilterModeExcludeNone BlockFilterMode = 0

BlockFilterModeExcludeNone return all blocks including empty ones.

func BlockFilterModeByName added in v1.1.0

func BlockFilterModeByName(name string) (BlockFilterMode, bool)

BlockFilterModeByName returns the named Block Filter Mode.

func (BlockFilterMode) GetEnumValue added in v1.1.0

func (v BlockFilterMode) GetEnumValue() uint64

GetEnumValue returns the value of the Block Filter Mode

func (BlockFilterMode) MarshalJSON added in v1.1.0

func (v BlockFilterMode) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Block Filter Mode to JSON as a string.

func (*BlockFilterMode) SetEnumValue added in v1.1.0

func (v *BlockFilterMode) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (BlockFilterMode) String added in v1.1.0

func (v BlockFilterMode) String() string

String returns the name of the Block Filter Mode.

func (*BlockFilterMode) UnmarshalJSON added in v1.1.0

func (v *BlockFilterMode) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Block Filter Mode from JSON as a string.

type ChainEntry added in v0.5.1

type ChainEntry struct {
	Height uint64      `json:"height" form:"height" query:"height" validate:"required"`
	Entry  []byte      `json:"entry,omitempty" form:"entry" query:"entry" validate:"required"`
	State  [][]byte    `json:"state,omitempty" form:"state" query:"state" validate:"required"`
	Value  interface{} `json:"value,omitempty" form:"value" query:"value" validate:"required"`
}

func (*ChainEntry) Equal added in v1.1.0

func (v *ChainEntry) Equal(u *ChainEntry) bool

func (*ChainEntry) MarshalJSON added in v0.5.1

func (v *ChainEntry) MarshalJSON() ([]byte, error)

func (*ChainEntry) UnmarshalJSON added in v0.5.1

func (v *ChainEntry) UnmarshalJSON(data []byte) error

type ChainIdQuery

type ChainIdQuery struct {
	ChainId []byte `json:"chainId,omitempty" form:"chainId" query:"chainId" validate:"required"`
}

func (*ChainIdQuery) Equal added in v1.1.0

func (v *ChainIdQuery) Equal(u *ChainIdQuery) bool

func (*ChainIdQuery) MarshalJSON

func (v *ChainIdQuery) MarshalJSON() ([]byte, error)

func (*ChainIdQuery) UnmarshalJSON

func (v *ChainIdQuery) UnmarshalJSON(data []byte) error

type ChainQueryResponse

type ChainQueryResponse struct {
	Type      string          `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	MainChain *MerkleState    `json:"mainChain,omitempty" form:"mainChain" query:"mainChain" validate:"required"`
	Chains    []ChainState    `json:"chains,omitempty" form:"chains" query:"chains" validate:"required"`
	Data      interface{}     `json:"data,omitempty" form:"data" query:"data" validate:"required"`
	ChainId   []byte          `json:"chainId,omitempty" form:"chainId" query:"chainId" validate:"required"`
	Receipt   *GeneralReceipt `json:"receipt,omitempty" form:"receipt" query:"receipt" validate:"required"`
}

func (*ChainQueryResponse) Equal added in v1.1.0

func (*ChainQueryResponse) MarshalJSON

func (v *ChainQueryResponse) MarshalJSON() ([]byte, error)

func (*ChainQueryResponse) UnmarshalJSON

func (v *ChainQueryResponse) UnmarshalJSON(data []byte) error

type ChainState added in v1.1.0

type ChainState struct {
	Name   string             `json:"name,omitempty" form:"name" query:"name" validate:"required"`
	Type   protocol.ChainType `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	Height uint64             `json:"height,omitempty" form:"height" query:"height" validate:"required"`
	Roots  [][]byte           `json:"roots,omitempty" form:"roots" query:"roots" validate:"required"`
	// contains filtered or unexported fields
}

func (*ChainState) Copy added in v1.1.0

func (v *ChainState) Copy() *ChainState

func (*ChainState) CopyAsInterface added in v1.1.0

func (v *ChainState) CopyAsInterface() interface{}

func (*ChainState) Equal added in v1.1.0

func (v *ChainState) Equal(u *ChainState) bool

func (*ChainState) IsValid added in v1.1.0

func (v *ChainState) IsValid() error

func (*ChainState) MarshalBinary added in v1.1.0

func (v *ChainState) MarshalBinary() ([]byte, error)

func (*ChainState) MarshalJSON added in v1.1.0

func (v *ChainState) MarshalJSON() ([]byte, error)

func (*ChainState) UnmarshalBinary added in v1.1.0

func (v *ChainState) UnmarshalBinary(data []byte) error

func (*ChainState) UnmarshalBinaryFrom added in v1.1.0

func (v *ChainState) UnmarshalBinaryFrom(rd io.Reader) error

func (*ChainState) UnmarshalJSON added in v1.1.0

func (v *ChainState) UnmarshalJSON(data []byte) error

type DataEntryQuery

type DataEntryQuery struct {
	Url       *url.URL `json:"url,omitempty" form:"url" query:"url" validate:"required"`
	EntryHash [32]byte `json:"entryHash,omitempty" form:"entryHash" query:"entryHash"`
	// contains filtered or unexported fields
}

func (*DataEntryQuery) Copy added in v0.5.1

func (v *DataEntryQuery) Copy() *DataEntryQuery

func (*DataEntryQuery) CopyAsInterface added in v0.5.1

func (v *DataEntryQuery) CopyAsInterface() interface{}

func (*DataEntryQuery) Equal

func (v *DataEntryQuery) Equal(u *DataEntryQuery) bool

func (*DataEntryQuery) IsValid

func (v *DataEntryQuery) IsValid() error

func (*DataEntryQuery) MarshalBinary

func (v *DataEntryQuery) MarshalBinary() ([]byte, error)

func (*DataEntryQuery) MarshalJSON

func (v *DataEntryQuery) MarshalJSON() ([]byte, error)

func (*DataEntryQuery) UnmarshalBinary

func (v *DataEntryQuery) UnmarshalBinary(data []byte) error

func (*DataEntryQuery) UnmarshalBinaryFrom

func (v *DataEntryQuery) UnmarshalBinaryFrom(rd io.Reader) error

func (*DataEntryQuery) UnmarshalJSON

func (v *DataEntryQuery) UnmarshalJSON(data []byte) error

type DataEntryQueryResponse

type DataEntryQueryResponse struct {
	EntryHash [32]byte           `json:"entryHash,omitempty" form:"entryHash" query:"entryHash" validate:"required"`
	Entry     protocol.DataEntry `json:"entry,omitempty" form:"entry" query:"entry" validate:"required"`
	TxId      *url.TxID          `json:"txId,omitempty" form:"txId" query:"txId" validate:"required"`
	CauseTxId *url.TxID          `json:"causeTxId,omitempty" form:"causeTxId" query:"causeTxId" validate:"required"`
	// contains filtered or unexported fields
}

func (*DataEntryQueryResponse) Copy added in v0.5.1

func (*DataEntryQueryResponse) CopyAsInterface added in v0.5.1

func (v *DataEntryQueryResponse) CopyAsInterface() interface{}

func (*DataEntryQueryResponse) Equal

func (*DataEntryQueryResponse) IsValid

func (v *DataEntryQueryResponse) IsValid() error

func (*DataEntryQueryResponse) MarshalBinary

func (v *DataEntryQueryResponse) MarshalBinary() ([]byte, error)

func (*DataEntryQueryResponse) MarshalJSON

func (v *DataEntryQueryResponse) MarshalJSON() ([]byte, error)

func (*DataEntryQueryResponse) UnmarshalBinary

func (v *DataEntryQueryResponse) UnmarshalBinary(data []byte) error

func (*DataEntryQueryResponse) UnmarshalBinaryFrom

func (v *DataEntryQueryResponse) UnmarshalBinaryFrom(rd io.Reader) error

func (*DataEntryQueryResponse) UnmarshalJSON

func (v *DataEntryQueryResponse) UnmarshalJSON(data []byte) error

type DataEntrySetQuery

type DataEntrySetQuery struct {
	UrlQuery
	QueryPagination
	QueryOptions
}

func (*DataEntrySetQuery) Equal added in v1.1.0

func (*DataEntrySetQuery) MarshalJSON

func (v *DataEntrySetQuery) MarshalJSON() ([]byte, error)

func (*DataEntrySetQuery) UnmarshalJSON

func (v *DataEntrySetQuery) UnmarshalJSON(data []byte) error

type DescriptionResponse

type DescriptionResponse struct {
	PartitionId   string                 `json:"partitionId,omitempty" form:"partitionId" query:"partitionId" validate:"required"`
	NetworkType   protocol.PartitionType `json:"networkType,omitempty" form:"networkType" query:"networkType" validate:"required"`
	Network       config.Network         `json:"network,omitempty" form:"network" query:"network" validate:"required"`
	NetworkAnchor [32]byte               `json:"networkAnchor,omitempty" form:"networkAnchor" query:"networkAnchor" validate:"required"`
	Values        core.GlobalValues      `json:"values,omitempty" form:"values" query:"values" validate:"required"`
	Error         *errors2.Error         `json:"error,omitempty" form:"error" query:"error" validate:"required"`
}

func (*DescriptionResponse) Equal added in v1.1.0

func (*DescriptionResponse) MarshalJSON added in v1.0.0

func (v *DescriptionResponse) MarshalJSON() ([]byte, error)

func (*DescriptionResponse) UnmarshalJSON added in v1.0.0

func (v *DescriptionResponse) UnmarshalJSON(data []byte) error

type DirectoryQuery

type DirectoryQuery struct {
	UrlQuery
	QueryPagination
	QueryOptions
}

func (*DirectoryQuery) Equal added in v1.1.0

func (v *DirectoryQuery) Equal(u *DirectoryQuery) bool

func (*DirectoryQuery) MarshalJSON

func (v *DirectoryQuery) MarshalJSON() ([]byte, error)

func (*DirectoryQuery) UnmarshalJSON

func (v *DirectoryQuery) UnmarshalJSON(data []byte) error

type ExecuteRequest added in v1.0.0

type ExecuteRequest struct {
	Envelope  *messaging.Envelope `json:"envelope,omitempty" form:"envelope" query:"envelope" validate:"required"`
	CheckOnly bool                `json:"checkOnly,omitempty" form:"checkOnly" query:"checkOnly"`
}

func (*ExecuteRequest) Equal added in v1.1.0

func (v *ExecuteRequest) Equal(u *ExecuteRequest) bool

type GeneralQuery

type GeneralQuery struct {
	UrlQuery
	QueryOptions
}

func (*GeneralQuery) Equal added in v1.1.0

func (v *GeneralQuery) Equal(u *GeneralQuery) bool

func (*GeneralQuery) MarshalJSON

func (v *GeneralQuery) MarshalJSON() ([]byte, error)

func (*GeneralQuery) UnmarshalJSON

func (v *GeneralQuery) UnmarshalJSON(data []byte) error

type GeneralReceipt added in v1.1.0

type GeneralReceipt struct {
	LocalBlock     uint64         `json:"localBlock,omitempty" form:"localBlock" query:"localBlock" validate:"required"`
	LocalBlockTime *time.Time     `json:"localBlockTime,omitempty" form:"localBlockTime" query:"localBlockTime" validate:"required"`
	DirectoryBlock uint64         `json:"directoryBlock,omitempty" form:"directoryBlock" query:"directoryBlock" validate:"required"`
	MajorBlock     uint64         `json:"majorBlock,omitempty" form:"majorBlock" query:"majorBlock" validate:"required"`
	Proof          merkle.Receipt `json:"proof,omitempty" form:"proof" query:"proof" validate:"required"`
	Error          string         `json:"error,omitempty" form:"error" query:"error" validate:"required"`
	// contains filtered or unexported fields
}

func (*GeneralReceipt) Copy added in v1.1.0

func (v *GeneralReceipt) Copy() *GeneralReceipt

func (*GeneralReceipt) CopyAsInterface added in v1.1.0

func (v *GeneralReceipt) CopyAsInterface() interface{}

func (*GeneralReceipt) Equal added in v1.1.0

func (v *GeneralReceipt) Equal(u *GeneralReceipt) bool

func (*GeneralReceipt) IsValid added in v1.1.0

func (v *GeneralReceipt) IsValid() error

func (*GeneralReceipt) MarshalBinary added in v1.1.0

func (v *GeneralReceipt) MarshalBinary() ([]byte, error)

func (*GeneralReceipt) MarshalJSON added in v1.1.0

func (v *GeneralReceipt) MarshalJSON() ([]byte, error)

func (*GeneralReceipt) UnmarshalBinary added in v1.1.0

func (v *GeneralReceipt) UnmarshalBinary(data []byte) error

func (*GeneralReceipt) UnmarshalBinaryFrom added in v1.1.0

func (v *GeneralReceipt) UnmarshalBinaryFrom(rd io.Reader) error

func (*GeneralReceipt) UnmarshalJSON added in v1.1.0

func (v *GeneralReceipt) UnmarshalJSON(data []byte) error

type JrpcMethods

type JrpcMethods struct {
	Options
	// contains filtered or unexported fields
}

func NewJrpc

func NewJrpc(opts Options) (*JrpcMethods, error)

func (*JrpcMethods) Describe

func (m *JrpcMethods) Describe(ctx context.Context, _ json.RawMessage) interface{}

func (*JrpcMethods) Execute

func (m *JrpcMethods) Execute(ctx context.Context, params json.RawMessage) interface{}

func (*JrpcMethods) ExecuteAddCredits

func (m *JrpcMethods) ExecuteAddCredits(ctx context.Context, params json.RawMessage) interface{}

ExecuteAddCredits submits an AddCredits transaction.

func (*JrpcMethods) ExecuteBurnTokens

func (m *JrpcMethods) ExecuteBurnTokens(ctx context.Context, params json.RawMessage) interface{}

ExecuteBurnTokens submits a BurnTokens transaction.

func (*JrpcMethods) ExecuteCreateAdi

func (m *JrpcMethods) ExecuteCreateAdi(ctx context.Context, params json.RawMessage) interface{}

ExecuteCreateAdi submits a CreateIdentity transaction.

func (*JrpcMethods) ExecuteCreateDataAccount

func (m *JrpcMethods) ExecuteCreateDataAccount(ctx context.Context, params json.RawMessage) interface{}

ExecuteCreateDataAccount submits a CreateDataAccount transaction.

func (*JrpcMethods) ExecuteCreateIdentity

func (m *JrpcMethods) ExecuteCreateIdentity(ctx context.Context, params json.RawMessage) interface{}

ExecuteCreateIdentity submits a CreateIdentity transaction.

func (*JrpcMethods) ExecuteCreateKeyBook

func (m *JrpcMethods) ExecuteCreateKeyBook(ctx context.Context, params json.RawMessage) interface{}

ExecuteCreateKeyBook submits a CreateKeyBook transaction.

func (*JrpcMethods) ExecuteCreateKeyPage

func (m *JrpcMethods) ExecuteCreateKeyPage(ctx context.Context, params json.RawMessage) interface{}

ExecuteCreateKeyPage submits a CreateKeyPage transaction.

func (*JrpcMethods) ExecuteCreateToken

func (m *JrpcMethods) ExecuteCreateToken(ctx context.Context, params json.RawMessage) interface{}

ExecuteCreateToken submits a CreateToken transaction.

func (*JrpcMethods) ExecuteCreateTokenAccount

func (m *JrpcMethods) ExecuteCreateTokenAccount(ctx context.Context, params json.RawMessage) interface{}

ExecuteCreateTokenAccount submits a CreateTokenAccount transaction.

func (*JrpcMethods) ExecuteDirect added in v1.0.0

func (m *JrpcMethods) ExecuteDirect(ctx context.Context, params json.RawMessage) interface{}

func (*JrpcMethods) ExecuteIssueTokens

func (m *JrpcMethods) ExecuteIssueTokens(ctx context.Context, params json.RawMessage) interface{}

ExecuteIssueTokens submits an IssueTokens transaction.

func (*JrpcMethods) ExecuteLocal added in v1.0.0

func (m *JrpcMethods) ExecuteLocal(ctx context.Context, params json.RawMessage) interface{}

func (*JrpcMethods) ExecuteSendTokens

func (m *JrpcMethods) ExecuteSendTokens(ctx context.Context, params json.RawMessage) interface{}

ExecuteSendTokens submits a SendTokens transaction.

func (*JrpcMethods) ExecuteUpdateAccountAuth added in v0.6.0

func (m *JrpcMethods) ExecuteUpdateAccountAuth(ctx context.Context, params json.RawMessage) interface{}

ExecuteUpdateAccountAuth submits an UpdateAccountAuth transaction.

func (*JrpcMethods) ExecuteUpdateKey added in v0.6.0

func (m *JrpcMethods) ExecuteUpdateKey(ctx context.Context, params json.RawMessage) interface{}

ExecuteUpdateKey submits an UpdateKey transaction.

func (*JrpcMethods) ExecuteUpdateKeyPage

func (m *JrpcMethods) ExecuteUpdateKeyPage(ctx context.Context, params json.RawMessage) interface{}

ExecuteUpdateKeyPage submits an UpdateKeyPage transaction.

func (*JrpcMethods) ExecuteWriteData

func (m *JrpcMethods) ExecuteWriteData(ctx context.Context, params json.RawMessage) interface{}

ExecuteWriteData submits a WriteData transaction.

func (*JrpcMethods) ExecuteWriteDataTo

func (m *JrpcMethods) ExecuteWriteDataTo(ctx context.Context, params json.RawMessage) interface{}

ExecuteWriteDataTo submits a WriteDataTo transaction.

func (*JrpcMethods) Faucet

func (m *JrpcMethods) Faucet(ctx context.Context, params json.RawMessage) interface{}

func (*JrpcMethods) Metrics

func (m *JrpcMethods) Metrics(ctx context.Context, params json.RawMessage) interface{}

Metrics returns Metrics for explorer (tps, etc.)

func (*JrpcMethods) NewMux

func (m *JrpcMethods) NewMux() *http.ServeMux

func (*JrpcMethods) Query

func (m *JrpcMethods) Query(ctx context.Context, params json.RawMessage) any

Query queries an account or account chain by URL.

func (*JrpcMethods) QueryData

func (m *JrpcMethods) QueryData(ctx context.Context, params json.RawMessage) any

func (*JrpcMethods) QueryDataSet

func (m *JrpcMethods) QueryDataSet(ctx context.Context, params json.RawMessage) any

func (*JrpcMethods) QueryDirectory

func (m *JrpcMethods) QueryDirectory(ctx context.Context, params json.RawMessage) any

func (*JrpcMethods) QueryKeyPageIndex

func (m *JrpcMethods) QueryKeyPageIndex(ctx context.Context, params json.RawMessage) any

func (*JrpcMethods) QueryMajorBlocks added in v1.0.0

func (m *JrpcMethods) QueryMajorBlocks(ctx context.Context, params json.RawMessage) interface{}

func (*JrpcMethods) QueryMinorBlocks added in v0.6.0

func (m *JrpcMethods) QueryMinorBlocks(ctx context.Context, params json.RawMessage) interface{}

func (*JrpcMethods) QuerySynth added in v1.0.0

func (m *JrpcMethods) QuerySynth(ctx context.Context, params json.RawMessage) interface{}

func (*JrpcMethods) QueryTx

func (m *JrpcMethods) QueryTx(ctx context.Context, params json.RawMessage) interface{}

func (*JrpcMethods) QueryTxHistory

func (m *JrpcMethods) QueryTxHistory(ctx context.Context, params json.RawMessage) any

func (*JrpcMethods) QueryTxLocal added in v1.0.0

func (m *JrpcMethods) QueryTxLocal(ctx context.Context, params json.RawMessage) any

func (*JrpcMethods) Status

func (m *JrpcMethods) Status(ctx context.Context, _ json.RawMessage) interface{}

func (*JrpcMethods) Version

func (m *JrpcMethods) Version(ctx context.Context, _ json.RawMessage) interface{}

type KeyPage

type KeyPage struct {
	Version uint64 `json:"version,omitempty" form:"version" query:"version"`
}

func (*KeyPage) Equal added in v1.1.0

func (v *KeyPage) Equal(u *KeyPage) bool

func (*KeyPage) MarshalJSON added in v0.5.1

func (v *KeyPage) MarshalJSON() ([]byte, error)

func (*KeyPage) UnmarshalJSON added in v0.5.1

func (v *KeyPage) UnmarshalJSON(data []byte) error

type KeyPageIndexQuery

type KeyPageIndexQuery struct {
	UrlQuery
	Key []byte `json:"key,omitempty" form:"key" query:"key" validate:"required"`
}

func (*KeyPageIndexQuery) Equal added in v1.1.0

func (*KeyPageIndexQuery) MarshalJSON

func (v *KeyPageIndexQuery) MarshalJSON() ([]byte, error)

func (*KeyPageIndexQuery) UnmarshalJSON

func (v *KeyPageIndexQuery) UnmarshalJSON(data []byte) error

type MajorBlocksQuery added in v1.0.0

type MajorBlocksQuery struct {
	UrlQuery
	QueryPagination
}

func (*MajorBlocksQuery) Equal added in v1.1.0

func (v *MajorBlocksQuery) Equal(u *MajorBlocksQuery) bool

func (*MajorBlocksQuery) MarshalJSON added in v1.0.0

func (v *MajorBlocksQuery) MarshalJSON() ([]byte, error)

func (*MajorBlocksQuery) UnmarshalJSON added in v1.0.0

func (v *MajorBlocksQuery) UnmarshalJSON(data []byte) error

type MajorQueryResponse added in v1.0.0

type MajorQueryResponse struct {

	// MajorBlockIndex is the index of the major block..
	MajorBlockIndex uint64 `json:"majorBlockIndex,omitempty" form:"majorBlockIndex" query:"majorBlockIndex" validate:"required"`
	// MajorBlockTime is the start time of the major block..
	MajorBlockTime *time.Time    `json:"majorBlockTime,omitempty" form:"majorBlockTime" query:"majorBlockTime" validate:"required"`
	MinorBlocks    []*MinorBlock `json:"minorBlocks,omitempty" form:"minorBlocks" query:"minorBlocks" validate:"required"`
}

func (*MajorQueryResponse) Equal added in v1.1.0

func (*MajorQueryResponse) MarshalJSON added in v1.0.0

func (v *MajorQueryResponse) MarshalJSON() ([]byte, error)

func (*MajorQueryResponse) UnmarshalJSON added in v1.0.0

func (v *MajorQueryResponse) UnmarshalJSON(data []byte) error

type MerkleState

type MerkleState struct {
	Height uint64   `json:"height,omitempty" form:"height" query:"height" validate:"required"`
	Roots  [][]byte `json:"roots,omitempty" form:"roots" query:"roots" validate:"required"`
}

func (*MerkleState) Equal added in v1.1.0

func (v *MerkleState) Equal(u *MerkleState) bool

func (*MerkleState) MarshalJSON

func (v *MerkleState) MarshalJSON() ([]byte, error)

func (*MerkleState) UnmarshalJSON

func (v *MerkleState) UnmarshalJSON(data []byte) error

type MetricsQuery

type MetricsQuery struct {
	Metric   string        `json:"metric,omitempty" form:"metric" query:"metric" validate:"required"`
	Duration time.Duration `json:"duration,omitempty" form:"duration" query:"duration" validate:"required"`
}

func (*MetricsQuery) Equal added in v1.1.0

func (v *MetricsQuery) Equal(u *MetricsQuery) bool

func (*MetricsQuery) MarshalJSON

func (v *MetricsQuery) MarshalJSON() ([]byte, error)

func (*MetricsQuery) UnmarshalJSON

func (v *MetricsQuery) UnmarshalJSON(data []byte) error

type MetricsResponse

type MetricsResponse struct {
	Value interface{} `json:"value,omitempty" form:"value" query:"value" validate:"required"`
}

func (*MetricsResponse) Equal added in v1.1.0

func (v *MetricsResponse) Equal(u *MetricsResponse) bool

func (*MetricsResponse) MarshalJSON

func (v *MetricsResponse) MarshalJSON() ([]byte, error)

func (*MetricsResponse) UnmarshalJSON

func (v *MetricsResponse) UnmarshalJSON(data []byte) error

type MinorBlock added in v1.0.0

type MinorBlock struct {

	// BlockIndex is the index of the block. Only include when indexing the root anchor chain.
	BlockIndex uint64 `json:"blockIndex,omitempty" form:"blockIndex" query:"blockIndex" validate:"required"`
	// BlockTime is the start time of the block..
	BlockTime *time.Time `json:"blockTime,omitempty" form:"blockTime" query:"blockTime" validate:"required"`
}

func (*MinorBlock) Equal added in v1.1.0

func (v *MinorBlock) Equal(u *MinorBlock) bool

type MinorBlocksQuery added in v0.6.0

type MinorBlocksQuery struct {
	UrlQuery
	QueryPagination
	TxFetchMode     TxFetchMode     `json:"txFetchMode,omitempty" form:"txFetchMode" query:"txFetchMode"`
	BlockFilterMode BlockFilterMode `json:"blockFilterMode,omitempty" form:"blockFilterMode" query:"blockFilterMode"`
}

func (*MinorBlocksQuery) Equal added in v1.1.0

func (v *MinorBlocksQuery) Equal(u *MinorBlocksQuery) bool

func (*MinorBlocksQuery) MarshalJSON added in v0.6.0

func (v *MinorBlocksQuery) MarshalJSON() ([]byte, error)

func (*MinorBlocksQuery) UnmarshalJSON added in v0.6.0

func (v *MinorBlocksQuery) UnmarshalJSON(data []byte) error

type MinorQueryResponse added in v0.6.0

type MinorQueryResponse struct {
	MinorBlock
	// TxCount shows how many transactions this block contains.
	TxCount      uint64                      `json:"txCount,omitempty" form:"txCount" query:"txCount" validate:"required"`
	TxIds        [][]byte                    `json:"txIds,omitempty" form:"txIds" query:"txIds" validate:"required"`
	Transactions []*TransactionQueryResponse `json:"transactions,omitempty" form:"transactions" query:"transactions" validate:"required"`
}

func (*MinorQueryResponse) Equal added in v1.1.0

func (*MinorQueryResponse) MarshalJSON added in v0.6.0

func (v *MinorQueryResponse) MarshalJSON() ([]byte, error)

func (*MinorQueryResponse) UnmarshalJSON added in v0.6.0

func (v *MinorQueryResponse) UnmarshalJSON(data []byte) error

type MultiResponse

type MultiResponse struct {
	Type       string        `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	Items      []interface{} `json:"items,omitempty" form:"items" query:"items" validate:"required"`
	Start      uint64        `json:"start" form:"start" query:"start" validate:"required"`
	Count      uint64        `json:"count" form:"count" query:"count" validate:"required"`
	Total      uint64        `json:"total" form:"total" query:"total" validate:"required"`
	OtherItems []interface{} `json:"otherItems,omitempty" form:"otherItems" query:"otherItems" validate:"required"`
}

func (*MultiResponse) Equal added in v1.1.0

func (v *MultiResponse) Equal(u *MultiResponse) bool

func (*MultiResponse) MarshalJSON

func (v *MultiResponse) MarshalJSON() ([]byte, error)

func (*MultiResponse) UnmarshalJSON

func (v *MultiResponse) UnmarshalJSON(data []byte) error

type Options

type Options struct {
	Logger        log.Logger
	Describe      *config.Describe
	TxMaxWaitTime time.Duration
	LocalV3       V3
	Querier       api.Querier
	Submitter     api.Submitter
	Network       api.NetworkService
	Faucet        api.Faucet
	Validator     api.Validator
	Sequencer     private.Sequencer
}

type QueryOptions

type QueryOptions struct {
	Expand  bool   `json:"expand,omitempty" form:"expand" query:"expand"`
	Height  uint64 `json:"height,omitempty" form:"height" query:"height"`
	Scratch bool   `json:"scratch,omitempty" form:"scratch" query:"scratch"`
	Prove   bool   `json:"prove,omitempty" form:"prove" query:"prove"`
	// IncludeRemote tells QueryTx not to ignore remote transactions.
	IncludeRemote bool `json:"includeRemote,omitempty" form:"includeRemote" query:"includeRemote"`
}

func (*QueryOptions) Equal added in v1.1.0

func (v *QueryOptions) Equal(u *QueryOptions) bool

func (*QueryOptions) MarshalJSON

func (v *QueryOptions) MarshalJSON() ([]byte, error)

func (*QueryOptions) UnmarshalJSON

func (v *QueryOptions) UnmarshalJSON(data []byte) error

type QueryPagination

type QueryPagination struct {
	Start uint64 `json:"start,omitempty" form:"start" query:"start"`
	Count uint64 `json:"count,omitempty" form:"count" query:"count"`
}

func (*QueryPagination) Equal added in v1.1.0

func (v *QueryPagination) Equal(u *QueryPagination) bool

type ResponseDataEntry added in v1.1.0

type ResponseDataEntry struct {
	EntryHash [32]byte           `json:"entryHash,omitempty" form:"entryHash" query:"entryHash" validate:"required"`
	Entry     protocol.DataEntry `json:"entry,omitempty" form:"entry" query:"entry" validate:"required"`
	TxId      *url.TxID          `json:"txId,omitempty" form:"txId" query:"txId" validate:"required"`
	CauseTxId *url.TxID          `json:"causeTxId,omitempty" form:"causeTxId" query:"causeTxId" validate:"required"`
	// contains filtered or unexported fields
}

func (*ResponseDataEntry) Copy added in v1.1.0

func (*ResponseDataEntry) CopyAsInterface added in v1.1.0

func (v *ResponseDataEntry) CopyAsInterface() interface{}

func (*ResponseDataEntry) Equal added in v1.1.0

func (*ResponseDataEntry) IsValid added in v1.1.0

func (v *ResponseDataEntry) IsValid() error

func (*ResponseDataEntry) MarshalBinary added in v1.1.0

func (v *ResponseDataEntry) MarshalBinary() ([]byte, error)

func (*ResponseDataEntry) MarshalJSON added in v1.1.0

func (v *ResponseDataEntry) MarshalJSON() ([]byte, error)

func (*ResponseDataEntry) UnmarshalBinary added in v1.1.0

func (v *ResponseDataEntry) UnmarshalBinary(data []byte) error

func (*ResponseDataEntry) UnmarshalBinaryFrom added in v1.1.0

func (v *ResponseDataEntry) UnmarshalBinaryFrom(rd io.Reader) error

func (*ResponseDataEntry) UnmarshalJSON added in v1.1.0

func (v *ResponseDataEntry) UnmarshalJSON(data []byte) error

type ResponseDataEntrySet added in v1.1.0

type ResponseDataEntrySet struct {
	DataEntries []ResponseDataEntry `json:"dataEntries,omitempty" form:"dataEntries" query:"dataEntries" validate:"required"`
	Total       uint64              `json:"total,omitempty" form:"total" query:"total" validate:"required"`
	// contains filtered or unexported fields
}

func (*ResponseDataEntrySet) Copy added in v1.1.0

func (*ResponseDataEntrySet) CopyAsInterface added in v1.1.0

func (v *ResponseDataEntrySet) CopyAsInterface() interface{}

func (*ResponseDataEntrySet) Equal added in v1.1.0

func (*ResponseDataEntrySet) IsValid added in v1.1.0

func (v *ResponseDataEntrySet) IsValid() error

func (*ResponseDataEntrySet) MarshalBinary added in v1.1.0

func (v *ResponseDataEntrySet) MarshalBinary() ([]byte, error)

func (*ResponseDataEntrySet) MarshalJSON added in v1.1.0

func (v *ResponseDataEntrySet) MarshalJSON() ([]byte, error)

func (*ResponseDataEntrySet) UnmarshalBinary added in v1.1.0

func (v *ResponseDataEntrySet) UnmarshalBinary(data []byte) error

func (*ResponseDataEntrySet) UnmarshalBinaryFrom added in v1.1.0

func (v *ResponseDataEntrySet) UnmarshalBinaryFrom(rd io.Reader) error

func (*ResponseDataEntrySet) UnmarshalJSON added in v1.1.0

func (v *ResponseDataEntrySet) UnmarshalJSON(data []byte) error

type ResponseKeyPageIndex added in v1.1.0

type ResponseKeyPageIndex struct {
	Authority *url.URL `json:"authority,omitempty" form:"authority" query:"authority" validate:"required"`
	Signer    *url.URL `json:"signer,omitempty" form:"signer" query:"signer" validate:"required"`
	Index     uint64   `json:"index" form:"index" query:"index" validate:"required"`
	// contains filtered or unexported fields
}

func (*ResponseKeyPageIndex) Copy added in v1.1.0

func (*ResponseKeyPageIndex) CopyAsInterface added in v1.1.0

func (v *ResponseKeyPageIndex) CopyAsInterface() interface{}

func (*ResponseKeyPageIndex) Equal added in v1.1.0

func (*ResponseKeyPageIndex) IsValid added in v1.1.0

func (v *ResponseKeyPageIndex) IsValid() error

func (*ResponseKeyPageIndex) MarshalBinary added in v1.1.0

func (v *ResponseKeyPageIndex) MarshalBinary() ([]byte, error)

func (*ResponseKeyPageIndex) MarshalJSON added in v1.1.0

func (v *ResponseKeyPageIndex) MarshalJSON() ([]byte, error)

func (*ResponseKeyPageIndex) UnmarshalBinary added in v1.1.0

func (v *ResponseKeyPageIndex) UnmarshalBinary(data []byte) error

func (*ResponseKeyPageIndex) UnmarshalBinaryFrom added in v1.1.0

func (v *ResponseKeyPageIndex) UnmarshalBinaryFrom(rd io.Reader) error

func (*ResponseKeyPageIndex) UnmarshalJSON added in v1.1.0

func (v *ResponseKeyPageIndex) UnmarshalJSON(data []byte) error

type SignatureBook added in v0.5.1

type SignatureBook struct {
	Authority *url.URL         `json:"authority,omitempty" form:"authority" query:"authority" validate:"required"`
	Pages     []*SignaturePage `json:"pages,omitempty" form:"pages" query:"pages" validate:"required"`
}

func (*SignatureBook) Equal added in v1.1.0

func (v *SignatureBook) Equal(u *SignatureBook) bool

func (*SignatureBook) MarshalJSON added in v0.6.0

func (v *SignatureBook) MarshalJSON() ([]byte, error)

func (*SignatureBook) UnmarshalJSON added in v0.6.0

func (v *SignatureBook) UnmarshalJSON(data []byte) error

type SignaturePage added in v0.5.1

type SignaturePage struct {
	Signer     SignerMetadata       `json:"signer,omitempty" form:"signer" query:"signer" validate:"required"`
	Signatures []protocol.Signature `json:"signatures,omitempty" form:"signatures" query:"signatures" validate:"required"`
}

func (*SignaturePage) Equal added in v1.1.0

func (v *SignaturePage) Equal(u *SignaturePage) bool

func (*SignaturePage) MarshalJSON added in v0.5.1

func (v *SignaturePage) MarshalJSON() ([]byte, error)

func (*SignaturePage) UnmarshalJSON added in v0.5.1

func (v *SignaturePage) UnmarshalJSON(data []byte) error

type Signer

type Signer struct {
	PublicKey     []byte                 `json:"publicKey,omitempty" form:"publicKey" query:"publicKey" validate:"required"`
	Timestamp     uint64                 `json:"timestamp,omitempty" form:"timestamp" query:"timestamp" validate:"required"`
	Url           *url.URL               `json:"url,omitempty" form:"url" query:"url" validate:"required"`
	Version       uint64                 `json:"version,omitempty" form:"version" query:"version"`
	SignatureType protocol.SignatureType `json:"signatureType,omitempty" form:"signatureType" query:"signatureType"`
	// UseSimpleHash tells the API to use the signature's simple metadata hash as the initiator hash instead of its Merkle hash.
	UseSimpleHash bool `json:"useSimpleHash,omitempty" form:"useSimpleHash" query:"useSimpleHash"`
}

func (*Signer) Equal added in v1.1.0

func (v *Signer) Equal(u *Signer) bool

func (*Signer) MarshalJSON

func (v *Signer) MarshalJSON() ([]byte, error)

func (*Signer) UnmarshalJSON

func (v *Signer) UnmarshalJSON(data []byte) error

type SignerMetadata added in v0.5.1

type SignerMetadata struct {
	Type            protocol.AccountType `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	Url             *url.URL             `json:"url,omitempty" form:"url" query:"url" validate:"required"`
	AcceptThreshold uint64               `json:"acceptThreshold,omitempty" form:"acceptThreshold" query:"acceptThreshold" validate:"required"`
}

func (*SignerMetadata) Equal added in v1.1.0

func (v *SignerMetadata) Equal(u *SignerMetadata) bool

type StatusResponse

type StatusResponse struct {
	Ok                        bool      `json:"ok,omitempty" form:"ok" query:"ok" validate:"required"`
	BvnHeight                 int64     `json:"bvnHeight,omitempty" form:"bvnHeight" query:"bvnHeight" validate:"required"`
	DnHeight                  int64     `json:"dnHeight,omitempty" form:"dnHeight" query:"dnHeight" validate:"required"`
	BvnTime                   time.Time `json:"bvnTime,omitempty" form:"bvnTime" query:"bvnTime" validate:"required"`
	DnTime                    time.Time `json:"dnTime,omitempty" form:"dnTime" query:"dnTime" validate:"required"`
	LastDirectoryAnchorHeight uint64    `` /* 129-byte string literal not displayed */
	BvnRootHash               [32]byte  `json:"bvnRootHash,omitempty" form:"bvnRootHash" query:"bvnRootHash" validate:"required"`
	DnRootHash                [32]byte  `json:"dnRootHash,omitempty" form:"dnRootHash" query:"dnRootHash" validate:"required"`
	BvnBptHash                [32]byte  `json:"bvnBptHash,omitempty" form:"bvnBptHash" query:"bvnBptHash" validate:"required"`
	DnBptHash                 [32]byte  `json:"dnBptHash,omitempty" form:"dnBptHash" query:"dnBptHash" validate:"required"`
}

func (*StatusResponse) Equal added in v1.1.0

func (v *StatusResponse) Equal(u *StatusResponse) bool

func (*StatusResponse) MarshalJSON added in v1.0.0

func (v *StatusResponse) MarshalJSON() ([]byte, error)

func (*StatusResponse) UnmarshalJSON added in v1.0.0

func (v *StatusResponse) UnmarshalJSON(data []byte) error

type SyntheticTransactionRequest added in v1.0.0

type SyntheticTransactionRequest struct {
	Source         *url.URL `json:"source,omitempty" form:"source" query:"source" validate:"required"`
	Destination    *url.URL `json:"destination,omitempty" form:"destination" query:"destination" validate:"required"`
	SequenceNumber uint64   `json:"sequenceNumber,omitempty" form:"sequenceNumber" query:"sequenceNumber"`
	Anchor         bool     `json:"anchor,omitempty" form:"anchor" query:"anchor"`
}

func (*SyntheticTransactionRequest) Equal added in v1.1.0

type TokenDeposit

type TokenDeposit struct {
	Url    *url.URL `json:"url,omitempty" form:"url" query:"url" validate:"required"`
	Amount big.Int  `json:"amount,omitempty" form:"amount" query:"amount" validate:"required"`
	Txid   []byte   `json:"txid,omitempty" form:"txid" query:"txid" validate:"required"`
}

func (*TokenDeposit) Equal added in v1.1.0

func (v *TokenDeposit) Equal(u *TokenDeposit) bool

func (*TokenDeposit) MarshalJSON

func (v *TokenDeposit) MarshalJSON() ([]byte, error)

func (*TokenDeposit) UnmarshalJSON

func (v *TokenDeposit) UnmarshalJSON(data []byte) error

type TokenSend

type TokenSend struct {
	From *url.URL       `json:"from,omitempty" form:"from" query:"from" validate:"required"`
	To   []TokenDeposit `json:"to,omitempty" form:"to" query:"to" validate:"required"`
}

func (*TokenSend) Equal added in v1.1.0

func (v *TokenSend) Equal(u *TokenSend) bool

func (*TokenSend) MarshalJSON added in v0.6.0

func (v *TokenSend) MarshalJSON() ([]byte, error)

func (*TokenSend) UnmarshalJSON added in v0.6.0

func (v *TokenSend) UnmarshalJSON(data []byte) error

type TransactionQueryResponse

type TransactionQueryResponse struct {
	Type            string                      `json:"type,omitempty" form:"type" query:"type" validate:"required"`
	MainChain       *MerkleState                `json:"mainChain,omitempty" form:"mainChain" query:"mainChain" validate:"required"`
	Data            interface{}                 `json:"data,omitempty" form:"data" query:"data" validate:"required"`
	Origin          *url.URL                    `json:"origin,omitempty" form:"origin" query:"origin" validate:"required"`
	TransactionHash []byte                      `json:"transactionHash,omitempty" form:"transactionHash" query:"transactionHash" validate:"required"`
	Txid            *url.TxID                   `json:"txid,omitempty" form:"txid" query:"txid" validate:"required"`
	Transaction     *protocol.Transaction       `json:"transaction,omitempty" form:"transaction" query:"transaction" validate:"required"`
	Signatures      []protocol.Signature        `json:"signatures,omitempty" form:"signatures" query:"signatures" validate:"required"`
	Status          *protocol.TransactionStatus `json:"status,omitempty" form:"status" query:"status" validate:"required"`
	Produced        []*url.TxID                 `json:"produced,omitempty" form:"produced" query:"produced" validate:"required"`
	Receipts        []*TxReceipt                `json:"receipts,omitempty" form:"receipts" query:"receipts" validate:"required"`
	SignatureBooks  []*SignatureBook            `json:"signatureBooks,omitempty" form:"signatureBooks" query:"signatureBooks" validate:"required"`
}

func (*TransactionQueryResponse) Equal added in v1.1.0

func (*TransactionQueryResponse) MarshalJSON

func (v *TransactionQueryResponse) MarshalJSON() ([]byte, error)

func (*TransactionQueryResponse) UnmarshalJSON

func (v *TransactionQueryResponse) UnmarshalJSON(data []byte) error

type TxFetchMode added in v1.1.0

type TxFetchMode uint64

TxFetchMode specifies how much detail of the transactions should be included in the result set

const TxFetchModeCountOnly TxFetchMode = 2

TxFetchModeCountOnly only include the transaction count in the result set.

const TxFetchModeExpand TxFetchMode = 0

TxFetchModeExpand expand the full transactions in the result set.

const TxFetchModeIds TxFetchMode = 1

TxFetchModeIds include the transaction IDs & count in the result set.

const TxFetchModeOmit TxFetchMode = 3

TxFetchModeOmit omit all transaction info from the result set.

func TxFetchModeByName added in v1.1.0

func TxFetchModeByName(name string) (TxFetchMode, bool)

TxFetchModeByName returns the named Tx Fetch Mode.

func (TxFetchMode) GetEnumValue added in v1.1.0

func (v TxFetchMode) GetEnumValue() uint64

GetEnumValue returns the value of the Tx Fetch Mode

func (TxFetchMode) MarshalJSON added in v1.1.0

func (v TxFetchMode) MarshalJSON() ([]byte, error)

MarshalJSON marshals the Tx Fetch Mode to JSON as a string.

func (*TxFetchMode) SetEnumValue added in v1.1.0

func (v *TxFetchMode) SetEnumValue(id uint64) bool

SetEnumValue sets the value. SetEnumValue returns false if the value is invalid.

func (TxFetchMode) String added in v1.1.0

func (v TxFetchMode) String() string

String returns the name of the Tx Fetch Mode.

func (*TxFetchMode) UnmarshalJSON added in v1.1.0

func (v *TxFetchMode) UnmarshalJSON(data []byte) error

UnmarshalJSON unmarshals the Tx Fetch Mode from JSON as a string.

type TxHistoryQuery

type TxHistoryQuery struct {
	UrlQuery
	QueryPagination
	Scratch bool `json:"scratch,omitempty" form:"scratch" query:"scratch"`
}

func (*TxHistoryQuery) Equal added in v1.1.0

func (v *TxHistoryQuery) Equal(u *TxHistoryQuery) bool

func (*TxHistoryQuery) MarshalJSON

func (v *TxHistoryQuery) MarshalJSON() ([]byte, error)

func (*TxHistoryQuery) UnmarshalJSON

func (v *TxHistoryQuery) UnmarshalJSON(data []byte) error

type TxReceipt added in v1.1.0

type TxReceipt struct {
	GeneralReceipt
	Account *url.URL `json:"account,omitempty" form:"account" query:"account" validate:"required"`
	Chain   string   `json:"chain,omitempty" form:"chain" query:"chain" validate:"required"`
	// contains filtered or unexported fields
}

func (*TxReceipt) Copy added in v1.1.0

func (v *TxReceipt) Copy() *TxReceipt

func (*TxReceipt) CopyAsInterface added in v1.1.0

func (v *TxReceipt) CopyAsInterface() interface{}

func (*TxReceipt) Equal added in v1.1.0

func (v *TxReceipt) Equal(u *TxReceipt) bool

func (*TxReceipt) IsValid added in v1.1.0

func (v *TxReceipt) IsValid() error

func (*TxReceipt) MarshalBinary added in v1.1.0

func (v *TxReceipt) MarshalBinary() ([]byte, error)

func (*TxReceipt) MarshalJSON added in v1.1.0

func (v *TxReceipt) MarshalJSON() ([]byte, error)

func (*TxReceipt) UnmarshalBinary added in v1.1.0

func (v *TxReceipt) UnmarshalBinary(data []byte) error

func (*TxReceipt) UnmarshalBinaryFrom added in v1.1.0

func (v *TxReceipt) UnmarshalBinaryFrom(rd io.Reader) error

func (*TxReceipt) UnmarshalJSON added in v1.1.0

func (v *TxReceipt) UnmarshalJSON(data []byte) error

type TxRequest

type TxRequest struct {
	CheckOnly  bool     `json:"checkOnly,omitempty" form:"checkOnly" query:"checkOnly"`
	IsEnvelope bool     `json:"isEnvelope,omitempty" form:"isEnvelope" query:"isEnvelope"`
	Origin     *url.URL `json:"origin,omitempty" form:"origin" query:"origin" validate:"required"`
	Signer     Signer   `json:"signer,omitempty" form:"signer" query:"signer" validate:"required"`
	Signature  []byte   `json:"signature,omitempty" form:"signature" query:"signature" validate:"required"`
	// KeyPage is deprecated.
	KeyPage  KeyPage     `json:"keyPage,omitempty" form:"keyPage" query:"keyPage" validate:"required"`
	TxHash   []byte      `json:"txHash,omitempty" form:"txHash" query:"txHash"`
	Payload  interface{} `json:"payload,omitempty" form:"payload" query:"payload" validate:"required"`
	Memo     string      `json:"memo,omitempty" form:"memo" query:"memo"`
	Metadata []byte      `json:"metadata,omitempty" form:"metadata" query:"metadata"`
}

func (*TxRequest) Equal added in v1.1.0

func (v *TxRequest) Equal(u *TxRequest) bool

func (*TxRequest) MarshalJSON

func (v *TxRequest) MarshalJSON() ([]byte, error)

func (*TxRequest) UnmarshalJSON

func (v *TxRequest) UnmarshalJSON(data []byte) error

type TxResponse

type TxResponse struct {
	TransactionHash []byte      `json:"transactionHash,omitempty" form:"transactionHash" query:"transactionHash" validate:"required"`
	Txid            *url.TxID   `json:"txid,omitempty" form:"txid" query:"txid" validate:"required"`
	SignatureHashes [][]byte    `json:"signatureHashes,omitempty" form:"signatureHashes" query:"signatureHashes" validate:"required"`
	SimpleHash      []byte      `json:"simpleHash,omitempty" form:"simpleHash" query:"simpleHash" validate:"required"`
	Code            uint64      `json:"code,omitempty" form:"code" query:"code" validate:"required"`
	Message         string      `json:"message,omitempty" form:"message" query:"message" validate:"required"`
	Delivered       bool        `json:"delivered,omitempty" form:"delivered" query:"delivered" validate:"required"`
	Result          interface{} `json:"result,omitempty" form:"result" query:"result" validate:"required"`
}

func (*TxResponse) Equal added in v1.1.0

func (v *TxResponse) Equal(u *TxResponse) bool

func (*TxResponse) MarshalJSON

func (v *TxResponse) MarshalJSON() ([]byte, error)

func (*TxResponse) UnmarshalJSON

func (v *TxResponse) UnmarshalJSON(data []byte) error

type TxnQuery

type TxnQuery struct {
	QueryOptions
	Txid    []byte        `json:"txid,omitempty" form:"txid" query:"txid"`
	TxIdUrl *url.TxID     `json:"txIdUrl,omitempty" form:"txIdUrl" query:"txIdUrl"`
	Wait    time.Duration `json:"wait,omitempty" form:"wait" query:"wait"`
	// IgnorePending tells QueryTx to ignore pending transactions.
	IgnorePending bool `json:"ignorePending,omitempty" form:"ignorePending" query:"ignorePending"`
}

func (*TxnQuery) Equal added in v1.1.0

func (v *TxnQuery) Equal(u *TxnQuery) bool

func (*TxnQuery) MarshalJSON

func (v *TxnQuery) MarshalJSON() ([]byte, error)

func (*TxnQuery) UnmarshalJSON

func (v *TxnQuery) UnmarshalJSON(data []byte) error

type UrlQuery

type UrlQuery struct {
	Url *url.URL `json:"url,omitempty" form:"url" query:"url" validate:"required"`
}

func (*UrlQuery) Equal added in v1.1.0

func (v *UrlQuery) Equal(u *UrlQuery) bool

type V3 added in v1.1.0

type V3 interface {
	api.ConsensusService
	api.NetworkService
	api.MetricsService
	api.Querier
	api.Submitter
	api.Validator
	api.Faucet
	Private() private.Sequencer
}

type VersionResponse

type VersionResponse struct {
	Version        string `json:"version,omitempty" form:"version" query:"version" validate:"required"`
	Commit         string `json:"commit,omitempty" form:"commit" query:"commit" validate:"required"`
	VersionIsKnown bool   `json:"versionIsKnown,omitempty" form:"versionIsKnown" query:"versionIsKnown" validate:"required"`
	IsTestNet      bool   `json:"isTestNet,omitempty" form:"isTestNet" query:"isTestNet" validate:"required"`
}

func (*VersionResponse) Equal added in v1.1.0

func (v *VersionResponse) Equal(u *VersionResponse) bool

Jump to

Keyboard shortcuts

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