Skip to content

celenium-io/celenium-api-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for celenium

Celenium 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/celenium-io/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

Class Method HTTP request Description
AddressAPI AddressBlobs Get /address/{hash}/blobs Get blobs pushed by address
AddressAPI AddressDelegations Get /address/{hash}/delegations Get delegations made by address
AddressAPI AddressGrantee Get /address/{hash}/granters Get grants where address is grantee
AddressAPI AddressGrants Get /address/{hash}/grants Get grants made by address
AddressAPI AddressMessages Get /address/{hash}/messages Get address messages
AddressAPI AddressRedelegations Get /address/{hash}/redelegations Get redelegations made by address
AddressAPI AddressStats Get /address/{hash}/stats/{name}/{timeframe} Get address stats
AddressAPI AddressTransactions Get /address/{hash}/txs Get address transactions
AddressAPI AddressUndelegations Get /address/{hash}/undelegations Get undelegations made by address
AddressAPI AddressVesting Get /address/{hash}/vestings Get vesting for address
AddressAPI GetAddress Get /address/{hash} Get address info
AddressAPI GetAddressCount Get /address/count Get count of addresses in network
AddressAPI ListAddress Get /address List address info
BlockAPI BlockBlobsCount Get /block/{height}/blobs/count Count of blobs which was pushed by transaction
BlockAPI GetBlock Get /block/{height} Get block info
BlockAPI GetBlockBlobs Get /block/{height}/blobs List blobs which was pushed in the block
BlockAPI GetBlockCount Get /block/count Get count of blocks in network
BlockAPI GetBlockEvents Get /block/{height}/events Get events from begin and end of block
BlockAPI GetBlockMessages Get /block/{height}/messages Get messages contained in the block
BlockAPI GetBlockStats Get /block/{height}/stats Get block stats by height
BlockAPI ListBlock Get /block List blocks info
GasAPI GasEstimateForPfb Get /gas/estimate_for_pfb Get estimated gas for pay for blob
GasAPI GasPrice Get /gas/price Get estimated gas price
GeneralAPI GetConstants Get /constants Get network constants
GeneralAPI GetEnums Get /enums Get celenium enumerators
GeneralAPI Head Get /head Get current indexer head
NamespaceAPI GetBlob Post /blob Get namespace blob by commitment on height
NamespaceAPI GetBlobLogs Get /namespace/{id}/{version}/blobs Get blob changes for namespace
NamespaceAPI GetBlobMetadata Post /blob/metadata Get blob metadata by commitment on height
NamespaceAPI GetBlobs Get /blob List all blobs with filters
NamespaceAPI GetNamespace Get /namespace/{id} Get namespace info
NamespaceAPI GetNamespaceActive Get /namespace/active Get last used namespace
NamespaceAPI GetNamespaceBase64 Get /namespace_by_hash/{hash} Get namespace info by base64
NamespaceAPI GetNamespaceBlobs Get /namespace_by_hash/{hash}/{height} Get namespace blobs on height
NamespaceAPI GetNamespaceByVersionAndId Get /namespace/{id}/{version} Get namespace info by id and version
NamespaceAPI GetNamespaceCount Get /namespace/count Get count of namespaces in network
NamespaceAPI GetNamespaceMessages Get /namespace/{id}/{version}/messages Get namespace messages by id and version
NamespaceAPI GetNamespaceRollups Get /namespace/{id}/{version}/rollups List rollups using the namespace
NamespaceAPI ListNamespace Get /namespace List namespace info
RollupAPI GetRollup Get /rollup/{id} Get rollup info
RollupAPI GetRollupAllSeries Get /rollup/stats/series Get series for all rollups
RollupAPI GetRollupBlobs Get /rollup/{id}/blobs Get rollup blobs
RollupAPI GetRollupBySlug Get /rollup/slug/{slug} Get rollup by slug
RollupAPI GetRollupDistribution Get /rollup/{id}/distribution/{name}/{timeframe} Get rollup distribution
RollupAPI GetRollupNamespaces Get /rollup/{id}/namespaces Get rollup namespaces info
RollupAPI GetRollupStats Get /rollup/{id}/stats/{name}/{timeframe} Get rollup stats
RollupAPI GetRollupsCount Get /rollup/count Get count of rollups in network
RollupAPI ListRollup Get /rollup List rollups info
RollupAPI ListRollup24h Get /rollup/day List rollups info with stats by previous 24 hours
RollupAPI RollupExport Get /rollup/{id}/export Export rollup blobs
SearchAPI Search Get /search Search by hash
StatsAPI Stats24hChanges Get /stats/changes_24h Get changes for 24 hours
StatsAPI StatsMessagesCount24h Get /stats/messages_count_24h Get messages distribution for the last 24 hours
StatsAPI StatsNamespaceUsage Get /stats/namespace/usage Get namespaces with sorting by size.
StatsAPI StatsNsSeries Get /stats/namespace/series/{id}/{name}/{timeframe} Get histogram for namespace with precomputed stats
StatsAPI StatsPriceCurrent Get /stats/price/current Get current TIA price
StatsAPI StatsPriceSeries Get /stats/price/series/{timeframe} Get histogram with TIA price
StatsAPI StatsRollup24h Get /stats/rollup_stats_24h Get rollups stats for last 24 hours
StatsAPI StatsSeries Get /stats/series/{name}/{timeframe} Get histogram with precomputed stats
StatsAPI StatsSeriesCumulative Get /stats/series/{name}/{timeframe}/cumulative Get cumulative histogram with precomputed stats
StatsAPI StatsSquareSize Get /stats/square_size Get histogram for square size distribution
StatsAPI StatsStakingSeries Get /stats/staking/series/{id}/{name}/{timeframe} Get histogram for staking with precomputed stats
StatsAPI StatsSummary Get /stats/summary/{table}/{function} Get value by table and function
TransactionsAPI GetTransaction Get /tx/{hash} Get transaction by hash
TransactionsAPI GetTransactionEvents Get /tx/{hash}/events Get transaction events
TransactionsAPI GetTransactionMessages Get /tx/{hash}/messages Get transaction messages
TransactionsAPI GetTransactionsCount Get /tx/count Get count of transactions in network
TransactionsAPI ListGenesisTransactions Get /tx/genesis List genesis transactions info
TransactionsAPI ListTransactionBlobs Get /tx/{hash}/blobs List blobs which was pushed by transaction
TransactionsAPI ListTransactions Get /tx List transactions info
TransactionsAPI TransactionBlobsCount Get /tx/{hash}/blobs/count Count of blobs which was pushed by transaction
ValidatorAPI GetValidator Get /validators/{id} Get validator info
ValidatorAPI GetValidatorBlocks Get /validators/{id}/blocks Get blocks which was proposed by validator
ValidatorAPI GetValidatorUptime Get /validators/{id}/uptime Get validator's uptime and history of signed block
ValidatorAPI ListValidator Get /validators List validators
ValidatorAPI ValidatorCount Get /validators/count Get validator's count by status
ValidatorAPI ValidatorDelegators Get /validators/{id}/delegators Get validator's delegators
ValidatorAPI ValidatorJails Get /validators/{id}/jails Get validator's jails
VestingAPI GetVestingPeriods Get /vesting/{id}/periods Periods 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]