@triadxyz/triad-protocol 2.8.9-beta → 2.9.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -0
- package/dist/utils/swap.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1046,6 +1046,7 @@ class TriadProtocolClient {
|
|
|
1046
1046
|
.instruction());
|
|
1047
1047
|
}
|
|
1048
1048
|
}
|
|
1049
|
+
console.log('amountOfUSDC', amountOfUSDC.toNumber());
|
|
1049
1050
|
if (isTrdPayout) {
|
|
1050
1051
|
const { setupInstructions, swapIxs, addressLookupTableAccounts: swapAddressLookupTableAccounts } = yield (0, swap_1.swap)({
|
|
1051
1052
|
connection: this.program.provider.connection,
|
package/dist/utils/swap.js
CHANGED
|
@@ -24,7 +24,7 @@ const swap = ({ connection, wallet, inToken, outToken, amount }) => __awaiter(vo
|
|
|
24
24
|
throw new Error('Token not found');
|
|
25
25
|
}
|
|
26
26
|
const formattedAmountIn = amount * Math.pow(10, token.decimals);
|
|
27
|
-
const quoteResponse = yield axios_1.default.get(`https://lite-api.jup.ag/swap/v1/quote?inputMint=${inToken}&outputMint=${outToken}&amount=${formattedAmountIn}&slippageBps=
|
|
27
|
+
const quoteResponse = yield axios_1.default.get(`https://lite-api.jup.ag/swap/v1/quote?inputMint=${inToken}&outputMint=${outToken}&amount=${formattedAmountIn}&slippageBps=50&onlyDirectRoutes=true&platformFeeBps=60`);
|
|
28
28
|
const { data: quoteData } = quoteResponse;
|
|
29
29
|
const swapResponse = yield axios_1.default.post('https://lite-api.jup.ag/swap/v1/swap-instructions', {
|
|
30
30
|
quoteResponse: quoteData,
|