Documentation ¶
Overview ¶
Package http_client package implements the API v2 methods usage interface.
Index ¶
- func ErrorBody(err error) (int, *models.ErrorBody, error)
- func Marshal(i interface{}) (json string, err error)
- type BestTradeRequest_Type
- type Client
- func (c *Client) Address(address string, optionalHeight ...uint64) (*models.AddressResponse, error)
- func (c *Client) AddressExtended(address string, delegated bool, optionalHeight ...uint64) (*models.AddressResponse, error)
- func (c *Client) Addresses(addresses []string, optionalHeight ...uint64) (*models.AddressesResponse, error)
- func (c *Client) AddressesExtended(addresses []string, delegated bool, optionalHeight ...uint64) (*models.AddressesResponse, error)
- func (c *Client) BestTrade(sellCoinID, buyCoinID uint64, t BestTradeRequest_Type, amount string, ...) (*models.BestTradeResponse, error)
- func (c *Client) Block(height uint64) (*models.BlockResponse, error)
- func (c *Client) BlockExtended(height uint64, failedTxs, events bool, fieldsBlock ...string) (*models.BlockResponse, error)
- func (c *Client) Blocks(from, to uint64, failedTxs, events bool, fieldsBlock ...string) (*models.BlocksResponse, error)
- func (c *Client) Candidate(publicKey string, optionalHeight ...uint64) (*models.CandidateResponse, error)
- func (c *Client) CandidateExtended(publicKey string, notShowStakes bool, optionalHeight ...uint64) (*models.CandidateResponse, error)
- func (c *Client) Candidates(includeStakes bool, status string, optionalHeight ...uint64) (*models.CandidatesResponse, error)
- func (c *Client) CandidatesExtended(includeStakes, notShowStakes bool, status string, optionalHeight ...uint64) (*models.CandidatesResponse, error)
- func (c *Client) CheckVersion(version string, isTestnet bool) error
- func (c *Client) CoinID(symbol string, optionalHeight ...uint64) (uint64, error)
- func (c *Client) CoinInfo(symbol string, optionalHeight ...uint64) (*models.CoinInfoResponse, error)
- func (c *Client) CoinInfoByID(id uint64, optionalHeight ...uint64) (*models.CoinInfoResponse, error)
- func (c *Client) CommissionVotes(target uint64, optionalHeight ...uint64) (*models.CommissionVotesResponse, error)
- func (c *Client) ErrorBody(err error) (int, *models.ErrorBody, error)
- func (c *Client) EstimateCoinIDBuy(coinToSell, coinToBuy uint64, valueToBuy string, coinCommission uint64, ...) (*models.EstimateCoinBuyResponse, error)
- func (c *Client) EstimateCoinIDBuyExtended(coinToSell, coinToBuy uint64, valueToBuy string, coinCommission uint64, ...) (*models.EstimateCoinBuyResponse, error)
- func (c *Client) EstimateCoinIDSell(coinToBuy, coinToSell uint64, valueToSell string, coinCommission uint64, ...) (*models.EstimateCoinSellResponse, error)
- func (c *Client) EstimateCoinIDSellAll(coinToBuy, coinToSell, gasPrice uint64, valueToSell string, ...) (*models.EstimateCoinSellAllResponse, error)
- func (c *Client) EstimateCoinIDSellAllExtended(coinToBuy, coinToSell, gasPrice uint64, valueToSell string, swapFrom string, ...) (*models.EstimateCoinSellAllResponse, error)
- func (c *Client) EstimateCoinIDSellExtended(coinToBuy, coinToSell uint64, valueToSell string, coinCommission uint64, ...) (*models.EstimateCoinSellResponse, error)
- func (c *Client) EstimateCoinSymbolBuy(coinToSell, coinToBuy, valueToBuy string, coinCommission string, ...) (*models.EstimateCoinBuyResponse, error)
- func (c *Client) EstimateCoinSymbolBuyExtended(coinToSell, coinToBuy, valueToBuy string, coinCommission string, ...) (*models.EstimateCoinBuyResponse, error)
- func (c *Client) EstimateCoinSymbolSell(coinToBuy, coinToSell, valueToSell string, coinCommission string, ...) (*models.EstimateCoinSellResponse, error)
- func (c *Client) EstimateCoinSymbolSellAll(coinToBuy, coinToSell string, gasPrice uint64, valueToSell string, ...) (*models.EstimateCoinSellAllResponse, error)
- func (c *Client) EstimateCoinSymbolSellAllExtended(coinToBuy, coinToSell string, gasPrice uint64, valueToSell string, ...) (*models.EstimateCoinSellAllResponse, error)
- func (c *Client) EstimateCoinSymbolSellExtended(coinToBuy, coinToSell, valueToSell string, coinCommission string, ...) (*models.EstimateCoinSellResponse, error)
- func (c *Client) EstimateTxCommission(tx string, optionalHeight ...uint64) (*models.EstimateTxCommissionResponse, error)
- func (c *Client) Events(height uint64, search ...string) (*models.EventsResponse, error)
- func (c *Client) Frozen(address string, coinID *uint64, optionalHeight ...uint64) (*models.FrozenResponse, error)
- func (c *Client) FrozenAll(addresses []string, coinIDs []uint64, startHeight, endHeight uint64, ...) (*models.FrozenResponse, error)
- func (c *Client) Genesis() (*models.GenesisResponse, error)
- func (c *Client) Halts(height uint64) (*models.HaltsResponse, error)
- func (c *Client) LimitOrder(orderID uint64, optionalHeight ...uint64) (*models.LimitOrderResponse, error)
- func (c *Client) LimitOrders(orderIDs []uint64, optionalHeight ...uint64) (*models.LimitOrdersResponse, error)
- func (c *Client) LimitOrdersByOwner(owner string, optionalHeight ...uint64) (*models.LimitOrdersResponse, error)
- func (c *Client) LimitOrdersOfPool(sellCoin, buyCoin uint64, optionalHeight ...uint64) (*models.LimitOrdersOfPoolResponse, error)
- func (c *Client) Marshal(i interface{}) (json string, err error)
- func (c *Client) MaxGasPrice(optionalHeight ...uint64) (*models.MaxGasPriceResponse, error)
- func (c *Client) MinGasPrice() (*models.MinGasPriceResponse, error)
- func (c *Client) MissedBlocks(publicKey string, optionalHeight ...uint64) (*models.MissedBlocksResponse, error)
- func (c *Client) NetInfo() (*models.NetInfoResponse, error)
- func (c *Client) Nonce(address string, optionalHeight ...uint64) (uint64, error)
- func (c *Client) PriceCommission(optionalHeight ...uint64) (*models.PriceCommissionResponse, error)
- func (c *Client) SendTransaction(tx string) (*models.SendTransactionResponse, error)
- func (c *Client) Status() (*models.StatusResponse, error)
- func (c *Client) Subscribe(query string) (*SubscriberClient, error)
- func (c *Client) SwapPool(coin0, coin1 uint64, optionalHeight ...uint64) (*models.SwapPoolResponse, error)
- func (c *Client) SwapPoolProvider(coin0, coin1 uint64, provider string, optionalHeight ...uint64) (*models.SwapPoolResponse, error)
- func (c *Client) SwapPools(orders bool, optionalHeight ...uint64) (*models.SwapPoolsResponse, error)
- func (c *Client) Transaction(hash string) (*models.TransactionResponse, error)
- func (c *Client) Transactions(query string, page, perPage int32) (*models.TransactionsResponse, error)
- func (c *Client) UnconfirmedTxs(limit int32) (*models.UnconfirmedTxsResponse, error)
- func (c *Client) UpdateVotes(target uint64, optionalHeight ...uint64) (*models.UpdateVotesResponse, error)
- func (c *Client) Validators(optionalHeight ...uint64) (*models.ValidatorsResponse, error)
- func (c *Client) VersionNetwork() (*models.VersionNetworkResponse, error)
- func (c *Client) WaitList(publicKey, address string, optionalHeight ...uint64) (*models.WaitListResponse, error)
- func (c *Client) WaitLists(optionalHeight ...uint64) (*models.WaitListsResponse, error)
- func (c *Client) WithCallOption(opts ...api_service.ClientOption) *Client
- func (c *Client) WithContextFunc(contextFunc func(context.Context) func() context.Context) *Client
- func (c *Client) WithDebug(debug bool) *Client
- func (c *Client) WithHeaders(headers map[string][]string) *Client
- func (c *Client) WithLogger(logger logger.Logger) *Client
- func (c *Client) WithTimeout(timeout time.Duration) *Client
- type SubscriberClient
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type BestTradeRequest_Type ¶ added in v2.5.1
type BestTradeRequest_Type string
const ( BestTradeRequest_input BestTradeRequest_Type = "input" BestTradeRequest_output BestTradeRequest_Type = "output" )
type Client ¶
type Client struct { api_service.ClientService // contains filtered or unexported fields }
Client http apiClient HTTP client, with wrapper over go-swagger SwagClient methods
func (*Client) Address ¶ added in v2.2.0
Address returns coins list, balance and transaction count of an address.
func (*Client) AddressExtended ¶ added in v2.2.0
func (c *Client) AddressExtended(address string, delegated bool, optionalHeight ...uint64) (*models.AddressResponse, error)
AddressExtended returns coins list with bipValue, balance, delegated and transaction count of an address.
func (*Client) Addresses ¶ added in v2.2.0
func (c *Client) Addresses(addresses []string, optionalHeight ...uint64) (*models.AddressesResponse, error)
Addresses returns list of addresses.
func (*Client) AddressesExtended ¶ added in v2.2.0
func (c *Client) AddressesExtended(addresses []string, delegated bool, optionalHeight ...uint64) (*models.AddressesResponse, error)
AddressesExtended returns list of addresses with bipValue and delegated.
func (*Client) BestTrade ¶ added in v2.5.0
func (c *Client) BestTrade(sellCoinID, buyCoinID uint64, t BestTradeRequest_Type, amount string, maxDepth int32, optionalHeight ...uint64) (*models.BestTradeResponse, error)
BestTrade returns optimal exchange route.
func (*Client) Block ¶ added in v2.2.0
func (c *Client) Block(height uint64) (*models.BlockResponse, error)
Block returns block data at given height.
func (*Client) BlockExtended ¶ added in v2.2.0
func (c *Client) BlockExtended(height uint64, failedTxs, events bool, fieldsBlock ...string) (*models.BlockResponse, error)
BlockExtended returns block data at given height by filtered data.
func (*Client) Blocks ¶ added in v2.2.0
func (c *Client) Blocks(from, to uint64, failedTxs, events bool, fieldsBlock ...string) (*models.BlocksResponse, error)
Blocks returns blocks at given interval.
func (*Client) Candidate ¶ added in v2.2.0
func (c *Client) Candidate(publicKey string, optionalHeight ...uint64) (*models.CandidateResponse, error)
Candidate returns candidate’s res by provided public_key.
func (*Client) CandidateExtended ¶ added in v2.2.0
func (c *Client) CandidateExtended(publicKey string, notShowStakes bool, optionalHeight ...uint64) (*models.CandidateResponse, error)
CandidateExtended returns candidate’s res by provided public_key.
func (*Client) Candidates ¶ added in v2.2.0
func (c *Client) Candidates(includeStakes bool, status string, optionalHeight ...uint64) (*models.CandidatesResponse, error)
Candidates returns list of candidates.
func (*Client) CandidatesExtended ¶ added in v2.2.0
func (c *Client) CandidatesExtended(includeStakes, notShowStakes bool, status string, optionalHeight ...uint64) (*models.CandidatesResponse, error)
CandidatesExtended returns list of candidates.
func (*Client) CheckVersion ¶ added in v2.2.0
CheckVersion compares the prefix in the version name and checks the testnet mode
func (*Client) CoinInfo ¶ added in v2.2.0
func (c *Client) CoinInfo(symbol string, optionalHeight ...uint64) (*models.CoinInfoResponse, error)
CoinInfo returns information about coin symbol.
func (*Client) CoinInfoByID ¶ added in v2.2.0
func (c *Client) CoinInfoByID(id uint64, optionalHeight ...uint64) (*models.CoinInfoResponse, error)
CoinInfoByID returns information about coin ID.
func (*Client) CommissionVotes ¶ added in v2.2.0
func (c *Client) CommissionVotes(target uint64, optionalHeight ...uint64) (*models.CommissionVotesResponse, error)
CommissionVotes returns votes for update commissions.
func (*Client) EstimateCoinIDBuy ¶ added in v2.2.0
func (c *Client) EstimateCoinIDBuy(coinToSell, coinToBuy uint64, valueToBuy string, coinCommission uint64, optionalHeight ...uint64) (*models.EstimateCoinBuyResponse, error)
EstimateCoinIDBuy return estimate of buy coin transaction.
func (*Client) EstimateCoinIDBuyExtended ¶ added in v2.2.0
func (c *Client) EstimateCoinIDBuyExtended(coinToSell, coinToBuy uint64, valueToBuy string, coinCommission uint64, swapFrom string, route []uint64, optionalHeight ...uint64) (*models.EstimateCoinBuyResponse, error)
EstimateCoinIDBuyExtended return estimate of buy coin transaction with choice of the exchange source.
func (*Client) EstimateCoinIDSell ¶ added in v2.2.0
func (c *Client) EstimateCoinIDSell(coinToBuy, coinToSell uint64, valueToSell string, coinCommission uint64, optionalHeight ...uint64) (*models.EstimateCoinSellResponse, error)
EstimateCoinIDSell return estimate of sell coin transaction.
func (*Client) EstimateCoinIDSellAll ¶ added in v2.2.0
func (c *Client) EstimateCoinIDSellAll(coinToBuy, coinToSell, gasPrice uint64, valueToSell string, optionalHeight ...uint64) (*models.EstimateCoinSellAllResponse, error)
EstimateCoinIDSellAll return estimate of sell all coin transaction.
func (*Client) EstimateCoinIDSellAllExtended ¶ added in v2.2.0
func (c *Client) EstimateCoinIDSellAllExtended(coinToBuy, coinToSell, gasPrice uint64, valueToSell string, swapFrom string, route []uint64, optionalHeight ...uint64) (*models.EstimateCoinSellAllResponse, error)
EstimateCoinIDSellAllExtended return estimate of sell all coin transaction with choice of the exchange source.
func (*Client) EstimateCoinIDSellExtended ¶ added in v2.2.0
func (c *Client) EstimateCoinIDSellExtended(coinToBuy, coinToSell uint64, valueToSell string, coinCommission uint64, swapFrom string, route []uint64, optionalHeight ...uint64) (*models.EstimateCoinSellResponse, error)
EstimateCoinIDSellExtended return estimate of sell coin transaction with choice of the exchange source.
func (*Client) EstimateCoinSymbolBuy ¶ added in v2.2.0
func (c *Client) EstimateCoinSymbolBuy(coinToSell, coinToBuy, valueToBuy string, coinCommission string, optionalHeight ...uint64) (*models.EstimateCoinBuyResponse, error)
EstimateCoinSymbolBuy return estimate of buy coin transaction.
func (*Client) EstimateCoinSymbolBuyExtended ¶ added in v2.2.0
func (c *Client) EstimateCoinSymbolBuyExtended(coinToSell, coinToBuy, valueToBuy string, coinCommission string, swapFrom string, route []uint64, optionalHeight ...uint64) (*models.EstimateCoinBuyResponse, error)
EstimateCoinSymbolBuyExtended return estimate of buy coin transaction with choice of the exchange source.
func (*Client) EstimateCoinSymbolSell ¶ added in v2.2.0
func (c *Client) EstimateCoinSymbolSell(coinToBuy, coinToSell, valueToSell string, coinCommission string, optionalHeight ...uint64) (*models.EstimateCoinSellResponse, error)
EstimateCoinSymbolSell return estimate of sell coin transaction.
func (*Client) EstimateCoinSymbolSellAll ¶ added in v2.2.0
func (c *Client) EstimateCoinSymbolSellAll(coinToBuy, coinToSell string, gasPrice uint64, valueToSell string, optionalHeight ...uint64) (*models.EstimateCoinSellAllResponse, error)
EstimateCoinSymbolSellAll return estimate of sell all coin transaction.
func (*Client) EstimateCoinSymbolSellAllExtended ¶ added in v2.2.0
func (c *Client) EstimateCoinSymbolSellAllExtended(coinToBuy, coinToSell string, gasPrice uint64, valueToSell string, swapFrom string, route []uint64, optionalHeight ...uint64) (*models.EstimateCoinSellAllResponse, error)
EstimateCoinSymbolSellAllExtended return estimate of sell all coin transaction with choice of the exchange source.
func (*Client) EstimateCoinSymbolSellExtended ¶ added in v2.2.0
func (c *Client) EstimateCoinSymbolSellExtended(coinToBuy, coinToSell, valueToSell string, coinCommission string, swapFrom string, route []uint64, optionalHeight ...uint64) (*models.EstimateCoinSellResponse, error)
EstimateCoinSymbolSellExtended return estimate of sell coin transaction with choice of the exchange source.
func (*Client) EstimateTxCommission ¶ added in v2.2.0
func (c *Client) EstimateTxCommission(tx string, optionalHeight ...uint64) (*models.EstimateTxCommissionResponse, error)
EstimateTxCommission return estimate of encoding transaction.
func (*Client) Frozen ¶ added in v2.2.0
func (c *Client) Frozen(address string, coinID *uint64, optionalHeight ...uint64) (*models.FrozenResponse, error)
Frozen returns frozen balance. Deprecated: Use FrozenAll instead.
func (*Client) FrozenAll ¶ added in v2.5.0
func (c *Client) FrozenAll(addresses []string, coinIDs []uint64, startHeight, endHeight uint64, optionalHeight ...uint64) (*models.FrozenResponse, error)
FrozenAll returns frozen balance.
func (*Client) Genesis ¶ added in v2.2.0
func (c *Client) Genesis() (*models.GenesisResponse, error)
Genesis returns genesis file.
func (*Client) Halts ¶ added in v2.2.0
func (c *Client) Halts(height uint64) (*models.HaltsResponse, error)
Halts returns the candidate votes for stopping the network at block.
func (*Client) LimitOrder ¶ added in v2.4.0
func (c *Client) LimitOrder(orderID uint64, optionalHeight ...uint64) (*models.LimitOrderResponse, error)
LimitOrder returns order by ID.
func (*Client) LimitOrders ¶ added in v2.4.0
func (c *Client) LimitOrders(orderIDs []uint64, optionalHeight ...uint64) (*models.LimitOrdersResponse, error)
LimitOrders returns orders by IDs.
func (*Client) LimitOrdersByOwner ¶ added in v2.6.1
func (c *Client) LimitOrdersByOwner(owner string, optionalHeight ...uint64) (*models.LimitOrdersResponse, error)
LimitOrdersByOwner returns orders by owner.
func (*Client) LimitOrdersOfPool ¶ added in v2.4.0
func (c *Client) LimitOrdersOfPool(sellCoin, buyCoin uint64, optionalHeight ...uint64) (*models.LimitOrdersOfPoolResponse, error)
LimitOrdersOfPool returns sell orders for a pair of coins.
func (*Client) MaxGasPrice ¶ added in v2.2.0
func (c *Client) MaxGasPrice(optionalHeight ...uint64) (*models.MaxGasPriceResponse, error)
MaxGasPrice returns current max gas.
func (*Client) MinGasPrice ¶ added in v2.2.0
func (c *Client) MinGasPrice() (*models.MinGasPriceResponse, error)
MinGasPrice returns current min gas price.
func (*Client) MissedBlocks ¶ added in v2.2.0
func (c *Client) MissedBlocks(publicKey string, optionalHeight ...uint64) (*models.MissedBlocksResponse, error)
MissedBlocks returns missed blocks by validator public key.
func (*Client) NetInfo ¶ added in v2.2.0
func (c *Client) NetInfo() (*models.NetInfoResponse, error)
NetInfo returns network res
func (*Client) PriceCommission ¶ added in v2.2.0
func (c *Client) PriceCommission(optionalHeight ...uint64) (*models.PriceCommissionResponse, error)
PriceCommission returns commissions.
func (*Client) SendTransaction ¶ added in v2.2.0
func (c *Client) SendTransaction(tx string) (*models.SendTransactionResponse, error)
SendTransaction returns the result of sending signed tx. To ensure that transaction was successfully committed to the blockchain, you need to find the transaction by the hash and ensure that the status code equals to 0.
Example ¶
package main import ( "context" "github.com/MinterTeam/minter-go-sdk/v2/api" "github.com/MinterTeam/minter-go-sdk/v2/api/http_client" "github.com/MinterTeam/minter-go-sdk/v2/api/http_client/models" "github.com/MinterTeam/minter-go-sdk/v2/transaction" "github.com/MinterTeam/minter-go-sdk/v2/wallet" "io" "math/big" "time" ) func main() { client, _ := http_client.New("http://localhost:8843/v2") coinID, _ := client.CoinID("SYMBOL") w, _ := wallet.Create("1 2 3 4 5 6 7 8 9 10 11 12", "") nonce, _ := client.Nonce(w.Address) data := transaction.NewSendData().SetCoin(coinID).SetValue(transaction.BipToPip(big.NewInt(1))).MustSetTo(w.Address) transactionsBuilder := transaction.NewBuilder(transaction.TestNetChainID) tx, _ := transactionsBuilder.NewTransaction(data) sign, _ := tx.SetNonce(nonce).Sign(w.PrivateKey) encode, _ := sign.Encode() hash, _ := sign.Hash() subscribeClient, _ := client.Subscribe(api.QueryHash(hash)) defer subscribeClient.CloseSend() res, err := client.SendTransaction(encode) if err != nil { _, _, _ = client.ErrorBody(err) } if res.Code != 0 { panic(res.Log) } { recv, err := subscribeClient.Recv() if err == io.EOF { return } if err == context.Canceled || err == context.DeadlineExceeded { return } if err != nil { panic(err) } marshal, _ := client.Marshal(recv) findedTx, _ := api.SubscribeNewTxToTx(marshal) _, _ = findedTx.GetTransaction(), findedTx.Data().(*transaction.SendData) } // or { time.Sleep(5 * time.Second) response, _ := client.Transaction(hash) _, _ = client.Marshal(response) sendData := new(models.SendData) _ = response.Data.UnmarshalTo(sendData) _, _ = client.Marshal(sendData) } }
Output:
func (*Client) Status ¶ added in v2.2.0
func (c *Client) Status() (*models.StatusResponse, error)
Status returns node status including pubkey, latest block.
func (*Client) Subscribe ¶
func (c *Client) Subscribe(query string) (*SubscriberClient, error)
Subscribe returns a subscription for events by query.
Example (NewBlock) ¶
package main import ( "context" "github.com/MinterTeam/minter-go-sdk/v2/api" "github.com/MinterTeam/minter-go-sdk/v2/api/http_client" "github.com/MinterTeam/minter-go-sdk/v2/transaction" "io" "log" ) func main() { client, _ := http_client.New("http://localhost:8842/v2") subscribeClient, err := client.Subscribe(api.QueryEvent(api.EventNewBlock)) if err != nil { log.Fatal(err) } defer subscribeClient.CloseSend() for { recv, err := subscribeClient.Recv() if err == io.EOF { log.Fatal(err) } if err == io.EOF { return } if err == context.Canceled || err == context.DeadlineExceeded { return } if err != nil { panic(err) } marshal, err := client.Marshal(recv) if err != nil { log.Fatal(err) } parse, err := api.SubscribeNewBlockParse(marshal) block, err := client. //WithCallOption(). BlockExtended(parse.Data.Block.Header.Height, true, false) if err != nil { log.Fatal(err) } for _, tx := range block.Transactions { txDecode, err := transaction.Decode(tx.RawTx) if err != nil { log.Fatal(err) } log.Printf("%#v", txDecode.Data()) } } }
Output:
func (*Client) SwapPool ¶ added in v2.2.0
func (c *Client) SwapPool(coin0, coin1 uint64, optionalHeight ...uint64) (*models.SwapPoolResponse, error)
SwapPool returns total supply and reserves.
func (*Client) SwapPoolProvider ¶ added in v2.2.0
func (c *Client) SwapPoolProvider(coin0, coin1 uint64, provider string, optionalHeight ...uint64) (*models.SwapPoolResponse, error)
SwapPoolProvider returns reserves and liquidity balance of provider.
func (*Client) SwapPools ¶ added in v2.5.0
func (c *Client) SwapPools(orders bool, optionalHeight ...uint64) (*models.SwapPoolsResponse, error)
SwapPools returns list of all pools.
func (*Client) Transaction ¶ added in v2.2.0
func (c *Client) Transaction(hash string) (*models.TransactionResponse, error)
Transaction returns transaction res.
func (*Client) Transactions ¶ added in v2.2.0
func (c *Client) Transactions(query string, page, perPage int32) (*models.TransactionsResponse, error)
Transactions returns transactions by query.
func (*Client) UnconfirmedTxs ¶ added in v2.2.0
func (c *Client) UnconfirmedTxs(limit int32) (*models.UnconfirmedTxsResponse, error)
UnconfirmedTxs returns unconfirmed transactions.
func (*Client) UpdateVotes ¶ added in v2.2.0
func (c *Client) UpdateVotes(target uint64, optionalHeight ...uint64) (*models.UpdateVotesResponse, error)
UpdateVotes returns votes for update network.
func (*Client) Validators ¶ added in v2.2.0
func (c *Client) Validators(optionalHeight ...uint64) (*models.ValidatorsResponse, error)
Validators returns list of active validators.
func (*Client) VersionNetwork ¶ added in v2.2.0
func (c *Client) VersionNetwork() (*models.VersionNetworkResponse, error)
VersionNetwork returns versions network.
func (*Client) WaitList ¶ added in v2.2.0
func (c *Client) WaitList(publicKey, address string, optionalHeight ...uint64) (*models.WaitListResponse, error)
WaitList returns the list of address stakes in waitlist.
func (*Client) WaitLists ¶ added in v2.6.1
func (c *Client) WaitLists(optionalHeight ...uint64) (*models.WaitListsResponse, error)
WaitLists returns the list addresses and stakes in waitlist.
func (*Client) WithCallOption ¶ added in v2.4.0
func (c *Client) WithCallOption(opts ...api_service.ClientOption) *Client
WithCallOption returns new Client with additional api_service.ClientOption
func (*Client) WithContextFunc ¶ added in v2.2.0
WithContextFunc returns new Client client with new context Example:
timeout := func(c context.Context) func() context.Context { return func() context.Context { ctx, _ := context.WithTimeout(c, 10*time.Second) return ctx } }
func (*Client) WithHeaders ¶ added in v2.2.0
WithHeaders returns copy of Client with custom headers.
func (*Client) WithLogger ¶ added in v2.2.0
WithLogger returns copy of Client with custom logger.
type SubscriberClient ¶
type SubscriberClient struct {
// contains filtered or unexported fields
}
SubscriberClient is subscriber
func (*SubscriberClient) CloseSend ¶
func (s *SubscriberClient) CloseSend() error
CloseSend closes the send direction of the stream.
func (*SubscriberClient) Recv ¶
func (s *SubscriberClient) Recv() (*models.SubscribeResponse, error)
Recv returns message SubscribeOKBody.