UNPKG

layerzero-stargate-api

Version:

API for Stargate and LayerZero

88 lines (58 loc) 1.87 kB
# layerzero-stargate-api This API give you the ability to retrieve data from Stargate, on all chains. Full documentation : https://goldennaim.gitbook.io/stargateapi/ # Installation Use the package manager npm to install layerzero-stargate-api ``` npm i layerzero-stargate-api ``` # Blockchain available / value of chainID * 1 - Ethereum * 2 - Binance Smart Chain * 6 - Avalanche * 9 - Polygon * 10 - Arbitrum * 11 - Optimism * 12 - Fantom # Functions * **getTransfers**(chainID, srcPoolID, dstChainID, dstPoolID, startDate, endDate, page) * **getFarmsActions**(chainID, poolID, type, startDate, endDate, user, page) * **getPoolsActions**(chainID, poolID, type, startDate, endDate, user, page) * **getHourlyData**(chainID, poolID, startDate, endDate, page) * **getChains**(chainID) * **getContracts**(chainID) Parameters : Function | Parameter | Description ----------- | ----------- | ------------ all | chainID | The source chain ID all | srcPoolID, poolID | The source pool ID getTransfers | dstChainID | The recipient chain ID getTransfers | dstPoolID | The recipient pool ID getFarmsActions | type | 1 for deposit, 2 for withdraw getPoolsActions | type | 1 for mint, 2 for burn all | startDate, endDate | Timetamp all | page | Pagination, 100 results by page # Usage / Example ```javascript api = require('layerzero-stargate-api'); // Get last transfers from chainID 1 ( Ethereum ), poolID 1, to chainID 9 ( Polygon ) api.getTransfers(1,1,9).then( function(res) { res[1].forEach( function(Transfers) { console.log(Transfers); } ); } ); // Get the latest hourly data from chainID 9 ( Polygon ) and pool ID 1 api.getHourlyData(9,1).then( function(res) { res[1].forEach( function(Transfers) { console.log(Transfers); } ); } ); ``` # Author GoldenNaim - Naim Boubziz - https://twitter.com/BrutalTrade # License MIT