Skip to content

Latest commit

 

History

History
517 lines (331 loc) · 15.7 KB

WalletApi.md

File metadata and controls

517 lines (331 loc) · 15.7 KB

\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(ctx, blockchain).SupplyWalletRequest(supplyWalletRequest).Execute()

Derive private key

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    blockchain := "blockchain_example" // string | The blockchain you want to use 
    supplyWalletRequest := *openapiclient.NewSupplyWalletRequest(openapiclient.GeneralWallet{GeneralB58PrivateKey: openapiclient.NewGeneralB58PrivateKey("B58PrivateKey_example")}) // SupplyWalletRequest | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WalletApi.DerivePrivateKey(context.Background(), blockchain).SupplyWalletRequest(supplyWalletRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WalletApi.DerivePrivateKey``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DerivePrivateKey`: GeneralGeneratePrivateKeyResponse
    fmt.Fprintf(os.Stdout, "Response from `WalletApi.DerivePrivateKey`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
blockchain string The blockchain you want to use

Other Parameters

Other parameters are passed through a pointer to a apiDerivePrivateKeyRequest struct via the builder pattern

Name Type Description Notes

supplyWalletRequest | SupplyWalletRequest | |

Return type

GeneralGeneratePrivateKeyResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

DeriveWalletIdentifier

WalletIdentifiers DeriveWalletIdentifier(ctx, blockchain).SupplyWalletRequest(supplyWalletRequest).Execute()

Derive wallet identifier

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    blockchain := "blockchain_example" // string | The blockchain you want to use 
    supplyWalletRequest := *openapiclient.NewSupplyWalletRequest(openapiclient.GeneralWallet{GeneralB58PrivateKey: openapiclient.NewGeneralB58PrivateKey("B58PrivateKey_example")}) // SupplyWalletRequest | 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WalletApi.DeriveWalletIdentifier(context.Background(), blockchain).SupplyWalletRequest(supplyWalletRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WalletApi.DeriveWalletIdentifier``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `DeriveWalletIdentifier`: WalletIdentifiers
    fmt.Fprintf(os.Stdout, "Response from `WalletApi.DeriveWalletIdentifier`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
blockchain string The blockchain you want to use

Other Parameters

Other parameters are passed through a pointer to a apiDeriveWalletIdentifierRequest struct via the builder pattern

Name Type Description Notes

supplyWalletRequest | SupplyWalletRequest | |

Return type

WalletIdentifiers

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

GeneratePrivateKey

GeneralGeneratePrivateKeyResponse GeneratePrivateKey(ctx, blockchain).Execute()

Generate private key

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    blockchain := "blockchain_example" // string | The blockchain you want to use 

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WalletApi.GeneratePrivateKey(context.Background(), blockchain).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WalletApi.GeneratePrivateKey``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GeneratePrivateKey`: GeneralGeneratePrivateKeyResponse
    fmt.Fprintf(os.Stdout, "Response from `WalletApi.GeneratePrivateKey`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
blockchain string The blockchain you want to use

Other Parameters

Other parameters are passed through a pointer to a apiGeneratePrivateKeyRequest struct via the builder pattern

Name Type Description Notes

Return type

GeneralGeneratePrivateKeyResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

GenerateSeedPhrase

GeneralSecretPhrase GenerateSeedPhrase(ctx, blockchain).GenerateSeedPhraseRequest(generateSeedPhraseRequest).Execute()

Generate seed phrase

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    blockchain := "blockchain_example" // string | The blockchain you want to use 
    generateSeedPhraseRequest := *openapiclient.NewGenerateSeedPhraseRequest() // GenerateSeedPhraseRequest |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WalletApi.GenerateSeedPhrase(context.Background(), blockchain).GenerateSeedPhraseRequest(generateSeedPhraseRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WalletApi.GenerateSeedPhrase``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GenerateSeedPhrase`: GeneralSecretPhrase
    fmt.Fprintf(os.Stdout, "Response from `WalletApi.GenerateSeedPhrase`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
blockchain string The blockchain you want to use

Other Parameters

Other parameters are passed through a pointer to a apiGenerateSeedPhraseRequest struct via the builder pattern

Name Type Description Notes

generateSeedPhraseRequest | GenerateSeedPhraseRequest | |

Return type

GeneralSecretPhrase

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

GetAirdrop

GeneralTransactionMadeResponse GetAirdrop(ctx, blockchain).GeneralAirdropRequest(generalAirdropRequest).Execute()

Get an airdrop

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    blockchain := "blockchain_example" // string | The blockchain you want to use 
    generalAirdropRequest := *openapiclient.NewGeneralAirdropRequest("RecipientBlockchainIdentifier_example") // GeneralAirdropRequest |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WalletApi.GetAirdrop(context.Background(), blockchain).GeneralAirdropRequest(generalAirdropRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WalletApi.GetAirdrop``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetAirdrop`: GeneralTransactionMadeResponse
    fmt.Fprintf(os.Stdout, "Response from `WalletApi.GetAirdrop`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
blockchain string The blockchain you want to use

Other Parameters

Other parameters are passed through a pointer to a apiGetAirdropRequest struct via the builder pattern

Name Type Description Notes

generalAirdropRequest | GeneralAirdropRequest | |

Return type

GeneralTransactionMadeResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

GetBalance

GeneralBalanceResponse GetBalance(ctx, blockchain).GeneralBalanceRequest(generalBalanceRequest).Execute()

Get wallet's balance of X

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    blockchain := "blockchain_example" // string | The blockchain you want to use 
    generalBalanceRequest := *openapiclient.NewGeneralBalanceRequest() // GeneralBalanceRequest |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WalletApi.GetBalance(context.Background(), blockchain).GeneralBalanceRequest(generalBalanceRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WalletApi.GetBalance``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetBalance`: GeneralBalanceResponse
    fmt.Fprintf(os.Stdout, "Response from `WalletApi.GetBalance`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
blockchain string The blockchain you want to use

Other Parameters

Other parameters are passed through a pointer to a apiGetBalanceRequest struct via the builder pattern

Name Type Description Notes

generalBalanceRequest | GeneralBalanceRequest | |

Return type

GeneralBalanceResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

Transfer

GeneralTransactionResponse Transfer(ctx, blockchain).GeneralTransferRequest(generalTransferRequest).Execute()

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

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    blockchain := "blockchain_example" // string | The blockchain you want to use 
    generalTransferRequest := *openapiclient.NewGeneralTransferRequest("RecipientBlockchainIdentifier_example") // GeneralTransferRequest |  (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.WalletApi.Transfer(context.Background(), blockchain).GeneralTransferRequest(generalTransferRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `WalletApi.Transfer``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `Transfer`: GeneralTransactionResponse
    fmt.Fprintf(os.Stdout, "Response from `WalletApi.Transfer`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
blockchain string The blockchain you want to use

Other Parameters

Other parameters are passed through a pointer to a apiTransferRequest struct via the builder pattern

Name Type Description Notes

generalTransferRequest | GeneralTransferRequest | |

Return type

GeneralTransactionResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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