Go API client for openapi

A developer friendly bitcoin cash wallet api

This API is currently in active development, breaking changes may be made prior to official release of version 1.0.0.

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.4.3
  • 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
go get github.com/antihax/optional

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

import "./openapi"

Documentation for API Endpoints

All URIs are relative to https://rest-unstable.mainnet.cash

Class Method HTTP request Description
ContractApi ContractFn Post /contract/call Call a method on a contract
ContractApi ContractInfo Post /contract/info Get information about a contract from the contractId
ContractApi ContractUtxos Post /contract/utxos List specific utxos on any contract
ContractApi CreateContract Post /contract/create Create a cashscript contract
ContractEscrowApi CreateEscrow Post /contract/escrow/create Create an escrow contract
ContractEscrowApi EscrowFn Post /contract/escrow/call Finalize an escrow contract
ContractEscrowApi EscrowInfo Post /contract/escrow/info Get information about an escrow contract from the escrowContractId
ContractEscrowApi EscrowUtxos Post /contract/escrow/utxos List specific utxos on any escrow contract
FaucetApi GetAddresses Post /faucet/get_addresses Get addresses to return back or donate the testnet bch and tokens
FaucetApi GetTestnetBch Post /faucet/get_testnet_bch Get testnet bch
MineApi Mine Post /mine Mine regtest coins to a specified address
UtilApi Convert Post /util/convert convert between units
UtilApi GetAddrsByXpubKey Post /util/get_addrs_by_xpubkey Derive heristic determined addresses from an extended public key, per BIP32
UtilApi GetXpubKeyInfo Post /util/get_xpubkey_info Decode information about an extended public key, per BIP32
WalletApi Balance Post /wallet/balance Get total balance for wallet
WalletApi CreateWallet Post /wallet/create create a new wallet
WalletApi DepositAddress Post /wallet/deposit_address Get a deposit address in cash address format
WalletApi DepositQr Post /wallet/deposit_qr Get receiving cash address as a qrcode
WalletApi EncodeTransaction Post /wallet/encode_transaction Encode and sign a transaction given a list of sendRequests, options and estimate fees
WalletApi GetAllNftTokenBalances Post /wallet/get_all_nft_token_balances Get non-fungible token balance
WalletApi GetAllTokenBalances Post /wallet/get_all_token_balances Get non-fungible token balance
WalletApi GetHistory Post /wallet/get_history Get a list of transactions related to a wallet
WalletApi GetNftTokenBalance Post /wallet/get_nft_token_balance Get non-fungible token balance
WalletApi GetTokenBalance Post /wallet/get_token_balance Get fungible token balance
WalletApi GetTokenUtxos Post /wallet/get_token_utxos Get token utxos
WalletApi Info Post /wallet/info Get information about a wallet
WalletApi MaxAmountToSend Post /wallet/max_amount_to_send Get maximum spendable amount
WalletApi NamedExists Post /wallet/named_exists Check if a named wallet already exists
WalletApi ReplaceNamed Post /wallet/replace_named Replace (recover) named wallet with a new walletId. If wallet with a provided name does not exist yet, it will be creted with a `walletId` supplied If wallet exists it will be overwritten without exception
WalletApi Send Post /wallet/send Send some amount to a given address
WalletApi SendMax Post /wallet/send_max Send all available funds to a given address
WalletApi SubmitTransaction Post /wallet/submit_transaction submit an encoded and signed transaction to the network
WalletApi TokenBurn Post /wallet/token_burn Perform an explicit token burn
WalletApi TokenDepositAddress Post /wallet/token_deposit_address Get a token aware deposit address in cash address format
WalletApi TokenDepositQr Post /wallet/token_deposit_qr Get receiving token aware cash address as a qrcode
WalletApi TokenGenesis Post /wallet/token_genesis Create new token category
WalletApi TokenMint Post /wallet/token_mint Mint new non-fungible tokens
WalletApi Utxos Post /wallet/utxo Get detailed information about unspent outputs (utxos)
WalletApi Xpubkeys Post /wallet/xpubkeys A set of xpubkeys and paths for the wallet.
WalletBcmrApi BcmrAddMetadataRegistryAuthChain Post /wallet/bcmr/add_registry_authchain Add BCMR metadata registry from autchain, returning the built chain
WalletBcmrApi BcmrAddRegistry Post /wallet/bcmr/add_registry Add BCMR registry from parameter
WalletBcmrApi BcmrAddRegistryFromUri Post /wallet/bcmr/add_registry_from_uri Reset tracked BCMR registries
WalletBcmrApi BcmrBuildAuthChain Post /wallet/bcmr/build_authchain Build a BCMR authchain
WalletBcmrApi BcmrGetRegistries Post /wallet/bcmr/get_registries Get tracked BCMR registries
WalletBcmrApi BcmrGetTokenInfo Post /wallet/bcmr/get_token_info Get token info
WalletBcmrApi BcmrResetRegistries Post /wallet/bcmr/reset_registries Reset tracked BCMR registries
WalletSignedApi SignedMessageSign Post /wallet/signed/sign Returns the message signature
WalletSignedApi SignedMessageVerify Post /wallet/signed/verify Returns a boolean indicating whether message was valid for a given address
WalletUtilApi UtilDecodeTransaction Post /wallet/util/decode_transaction Decode a bitcoin transaction. Accepts both transaction hash or raw transaction in hex format.
WalletUtilApi UtilGetRawTransaction Post /wallet/util/get_raw_transaction Get bitcoin raw transaction
WebhookApi WatchAddress Post /webhook/watch_address Create a webhook to watch cashaddress balance and transactions.

Documentation For Models

Documentation For Authorization

bearerAuth

  • Type: HTTP basic authentication

Example

auth := context.WithValue(context.Background(), sw.ContextBasicAuth, sw.BasicAuth{
    UserName: "username",
    Password: "password",
})
r, err := client.Service.Operation(auth, args)

Author

hello@mainnet.cash