Skip to content

openweb3-io/tonapi-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for tonapi

Provide access to indexed TON blockchain

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: 2.0.0
  • Package version: 1.0.0
  • Generator version: 7.7.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

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 tonapi "github.com/GIT_USER_ID/GIT_REPO_ID/tonapi"

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 tonapi.ContextServerIndex of type int.

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

Templated Server URL

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

ctx := context.WithValue(context.Background(), tonapi.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 tonapi.ContextOperationServerIndices and tonapi.ContextOperationServerVariables context maps.

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

Documentation for API Endpoints

All URIs are relative to https://tonapi.io

Class Method HTTP request Description
AccountsAPI AccountDnsBackResolve Get /v2/accounts/{account_id}/dns/backresolve
AccountsAPI AddressParse Get /v2/address/{account_id}/parse
AccountsAPI GetAccount Get /v2/accounts/{account_id}
AccountsAPI GetAccountDiff Get /v2/accounts/{account_id}/diff
AccountsAPI GetAccountDnsExpiring Get /v2/accounts/{account_id}/dns/expiring
AccountsAPI GetAccountEvent Get /v2/accounts/{account_id}/events/{event_id}
AccountsAPI GetAccountEvents Get /v2/accounts/{account_id}/events
AccountsAPI GetAccountJettonBalance Get /v2/accounts/{account_id}/jettons/{jetton_id}
AccountsAPI GetAccountJettonHistoryByID Get /v2/accounts/{account_id}/jettons/{jetton_id}/history
AccountsAPI GetAccountJettonsBalances Get /v2/accounts/{account_id}/jettons
AccountsAPI GetAccountJettonsHistory Get /v2/accounts/{account_id}/jettons/history
AccountsAPI GetAccountMultisigs Get /v2/accounts/{account_id}/multisigs
AccountsAPI GetAccountNftItems Get /v2/accounts/{account_id}/nfts
AccountsAPI GetAccountPublicKey Get /v2/accounts/{account_id}/publickey
AccountsAPI GetAccountSubscriptions Get /v2/accounts/{account_id}/subscriptions
AccountsAPI GetAccountTraces Get /v2/accounts/{account_id}/traces
AccountsAPI GetAccounts Post /v2/accounts/_bulk
AccountsAPI ReindexAccount Post /v2/accounts/{account_id}/reindex
AccountsAPI SearchAccounts Get /v2/accounts/search
BlockchainAPI BlockchainAccountInspect Get /v2/blockchain/accounts/{account_id}/inspect
BlockchainAPI ExecGetMethodForBlockchainAccount Get /v2/blockchain/accounts/{account_id}/methods/{method_name}
BlockchainAPI GetBlockchainAccountTransactions Get /v2/blockchain/accounts/{account_id}/transactions
BlockchainAPI GetBlockchainBlock Get /v2/blockchain/blocks/{block_id}
BlockchainAPI GetBlockchainBlockTransactions Get /v2/blockchain/blocks/{block_id}/transactions
BlockchainAPI GetBlockchainConfig Get /v2/blockchain/config
BlockchainAPI GetBlockchainConfigFromBlock Get /v2/blockchain/masterchain/{masterchain_seqno}/config
BlockchainAPI GetBlockchainMasterchainBlocks Get /v2/blockchain/masterchain/{masterchain_seqno}/blocks
BlockchainAPI GetBlockchainMasterchainHead Get /v2/blockchain/masterchain-head
BlockchainAPI GetBlockchainMasterchainShards Get /v2/blockchain/masterchain/{masterchain_seqno}/shards
BlockchainAPI GetBlockchainMasterchainTransactions Get /v2/blockchain/masterchain/{masterchain_seqno}/transactions
BlockchainAPI GetBlockchainRawAccount Get /v2/blockchain/accounts/{account_id}
BlockchainAPI GetBlockchainTransaction Get /v2/blockchain/transactions/{transaction_id}
BlockchainAPI GetBlockchainTransactionByMessageHash Get /v2/blockchain/messages/{msg_id}/transaction
BlockchainAPI GetBlockchainValidators Get /v2/blockchain/validators
BlockchainAPI GetRawBlockchainConfig Get /v2/blockchain/config/raw
BlockchainAPI GetRawBlockchainConfigFromBlock Get /v2/blockchain/masterchain/{masterchain_seqno}/config/raw
BlockchainAPI GetReducedBlockchainBlocks Get /v2/blockchain/reduced/blocks
BlockchainAPI SendBlockchainMessage Post /v2/blockchain/message
BlockchainAPI Status Get /v2/status
ConnectAPI GetAccountInfoByStateInit Post /v2/tonconnect/stateinit
ConnectAPI GetTonConnectPayload Get /v2/tonconnect/payload
DNSAPI DnsResolve Get /v2/dns/{domain_name}/resolve
DNSAPI GetAllAuctions Get /v2/dns/auctions
DNSAPI GetDnsInfo Get /v2/dns/{domain_name}
DNSAPI GetDomainBids Get /v2/dns/{domain_name}/bids
EmulationAPI DecodeMessage Post /v2/message/decode
EmulationAPI EmulateMessageToAccountEvent Post /v2/accounts/{account_id}/events/emulate
EmulationAPI EmulateMessageToEvent Post /v2/events/emulate
EmulationAPI EmulateMessageToTrace Post /v2/traces/emulate
EmulationAPI EmulateMessageToWallet Post /v2/wallet/emulate
EventsAPI GetEvent Get /v2/events/{event_id}
GaslessAPI GaslessConfig Get /v2/gasless/config
GaslessAPI GaslessEstimate Post /v2/gasless/estimate/{master_id}
GaslessAPI GaslessSend Post /v2/gasless/send
InscriptionsAPI GetAccountInscriptions Get /v2/experimental/accounts/{account_id}/inscriptions
InscriptionsAPI GetAccountInscriptionsHistory Get /v2/experimental/accounts/{account_id}/inscriptions/history
InscriptionsAPI GetAccountInscriptionsHistoryByTicker Get /v2/experimental/accounts/{account_id}/inscriptions/{ticker}/history
InscriptionsAPI GetInscriptionOpTemplate Get /v2/experimental/inscriptions/op-template
JettonsAPI GetJettonHolders Get /v2/jettons/{account_id}/holders
JettonsAPI GetJettonInfo Get /v2/jettons/{account_id}
JettonsAPI GetJettons Get /v2/jettons
JettonsAPI GetJettonsEvents Get /v2/events/{event_id}/jettons
LiteServerAPI GetAllRawShardsInfo Get /v2/liteserver/get_all_shards_info/{block_id}
LiteServerAPI GetOutMsgQueueSizes Get /v2/liteserver/get_out_msg_queue_sizes
LiteServerAPI GetRawAccountState Get /v2/liteserver/get_account_state/{account_id}
LiteServerAPI GetRawBlockProof Get /v2/liteserver/get_block_proof
LiteServerAPI GetRawBlockchainBlock Get /v2/liteserver/get_block/{block_id}
LiteServerAPI GetRawBlockchainBlockHeader Get /v2/liteserver/get_block_header/{block_id}
LiteServerAPI GetRawBlockchainBlockState Get /v2/liteserver/get_state/{block_id}
LiteServerAPI GetRawConfig Get /v2/liteserver/get_config_all/{block_id}
LiteServerAPI GetRawListBlockTransactions Get /v2/liteserver/list_block_transactions/{block_id}
LiteServerAPI GetRawMasterchainInfo Get /v2/liteserver/get_masterchain_info
LiteServerAPI GetRawMasterchainInfoExt Get /v2/liteserver/get_masterchain_info_ext
LiteServerAPI GetRawShardBlockProof Get /v2/liteserver/get_shard_block_proof/{block_id}
LiteServerAPI GetRawShardInfo Get /v2/liteserver/get_shard_info/{block_id}
LiteServerAPI GetRawTime Get /v2/liteserver/get_time
LiteServerAPI GetRawTransactions Get /v2/liteserver/get_transactions/{account_id}
LiteServerAPI SendRawMessage Post /v2/liteserver/send_message
MultisigAPI GetMultisigAccount Get /v2/multisig/{account_id}
NFTAPI GetAccountNftHistory Get /v2/accounts/{account_id}/nfts/history
NFTAPI GetItemsFromCollection Get /v2/nfts/collections/{account_id}/items
NFTAPI GetNftCollection Get /v2/nfts/collections/{account_id}
NFTAPI GetNftCollections Get /v2/nfts/collections
NFTAPI GetNftHistoryByID Get /v2/nfts/{account_id}/history
NFTAPI GetNftItemByAddress Get /v2/nfts/{account_id}
NFTAPI GetNftItemsByAddresses Post /v2/nfts/_bulk
RatesAPI GetChartRates Get /v2/rates/chart
RatesAPI GetMarketsRates Get /v2/rates/markets
RatesAPI GetRates Get /v2/rates
StakingAPI GetAccountNominatorsPools Get /v2/staking/nominator/{account_id}/pools
StakingAPI GetStakingPoolHistory Get /v2/staking/pool/{account_id}/history
StakingAPI GetStakingPoolInfo Get /v2/staking/pool/{account_id}
StakingAPI GetStakingPools Get /v2/staking/pools
StorageAPI GetStorageProviders Get /v2/storage/providers
TracesAPI GetTrace Get /v2/traces/{trace_id}
WalletAPI GetAccountSeqno Get /v2/wallet/{account_id}/seqno
WalletAPI GetWalletBackup Get /v2/wallet/backup
WalletAPI GetWalletsByPublicKey Get /v2/pubkeys/{public_key}/wallets
WalletAPI SetWalletBackup Put /v2/wallet/backup
WalletAPI TonConnectProof Post /v2/wallet/auth/proof

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

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

support@tonkeeper.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages