Skip to content

Latest commit

 

History

History
643 lines (485 loc) · 26.6 KB

WalletApi.md

File metadata and controls

643 lines (485 loc) · 26.6 KB

Org.OpenAPITools.Api.WalletApi

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

Method HTTP request Description
DerivePrivateKey POST /{blockchain}/wallet/private_key Derive private key
DeriveWalletIdentifier POST /{blockchain}/wallet/identifier Derive wallet identifier
GeneratePrivateKey POST /{blockchain}/wallet/generate/private_key Generate private key
GenerateSeedPhrase POST /{blockchain}/wallet/generate/secret_recovery_phrase Generate seed phrase
GetAirdrop POST /{blockchain}/wallet/airdrop Get an airdrop
GetBalance POST /{blockchain}/wallet/balance Get wallet's balance of X
Transfer POST /{blockchain}/wallet/transfer Transfer crypto, a token, or an NFT to another wallet

DerivePrivateKey

GeneralGeneratePrivateKeyResponse DerivePrivateKey (string blockchain, SupplyWalletRequest supplyWalletRequest)

Derive private key

<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/wallet/derive-private-key\" target="_blank">See examples (Python, JavaScript). Use this endpoint to securely derive a private key for a wallet. For example, if you have a seed phrase and want to derive the corresponding private key, use this endpoint. Cost: 0 Credit (Free) (<a href="#section/Pricing">See Pricing)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class DerivePrivateKeyExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
            // Configure API key authorization: APIKeyID
            Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
            // Configure API key authorization: APISecretKey
            Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");

            var apiInstance = new WalletApi(Configuration.Default);
            var blockchain = "avalanche";  // string | The blockchain you want to use 
            var supplyWalletRequest = new SupplyWalletRequest(); // SupplyWalletRequest | 

            try
            {
                // Derive private key
                GeneralGeneratePrivateKeyResponse result = apiInstance.DerivePrivateKey(blockchain, supplyWalletRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling WalletApi.DerivePrivateKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
blockchain string The blockchain you want to use
supplyWalletRequest SupplyWalletRequest

Return type

GeneralGeneratePrivateKeyResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
400 Bad request (check response message) -
401 Invalid API key pair in headers -
402 Payment required. Occurs when you run out of API requests. Upgrade <a href=&quot;https://dashboard.theblockchainapi.com/billing\" target=&quot;_blank&quot;>here</a>. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeriveWalletIdentifier

WalletIdentifiers DeriveWalletIdentifier (string blockchain, SupplyWalletRequest supplyWalletRequest)

Derive wallet identifier

<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/wallet/derive-wallet-identifier\" target="_blank">See examples (Python, JavaScript). Derive the identifier for a wallet. Cost: 0 Credit (Free) (<a href="#section/Pricing">See Pricing)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class DeriveWalletIdentifierExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
            // Configure API key authorization: APIKeyID
            Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
            // Configure API key authorization: APISecretKey
            Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");

            var apiInstance = new WalletApi(Configuration.Default);
            var blockchain = "avalanche";  // string | The blockchain you want to use 
            var supplyWalletRequest = new SupplyWalletRequest(); // SupplyWalletRequest | 

            try
            {
                // Derive wallet identifier
                WalletIdentifiers result = apiInstance.DeriveWalletIdentifier(blockchain, supplyWalletRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling WalletApi.DeriveWalletIdentifier: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
blockchain string The blockchain you want to use
supplyWalletRequest SupplyWalletRequest

Return type

WalletIdentifiers

Authorization

APIKeyID, APISecretKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
400 Bad request (check response message) -
401 Invalid API key pair in headers -
402 Payment required. Occurs when you run out of API requests. Upgrade <a href=&quot;https://dashboard.theblockchainapi.com/billing\" target=&quot;_blank&quot;>here</a>. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GeneratePrivateKey

GeneralGeneratePrivateKeyResponse GeneratePrivateKey (string blockchain)

Generate private key

<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/wallet/generate-private-key\" target="_blank">See examples (Python, JavaScript). Use this endpoint to securely and randomly generate a private key for a wallet. Cost: 0 Credit (Free) (<a href="#section/Pricing">See Pricing)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class GeneratePrivateKeyExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
            // Configure API key authorization: APIKeyID
            Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
            // Configure API key authorization: APISecretKey
            Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");

            var apiInstance = new WalletApi(Configuration.Default);
            var blockchain = "avalanche";  // string | The blockchain you want to use 

            try
            {
                // Generate private key
                GeneralGeneratePrivateKeyResponse result = apiInstance.GeneratePrivateKey(blockchain);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling WalletApi.GeneratePrivateKey: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
blockchain string The blockchain you want to use

Return type

GeneralGeneratePrivateKeyResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
400 Bad request (check response message) -
401 Invalid API key pair in headers -
402 Payment required. Occurs when you run out of API requests. Upgrade <a href=&quot;https://dashboard.theblockchainapi.com/billing\" target=&quot;_blank&quot;>here</a>. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GenerateSeedPhrase

GeneralSecretPhrase GenerateSeedPhrase (string blockchain, GenerateSeedPhraseRequest generateSeedPhraseRequest = null)

Generate seed phrase

<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/wallet/generate-secret-phrase\" target="_blank">See examples (Python, JavaScript). Use this endpoint to securely and randomly generate a seed phrase for a wallet. Cost: 0 Credit (Free) (<a href="#section/Pricing">See Pricing)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class GenerateSeedPhraseExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
            // Configure API key authorization: APIKeyID
            Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
            // Configure API key authorization: APISecretKey
            Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");

            var apiInstance = new WalletApi(Configuration.Default);
            var blockchain = "avalanche";  // string | The blockchain you want to use 
            var generateSeedPhraseRequest = new GenerateSeedPhraseRequest(); // GenerateSeedPhraseRequest |  (optional) 

            try
            {
                // Generate seed phrase
                GeneralSecretPhrase result = apiInstance.GenerateSeedPhrase(blockchain, generateSeedPhraseRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling WalletApi.GenerateSeedPhrase: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
blockchain string The blockchain you want to use
generateSeedPhraseRequest GenerateSeedPhraseRequest [optional]

Return type

GeneralSecretPhrase

Authorization

APIKeyID, APISecretKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
400 Bad request (check response message) -
401 Invalid API key pair in headers -
402 Payment required. Occurs when you run out of API requests. Upgrade <a href=&quot;https://dashboard.theblockchainapi.com/billing\" target=&quot;_blank&quot;>here</a>. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetAirdrop

GeneralTransactionMadeResponse GetAirdrop (string blockchain, GeneralAirdropRequest generalAirdropRequest = null)

Get an airdrop

<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/wallet/get-airdrop\" target="_blank">See examples (Python, JavaScript). - Ethereum: Receive an airdrop of 0.001 ETH on Ropsten (not real ETH). - Solana: Use this endpoint to get an airdrop of SOL on the devnet (not real SOL). Amount of 0.015, which is the minimum amount of SOL you need to mint an NFT and then transfer it to another wallet. Cost: 0 Credit (Free) (<a href="#section/Pricing">See Pricing)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class GetAirdropExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
            // Configure API key authorization: APIKeyID
            Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
            // Configure API key authorization: APISecretKey
            Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");

            var apiInstance = new WalletApi(Configuration.Default);
            var blockchain = "ethereum";  // string | The blockchain you want to use 
            var generalAirdropRequest = new GeneralAirdropRequest(); // GeneralAirdropRequest |  (optional) 

            try
            {
                // Get an airdrop
                GeneralTransactionMadeResponse result = apiInstance.GetAirdrop(blockchain, generalAirdropRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling WalletApi.GetAirdrop: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
blockchain string The blockchain you want to use
generalAirdropRequest GeneralAirdropRequest [optional]

Return type

GeneralTransactionMadeResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
400 Bad request (check response message) -
401 Invalid API key pair in headers -
402 Payment required. Occurs when you run out of API requests. Upgrade <a href=&quot;https://dashboard.theblockchainapi.com/billing\" target=&quot;_blank&quot;>here</a>. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetBalance

GeneralBalanceResponse GetBalance (string blockchain, GeneralBalanceRequest generalBalanceRequest = null)

Get wallet's balance of X

<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/wallet/get-wallet-balance\" target="_blank">See examples (Python, JavaScript). See the balance of a wallet in the native blockchain currency (e.g., ETH, SOL) or any token (e.g., ERC-20, NFTs, SPL, etc.). To get the balance of a specific token, supply the token_blockchain_identifier of the token. You can also use this endpoint to see whether or not a person owns an NFT. Just supply the token_blockchain_identifier of the NFT. A balance of "1" means the person owns the NFT, and a balance of "0" means the person does not own the NFT. Cost: 0.25 Credit (<a href="#section/Pricing">See Pricing)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class GetBalanceExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
            // Configure API key authorization: APIKeyID
            Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
            // Configure API key authorization: APISecretKey
            Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");

            var apiInstance = new WalletApi(Configuration.Default);
            var blockchain = "ethereum";  // string | The blockchain you want to use 
            var generalBalanceRequest = new GeneralBalanceRequest(); // GeneralBalanceRequest |  (optional) 

            try
            {
                // Get wallet's balance of X
                GeneralBalanceResponse result = apiInstance.GetBalance(blockchain, generalBalanceRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling WalletApi.GetBalance: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
blockchain string The blockchain you want to use
generalBalanceRequest GeneralBalanceRequest [optional]

Return type

GeneralBalanceResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
400 Bad request (check response message) -
401 Invalid API key pair in headers -
402 Payment required. Occurs when you run out of API requests. Upgrade <a href=&quot;https://dashboard.theblockchainapi.com/billing\" target=&quot;_blank&quot;>here</a>. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

Transfer

GeneralTransactionResponse Transfer (string blockchain, GeneralTransferRequest generalTransferRequest = null)

Transfer crypto, a token, or an NFT to another wallet

<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/wallet/transfer-crypto-token-or-nft\" target="_blank">See transfer ETH/SOL/crypto example (Python, JavaScript). <a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/wallet/transfer-crypto-token-or-nft\" target="_blank">See transfer NFT/token example (Python, JavaScript). This is a powerful function. It might be slightly confusing because there are several optional parameters, so take some time to review it. This function can send - The native currency of the selected blockchain (e.g., SOL, ETH, BNB, etc.) - A token (e.g., an SPL token, ERC-20 token, etc.) - An NFT You can sign and submit the transaction for confirmation; and you can select to simply return the compiled transaction so that you can submit it to the user for signing (e.g., via Phantom or Metamask; no private keys required in this case). If you're transferring an NFT or a token, supply its respective token_blockchain_identifier. SENDER: Note that the wallet information is used to authorize the sending of the tokens and identifies the source of the tokens. If return_compiled_transaction = false, we sign and submit the transaction (wallet is required in this case; do not provide a value for sender_blockchain_identifier). If return_compiled_transaction = true, we compile the transaction (sender_blockchain_identifier is required in this case; do not provide wallet). RECIPIENT: recipient_blockchain_identifier identifies the receiver. This is entirely separate from the information used for the SENDER above. So, in this API call, there are two wallets involved, but only one (namely, the SENDER) is needed to authorize the transaction (if you want us to sign and submitting it). FEE_PAYER (Solana only): The fee payer of the transaction defaults to wallet (or sender_blockchain_identifier). To set a different fee payer, provide a value for fee_payer_wallet. Cost: 2 Credit (<a href="#section/Pricing">See Pricing)

Example

using System.Collections.Generic;
using System.Diagnostics;
using Org.OpenAPITools.Api;
using Org.OpenAPITools.Client;
using Org.OpenAPITools.Model;

namespace Example
{
    public class TransferExample
    {
        public static void Main()
        {
            Configuration.Default.BasePath = "https://api.blockchainapi.com/v1";
            // Configure API key authorization: APIKeyID
            Configuration.Default.AddApiKey("APIKeyID", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APIKeyID", "Bearer");
            // Configure API key authorization: APISecretKey
            Configuration.Default.AddApiKey("APISecretKey", "YOUR_API_KEY");
            // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
            // Configuration.Default.AddApiKeyPrefix("APISecretKey", "Bearer");

            var apiInstance = new WalletApi(Configuration.Default);
            var blockchain = "ethereum";  // string | The blockchain you want to use 
            var generalTransferRequest = new GeneralTransferRequest(); // GeneralTransferRequest |  (optional) 

            try
            {
                // Transfer crypto, a token, or an NFT to another wallet
                GeneralTransactionResponse result = apiInstance.Transfer(blockchain, generalTransferRequest);
                Debug.WriteLine(result);
            }
            catch (ApiException e)
            {
                Debug.Print("Exception when calling WalletApi.Transfer: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
blockchain string The blockchain you want to use
generalTransferRequest GeneralTransferRequest [optional]

Return type

GeneralTransactionResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 Successful Response -
400 Bad request (check response message) -
401 Invalid API key pair in headers -
402 Payment required. Occurs when you run out of API requests. Upgrade <a href=&quot;https://dashboard.theblockchainapi.com/billing\" target=&quot;_blank&quot;>here</a>. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]