1.0.15 • Published 2 years ago

@volare.defi/mercury.js v1.0.15

Weekly downloads
-
License
Unlicense
Repository
github
Last release
2 years ago

mercury_api

MercuryApi - JavaScript client for mercury_api The Mercury API description This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 1.0
  • Package version: 1.0
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install mercury_api --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your mercury_api from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

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

var MercuryApi = require('mercury_api');


var api = new MercuryApi.DefaultApi()
var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully.');
  }
};
api.appControllerHello(callback);

Documentation for API Endpoints

All URIs are relative to http://localhost

ClassMethodHTTP requestDescription
MercuryApi.DefaultApiappControllerHelloGET /
MercuryApi.EthApiethControllerCountFtTransfersByContractPOST /eth/ft/{contract}/transfers/countGet amount of FT transfers.
MercuryApi.EthApiethControllerFindBlkByHashGET /eth/blks/{hash}Get a block by hash.
MercuryApi.EthApiethControllerFindBlksPOST /eth/blksGet all blocks.
MercuryApi.EthApiethControllerFindContractByAddressPOST /eth/contracts/{address}Get a contract by address.
MercuryApi.EthApiethControllerFindContractsPOST /eth/contractsGet all contracts.
MercuryApi.EthApiethControllerFindERC20POST /eth/contracts/erc20Get all ERC20.
MercuryApi.EthApiethControllerFindERC20ByAddressPOST /eth/contracts/erc20/{address}Get an ERC20 by address.
MercuryApi.EthApiethControllerFindERC721POST /eth/contracts/erc721Get all ERC721.
MercuryApi.EthApiethControllerFindERC721ByAddressPOST /eth/contracts/erc721/{address}Get an ERC721 by address.
MercuryApi.EthApiethControllerFindFtBalancesByContractPOST /eth/ft/{contract}/balancesGet contract's all FT balances by the owner's address.
MercuryApi.EthApiethControllerFindFtTransferStatsPOST /eth/ft/transfers/statsGet all FT transfers stats.
MercuryApi.EthApiethControllerFindFtTransferStatsByContractPOST /eth/ft/{contract}/transfers/statsGet all FT transfers stats.
MercuryApi.EthApiethControllerFindFtTransfersPOST /eth/ft/transfersGet all FT transfers by the transaction hash.
MercuryApi.EthApiethControllerFindFtTransfersByContractPOST /eth/ft/{contract}/transfersGet all FT transfers.
MercuryApi.EthApiethControllerFindLogsPOST /eth/logsGet all logs.
MercuryApi.EthApiethControllerFindLogsByContractPOST /eth/{contract}/logsGet contract's all logs.
MercuryApi.EthApiethControllerFindSpecificLogsByContractPOST /eth/{contract}/logs/{name}Get contract's all logs by the event name.
MercuryApi.EthApiethControllerFindTxByHashGET /eth/txs/{hash}Get a transaction by hash.
MercuryApi.EthApiethControllerFindTxsPOST /eth/txsGet all transactions.
MercuryApi.EthApiethControllerHoldFtBalancesByContractPOST /eth/ft/{contract}/balances/holdGet contract's all FT balances holds.
MercuryApi.EthApiethControllerInsightFtBalancesByContractPOST /eth/ft/{contract}/balances/insightGet contract's all FT balances insight.
MercuryApi.EthApiethControllerNftCountMintsPOST /eth/nft/mints/countGet amount of mint NFT transfers.
MercuryApi.EthApiethControllerNftCountMintsByContractPOST /eth/nft/{contract}/mints/countGet amount of contract's mint NFT transfers.
MercuryApi.EthApiethControllerNftCountTransfersByContractPOST /eth/nft/{contract}/transfers/countGet amount of NFT transfers.
MercuryApi.EthApiethControllerNftFindMetadataByContractGET /eth/nft/{contract}/metadata/{tokenId}Get token's metadata in the contract.
MercuryApi.EthApiethControllerNftFindMintsPOST /eth/nft/mintsGet all mint NFT transfers.
MercuryApi.EthApiethControllerNftFindMintsByContractPOST /eth/nft/{contract}/mintsGet contract's all mint NFT transfers.
MercuryApi.EthApiethControllerNftFindTokensByContractPOST /eth/nft/{contract}/tokensGet all NFT tokens.
MercuryApi.EthApiethControllerNftFindTransfersByContractPOST /eth/nft/{contract}/transfersGet all NFT transfers.
MercuryApi.EthApiethControllerNftSignClaimPOST /eth/nft/claims/signSign data.
MercuryApi.EthApiethControllerTrackFtBalancesByContractPOST /eth/ft/{contract}/balances/trackGet contract's all FT balances track by the owner's address.
MercuryApi.EthApiethControllerUniCountSwapsByPairPOST /eth/uni/pairs/{pair}/swaps/countGet amount of pair swaps.
MercuryApi.EthApiethControllerUniFindLiquidityByPairPOST /eth/uni/pairs/{pair}/liquidityGet all pairs liquidity.
MercuryApi.EthApiethControllerUniFindPairsPOST /eth/uni/pairsGet all pairs by the factory contract address.
MercuryApi.EthApiethControllerUniFindSwapsByPairPOST /eth/uni/pairs/{pair}/swapsGet all pair swaps.

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago