Categorygithub.com/mismirnov/celenium-api-go
repositorypackage
1.10.11
Repository: https://github.com/mismirnov/celenium-api-go.git
Documentation: pkg.go.dev

# Packages

No description provided by the author

# README

Go API client for celenium

Celenium TEST API is a powerful tool to access all blockchain data that is processed and indexed by our proprietary indexer. With Celenium API you can retrieve all historical data, off-chain data, blobs and statistics through our REST API. Celenium API indexer are open source, which allows you to not depend on third-party services. You can clone, build and run them independently, giving you full control over all components. If you have any questions or feature requests, please feel free to contact us. We appreciate your feedback!

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 1.0
  • Package version: 1.0.0
  • Generator version: 7.9.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://discord.gg/3k83Przqk8

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import celenium "github.com/mismirnov/celenium-api-go"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value celenium.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), celenium.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value celenium.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), celenium.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using celenium.ContextOperationServerIndices and celenium.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), celenium.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), celenium.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api-mainnet.celenium.io/v1

ClassMethodHTTP requestDescription
AddressAPIAddressBlobsGet /address/{hash}/blobsGet blobs pushed by address
AddressAPIAddressDelegationsGet /address/{hash}/delegationsGet delegations made by address
AddressAPIAddressGranteeGet /address/{hash}/grantersGet grants where address is grantee
AddressAPIAddressGrantsGet /address/{hash}/grantsGet grants made by address
AddressAPIAddressMessagesGet /address/{hash}/messagesGet address messages
AddressAPIAddressRedelegationsGet /address/{hash}/redelegationsGet redelegations made by address
AddressAPIAddressStatsGet /address/{hash}/stats/{name}/{timeframe}Get address stats
AddressAPIAddressTransactionsGet /address/{hash}/txsGet address transactions
AddressAPIAddressUndelegationsGet /address/{hash}/undelegationsGet undelegations made by address
AddressAPIAddressVestingGet /address/{hash}/vestingsGet vesting for address
AddressAPIGetAddressGet /address/{hash}Get address info
AddressAPIGetAddressCountGet /address/countGet count of addresses in network
AddressAPIListAddressGet /addressList address info
BlockAPIBlockBlobsCountGet /block/{height}/blobs/countCount of blobs which was pushed by transaction
BlockAPIGetBlockGet /block/{height}Get block info
BlockAPIGetBlockBlobsGet /block/{height}/blobsList blobs which was pushed in the block
BlockAPIGetBlockCountGet /block/countGet count of blocks in network
BlockAPIGetBlockEventsGet /block/{height}/eventsGet events from begin and end of block
BlockAPIGetBlockMessagesGet /block/{height}/messagesGet messages contained in the block
BlockAPIGetBlockStatsGet /block/{height}/statsGet block stats by height
BlockAPIListBlockGet /blockList blocks info
GasAPIGasEstimateForPfbGet /gas/estimate_for_pfbGet estimated gas for pay for blob
GasAPIGasPriceGet /gas/priceGet estimated gas price
GeneralAPIGetConstantsGet /constantsGet network constants
GeneralAPIGetEnumsGet /enumsGet celenium enumerators
GeneralAPIHeadGet /headGet current indexer head
NamespaceAPIGetBlobPost /blobGet namespace blob by commitment on height
NamespaceAPIGetBlobLogsGet /namespace/{id}/{version}/blobsGet blob changes for namespace
NamespaceAPIGetBlobMetadataPost /blob/metadataGet blob metadata by commitment on height
NamespaceAPIGetBlobsGet /blobList all blobs with filters
NamespaceAPIGetNamespaceGet /namespace/{id}Get namespace info
NamespaceAPIGetNamespaceActiveGet /namespace/activeGet last used namespace
NamespaceAPIGetNamespaceBase64Get /namespace_by_hash/{hash}Get namespace info by base64
NamespaceAPIGetNamespaceBlobsGet /namespace_by_hash/{hash}/{height}Get namespace blobs on height
NamespaceAPIGetNamespaceByVersionAndIdGet /namespace/{id}/{version}Get namespace info by id and version
NamespaceAPIGetNamespaceCountGet /namespace/countGet count of namespaces in network
NamespaceAPIGetNamespaceMessagesGet /namespace/{id}/{version}/messagesGet namespace messages by id and version
NamespaceAPIGetNamespaceRollupsGet /namespace/{id}/{version}/rollupsList rollups using the namespace
NamespaceAPIListNamespaceGet /namespaceList namespace info
RollupAPIGetRollupGet /rollup/{id}Get rollup info
RollupAPIGetRollupAllSeriesGet /rollup/stats/seriesGet series for all rollups
RollupAPIGetRollupBlobsGet /rollup/{id}/blobsGet rollup blobs
RollupAPIGetRollupBySlugGet /rollup/slug/{slug}Get rollup by slug
RollupAPIGetRollupDistributionGet /rollup/{id}/distribution/{name}/{timeframe}Get rollup distribution
RollupAPIGetRollupNamespacesGet /rollup/{id}/namespacesGet rollup namespaces info
RollupAPIGetRollupStatsGet /rollup/{id}/stats/{name}/{timeframe}Get rollup stats
RollupAPIGetRollupsCountGet /rollup/countGet count of rollups in network
RollupAPIListRollupGet /rollupList rollups info
RollupAPIListRollup24hGet /rollup/dayList rollups info with stats by previous 24 hours
RollupAPIRollupExportGet /rollup/{id}/exportExport rollup blobs
SearchAPISearchGet /searchSearch by hash
StatsAPIStats24hChangesGet /stats/changes_24hGet changes for 24 hours
StatsAPIStatsMessagesCount24hGet /stats/messages_count_24hGet messages distribution for the last 24 hours
StatsAPIStatsNamespaceUsageGet /stats/namespace/usageGet namespaces with sorting by size.
StatsAPIStatsNsSeriesGet /stats/namespace/series/{id}/{name}/{timeframe}Get histogram for namespace with precomputed stats
StatsAPIStatsPriceCurrentGet /stats/price/currentGet current TIA price
StatsAPIStatsPriceSeriesGet /stats/price/series/{timeframe}Get histogram with TIA price
StatsAPIStatsRollup24hGet /stats/rollup_stats_24hGet rollups stats for last 24 hours
StatsAPIStatsSeriesGet /stats/series/{name}/{timeframe}Get histogram with precomputed stats
StatsAPIStatsSeriesCumulativeGet /stats/series/{name}/{timeframe}/cumulativeGet cumulative histogram with precomputed stats
StatsAPIStatsSquareSizeGet /stats/square_sizeGet histogram for square size distribution
StatsAPIStatsStakingSeriesGet /stats/staking/series/{id}/{name}/{timeframe}Get histogram for staking with precomputed stats
StatsAPIStatsSummaryGet /stats/summary/{table}/{function}Get value by table and function
TransactionsAPIGetTransactionGet /tx/{hash}Get transaction by hash
TransactionsAPIGetTransactionEventsGet /tx/{hash}/eventsGet transaction events
TransactionsAPIGetTransactionMessagesGet /tx/{hash}/messagesGet transaction messages
TransactionsAPIGetTransactionsCountGet /tx/countGet count of transactions in network
TransactionsAPIListGenesisTransactionsGet /tx/genesisList genesis transactions info
TransactionsAPIListTransactionBlobsGet /tx/{hash}/blobsList blobs which was pushed by transaction
TransactionsAPIListTransactionsGet /txList transactions info
TransactionsAPITransactionBlobsCountGet /tx/{hash}/blobs/countCount of blobs which was pushed by transaction
ValidatorAPIGetValidatorGet /validators/{id}Get validator info
ValidatorAPIGetValidatorBlocksGet /validators/{id}/blocksGet blocks which was proposed by validator
ValidatorAPIGetValidatorUptimeGet /validators/{id}/uptimeGet validator's uptime and history of signed block
ValidatorAPIListValidatorGet /validatorsList validators
ValidatorAPIValidatorCountGet /validators/countGet validator's count by status
ValidatorAPIValidatorDelegatorsGet /validators/{id}/delegatorsGet validator's delegators
ValidatorAPIValidatorJailsGet /validators/{id}/jailsGet validator's jails
VestingAPIGetVestingPeriodsGet /vesting/{id}/periodsPeriods vesting periods by id

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

ApiKeyAuth

  • Type: API key
  • API key parameter name: apikey
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: ApiKeyAuth and passed in as the auth context for each request.

Example

auth := context.WithValue(
		context.Background(),
		celenium.ContextAPIKeys,
		map[string]celenium.APIKey{
			"ApiKeyAuth": {Key: "API_KEY_STRING"},
		},
	)
r, err := client.Service.Operation(auth, args)

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]