sorobanclient

package
v1.6.1-rc1 Latest Latest
Warning

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

Go to latest
Published: Oct 2, 2024 License: Apache-2.0 Imports: 10 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) GetLatestLedger

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

func (*Client) SimulateTransaction

func (c *Client) SimulateTransaction(txnXdr string, resourceCfg *ResourceConfig) (*TxSimulationResult, 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 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 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"`
}

Jump to

Keyboard shortcuts

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