Across SDK
The Across SDK is written and maintained by the engineering team at Risk Labs.
It is written in typescript and available on NPM at @across-protocol/sdk-v2. It's compatible with both Node JS environments and in the browser.
The SDK can be used currently to query suggested deposit fees and limits, and get liquidity pool statistics. It is imported and used in the API's implementation.
We recommend using the API, which wraps SDK functions and has an easier interface. However, if speed is a concern then we recommend reviewing the API implementation of the SDK to understand best how to use the SDK.
To add the SDK to your project, use npm or yarn to
npm install @across-protocol/sdk-v2
or yarn add @across-protocol/sdk-v2
.This can be used either in a frontend application or a node js project.
You can read about the different SDK modules on the Github README page. For convenience, the available modules are:
- relayFeeCalculator: Get suggested
relayerFeePct
for a deposit, which accounts for opportunity cost of capital and gas costs. If the depositor opts to set this fee lower than the suggested fee, then there is a chance that the deposit goes unfilled for a long time. - pool: Get HubPool statistics, such as available
liquidReserves
that be used to refund relayers andestimatedApy
for liquidity providers.
Last modified 10mo ago