metasv / metasv-mvc-sdk-java

Java client to call mvc service on metasv

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

openapi-java-client

MicrovisionChain API Document

  • API version: 3.0.8

  • Build date: 2023-04-16T17:24:50.047362+09:00[Asia/Tokyo]

API definition for MicrovisionChain provided apis

Automatically generated by the OpenAPI Generator

Requirements

Building the API client library requires:

  1. Java 1.8+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.metasv.mvc</groupId>
  <artifactId>openapi-java-client</artifactId>
  <version>3.0.8</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.metasv.mvc:openapi-java-client:3.0.8"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/openapi-java-client-3.0.8.jar
  • target/lib/*.jar

Getting Started

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

import com.metasv.mvc.client.openapi.*;
import com.metasv.mvc.client.openapi.auth.*;
import com.metasv.mvc.client.openapi.model.*;
import com.metasv.mvc.client.openapi.api.AddressApi;

public class AddressApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        defaultClient.setBasePath("https://testnet.mvcapi.com");
        
        // Configure HTTP bearer authorization: bearerAuth
        HttpBearerAuth bearerAuth = (HttpBearerAuth) defaultClient.getAuthentication("bearerAuth");
        bearerAuth.setBearerToken("BEARER TOKEN");

        AddressApi apiInstance = new AddressApi(defaultClient);
        String address = "address_example"; // String | the requested address
        try {
            AddressBalance result = apiInstance.addressAddressBalanceGet(address);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AddressApi#addressAddressBalanceGet");
            System.err.println("Status code: " + e.getCode());
            System.err.println("Reason: " + e.getResponseBody());
            System.err.println("Response headers: " + e.getResponseHeaders());
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://testnet.mvcapi.com

Class Method HTTP request Description
AddressApi addressAddressBalanceGet GET /address/{address}/balance Get address balance by specific address.
AddressApi addressAddressTxGet GET /address/{address}/tx Get address history by specific address(recent 10 days available).
AddressApi addressAddressUtxoGet GET /address/{address}/utxo Get address utxos by specific address(100 per page).
BlockApi blockBlockIdGet GET /block/{blockId} Get block request by height or hash
BlockApi blockGet GET /block Get recent block list by paging. 30 items per page.
BlockApi blockInfoGet GET /block/info Get current blockchain info from full node.
ContractApi contractFtAddressAddressBalanceConfirmedGet GET /contract/ft/address/{address}/balance/confirmed Get all contract token balances for specific address ignoring all unconfirmed txs.
ContractApi contractFtAddressAddressBalanceGet GET /contract/ft/address/{address}/balance Get all contract token balances for specific address.
ContractApi contractFtAddressAddressCodeHashGenesisTxGet GET /contract/ft/address/{address}/{codeHash}/{genesis}/tx Get all contract token balances for specific address.
ContractApi contractFtAddressAddressUtxoGet GET /contract/ft/address/{address}/utxo Get all contract token utxos for specific address.
ContractApi contractNftAddressAddressCountConfirmedGet GET /contract/nft/address/{address}/count/confirmed Get confirmed utxo count for specific nft(ignore all unconfirmed txs).
ContractApi contractNftAddressAddressSummaryGet GET /contract/nft/address/{address}/summary Get nft summary(NFT count group by genesis) for address.
ContractApi contractNftAddressAddressUtxoGet GET /contract/nft/address/{address}/utxo Get all contract nft token utxos for specific address.
ContractApi contractNftGenesisCodeHashGenesisSummaryGet GET /contract/nft/genesis/{codeHash}/{genesis}/summary Get nft summary(count group by address) for specific codeHash and genesisId(result cached for 60s).
ContractApi contractNftGenesisCodeHashGenesisUtxoGet GET /contract/nft/genesis/{codeHash}/{genesis}/utxo Get all contract nft token utxos by codeHash and genesisId.
ContractApi contractNftSellAddressAddressUtxoGet GET /contract/nft/sell/address/{address}/utxo Get all contract sell sell utxos for specific address.
ContractApi contractNftSellGenesisCodeHashGenesisUtxoGet GET /contract/nft/sell/genesis/{codeHash}/{genesis}/utxo Get all contract nft token utxos by codeHash and genesisId.
ContractApi contractUniqueGenesisCodeHashGenesisUtxoGet GET /contract/unique/genesis/{codeHash}/{genesis}/utxo Get contract unique utxos by codeHash and genesisId.
MerchantApi merchantUtxoPost POST /merchant/utxo Pick utxos by addresses and amount.
OutpointApi outpointTxidIndexGet GET /outpoint/{txid}/{index} Get tx output(outpoint for vin) spent status.
TreasuryApi treasuryGet GET /treasury Get current treasury info.
TreasuryApi treasuryHistoryGet GET /treasury/history Get all treasury history.
TxApi txBroadcastBatchPost POST /tx/broadcast/batch Broadcast a batch of tx to metasv fullnode. This endpoint use rpc sendrawtransactions.
TxApi txBroadcastPost POST /tx/broadcast Broadcast tx to metasv fullnode.
TxApi txTxidGet GET /tx/{txid} Get transaction detail by specific txid.
TxApi txTxidRawGet GET /tx/{txid}/raw Get transaction raw hex by specific txid.
TxApi txTxidSeenGet GET /tx/{txid}/seen Whether MetaSV have seen this tx before. This is a fast approach to know if the tx exist or not.
TxApi vinTxidDetailGet GET /vin/{txid}/detail Get all output point of vins in the tx with detailed output script.
XpubApi xpubLiteXpubAddressAddressGet GET /xpubLite/{xpub}/address/{address} Get xpub address type and index. Only index under /0/70 /1/30 is valid. Otherwise not found.
XpubApi xpubLiteXpubBalanceGet GET /xpubLite/{xpub}/balance Get xpub balances including confirmed and unconfirmed.
XpubApi xpubLiteXpubUtxoGet GET /xpubLite/{xpub}/utxo Get xpub utxos by specific xpub(300 per page).

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

bearerAuth

  • Type: HTTP basic authentication

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

heqiming@metasv.com

About

Java client to call mvc service on metasv


Languages

Language:Java 99.7%Language:Shell 0.3%Language:Scala 0.0%