modulepackage
0.0.0-20240301091929-391f54e5d6c7
Repository: https://github.com/mvc-labs/mvcapi-sdk-go.git
Documentation: pkg.go.dev
# README
Go API client for MvcApi
API definition for MvcApi provided apis
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/mvc-labs/mvcapi-sdk-go
Documentation For Authorization
bearerAuth
- Type: HTTP Bearer token authentication
Example
auth := context.WithValue(context.Background(), mvcapi.ContextAccessToken, "BEARERTOKENSTRING")
r, err := client.Service.Operation(auth, args)
Usage Example
package main
import (
"context"
"fmt"
"github.com/mvc-labs/mvcapi-sdk-go"
"os"
)
func main() {
authCtx := context.WithValue(context.Background(), mvcapi.ContextAccessToken, "YOUR_MVCAPI_KEY")
// testnet config
authCtx = context.WithValue(authCtx, mvcapi.ContextServerIndex, 0)
// mainnet config
//authCtx = context.WithValue(authCtx, mvcapi.ContextServerIndex, 1)
configuration := mvcapi.NewConfiguration()
client := mvcapi.NewAPIClient(configuration)
_, response, err := client.BlockApi.BlockInfoGet(authCtx).Execute()
if err.Error() != "" {
fmt.Fprintf(os.Stderr, "Error when calling `BlockApi.BlockInfoGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", response)
}
// response from `BlockInfoGet`: BlockchainInfo
fmt.Fprintf(os.Stdout, "Response from `BlockApi.BlockInfoGet`: %v\n", response)
}
Author
# Functions
CacheExpires helper function to determine remaining time before repeating a request.
NewAddressBalance instantiates a new AddressBalance object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAddressBalanceWithDefaults instantiates a new AddressBalance object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAddressTx instantiates a new AddressTx object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAddressTxWithDefaults instantiates a new AddressTx object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAddressUtxo instantiates a new AddressUtxo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAddressUtxoWithDefaults instantiates a new AddressUtxo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewAPIClient creates a new API client.
NewAPIResponse returns a new APIResonse object.
NewAPIResponseWithError returns a new APIResponse object with the provided error message.
NewAsyncBroadcastResult instantiates a new AsyncBroadcastResult object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewAsyncBroadcastResultWithDefaults instantiates a new AsyncBroadcastResult object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewBatchBroadcastResult instantiates a new BatchBroadcastResult object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewBatchBroadcastResultWithDefaults instantiates a new BatchBroadcastResult object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewBlockchainInfo instantiates a new BlockchainInfo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewBlockchainInfoWithDefaults instantiates a new BlockchainInfo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewBlockHeaderIndex instantiates a new BlockHeaderIndex object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewBlockHeaderIndexWithDefaults instantiates a new BlockHeaderIndex object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewBlockHeaderPage instantiates a new BlockHeaderPage object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewBlockHeaderPageWithDefaults instantiates a new BlockHeaderPage object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewBlockTx instantiates a new BlockTx object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewBlockTxWithDefaults instantiates a new BlockTx object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewBroadcastResult instantiates a new BroadcastResult object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewBroadcastResultWithDefaults instantiates a new BroadcastResult object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewClientPubkeyRequest instantiates a new ClientPubkeyRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewClientPubkeyRequestWithDefaults instantiates a new ClientPubkeyRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewClientPubkeyResult instantiates a new ClientPubkeyResult object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewClientPubkeyResultWithDefaults instantiates a new ClientPubkeyResult object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewConfiguration returns a new Configuration object.
NewContractFtAddressTx instantiates a new ContractFtAddressTx object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractFtAddressTxWithDefaults instantiates a new ContractFtAddressTx object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewContractFtBalance instantiates a new ContractFtBalance object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractFtBalanceWithDefaults instantiates a new ContractFtBalance object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewContractFtGenesisCirculation instantiates a new ContractFtGenesisCirculation object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractFtGenesisCirculationWithDefaults instantiates a new ContractFtGenesisCirculation object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewContractFtUtxo instantiates a new ContractFtUtxo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractFtUtxoWithDefaults instantiates a new ContractFtUtxo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewContractNftAddressSummary instantiates a new ContractNftAddressSummary object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractNftAddressSummaryWithDefaults instantiates a new ContractNftAddressSummary object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewContractNftAuctionUtxo instantiates a new ContractNftAuctionUtxo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractNftAuctionUtxoWithDefaults instantiates a new ContractNftAuctionUtxo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewContractNftGenesisSummary instantiates a new ContractNftGenesisSummary object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractNftGenesisSummaryWithDefaults instantiates a new ContractNftGenesisSummary object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewContractNftSellUtxo instantiates a new ContractNftSellUtxo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractNftSellUtxoWithDefaults instantiates a new ContractNftSellUtxo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewContractNftSellV2Utxo instantiates a new ContractNftSellV2Utxo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractNftSellV2UtxoWithDefaults instantiates a new ContractNftSellV2Utxo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewContractNftUtxo instantiates a new ContractNftUtxo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractNftUtxoWithDefaults instantiates a new ContractNftUtxo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewContractUniqueUtxo instantiates a new ContractUniqueUtxo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewContractUniqueUtxoWithDefaults instantiates a new ContractUniqueUtxo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewErrorResponse instantiates a new ErrorResponse object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewErrorResponseWithDefaults instantiates a new ErrorResponse object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInvalidBroadCast instantiates a new InvalidBroadCast object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInvalidBroadcastCollide instantiates a new InvalidBroadcastCollide object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewInvalidBroadcastCollideWithDefaults instantiates a new InvalidBroadcastCollide object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewInvalidBroadCastWithDefaults instantiates a new InvalidBroadCast object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewOutputInfo instantiates a new OutputInfo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewOutputInfoDetail instantiates a new OutputInfoDetail object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewOutputInfoDetailWithDefaults instantiates a new OutputInfoDetail object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewOutputInfoWithDefaults instantiates a new OutputInfo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewTreasuryHistory instantiates a new TreasuryHistory object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewTreasuryHistoryWithDefaults instantiates a new TreasuryHistory object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewTreasuryInfo instantiates a new TreasuryInfo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewTreasuryInfoWithDefaults instantiates a new TreasuryInfo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewTxDetail instantiates a new TxDetail object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewTxDetailWithDefaults instantiates a new TxDetail object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewTxInput instantiates a new TxInput object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewTxInputWithDefaults instantiates a new TxInput object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewTxOutput instantiates a new TxOutput object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewTxOutputWithDefaults instantiates a new TxOutput object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewTxRaw instantiates a new TxRaw object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewTxRawWithDefaults instantiates a new TxRaw object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewUtxoPickRequest instantiates a new UtxoPickRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewUtxoPickRequestWithDefaults instantiates a new UtxoPickRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewXpubAddress instantiates a new XpubAddress object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewXpubAddressWithDefaults instantiates a new XpubAddress object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewXpubBalance instantiates a new XpubBalance object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewXpubBalanceWithDefaults instantiates a new XpubBalance object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewXpubDetail instantiates a new XpubDetail object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewXpubDetailWithDefaults instantiates a new XpubDetail object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewXpubLiteBalance instantiates a new XpubLiteBalance object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewXpubLiteBalanceWithDefaults instantiates a new XpubLiteBalance object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewXpubRequest instantiates a new XpubRequest object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewXpubRequestWithDefaults instantiates a new XpubRequest object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewXpubResult instantiates a new XpubResult object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewXpubResultWithDefaults instantiates a new XpubResult object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewXPubTransaction instantiates a new XPubTransaction object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewXPubTransactionWithDefaults instantiates a new XPubTransaction object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
NewXpubUtxo instantiates a new XpubUtxo object This constructor will assign default values to properties that have it defined, and makes sure properties required by API are set, but the set of arguments will change when the set of required properties is changed.
NewXpubUtxoWithDefaults instantiates a new XpubUtxo object This constructor will only assign default values to properties that have it defined, but it doesn't guarantee that properties required by API are set.
PtrBool is a helper routine that returns a pointer to given boolean value.
PtrFloat32 is a helper routine that returns a pointer to given float value.
PtrFloat64 is a helper routine that returns a pointer to given float value.
PtrInt is a helper routine that returns a pointer to given integer value.
PtrInt32 is a helper routine that returns a pointer to given integer value.
PtrInt64 is a helper routine that returns a pointer to given integer value.
PtrString is a helper routine that returns a pointer to given string value.
PtrTime is helper routine that returns a pointer to given Time value.
# Variables
ContextAccessToken takes a string oauth2 access token as authentication for the request.
ContextAPIKeys takes a string apikey as authentication for the request.
ContextBasicAuth takes BasicAuth as authentication for the request.
ContextHttpSignatureAuth takes HttpSignatureAuth as authentication for the request.
ContextOAuth2 takes an oauth2.TokenSource as authentication for the request.
ContextOperationServerIndices uses a server configuration from the index mapping.
ContextOperationServerVariables overrides a server configuration variables using operation specific values.
ContextServerIndex uses a server configuration from the index.
ContextServerVariables overrides a server configuration variables.
# Structs
AddressBalance The current balance for a particular address.
AddressTx Transaction history of the address.
AddressUtxo Utxos by address(or addresses) order by height asc.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
APIClient manages communication with the MicrovisionChain API Document API v3.0.11 In most cases there should be only one, shared, APIClient.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
APIKey provides API key based authentication to a request passed via context using ContextAPIKey.
No description provided by the author
No description provided by the author
APIResponse stores the API response returned by the server.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
AsyncBroadcastResult Broadcast result.
BasicAuth provides basic http authentication to a request passed via context using ContextBasicAuth.
BatchBroadcastResult Batch broadcast result.
BlockchainInfo struct for BlockchainInfo.
BlockHeaderIndex Detailed block header info.
BlockHeaderPage block header saved by partition page.
BlockTx Tx simple info for block tx list.
BroadcastResult Broadcast result.
ClientPubkeyRequest Request object to register(or delete) a new client public key.
ClientPubkeyResult Client public key result.
Configuration stores the configuration of the API client.
ContractFtAddressTx Transaction history of the address for specific ft.
ContractFtBalance Contract fungible token balance.
ContractFtGenesisCirculation Get total circulation for specific genesis of ft token.
ContractFtUtxo Contract fungible token Utxo belongs to the specified address.
ContractNftAddressSummary Get nft summary(count group by genesis) for specific address.
ContractNftAuctionUtxo Contract nft auction Utxo belongs to the specified address.
ContractNftGenesisSummary Get summary(count group by address) for specific genesis.
ContractNftSellUtxo Contract nft sell Utxo belongs to the specified address.
ContractNftSellV2Utxo Contract nft sell v2 Utxo belongs to the specified address.
ContractNftUtxo Contract non fungible token Utxo belongs to the specified address.
ContractUniqueUtxo Contract unique Utxo indexed by codeHash and genesis.
ErrorResponse Error response.
GenericOpenAPIError Provides access to the body, error and model on returned errors.
InvalidBroadCast Invalid transactions detected during validation (if there are any).
InvalidBroadcastCollide This field is only present in case of double spent transaction and contains transactions we collided with.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
OutputInfo spent status and value info of the output.
OutputInfoDetail spent status and value info of the output with detailed output script.
ServerConfiguration stores the information about a server.
ServerVariable stores the information about a server variable.
TreasuryHistory treasury transaction history.
TreasuryInfo current treasury utxo info.
TxDetail Parsed tx info.
TxInput Parsed inputs from raw tx.
TxOutput Parsed outputs from raw tx.
TxRaw Raw hex formatted Tx returned.
UtxoPickRequest Request object to batch pick utxo.
XpubAddress Address detail in the wallet.
XpubBalance Registered Xpub balance including confirmed and unconfirmed.
XpubDetail Registered Xpub detail.
XpubLiteBalance Balance for xpub lite wallet.
XpubRequest Request object to register(or delete) a new xpub.
XpubResult XpubRegister result.
XPubTransaction Xpub transaction history.
XpubUtxo Utxo belongs to the specified xpub.
# Type aliases
AddressApiService AddressApi service.
BlockApiService BlockApi service.
ContractApiService ContractApi service.
MerchantApiService MerchantApi service.
OutpointApiService OutpointApi service.
ServerConfigurations stores multiple ServerConfiguration items.
TreasuryApiService TreasuryApi service.
TxApiService TxApi service.
XpubApiService XpubApi service.