@triadxyz/triad-protocol 2.9.0-beta → 2.9.2-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 CHANGED
@@ -1046,14 +1046,13 @@ class TriadProtocolClient {
1046
1046
  .instruction());
1047
1047
  }
1048
1048
  }
1049
- console.log('amountOfUSDC', amountOfUSDC.toNumber());
1050
1049
  if (isTrdPayout) {
1051
1050
  const { setupInstructions, swapIxs, addressLookupTableAccounts: swapAddressLookupTableAccounts } = yield (0, swap_1.swap)({
1052
1051
  connection: this.program.provider.connection,
1053
1052
  wallet: this.program.provider.publicKey.toBase58(),
1054
1053
  inToken: constants_1.USDC_MINT.toBase58(),
1055
1054
  outToken: constants_1.TRD_MINT.toString(),
1056
- amount: amountOfUSDC.toNumber()
1055
+ amount: amountOfUSDC.toNumber() / Math.pow(10, 6)
1057
1056
  });
1058
1057
  if (swapIxs.length > 0) {
1059
1058
  ixs.push(...setupInstructions);
@@ -24,12 +24,12 @@ 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=50&onlyDirectRoutes=true&platformFeeBps=60`);
27
+ const quoteResponse = yield axios_1.default.get(`https://lite-api.jup.ag/swap/v1/quote?inputMint=${inToken}&outputMint=${outToken}&amount=${formattedAmountIn}&slippageBps=20&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,
31
31
  userPublicKey: wallet,
32
- feeAccount: getFeeAccount()
32
+ feeAccount: inToken === constants_1.TRD_MINT.toString() ? getFeeAccount() : undefined
33
33
  });
34
34
  const { setupInstructions, swapInstruction, addressLookupTableAddresses } = swapResponse.data;
35
35
  return {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@triadxyz/triad-protocol",
3
- "version": "2.9.0-beta",
3
+ "version": "2.9.2-beta",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",