
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@getsafle/1inch-controller
Advanced tools
This SDK houses the functions to interact with the 1Inch Contracts.
To install this SDK,
npm install --save @getsafle/1inch-controller
Initialize the constructor,
const OneInch = require('@getsafle/1inch-controller');
const controller = new OneInch(chain);
Get supported tokens
This function will give us the list of all tokens supported by 1inch.
await controller.getSupportedTokens()
Get supported chains
This function will give us the list of all the supported chains.
await controller.getSupportedChains()
Get Exchange Rate
This will give us the exchange rate of 2 tokens.
Amount of fromContractAddress
the user will receive for fromQuantity
of toContractAddress
.
await controller.getExchangeRate({ toContractAddress, fromContractAddress, fromQuantity })
Get Estimated gas
This will give us the estimated amount of gas needed to do the swap.
await controller.getEstimatedGas({ toContractAddress, fromContractAddress, fromQuantity })
Get Raw Transaction
This will give us the raw transaction to swap the tokens on 1inch.
await controller.getRawTransaction({ walletAddress, toContractAddress, fromContractAddress, toQuantity, fromQuantity, slippageTolerance })
Get Approval Transaction
This function will call the approval smart contract function to approve spending fromQuantity
for the fromContractAddress
from the walletAddress
.
await controller.approvalRawTransaction({ walletAddress, fromContractAddress, fromQuantity })
1.2.2 (2023-10-31)
FAQs
1inch controller for safle token swaps
The npm package @getsafle/1inch-controller receives a total of 1 weekly downloads. As such, @getsafle/1inch-controller popularity was classified as not popular.
We found that @getsafle/1inch-controller demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.