Skip to content

oyyblin/theblockchainapi-go-wrapper

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for openapi

About

Our vision is to make it super easy to interact with the decentralized web. We want you to be able to do this in any coding language and do it easily and quickly.

You're a key part of our vision. We love feature requests! <a href="#section/Feature-Requests">Make one!

How to Use the API

To use the API, you simply need to create an API key pair.

Doing so takes less than a minute. Simply go to <a target="_blank" href="https://dashboard.blockchainapi.com\">the dashboard, create an account, and generate a key pair. You can now use this pair to make API requests. You must create your first pair via the dashboard.

Feature Requests

Got a feature request? Submit it as an issue on <a target="_blank" href="https://github.com/BL0CK-X/the-blockchain-api/issues/new/choose\">our GitHub repo or email us.

Contact

Text / Call: +1 (415) 888 4745

Email us: info@theblockchainapi.com

Join our Discord

Follow us on Twitter

Star us on Github

Security

Common dogma is to never give out your seed phrase. We agree. It's a matter of security, and anyone who has your seed phrase can irreversibly empty your wallet.

When using an API endpoint that requires a seed phrase, we highly recommend that users use or create a wallet that they do not use as their primary wallet.

How you make this work depends on what you're doing. If you're minting an NFT for example, we recommend creating a new wallet and then transferring just enough SOL to that wallet to mint the NFT. This is possible on Solana because such transactions cost less than a penny. We will have more tutorials in the future that make it easier for you to be secure when using our API.

We have easy-to-use endpoints for <a href="#tag/Solana-Wallet/paths/1solana1wallet1secret_recovery_phrase/post">creating a new seed phrase and then <a href="#tag/Solana-Wallet/paths/1solana1wallet1public_key/post">deriving a public key to enable you to transfer to that new wallet.

Let's have a constructive dialog about this. Feel free to <a href="#section/Contact">contact us. I made a video discussing this matter <a target="_blank" href="https://youtu.be/m9unUb8Z9qU\">here.

Note: We have had a couple of individuals harrass and threaten us. These individuals did not try our API or speak to anyone who has used it. They simply saw that we require a seed phrase for certain endpoints and figured that the proper response was to attack us. (I explain why we do <a target="_blank" href="https://youtu.be/m9unUb8Z9qU\">here.) Such harrassment and threats are not only harmful, but they are also illegal, and we will report offenders. Do not harrass us. Rather, feel free to discuss your concerns with us and we will be more than happy to work with you to come up with a solution.

Pricing

Each user receives 500 free credits.

You can learn more about our pricing <a href="https://dashboard.blockchainapi.com/billing\" target="_blank">here.

We frequently do custom plans. If our pricing doesn't work for you, <a href="#section/Contact">contact us.

If you have questions, concerns, feedback, or ideas, <a href="#section/Contact">contact us.

SDKs / API Wrappers

We have examples using both our <a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples\" target="_blank">Python wrapper and our JavaScript wrapper here.

We have built a custom <a href="https://github.com/BL0CK-X/the-blockchain-api-python-wrapper\" target="_blank">Python wrapper.

pip install theblockchainapi

We also have published a <a href="https://github.com/BL0CK-X/theblockchainapi-javascript-wrapper\" target="_blank">JavaScript Wrapper.

npm install theblockchainapi

We also have auto-generated wrappers for the following languages:

If you would like a different language as well, submit an issue <a href="https://github.com/BL0CK-X/theblockchainapi-wrappers/issues/new\" target="_blank">here.

If you run into any bugs with the wrappers, submit an issue <a href="https://github.com/BL0CK-X/theblockchainapi-wrappers/issues/new\" target="_blank">here.

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: null
  • Package version: 1.0.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/oauth2
go get golang.org/x/net/context

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

import sw "./openapi"

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

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

Templated Server URL

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

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

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

Documentation for API Endpoints

All URIs are relative to https://api.blockchainapi.com/v1

Class Method HTTP request Description
FileApi UploadFile Post /file Upload a file
SolanaAccountApi SolanaGetAccount Get /solana/account/{network}/{public_key} Get the details of an account on Solana
SolanaAccountApi SolanaGetAccountIsCandyMachine Get /solana/account/{network}/{public_key}/is_candy_machine Get if account is candy machine
SolanaAccountApi SolanaGetAccountIsNFT Get /solana/account/{network}/{public_key}/is_nft Get if account is NFT
SolanaCandyMachineApi SolanaCreateTestCandyMachine Post /solana/nft/candy_machine Create a test CM
SolanaCandyMachineApi SolanaGetAllNFTsFromCandyMachine Get /solana/nft/candy_machine/{network}/{candy_machine_id}/nfts Get CM's NFTs
SolanaCandyMachineApi SolanaGetCandyMachineMetadata Post /solana/nft/candy_machine/metadata Get a CM's metadata
SolanaCandyMachineApi SolanaListAllCandyMachines Get /solana/nft/candy_machine/list List all CMs
SolanaCandyMachineApi SolanaMintFromCandyMachine Post /solana/nft/candy_machine/mint Mint from a CM
SolanaCandyMachineApi SolanaSearchCandyMachines Post /solana/nft/candy_machine/search Search CMs
SolanaNFTApi SolanaCreateNFT Post /solana/nft Create an NFT on Solana
SolanaNFTApi SolanaGetNFT Get /solana/nft/{network}/{mint_address} Get an NFT's metadata
SolanaNFTApi SolanaGetNFTMintFee Get /solana/nft/mint/fee Get the NFT mint fee
SolanaNFTApi SolanaGetNFTOwner Get /solana/nft/{network}/{mint_address}/owner Get owner of an NFT
SolanaNFTApi SolanaGetNFTsCandyMachineId Post /solana/nft/candy_machine_id Get the ID of the candy machine of an NFT
SolanaNFTApi SolanaSearchNFTs Post /solana/nft/search Search NFTs on Solana
SolanaSPLTokenApi SolanaGetSPLToken Get /solana/spl-token/{network}/{public_key} Get SPL token metadata
SolanaTransactionApi SolanaGetTransaction Get /solana/transaction/{network}/{tx_signature} Get the details of a transaction made on Solana
SolanaWalletApi SolanaDeriveAssociatedTokenAccountAddress Get /solana/wallet/{public_key}/associated_token_account/{mint_address} Derive an associated token account address
SolanaWalletApi SolanaDerivePrivateKey Post /solana/wallet/private_key Derive private key
SolanaWalletApi SolanaDerivePublicKey Post /solana/wallet/public_key Derive public key
SolanaWalletApi SolanaGeneratePrivateKey Post /solana/wallet/generate/private_key Generate private key
SolanaWalletApi SolanaGenerateSecretRecoveryPhrase Post /solana/wallet/generate/secret_recovery_phrase Generate secret phrase
SolanaWalletApi SolanaGetAirdrop Post /solana/wallet/airdrop Get an airdrop on devnet
SolanaWalletApi SolanaGetBalance Post /solana/wallet/balance Get wallet's balance in SOL or any SPL
SolanaWalletApi SolanaGetNFTsBelongingToWallet Get /solana/wallet/{network}/{public_key}/nfts Get address's NFTs
SolanaWalletApi SolanaGetTokensBelongingToWallet Get /solana/wallet/{network}/{public_key}/tokens Get address's tokens and respective balances
SolanaWalletApi SolanaTransfer Post /solana/wallet/transfer Transfer SOL, a token, or an NFT to another address

Documentation For Models

Documentation For Authorization

APIKeyID

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

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

APISecretKey

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

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

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

info@blockchainapi.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 92.9%
  • Makefile 7.1%