Skip to content

Latest commit

History

48 Commits

Folders and files

NameName
Last commit message
Last commit date

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.24.0-SNAPSHOT
  • Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://discord.gg/3k83Przqk8

Installation

Import the package in a go file in your project and run go mod tidy:

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

ClassMethodHTTP requestDescription
AddressAPIAddressBalancesGet /address/{hash}/balancesGet list of balances for address
AddressAPIAddressBlobsGet /address/{hash}/blobsGet blobs pushed by address
AddressAPIAddressCelestialsGet /address/{hash}/celestialsGet list of celestial id for 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
AddressAPIAddressVotesGet /address/{hash}/votesGet list of votes for address
AddressAPIGetAddressGet /address/{hash}Get address info
AddressAPIGetAddressCountGet /address/countGet count of addresses in network
AddressAPIListAddressGet /addressList addresses
BlockAPIBlockBlobsCountGet /block/{height}/blobs/countCount of blobs which was pushed in the block
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
ForwardingAPIGetForwardingGet /forwarding/{id}Get forwarding event by ID
ForwardingAPIListForwardingGet /forwardingList forwarding events
GasAPIGasEstimateForPfbGet /gas/estimate_for_pfbGet estimated gas for pay for blob
GasAPIGasPriceGet /gas/priceGet estimated gas price
GasAPIGasPricePriorityGet /gas/price/{priority}Get estimated gas price with priority filter
GeneralAPIGetConstantsGet /constantsGet network constants
GeneralAPIGetEnumsGet /enumsGet celenium enumerators
GeneralAPIHeadGet /headGet current indexer head
HyperlaneAPIGetHyperlaneIgpGet /hyperlane/igp/{id}Get IGP by id
HyperlaneAPIGetHyperlaneMailboxGet /hyperlane/mailbox/{id}Get hyperlane mailbox info
HyperlaneAPIGetHyperlaneTokenGet /hyperlane/token/{id}Get hyperlane token info
HyperlaneAPIGetHyperlaneTransferGet /hyperlane/transfer/{id}Get transfer by id
HyperlaneAPIGetZkismGet /hyperlane/zkism/{id}Get ZK ISM by id
HyperlaneAPIGetZkismMessagesGet /hyperlane/zkism/{id}/messagesGet ZK ISM authorized messages
HyperlaneAPIGetZkismUpdatesGet /hyperlane/zkism/{id}/updatesGet ZK ISM state update history
HyperlaneAPIListHyperlaneDomainsGet /hyperlane/domainsList hyperlane domains info
HyperlaneAPIListHyperlaneIgpsGet /hyperlane/igpList hyperlane Interchain Gas Paymaster (IGP)
HyperlaneAPIListHyperlaneMailboxGet /hyperlane/mailboxList hyperlane mailboxes info
HyperlaneAPIListHyperlaneTokensGet /hyperlane/tokenList hyperlane tokens info
HyperlaneAPIListHyperlaneTransfersGet /hyperlane/transferList hyperlane transfers info
HyperlaneAPIListZkismGet /hyperlane/zkismList ZK Interchain Security Modules
IbcAPIGetIbcChannelGet /ibc/channel/{id}Get ibc channel info
IbcAPIGetIbcChannelsGet /ibc/channelGet ibc channels info
IbcAPIGetIbcClientGet /ibc/client/{id}Get ibc client info
IbcAPIGetIbcClientsGet /ibc/clientGet ibc clients info
IbcAPIGetIbcConnGet /ibc/connection/{id}Get ibc connection info
IbcAPIGetIbcConnsGet /ibc/connectionGet ibc connections info
IbcAPIGetIbcRelayersGet /ibc/relayersList ibc relayers
IbcAPIGetIbcTransferGet /ibc/transfer/{id}Get transfer by id
IbcAPIGetIbcTransfersGet /ibc/transferGet ibc transfers info
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
NamespaceAPIGetBlobProofPost /blob/proofsGet blob inclusion proofs
NamespaceAPIGetBlobsGet /blobList all blobs with filters
NamespaceAPIGetNamespaceGet /namespace/{id}Get namespace info
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
NamespaceAPIGetNamespaceMessagesGet /namespace/{id}/{version}/messagesGet namespace messages by id and version
NamespaceAPIGetNamespaceRollupsGet /namespace/{id}/{version}/rollupsList rollups using the namespace
NamespaceAPIListNamespaceGet /namespaceList namespace info
ProposalAPIGetProposalGet /proposal/{id}Get proposal info
ProposalAPIListProposalGet /proposalList proposal info
ProposalAPIProposalVotesGet /proposal/{id}/votesGet proposal's votes
RollupAPIGetRollupGet /rollup/{id}Get rollup info
RollupAPIGetRollupAllSeriesGet /rollup/stats/series/{timeframe}Get 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
RollupAPIGetRollupProvidersGet /rollup/{id}/providersGet rollup providers 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
RollupAPIRollupGroupedStatisticsGet /rollup/groupRollup Grouped Statistics
SearchAPISearchGet /searchSearch by hash
SignalAPIGetUpgradeGet /signal/upgrade/{version}Get upgrade by version
SignalAPIListSignalGet /signalList signals
SignalAPIListUpgradesGet /signal/upgradeList upgrades
StatsAPIStats24hChangesGet /stats/changes_24hGet changes for 24 hours
StatsAPIStatsHlDomainsGet /stats/hyperlane/chainsGet stats for hyperlane transfers splitted by domain
StatsAPIStatsHlSeriesGet /stats/hyperlane/series/{id}/{name}/{timeframe}Get histogram for hyperlane domains with precomputed stats
StatsAPIStatsHlTotalSeriesGet /stats/hyperlane/chains/{name}/{timeframe}Get histogram for aggregated hyperlane domains with precomputed stats
StatsAPIStatsIbcChainsGet /stats/ibc/chainsGet stats for ibc channels splitted by chains
StatsAPIStatsIbcSeriesGet /stats/ibc/series/{id}/{name}/{timeframe}Get histogram for ibc channels with precomputed stats
StatsAPIStatsIbcSummaryGet /stats/ibc/summaryGet stats for ibc the largest transfer and busiest channel per day
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
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
StatsAPIStatsSizeGroupsGet /stats/size_groupsGet blobs count grouped by size
StatsAPIStatsSquareSizeGet /stats/square_sizeGet histogram for square size distribution
StatsAPIStatsStakingDistributionGet /stats/staking/distributionGet histogram for staking
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
ValidatorAPIValidatorMessagesGet /validators/{id}/messagesGet validator messages
ValidatorAPIValidatorMetricsGet /validators/{id}/metricsGet validator's metrics
ValidatorAPIValidatorVotesGet /validators/{id}/votesGet list of votes for validator
ValidatorAPIValidatorsMetricsGet /validators/metricsGet validators metrics
VestingAPIGetVestingPeriodsGet /vesting/{id}/periodsGet 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

celenium@pklabs.me

About

Auto-generated Go wrapper for Celenium API.

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages