1.0.9407 • Published 2 years ago

theblockchainapi v1.0.9407

Weekly downloads
-
License
Unlicense
Repository
-
Last release
2 years ago

theblockchainapi

theblockchainapi - JavaScript client for theblockchainapi

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

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/~1solana~1wallet~1secret_recovery_phrase/post\">creating a new seed phrase and then <a href=\"#tag/Solana-Wallet/paths/~1solana~1wallet~1public_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 50,000 free credits each month. Each endpoint costs a certain amount credits. Scroll below to any endpoint (i.e., function) to see how much each endpoint costs. (Or CMD+F Cost: 0 Credit, for example)

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. This SDK is automatically generated by the OpenAPI Generator project:

  • API version: null
  • Package version: 1.0.9407
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install theblockchainapi --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your theblockchainapi from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var theblockchainapi = require('theblockchainapi');

var defaultClient = theblockchainapi.ApiClient.instance;
// Configure API key authorization: APIKeyID
var APIKeyID = defaultClient.authentications['APIKeyID'];
APIKeyID.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyID.apiKeyPrefix['APIKeyID'] = "Token"
// Configure API key authorization: APISecretKey
var APISecretKey = defaultClient.authentications['APISecretKey'];
APISecretKey.apiKey = "YOUR API KEY"
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APISecretKey.apiKeyPrefix['APISecretKey'] = "Token"

var api = new theblockchainapi.CCPaymentApi()
var projectId = project_WDQskRIfHQxj53N5mk5K; // {String} The ID of the project. Created and returned when a project is created.
var paymentIdentifier = ["payment_97jA1szpVjrSI5EvOb5zxNQFq5CfrC"]; // {String} You can supply either `payment_id` or `payment_validation_code`.  The `payment_id` is only visible by you and uniquely identifies a payment.  The `payment_validation_code` is shown exclusively to the customer and the owner of the project. It can be used to redeem a payment. You can verify a payment by pulling the payment with the `payment_validation_code`.
api.getCCPayment(projectId, paymentIdentifier).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
theblockchainapi.CCPaymentApigetCCPaymentGET /checkout/v1/project/{project_id}/payment/{payment_identifier}Get a payment
theblockchainapi.CCPaymentApilistAllCCPaymentsGET /checkout/v1/paymentsList all payments
theblockchainapi.CCPaymentApilistCCProjectPaymentsGET /checkout/v1/project/{project_id}/paymentsList a project's payments
theblockchainapi.CCProjectApicreateCCProjectPOST /checkout/v1/projectCreate a project
theblockchainapi.CCProjectApideleteCCProjectDELETE /checkout/v1/project/{project_id}Delete a project
theblockchainapi.CCProjectApigetCCProjectGET /checkout/v1/project/{project_id}Get a project
theblockchainapi.CCProjectApilistCCProjectsGET /checkout/v1/projectsList projects
theblockchainapi.CCProjectApiupdateCCProjectPUT /checkout/v1/project/{project_id}Update a project
theblockchainapi.CCWebhookApigetCCWebhookPOST /webhook/v1/project/{project_id}/webhook/{webhook_identifier}Get a webhook
theblockchainapi.CCWebhookApilistCCProjectWebhooksPOST /webhook/v1/project/{project_id}/webhooksList project's webhooks
theblockchainapi.CCWebhookApivalidateCCWebhookPOST /webhook/v1/project/{project_id}/webhook/{webhook_identifier}/validateValidate a webhook
theblockchainapi.NameServiceApigetBlockchainIdentifierFromNamePOST /{blockchain}/{network}/name_service/name_to_blockchain_identifierGet the identifier
theblockchainapi.NameServiceApigetNameForBlockchainIdentifierPOST /{blockchain}/{network}/name_service/blockchain_identifier_to_nameGet the name
theblockchainapi.SolanaAccountApisolanaGetAccountGET /solana/account/{network}/{public_key}Get the details of an account on Solana
theblockchainapi.SolanaAccountApisolanaGetAccountIsCandyMachineGET /solana/account/{network}/{public_key}/is_candy_machineGet if account is candy machine
theblockchainapi.SolanaAccountApisolanaGetAccountIsNFTGET /solana/account/{network}/{public_key}/is_nftGet if account is NFT
theblockchainapi.SolanaCandyMachineApisolanaGetAllNFTsFromCandyMachineGET /solana/nft/candy_machine/{network}/{candy_machine_id}/nftsGet CM's NFTs
theblockchainapi.SolanaCandyMachineApisolanaGetCandyMachineMetadataPOST /solana/nft/candy_machine/metadataGet a CM's metadata
theblockchainapi.SolanaCandyMachineApisolanaListAllCandyMachinesGET /solana/nft/candy_machine/listList all CMs
theblockchainapi.SolanaCandyMachineApisolanaSearchCandyMachinesPOST /solana/nft/candy_machine/searchSearch CMs
theblockchainapi.SolanaNFTApisolanaCreateNFTPOST /solana/nftCreate an NFT on Solana
theblockchainapi.SolanaNFTApisolanaGetNFTGET /solana/nft/{network}/{mint_address}Get an NFT's metadata
theblockchainapi.SolanaNFTApisolanaGetNFTMintFeeGET /solana/nft/mint/feeGet the NFT mint fee
theblockchainapi.SolanaNFTApisolanaGetNFTOwnerGET /solana/nft/{network}/{mint_address}/ownerGet owner of an NFT
theblockchainapi.SolanaNFTApisolanaGetNFTOwnerAdvancedGET /solana/nft/{network}/{mint_address}/owner_advancedGet owner of an NFT (advanced)
theblockchainapi.SolanaNFTApisolanaGetNFTsCandyMachineIdPOST /solana/nft/candy_machine_idGet the ID of the candy machine of an NFT
theblockchainapi.SolanaNFTApisolanaSearchNFTsPOST /solana/nft/searchSearch NFTs on Solana
theblockchainapi.SolanaSPLTokenApisolanaGetSPLTokenGET /solana/spl-token/{network}/{public_key}Get SPL token metadata
theblockchainapi.SolanaTransactionApisolanaGetTransactionGET /solana/transaction/{network}/{tx_signature}Get the details of a transaction made on Solana
theblockchainapi.SolanaWalletApisolanaDeriveAssociatedTokenAccountAddressGET /solana/wallet/{public_key}/associated_token_account/{mint_address}Derive an associated token account address
theblockchainapi.SolanaWalletApisolanaDerivePrivateKeyPOST /solana/wallet/private_keyDerive private key
theblockchainapi.SolanaWalletApisolanaDerivePublicKeyPOST /solana/wallet/public_keyDerive public key
theblockchainapi.SolanaWalletApisolanaGeneratePrivateKeyPOST /solana/wallet/generate/private_keyGenerate private key
theblockchainapi.SolanaWalletApisolanaGenerateSecretRecoveryPhrasePOST /solana/wallet/generate/secret_recovery_phraseGenerate secret phrase
theblockchainapi.SolanaWalletApisolanaGetAirdropPOST /solana/wallet/airdropGet an airdrop on devnet
theblockchainapi.SolanaWalletApisolanaGetBalancePOST /solana/wallet/balanceGet wallet's balance in SOL or any SPL
theblockchainapi.SolanaWalletApisolanaGetNFTsBelongingToWalletGET /solana/wallet/{network}/{public_key}/nftsGet address's NFTs
theblockchainapi.SolanaWalletApisolanaGetTokensBelongingToWalletGET /solana/wallet/{network}/{public_key}/tokensGet address's tokens and respective balances
theblockchainapi.SolanaWalletApisolanaGetWalletTransactionsGET /solana/wallet/{network}/{public_key}/transactionsGet address's associated transaction signatures
theblockchainapi.SolanaWalletApisolanaTransferPOST /solana/wallet/transferTransfer SOL, a token, or an NFT to another address
theblockchainapi.TokenApigetTokenMetadataGET /{blockchain}/{network}/token/{token_blockchain_identifier}Get a token's metadata
theblockchainapi.TokenApilistAllTokensGET /{blockchain}/{network}/all_tokensList all tokens
theblockchainapi.TransactionApigetTransactionGET /{blockchain}/transaction/{network}/{transaction_blockchain_identifier}Get the details of a transaction made on a blockchain
theblockchainapi.WalletApiderivePrivateKeyPOST /{blockchain}/wallet/private_keyDerive private key
theblockchainapi.WalletApideriveWalletIdentifierPOST /{blockchain}/wallet/identifierDerive wallet identifier
theblockchainapi.WalletApigeneratePrivateKeyPOST /{blockchain}/wallet/generate/private_keyGenerate private key
theblockchainapi.WalletApigenerateSeedPhrasePOST /{blockchain}/wallet/generate/secret_recovery_phraseGenerate seed phrase
theblockchainapi.WalletApigetAirdropPOST /{blockchain}/wallet/airdropGet an airdrop
theblockchainapi.WalletApigetBalancePOST /{blockchain}/wallet/balanceGet wallet's balance of X
theblockchainapi.WalletApitransferPOST /{blockchain}/wallet/transferTransfer crypto, a token, or an NFT to another wallet

Documentation for Models

Documentation for Authorization

APIKeyID

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

APISecretKey

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

2 years ago

1.0.9407

2 years ago

1.0.9402

2 years ago

1.0.9403

2 years ago

1.0.9404

2 years ago

1.0.9405

2 years ago

1.0.9400

2 years ago

1.0.9401

2 years ago

1.0.9398

2 years ago

1.0.9399

2 years ago

1.0.9394

2 years ago

1.0.9395

2 years ago

1.0.9396

2 years ago

1.0.9397

2 years ago

1.0.9392

2 years ago

1.0.939

2 years ago

1.0.938

2 years ago

1.0.937

2 years ago

1.0.9391

2 years ago

1.0.921

2 years ago

1.0.920

2 years ago

1.0.923

2 years ago

1.0.922

2 years ago

1.0.918

2 years ago

1.0.919

2 years ago

1.0.936

2 years ago

1.0.935

2 years ago

1.0.932

2 years ago

1.0.931

2 years ago

1.0.934

2 years ago

1.0.933

2 years ago

1.0.930

2 years ago

1.0.929

2 years ago

1.0.928

2 years ago

1.0.925

2 years ago

1.0.924

2 years ago

1.0.927

2 years ago

1.0.926

2 years ago

1.0.917

2 years ago

1.0.916

2 years ago

1.0.915

2 years ago

1.0.914

2 years ago

1.0.913

2 years ago

1.0.912

2 years ago

1.0.911

2 years ago

1.0.91

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago