Documentation ¶
Overview ¶
Package env provides the functionality to connect to the Stellar blockchain and broadcast transactions to the network and decode its response.
Index ¶
- Constants
- func BuildContractCallOp(caller horizon.Account, fName xdr.ScSymbol, callArgs xdr.ScVec, ...) *txnbuild.InvokeHostFunction
- func BuildForceCloseTxArgs(chanID pchannel.ID) (xdr.ScVec, error)
- func BuildFundTxArgs(chanID pchannel.ID, funderIdx bool) (xdr.ScVec, error)
- func BuildGetChannelTxArgs(chanID pchannel.ID) (xdr.ScVec, error)
- func BuildGetTokenBalanceArgs(balanceOf xdr.ScAddress) (xdr.ScVec, error)
- func BuildMintTokenArgs(mintTo xdr.ScAddress, amount xdr.ScVal) (xdr.ScVec, error)
- func BuildOpenTxArgs(params *pchannel.Params, state *pchannel.State) (xdr.ScVec, error)
- func CreateSignedTransactionWithParams(signers []*keypair.Full, txParams txnbuild.TransactionParams) (*txnbuild.Transaction, error)
- func DecodeTxMeta(tx horizon.Transaction) (xdr.TransactionMeta, error)
- func GetBaseTransactionParamsWithFee(source txnbuild.Account, fee int64, ops ...txnbuild.Operation) txnbuild.TransactionParams
- func NewHorizonClient() *horizonclient.Client
- func PreflightHostFunctions(hzClient *horizonclient.Client, sourceAccount txnbuild.Account, ...) (txnbuild.InvokeHostFunction, int64)
- type RPCSimulateHostFunctionResult
- type RPCSimulateTxResponse
- type StellarClient
- func (s *StellarClient) CreateSignedTxFromParams(txParams txnbuild.TransactionParams) (*txnbuild.Transaction, error)
- func (h *StellarClient) GetAccount() (horizon.Account, error)
- func (s *StellarClient) GetAddress() string
- func (s *StellarClient) GetHorizonAccount() (horizon.Account, error)
- func (c *StellarClient) GetHorizonClient() *horizonclient.Client
- func (s *StellarClient) InvokeAndProcessHostFunction(fname string, callTxArgs xdr.ScVec, contractAddr xdr.ScAddress) (xdr.TransactionMeta, error)
Constants ¶
View Source
const HorizonURL = "http://localhost:8000"
View Source
const NETWORK_PASSPHRASE = "Standalone Network ; February 2017"
Variables ¶
This section is empty.
Functions ¶
func BuildContractCallOp ¶
func BuildMintTokenArgs ¶
func BuildOpenTxArgs ¶
func CreateSignedTransactionWithParams ¶
func CreateSignedTransactionWithParams(signers []*keypair.Full, txParams txnbuild.TransactionParams, ) (*txnbuild.Transaction, error)
func DecodeTxMeta ¶
func DecodeTxMeta(tx horizon.Transaction) (xdr.TransactionMeta, error)
func NewHorizonClient ¶
func NewHorizonClient() *horizonclient.Client
func PreflightHostFunctions ¶
func PreflightHostFunctions(hzClient *horizonclient.Client, sourceAccount txnbuild.Account, function txnbuild.InvokeHostFunction, ) (txnbuild.InvokeHostFunction, int64)
Types ¶
type RPCSimulateTxResponse ¶
type RPCSimulateTxResponse struct { Error string `json:"error,omitempty"` TransactionData string `json:"transactionData"` Results []RPCSimulateHostFunctionResult `json:"results"` MinResourceFee int64 `json:"minResourceFee,string"` }
type StellarClient ¶
type StellarClient struct {
// contains filtered or unexported fields
}
func NewHorizonMasterClient ¶
func NewHorizonMasterClient() *StellarClient
func NewStellarClient ¶
func NewStellarClient(kp *keypair.Full) *StellarClient
func (*StellarClient) CreateSignedTxFromParams ¶
func (s *StellarClient) CreateSignedTxFromParams(txParams txnbuild.TransactionParams) (*txnbuild.Transaction, error)
func (*StellarClient) GetAccount ¶
func (h *StellarClient) GetAccount() (horizon.Account, error)
func (*StellarClient) GetAddress ¶
func (s *StellarClient) GetAddress() string
func (*StellarClient) GetHorizonAccount ¶
func (s *StellarClient) GetHorizonAccount() (horizon.Account, error)
func (*StellarClient) GetHorizonClient ¶
func (c *StellarClient) GetHorizonClient() *horizonclient.Client
func (*StellarClient) InvokeAndProcessHostFunction ¶
func (s *StellarClient) InvokeAndProcessHostFunction(fname string, callTxArgs xdr.ScVec, contractAddr xdr.ScAddress) (xdr.TransactionMeta, error)
Click to show internal directories.
Click to hide internal directories.