Hey @b7011343
If you look at the documentation that Ivan posted, you will find the function:
async function getQuote() {
const quote = await Moralis.Plugins.oneInch.quote({
chain: 'bsc', // The blockchain you want to use (eth/bsc/polygon)
fromTokenAddress: '0x0da6ed8b13214ff28e9ca979dd37439e8a88f6c4', // The token you want to swap
toTokenAddress: '0x6fd7c98458a943f469e1cf4ea85b173f5cd342f4', // The token you want to receive
amount: 1000,
});
console.log(quote);
}
You can try to specify protocols
option:
async function getQuote() {
const quote = await Moralis.Plugins.oneInch.quote({
chain: 'bsc', // The blockchain you want to use (eth/bsc/polygon)
fromTokenAddress: '0x0da6ed8b13214ff28e9ca979dd37439e8a88f6c4', // The token you want to swap
toTokenAddress: '0x6fd7c98458a943f469e1cf4ea85b173f5cd342f4', // The token you want to receive
amount: 1000,
protocols: ""
});
console.log(quote);
}
Protocols list you can find on 1 inch swagger by calling this API: