1
0
Fork 0
forked from lthn/blockchain
blockchain/utils/sdk/client/go/docs/InfoAPI.md
Snider 884958b0c7 Add Go SDK client for Lethean Blockchain API
Introduces a generated Go SDK client for the Lethean Blockchain API, including OpenAPI spec, models, API interfaces, documentation, and tests. This enables Go applications to interact with Lethean blockchain endpoints for block, info, and transaction operations.
2025-10-19 14:49:39 +01:00

3.6 KiB
Generated

\InfoAPI

All URIs are relative to http://127.0.0.1:36943

Method HTTP request Description
GetInfo Get /info Get detailed information about the blockchain and daemon state
Version Get /info/version Get API version

GetInfo

InfoModel GetInfo(ctx).Flags(flags).Execute()

Get detailed information about the blockchain and daemon state

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/letheanVPN/blockchain/lthn"
)

func main() {
	flags := "flags_example" // string | Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median. (optional)

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InfoAPI.GetInfo(context.Background()).Flags(flags).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InfoAPI.GetInfo``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetInfo`: InfoModel
	fmt.Fprintf(os.Stdout, "Response from `InfoAPI.GetInfo`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiGetInfoRequest struct via the builder pattern

Name Type Description Notes
flags string Possible values: net_time_delta_median, current_network_hashrate_50, current_network_hashrate_350, seconds_for_10_blocks, seconds_for_30_blocks, transactions_daily_stat, last_pos_timestamp, last_pow_timestamp, total_coins, last_block_size, tx_count_in_last_block, pos_sequence_factor, pow_sequence_factor, pos_difficulty, performance, outs_stat, expirations_median.

Return type

InfoModel

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Version

VersionModel Version(ctx).Execute()

Get API version

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/letheanVPN/blockchain/lthn"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.InfoAPI.Version(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `InfoAPI.Version``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `Version`: VersionModel
	fmt.Fprintf(os.Stdout, "Response from `InfoAPI.Version`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiVersionRequest struct via the builder pattern

Return type

VersionModel

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]