Package Exports
- layerzero-stargate-api
- layerzero-stargate-api/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (layerzero-stargate-api) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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-apiBlockchain 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
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