{"modulePath":"github.com/threefoldtech/web3_proxy/server","version":"v0.0.0-20230905100307-0269a1e6aecb","isLatest":false,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package stellar\n\n## Constants\n\n```go\nconst (\n\t// StellarID is the ID for state of a stellar client in the connection state.\n\tStellarID = \"stellar\"\n)\n```\n\n## Types\n\n```go\ntype AccountData struct {\n\tAccount string `json:\"account\"`\n}\n```\n\n```go\ntype BridgeTransfer struct {\n\tAmount      string `json:\"amount\"`\n\tDestination string `json:\"destination\"`\n}\n```\n\n```go\ntype Client struct {\n}\n```\nClient exposing stellar methods\n\n```go\nfunc NewClient() *Client\n```\nNewClient creates a new Client ready for use\n\n```go\nfunc (c *Client) AccountData(ctx context.Context, conState jsonrpc.State, account string) (horizon.Account, error)\n```\nGet data related to a stellar account\n\n```go\nfunc (c *Client) Address(ctx context.Context, conState jsonrpc.State) (string, error)\n```\nGet the public address of the loaded stellar secret\n\n```go\nfunc (c *Client) AwaitTransactionOnEthBridge(ctx context.Context, conState jsonrpc.State, memo string) error\n```\nAwait till a transaction is processed on ethereum bridge that contains a specific memo\n\n```go\nfunc (c *Client) Balance(ctx context.Context, conState jsonrpc.State, address string) (string, error)\n```\nBalance of an account for TFT on stellar.\n\n```go\nfunc (c *Client) BridgeToEth(ctx context.Context, conState jsonrpc.State, args BridgeTransfer) (string, error)\n```\nBridgeToEth transfers TFT from the loaded account to eth bridge and deposits into the destination ethereum account.\n\n```go\nfunc (c *Client) BridgeToTfchain(ctx context.Context, conState jsonrpc.State, args TfchainBridgeTransfer) (string, error)\n```\nBridgeToTfchain transfers TFT from the loaded account to tfchain bridge and deposits into a twin account.\n\n```go\nfunc (c *Client) CreateAccount(ctx context.Context, conState jsonrpc.State, network string) (string, error)\n```\n\n```go\nfunc (c *Client) Load(ctx context.Context, conState jsonrpc.State, args Load) error\n```\nLoad a client, connecting to the rpc endpoint at the given URL and loading a keypair from the given secret\n\n```go\nfunc (c *Client) Swap(ctx context.Context, conState jsonrpc.State, args Swap) error\n```\nSwap some amount from one asset to the other (for example from tft to xlm)\n\n```go\nfunc (c *Client) Transactions(ctx context.Context, conState jsonrpc.State, args Transactions) ([]horizon.Transaction, error)\n```\nGet the last transactions of your account\n\n```go\nfunc (c *Client) Transfer(ctx context.Context, conState jsonrpc.State, args Transfer) (string, error)\n```\nTranser an amount of TFT from the loaded account to the destination.\n\n```go\ntype ErrUnknownNetwork struct{}\n```\nErrUnknownNetwork indicates a client was requested for an unknown network\n\n```go\nfunc (e ErrUnknownNetwork) Error() string\n```\nError implements the error interface\n\n```go\ntype Load struct {\n\tNetwork string `json:\"network\"`\n\tSecret  string `json:\"secret\"`\n}\n```\n\n```go\ntype StellarState struct {\n\tClient *stellargoclient.Client\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc State(conState jsonrpc.State) *StellarState\n```\nState from a connection. If no state is present, it is initialized\n\n```go\nfunc (s *StellarState) Close()\n```\nClose implements jsonrpc.Closer\n\n```go\ntype Swap struct {\n\tAmount           string `json:\"amount\"`\n\tSourceAsset      string `json:\"source_asset\"`\n\tDestinationAsset string `json:\"destination_asset\"`\n}\n```\n\n```go\ntype TfchainBridgeTransfer struct {\n\tAmount string `json:\"amount\"`\n\tTwinId uint32 `json:\"twin_id\"`\n}\n```\n\n```go\ntype Transactions struct {\n\tAccount       string `json:\"account\"`\n\tLimit         uint   `json:\"limit\"`\n\tIncludeFailed bool   `json:\"include_failed\"`\n\tCursor        string `json:\"cursor\"`\n\tAscending     bool   `json:\"ascending\"`\n}\n```\n\n```go\ntype Transfer struct {\n\tAmount      string `json:\"amount\"`\n\tDestination string `json:\"destination\"`\n\tMemo        string `json:\"memo\"`\n}\n```\n\n","path":"github.com/threefoldtech/web3_proxy/server/pkg/stellar","name":"stellar","synopsis":"","isRedistributable":true}
