api

package
v0.5.1-rc6 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2022 License: MIT Imports: 38 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 occured")
	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.New("invalid URL")

Functions

This section is empty.

Types

type ChainIdQuery

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

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    []query.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"`
}

func (*ChainQueryResponse) MarshalJSON

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

func (*ChainQueryResponse) UnmarshalJSON

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

type DataEntry

type DataEntry struct {
	Data [][]byte `json:"data,omitempty" form:"data" query:"data" validate:"required"`
	// contains filtered or unexported fields
}

func (*DataEntry) Equal

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

func (*DataEntry) IsValid

func (v *DataEntry) IsValid() error

func (*DataEntry) MarshalBinary

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

func (*DataEntry) MarshalJSON

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

func (*DataEntry) UnmarshalBinary

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

func (*DataEntry) UnmarshalBinaryFrom

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

func (*DataEntry) UnmarshalJSON

func (v *DataEntry) 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) 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     DataEntry `json:"entry,omitempty" form:"entry" query:"entry" validate:"required"`
	// contains filtered or unexported fields
}

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) MarshalJSON

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

func (*DataEntrySetQuery) UnmarshalJSON

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

type DescriptionResponse

type DescriptionResponse struct {
	Subnet config.Network `json:"subnet,omitempty" form:"subnet" query:"subnet" validate:"required"`
}

type DirectoryQuery

type DirectoryQuery struct {
	UrlQuery
	QueryPagination
	QueryOptions
}

func (*DirectoryQuery) MarshalJSON

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

func (*DirectoryQuery) UnmarshalJSON

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

type GeneralQuery

type GeneralQuery struct {
	UrlQuery
	QueryOptions
}

func (*GeneralQuery) MarshalJSON

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

func (*GeneralQuery) UnmarshalJSON

func (v *GeneralQuery) 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(_ context.Context, params json.RawMessage) interface{}

func (*JrpcMethods) EnableDebug

func (m *JrpcMethods) EnableDebug()

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) ExecuteAddValidator added in v0.5.1

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

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) ExecuteIssueTokens

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

ExecuteIssueTokens submits an IssueTokens transaction.

func (*JrpcMethods) ExecuteRemoveManager

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

ExecuteRemoveManager submits a RemoveManager transaction.

func (*JrpcMethods) ExecuteRemoveValidator added in v0.5.1

func (m *JrpcMethods) ExecuteRemoveValidator(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) ExecuteUpdateKeyPage

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

ExecuteUpdateKeyPage submits an UpdateKeyPage transaction.

func (*JrpcMethods) ExecuteUpdateManager

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

ExecuteUpdateManager submits an UpdateManager transaction.

func (*JrpcMethods) ExecuteUpdateValidatorKey added in v0.5.1

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

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(_ context.Context, params json.RawMessage) interface{}

Metrics returns Metrics for explorer (tps, etc.)

func (*JrpcMethods) NewMux

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

func (*JrpcMethods) Querier_TESTONLY

func (m *JrpcMethods) Querier_TESTONLY() Querier

func (*JrpcMethods) Query

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

Query queries an account or account chain by URL.

func (*JrpcMethods) QueryChain

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

QueryChain queries an account by ID.

func (*JrpcMethods) QueryData

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

QueryData queries an entry on an account's data chain.

func (*JrpcMethods) QueryDataSet

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

QueryDataSet queries a range of entries on an account's data chain.

func (*JrpcMethods) QueryDirectory

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

QueryDirectory queries the directory entries of an account.

func (*JrpcMethods) QueryKeyPageIndex

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

QueryKeyPageIndex queries the location of a key within an account's key book(s).

func (*JrpcMethods) QueryTx

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

QueryTx queries a transaction by ID.

func (*JrpcMethods) QueryTxHistory

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

QueryTxHistory queries an account's transaction history.

func (*JrpcMethods) Status

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

func (*JrpcMethods) Version

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

type KeyPage

type KeyPage struct {
	Height uint64 `json:"height,omitempty" form:"height" query:"height" validate:"required"`
}

type KeyPageIndexQuery

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

func (*KeyPageIndexQuery) MarshalJSON

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

func (*KeyPageIndexQuery) UnmarshalJSON

func (v *KeyPageIndexQuery) 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) 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) 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) MarshalJSON

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

func (*MetricsResponse) UnmarshalJSON

func (v *MetricsResponse) 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) 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
	Network          *config.Network
	Router           routing.Router
	TxMaxWaitTime    time.Duration
	PrometheusServer string
}

type Querier

type Querier interface {
	QueryUrl(url *url.URL, opts QueryOptions) (interface{}, error)
	QueryDirectory(url *url.URL, pagination QueryPagination, opts QueryOptions) (*MultiResponse, error)
	QueryChain(id []byte) (*ChainQueryResponse, error)
	QueryTx(id []byte, wait time.Duration, opts QueryOptions) (*TransactionQueryResponse, error)
	QueryTxHistory(url *url.URL, pagination QueryPagination) (*MultiResponse, error)
	QueryData(url *url.URL, entryHash [32]byte) (*ChainQueryResponse, error)
	QueryDataSet(url *url.URL, pagination QueryPagination, opts QueryOptions) (*MultiResponse, error)
	QueryKeyPageIndex(url *url.URL, key []byte) (*ChainQueryResponse, error)
}

func NewQueryDirect

func NewQueryDirect(subnet string, opts Options) Querier

func NewQueryDispatch

func NewQueryDispatch(opts Options) Querier

type QueryOptions

type QueryOptions struct {
	Expand bool   `json:"expand,omitempty" form:"expand" query:"expand"`
	Height uint64 `json:"height,omitempty" form:"height" query:"height"`
	Prove  bool   `json:"prove,omitempty" form:"prove" query:"prove"`
}

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"`
}

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"`
}

func (*Signer) MarshalJSON

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

func (*Signer) UnmarshalJSON

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

type StatusResponse

type StatusResponse struct {
	Ok bool `json:"ok,omitempty" form:"ok" query:"ok" validate:"required"`
}

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) 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"`
}

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"`
	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"`
	SyntheticTxids     [][32]byte                  `json:"syntheticTxids,omitempty" form:"syntheticTxids" query:"syntheticTxids" validate:"required"`
	Receipts           []*query.TxReceipt          `json:"receipts,omitempty" form:"receipts" query:"receipts" validate:"required"`
	SignatureThreshold uint64                      `json:"signatureThreshold,omitempty" form:"signatureThreshold" query:"signatureThreshold" validate:"required"`
	Invalidated        bool                        `json:"invalidated,omitempty" form:"invalidated" query:"invalidated" validate:"required"`
}

func (*TransactionQueryResponse) MarshalJSON

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

func (*TransactionQueryResponse) UnmarshalJSON

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

type TxHistoryQuery

type TxHistoryQuery struct {
	UrlQuery
	QueryPagination
}

func (*TxHistoryQuery) MarshalJSON

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

func (*TxHistoryQuery) UnmarshalJSON

func (v *TxHistoryQuery) 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    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) 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"`
	EnvelopeHash    []byte      `json:"envelopeHash,omitempty" form:"envelopeHash" query:"envelopeHash" 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) 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" validate:"required"`
	Wait time.Duration `json:"wait,omitempty" form:"wait" query:"wait"`
}

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"`
}

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"`
}

Jump to

Keyboard shortcuts

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