entities

package
v0.0.0-...-80b12fe Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateSignersWeights

func ValidateSignersWeights(signers []Signer) (int, error)

ValidateSignersWeights will validate:

  1. all full signers have the same weight
  2. all partial signers weights are less than the full signer weight
  3. there's at least one full signer.

Types

type Asset

type Asset struct {
	Code   string
	Issuer string
}

type LedgerEntryResult

type LedgerEntryResult struct {
	KeyXDR             string `json:"key,omitempty"`
	DataXDR            string `json:"xdr,omitempty"`
	LastModifiedLedger uint32 `json:"lastModifiedLedgerSeq"`
	// The ledger sequence until the entry is live, available for entries that have associated ttl ledger entries.
	LiveUntilLedgerSeq *uint32 `json:"liveUntilLedgerSeq,omitempty"`
}

type Pagination

type Pagination struct {
	Links PaginationLinks `json:"_links"`
}
type PaginationLinks struct {
	Self string `json:"self"`
	Prev string `json:"next"`
	Next string `json:"prev"`
}

type RPCGetHealthResult

type RPCGetHealthResult struct {
	Status                string `json:"status"`
	LatestLedger          uint32 `json:"latestLedger"`
	OldestLedger          uint32 `json:"oldestLedger"`
	LedgerRetentionWindow uint32 `json:"ledgerRetentionWindow"`
}

type RPCGetLedgerEntriesResult

type RPCGetLedgerEntriesResult struct {
	LatestLedger uint32              `json:"latestLedger"`
	Entries      []LedgerEntryResult `json:"entries"`
}

type RPCGetTransactionResult

type RPCGetTransactionResult struct {
	Status                RPCStatus `json:"status"`
	LatestLedger          int64     `json:"latestLedger"`
	LatestLedgerCloseTime string    `json:"latestLedgerCloseTime"`
	OldestLedger          int64     `json:"oldestLedger"`
	OldestLedgerCloseTime string    `json:"oldestLedgerCloseTime"`
	ApplicationOrder      int64     `json:"applicationOrder"`
	Hash                  string    `json:"txHash"`
	EnvelopeXDR           string    `json:"envelopeXdr"`
	ResultXDR             string    `json:"resultXdr"`
	ResultMetaXDR         string    `json:"resultMetaXdr"`
	Ledger                int64     `json:"ledger"`
	CreatedAt             string    `json:"createdAt"`
	ErrorResultXDR        string    `json:"errorResultXdr"`
}

type RPCGetTransactionsResult

type RPCGetTransactionsResult struct {
	Transactions          []Transaction `json:"transactions"`
	LatestLedger          int64         `json:"latestLedger"`
	LatestLedgerCloseTime int64         `json:"latestLedgerCloseTimestamp"`
	OldestLedger          int64         `json:"oldestLedger"`
	OldestLedgerCloseTime int64         `json:"oldestLedgerCloseTimestamp"`
	Cursor                string        `json:"cursor"`
}

type RPCPagination

type RPCPagination struct {
	Cursor string `json:"cursor,omitempty"`
	Limit  int    `json:"limit"`
}

type RPCParams

type RPCParams struct {
	Transaction    string            `json:"transaction,omitempty"`
	Hash           string            `json:"hash,omitempty"`
	StartLedger    int64             `json:"startLedger,omitempty"`
	Pagination     RPCPagination     `json:"pagination,omitempty"`
	LedgerKeys     []string          `json:"keys,omitempty"`
	ResourceConfig RPCResourceConfig `json:"resourceConfig,omitempty"`
}

type RPCResourceConfig

type RPCResourceConfig struct {
	InstructionLeeway int `json:"instructionLeeway,omitempty"`
}

type RPCResponse

type RPCResponse struct {
	Result  json.RawMessage `json:"result"`
	JSONRPC string          `json:"jsonrpc"`
	ID      int64           `json:"id"`
}

type RPCRestorePreamble

type RPCRestorePreamble struct {
	MinResourceFee  string                     `json:"minResourceFee,omitempty"`
	TransactionData xdr.SorobanTransactionData `json:"transactionData,omitempty"`
}

func (RPCRestorePreamble) MarshalJSON

func (r RPCRestorePreamble) MarshalJSON() ([]byte, error)

func (*RPCRestorePreamble) UnmarshalJSON

func (r *RPCRestorePreamble) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshalling for RPCRestorePreamble, parsing base64-encoded XDR fields into `xdr.*` objects.

type RPCSendTransactionResult

type RPCSendTransactionResult struct {
	Status                RPCStatus `json:"status"`
	LatestLedger          int64     `json:"latestLedger"`
	LatestLedgerCloseTime string    `json:"latestLedgerCloseTime"`
	Hash                  string    `json:"hash"`
	ErrorResultXDR        string    `json:"errorResultXdr"`
}

type RPCSimulateHostFunctionResult

type RPCSimulateHostFunctionResult struct {
	Auth []xdr.SorobanAuthorizationEntry `json:"auth"`
	XDR  xdr.ScVal                       `json:"xdr"`
}

func (RPCSimulateHostFunctionResult) MarshalJSON

func (r RPCSimulateHostFunctionResult) MarshalJSON() ([]byte, error)

func (*RPCSimulateHostFunctionResult) UnmarshalJSON

func (r *RPCSimulateHostFunctionResult) UnmarshalJSON(data []byte) error

type RPCSimulateStateChange

type RPCSimulateStateChange struct {
	Type   string  `json:"type"`
	Key    string  `json:"key"`
	Before *string `json:"before"`
	After  *string `json:"after"`
}

type RPCSimulateTransactionResult

type RPCSimulateTransactionResult struct {
	TransactionData xdr.SorobanTransactionData `json:"transactionData,omitempty"`
	Events          []string                   `json:"events,omitempty"`
	MinResourceFee  string                     `json:"minResourceFee,omitempty"`
	// Results contains the outcome of the simulated invoke contract operation. It will have at most one element if the simulation is successful, or be omitted if the simulation fails.
	Results      []RPCSimulateHostFunctionResult `json:"results,omitempty"`
	LatestLedger int64                           `json:"latestLedger,omitempty"`
	// Error is only present if the transaction failed.
	Error string `json:"error,omitempty"`
	// RestorePreamble is only present if the transaction result indicates the account needs to be restored.
	RestorePreamble RPCRestorePreamble       `json:"restorePreamble,omitempty"`
	StateChanges    []RPCSimulateStateChange `json:"stateChanges,omitempty"`
}

func (RPCSimulateTransactionResult) MarshalJSON

func (r RPCSimulateTransactionResult) MarshalJSON() ([]byte, error)

func (*RPCSimulateTransactionResult) UnmarshalJSON

func (r *RPCSimulateTransactionResult) UnmarshalJSON(data []byte) error

UnmarshalJSON implements custom JSON unmarshalling for RPCSimulateTransactionResult, parsing base64-encoded XDR fields into `xdr.*` objects.

type RPCStatus

type RPCStatus string
const (
	// sendTransaction statuses
	PendingStatus       RPCStatus = "PENDING"
	DuplicateStatus     RPCStatus = "DUPLICATE"
	TryAgainLaterStatus RPCStatus = "TRY_AGAIN_LATER"
	ErrorStatus         RPCStatus = "ERROR"
	// getTransaction statuses
	NotFoundStatus RPCStatus = "NOT_FOUND"
	FailedStatus   RPCStatus = "FAILED"
	SuccessStatus  RPCStatus = "SUCCESS"
)

type Signer

type Signer struct {
	Address string     `json:"address" validate:"required,public_key"`
	Weight  int        `json:"weight" validate:"gte=1"`
	Type    SignerType `json:"type" validate:"required,oneof=full partial"`
}

type SignerType

type SignerType string
const (
	FullSignerType    SignerType = "full"
	PartialSignerType SignerType = "partial"
)

type Transaction

type Transaction struct {
	Status              RPCStatus `json:"status"`
	Hash                string    `json:"txHash"`
	ApplicationOrder    int64     `json:"applicationOrder"`
	FeeBump             bool      `json:"feeBump"`
	EnvelopeXDR         string    `json:"envelopeXdr"`
	ResultXDR           string    `json:"resultXdr"`
	ResultMetaXDR       string    `json:"resultMetaXdr"`
	Ledger              int64     `json:"ledger"`
	DiagnosticEventsXDR []string  `json:"diagnosticEventsXdr"`
	CreatedAt           uint32    `json:"createdAt"`
}

Jump to

Keyboard shortcuts

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