sorobanclient

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CallResult

type CallResult struct {
	Xdr  string   `json:"xdr"`
	Auth []string `json:"auth"`
}

type Client

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

func New

func New(rpcUrl string, httpCl *http.Client) (*Client, error)

func (*Client) CallContext

func (c *Client) CallContext(ctx context.Context, result interface{}, method string, params interface{}) error

func (*Client) GetEvents added in v1.9.2

func (c *Client) GetEvents(ctx context.Context, eventFilter types.GetEventFilter) (*LedgerEventResponse, error)

func (*Client) GetLatestLedger

func (c *Client) GetLatestLedger(ctx context.Context) (*LatestLedgerResponse, error)

func (*Client) GetTransaction added in v1.9.2

func (c *Client) GetTransaction(ctx context.Context, txHash string) (*TransactionResponse, error)

func (*Client) SimulateTransaction

func (c *Client) SimulateTransaction(txnXdr string, resourceCfg *ResourceConfig) (*TxSimulationResult, error)

func (*Client) SubmitTransactionXDR added in v1.9.2

func (c *Client) SubmitTransactionXDR(ctx context.Context, txXDR string) (*TransactionResponse, error)

type HTTPError

type HTTPError struct {
	StatusCode int
	Status     string
	Body       []byte
}

func (HTTPError) Error

func (err HTTPError) Error() string

type LatestLedgerResponse

type LatestLedgerResponse struct {
	ID              string `json:"id"`
	ProtocolVersion uint64 `json:"protocolVersion"`
	Sequence        uint64 `json:"sequence"`
}

type LedgerEventResponse added in v1.9.2

type LedgerEventResponse struct {
	Events       []LedgerEvents `json:"events"`
	LatestLedger uint64         `json:"latestLedger"`
}

type LedgerEvents added in v1.9.2

type LedgerEvents struct {
	Type                     string   `json:"type"`
	Ledger                   int64    `json:"ledger"`
	ContractID               string   `json:"contractId"`
	ID                       string   `json:"id"`
	PagingToken              string   `json:"pagingToken"`
	Topic                    []string `json:"topic"`
	Value                    string   `json:"value"`
	InSuccessfulContractCall bool     `json:"inSuccessfulContractCall"`
	TxHash                   string   `json:"txHash"`
}

type ResourceConfig

type ResourceConfig struct {
	InstructionLeeway uint64 `json:"instructionLeeway"`
}

type RestorePreamble

type RestorePreamble struct {
	TransactionData string `json:"transactionData"` // SorobanTransactionData XDR in base64
	MinResourceFee  int64  `json:"minResourceFee,string"`
}

type TransactionResponse added in v1.9.2

type TransactionResponse struct {
	Status                string `json:"status"`
	LatestLedger          int64  `json:"latestLedger"`
	LatestLedgerCloseTime string `json:"latestLedgerCloseTime"`
	OldestLedger          int64  `json:"oldestLedger"`
	OldestLedgerCloseTime string `json:"oldestLedgerCloseTime"`
	ApplicationOrder      int64  `json:"applicationOrder"`
	EnvelopeXdr           string `json:"envelopeXdr"`
	ResultXdr             string `json:"resultXdr"`
	ResultMetaXdr         string `json:"resultMetaXdr"`
	Ledger                int64  `json:"ledger"`
	CreatedAt             string `json:"createdAt"`
	Hash                  string
}

type TxSimulationResult

type TxSimulationResult struct {
	LatestLedger       uint64           `json:"latestLedger"`
	Results            []CallResult     `json:"results"`
	MinResourceFee     string           `json:"minResourceFee"`  // Recommended minimum resource fee to add when submitting the transaction. This fee is to be added on top of the Stellar network fee.
	TransactionDataXDR string           `json:"transactionData"` // The recommended Soroban Transaction Data to use when submitting the simulated transaction. This data contains the refundable fee and resource usage information such as the ledger footprint and IO access data (serialized in a base64 string).
	RestorePreamble    *RestorePreamble `json:"restorePreamble,omitempty"`
}

type TxnCreationResponse added in v1.9.2

type TxnCreationResponse struct {
	Status                string `json:"status"`
	Hash                  string `json:"hash"`
	LatestLedger          int64  `json:"latestLedger"`
	LatestLedgerCloseTime string `json:"latestLedgerCloseTime"`
}

Jump to

Keyboard shortcuts

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