getRecentPrioritizationFees_web3.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. const web3 = require('@solana/web3.js');
  2. const fs = require("fs-extra");
  3. const BigNumber = require("bignumber.js");
  4. const { Wallet } = require('@coral-xyz/anchor');
  5. const Decimal = require('decimal.js');
  6. const BN = require('bn.js');
  7. const cron = require('node-cron');
  8. const bs58 = require('bs58')
  9. const raydium_sdk = require("@raydium-io/raydium-sdk");
  10. const deepcopy = require('deepcopy');
  11. const clear = require('clear');
  12. const Config = require("./config")
  13. const axios = require('axios');
  14. let jsonInfo2PoolKeys = raydium_sdk.jsonInfo2PoolKeys;
  15. let mywalletaddress = Config.mywalletaddress;
  16. let log = console.log;
  17. console.log = function () {
  18. let args = Array.from(arguments);
  19. let log_prefix = new Date().toISOString();
  20. args.unshift(log_prefix + "");
  21. log.apply(console, args);
  22. }
  23. BigInt.prototype.toJSON = function () {
  24. return this.toString()
  25. }
  26. let swap_url = "https://solana-mainnet.g.alchemy.com/v2/WLI0ohbUlvbsJVmoIvB1wTSwUA8qP5qS";
  27. let swap_connection = new web3.Connection("https://solana-mainnet.g.alchemy.com/v2/WLI0ohbUlvbsJVmoIvB1wTSwUA8qP5qS", {
  28. commitment: "confirmed",
  29. });
  30. async function main() {
  31. // let str_dalao_address = '7T1kJcKi5tYA2Vpza1BQnfShSsFCmyVBnxbncqHoEUqAa'
  32. // let listen_body_data = `{"id":"${guid()}","jsonrpc":"2.0","method":"getSignaturesForAddress","params":["${str_dalao_address}",{"limit":5, "commitment": "confirmed"}]}`;
  33. // let requestSignatures = await axios.post(swap_url, listen_body_data, listen_axios_config);
  34. // if (requestSignatures.status != 200) {
  35. // console.log(``)
  36. // return;
  37. // }
  38. // else if (requestSignatures.status == 200 && requestSignatures.error) {
  39. // throw new Error(requestSignatures.error.message);
  40. // }
  41. // console.log("yes")
  42. // requestSignatures = requestSignatures.data.result;
  43. // requestSignatures = requestSignatures.data;
  44. // console.log(requestSignatures);
  45. let sign = '3dCiNfDyJvm1aXtGABgac6DWZ4WqhS3uhswvTEgFhoF2cT9dvaFazNtVg9T5Wm9zCBXsyTMZsUjzQhR4EsuWxVF3'
  46. let obj_RecentPrioritizationFees;
  47. // obj_RecentPrioritizationFees = await swap_connection.getRecentPrioritizationFees({ lockedWritableAccounts: [new web3.PublicKey(mywalletaddress)] });
  48. obj_RecentPrioritizationFees = await swap_connection.getRecentPrioritizationFees();
  49. console.log(obj_RecentPrioritizationFees)
  50. // let str_ammid = "AiyRewCvnCWaJuCE851bQZP5LQeT11uVgKCASYZAfEHp"
  51. // const account = await swap_connection.getAccountInfo(new web3.PublicKey(str_ammid));
  52. // console.log(account)
  53. // let web3pub_dalaoaddd = new web3.PublicKey('GFUS44ebiF6YQ5FZQ9dXZVFba69rEuTqLwXcUFvVxVTD')
  54. // let requestSignatures = await swap_connection.getSignaturesForAddress(web3pub_dalaoaddd, {
  55. // limit: 5,
  56. // }, 'confirmed');
  57. // console.log(requestSignatures);
  58. }
  59. main()