sol-parser-sdk-nodejs 0.4.4 → 0.5.5

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.
Files changed (52) hide show
  1. package/README.md +16 -4
  2. package/README_CN.md +16 -4
  3. package/dist/accounts/mod.d.ts +1 -1
  4. package/dist/accounts/mod.js +43 -9
  5. package/dist/accounts/pumpfun.d.ts +10 -0
  6. package/dist/accounts/pumpfun.js +384 -3
  7. package/dist/core/account_dispatcher_rpc.js +5 -26
  8. package/dist/core/account_fill_meteora.d.ts +1 -2
  9. package/dist/core/account_fill_meteora.js +0 -2
  10. package/dist/core/account_fill_pumpfun.js +86 -24
  11. package/dist/core/account_fill_pumpswap.js +50 -0
  12. package/dist/core/account_fill_raydium_launchlab.d.ts +4 -0
  13. package/dist/core/account_fill_raydium_launchlab.js +20 -0
  14. package/dist/core/dex_event.d.ts +136 -17
  15. package/dist/core/pumpfun_fee_enrich.d.ts +1 -0
  16. package/dist/core/pumpfun_fee_enrich.js +51 -0
  17. package/dist/grpc/log_instr_dedup.js +62 -14
  18. package/dist/grpc/program_ids.d.ts +4 -3
  19. package/dist/grpc/program_ids.js +11 -5
  20. package/dist/grpc/types.d.ts +13 -6
  21. package/dist/grpc/types.js +250 -239
  22. package/dist/index.d.ts +6 -5
  23. package/dist/index.js +21 -7
  24. package/dist/instr/meteora_damm_ix.js +4 -1
  25. package/dist/instr/meteora_dlmm_ix.d.ts +2 -0
  26. package/dist/instr/meteora_dlmm_ix.js +134 -0
  27. package/dist/instr/meteora_pools_ix.d.ts +2 -0
  28. package/dist/instr/meteora_pools_ix.js +78 -0
  29. package/dist/instr/mod.d.ts +3 -1
  30. package/dist/instr/mod.js +38 -19
  31. package/dist/instr/program_ids.d.ts +1 -5
  32. package/dist/instr/program_ids.js +3 -6
  33. package/dist/instr/pumpfun_ix.js +219 -5
  34. package/dist/instr/pumpswap_ix.js +36 -2
  35. package/dist/instr/raydium_launchlab_ix.d.ts +8 -0
  36. package/dist/instr/raydium_launchlab_ix.js +125 -0
  37. package/dist/instr/rust_aliases.d.ts +2 -0
  38. package/dist/instr/rust_aliases.js +5 -1
  39. package/dist/logs/optimized_matcher.js +14 -9
  40. package/dist/logs/pump.js +76 -3
  41. package/dist/logs/pump_amm.js +1 -1
  42. package/dist/logs/raydium_launchlab.d.ts +10 -0
  43. package/dist/logs/raydium_launchlab.js +84 -0
  44. package/dist/shredstream/client.d.ts +4 -1
  45. package/dist/shredstream/client.js +18 -14
  46. package/dist/shredstream/index.d.ts +1 -1
  47. package/dist/shredstream/index.js +1 -1
  48. package/dist/shredstream/instruction_parse.d.ts +3 -3
  49. package/dist/shredstream/instruction_parse.js +36 -13
  50. package/dist/util/market.d.ts +18 -0
  51. package/dist/util/market.js +54 -0
  52. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -33,10 +33,11 @@ var __importStar = (this && this.__importStar) || (function () {
33
33
  };
34
34
  })();
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
- exports.pubkey_bytes_to_bs58 = exports.tryYellowstoneSignature = exports.collectWatchTransferCounterpartyPairs = exports.splTokenCounterpartyByOwner = exports.tokenBalanceRawAmount = exports.heuristicSolCounterpartiesForWatchedKeys = exports.lamportBalanceDeltas = exports.collectAccountKeysBs58 = exports.pubkeyBytesToBs58 = exports.grpcTxIndexFromInfo = exports.parseDexEventsFromGrpcTransactionInfo = exports.convert_rpc_to_grpc = exports.convertRpcToGrpc = exports.applyAccountFillsToLogEvents = exports.fillDataRpc = exports.fillAccountsFromTransactionDataRpc = exports.parseRpcTransaction = exports.parseTransactionFromRpc = exports.isWarmedUp = exports.warmupParser = exports.build_account_pubkeys_with_cache = exports.buildAccountPubkeysWithCache = exports.AccountPubkeyCache = exports.elapsedMicrosSince = exports.nowNanos = exports.nowMicros = exports.nowUs = exports.parse_log = exports.parseLog = exports.parseTransactionWithStreamingListener = exports.parseLogsStreaming = exports.parseTransactionEventsStreaming = exports.parseTransactionWithListener = exports.parseLogsOnly = exports.parseTransactionEvents = exports.enrichPumpfunSameTxPostMerge = exports.enrichPumpfunTradesFromCreateInstructions = exports.enrichCreateV2ObservedFeeRecipient = exports.formatParseError = exports.dexEventToJsonString = exports.bigintToJsonReplacer = exports.defaultPubkey = exports.metadataForDexEvent = exports.SLOW_PROCESSING_THRESHOLD_US = exports.DEFAULT_REQUEST_TIMEOUT = exports.DEFAULT_METRICS_WINDOW_SECONDS = exports.DEFAULT_METRICS_PRINT_INTERVAL_SECONDS = exports.DEFAULT_MAX_DECODING_MESSAGE_SIZE = exports.DEFAULT_CONNECT_TIMEOUT = exports.DEFAULT_CHANNEL_SIZE = void 0;
37
- exports.protocol_program_ids = exports.accountFilterForProtocols = exports.transactionFilterForProtocols = exports.getProgramIdsForProtocols = exports.METEORA_DLMM_PROGRAM_ID = exports.METEORA_DAMM_V2_PROGRAM_ID = exports.METEORA_POOLS_PROGRAM_ID = exports.ORCA_WHIRLPOOL_PROGRAM_ID = exports.RAYDIUM_AMM_V4_PROGRAM_ID = exports.RAYDIUM_CLMM_PROGRAM_ID = exports.RAYDIUM_CPMM_PROGRAM_ID = exports.BONK_PROGRAM_ID = exports.PUMP_FEES_PROGRAM_ID = exports.PUMPSWAP_FEES_PROGRAM_ID = exports.PUMPSWAP_PROGRAM_ID = exports.PUMPFUN_PROGRAM_ID = exports.PROTOCOL_PROGRAM_IDS = exports.all_event_types = exports.ALL_EVENT_TYPES = exports.eventTypeFilterAllowsInstructionParsing = exports.eventTypeFilterIncludesPumpFees = exports.eventTypeFilterIncludesRaydiumLaunchpad = exports.eventTypeFilterIncludesBonk = exports.eventTypeFilterIncludesOrcaWhirlpool = exports.eventTypeFilterIncludesRaydiumAmmV4 = exports.eventTypeFilterIncludesRaydiumCpmm = exports.eventTypeFilterIncludesRaydiumClmm = exports.eventTypeFilterIncludesMeteoraDammV2 = exports.eventTypeFilterIncludesPumpswap = exports.eventTypeFilterIncludesPumpfun = exports.eventTypeFilterExclude = exports.eventTypeFilterIncludeOnly = exports.accountFilterMemcmp = exports.accountFilterFromProgramOwners = exports.slotFilterMaxSlot = exports.slotFilterMinSlot = exports.newSlotFilter = exports.newAccountFilter = exports.transactionFilterFromProgramIds = exports.newTransactionFilter = exports.highThroughputClientConfig = exports.lowLatencyClientConfig = exports.defaultClientConfig = exports.try_yellowstone_signature = exports.collect_watch_transfer_counterparty_pairs = exports.spl_token_counterparty_by_owner = exports.token_balance_raw_amount = exports.heuristic_sol_counterparties_for_watched_keys = exports.lamport_balance_deltas = exports.collect_account_keys_bs58 = void 0;
38
- exports.parsePumpswapPool = exports.parsePumpswapGlobalConfig = exports.isPumpfunGlobalAccount = exports.parsePumpfunAccount = exports.parsePumpfunGlobal = exports.parseTokenAccount = exports.isNonceAccount = exports.parseNonceAccount = exports.parseAccountUnified = exports.u64leDiscriminator = exports.PUMPSWAP_DISC = exports.PROGRAM_LOG_DISC = exports.parseMeteoraDammLog = exports.lookup_discriminator = exports.lookupDiscriminator = exports.discriminator_to_protocol = exports.discriminatorToProtocol = exports.discriminator_to_name = exports.discriminatorToName = exports.parse_log_unified = exports.parse_log_optimized = exports.parse_meteora_dlmm_log = exports.parse_meteora_damm_log = exports.parseLogOptimized = exports.parseLogUnified = exports.build_subscribe_transaction_filters_named = exports.build_subscribe_request_with_commitment = exports.build_subscribe_request = exports.CommitmentLevel = exports.buildSubscribeTransactionFiltersNamed = exports.buildSubscribeRequestWithCommitment = exports.buildSubscribeRequest = exports.exclude_types = exports.include_only = exports.event_type_filter_exclude = exports.event_type_filter_include_only = exports.account_filter_memcmp = exports.account_filter_from_program_owners = exports.slot_filter_max_slot = exports.slot_filter_min_slot = exports.new_slot_filter = exports.new_account_filter = exports.transaction_filter_from_program_ids = exports.new_transaction_filter = exports.high_throughput_client_config = exports.low_latency_client_config = exports.default_client_config = exports.account_filter_for_protocols = exports.transaction_filter_for_protocols = exports.get_program_ids_for_protocols = void 0;
39
- exports.high_throughput_shred_stream_config = exports.low_latency_shred_stream_config = exports.default_shred_stream_config = exports.highThroughputShredStreamConfig = exports.lowLatencyShredStreamConfig = exports.defaultShredStreamConfig = exports.wireBytesToShredWasmTx = exports.decodeShredstreamEntriesBincode = exports.decodeEntriesBincodeNested = exports.decodeEntriesBincodeFlat = exports.bincodeVecEntryCount = exports.loadAddressLookupTableAccounts = exports.fullAccountKeyStringsFromShredTx = exports.dexEventsFromShredWasmTxWithFullKeys = exports.dexEventsFromShredWasmTx = exports.ShredEventQueue = exports.ShredStreamClient = exports.geyser_grpc_channel_options = exports.default_geyser_connect_config = exports.connect_yellowstone_geyser = exports.event_parser = exports.geyserGrpcChannelOptions = exports.defaultGeyserConnectConfig = exports.connectYellowstoneGeyser = exports.YellowstoneGrpc = exports.programIds = exports.parse_pump_fees_instruction = exports.parse_meteora_damm_instruction = exports.parse_pumpswap_instruction = exports.parse_pumpfun_instruction = exports.parse_instruction_unified = exports.parsePumpFeesInstruction = exports.parseMeteoraDammInstruction = exports.parsePumpswapInstruction = exports.parsePumpfunInstruction = exports.parseInstructionUnified = exports.user_wallet_pubkey_for_onchain_account = exports.rpc_resolve_user_wallet_pubkey = exports.parse_pumpswap_pool = exports.parse_pumpswap_global_config = exports.parse_pumpfun_global = exports.parse_token_account = exports.parse_nonce_account = exports.parse_account_unified = exports.rpcResolveUserWalletPubkey = exports.userWalletPubkeyForOnchainAccount = exports.hasDiscriminator = exports.isPoolAccount = exports.isGlobalConfigAccount = exports.parsePumpswapAccount = void 0;
36
+ exports.heuristicSolCounterpartiesForWatchedKeys = exports.lamportBalanceDeltas = exports.collectAccountKeysBs58 = exports.pubkeyBytesToBs58 = exports.grpcTxIndexFromInfo = exports.parseDexEventsFromGrpcTransactionInfo = exports.convert_rpc_to_grpc = exports.convertRpcToGrpc = exports.applyAccountFillsToLogEvents = exports.fillDataRpc = exports.fillAccountsFromTransactionDataRpc = exports.parseRpcTransaction = exports.parseTransactionFromRpc = exports.isWarmedUp = exports.warmupParser = exports.build_account_pubkeys_with_cache = exports.buildAccountPubkeysWithCache = exports.AccountPubkeyCache = exports.normalizeBuySellFromInputMint = exports.normalizeBuySellFromTokenDelta = exports.vaultPriceFromBalances = exports.sqrtPriceX64ToPrice = exports.elapsedMicrosSince = exports.nowNanos = exports.nowMicros = exports.nowUs = exports.parse_log = exports.parseLog = exports.parseTransactionWithStreamingListener = exports.parseLogsStreaming = exports.parseTransactionEventsStreaming = exports.parseTransactionWithListener = exports.parseLogsOnly = exports.parseTransactionEvents = exports.enrichPumpfunSameTxPostMerge = exports.enrichPumpfunTradesFromCreateInstructions = exports.enrichCreateV2ObservedFeeRecipient = exports.enrichCreateV2FromCreateEvents = exports.formatParseError = exports.dexEventToJsonString = exports.bigintToJsonReplacer = exports.defaultPubkey = exports.metadataForDexEvent = exports.SLOW_PROCESSING_THRESHOLD_US = exports.DEFAULT_REQUEST_TIMEOUT = exports.DEFAULT_METRICS_WINDOW_SECONDS = exports.DEFAULT_METRICS_PRINT_INTERVAL_SECONDS = exports.DEFAULT_MAX_DECODING_MESSAGE_SIZE = exports.DEFAULT_CONNECT_TIMEOUT = exports.DEFAULT_CHANNEL_SIZE = void 0;
37
+ exports.ORCA_WHIRLPOOL_PROGRAM_ID = exports.RAYDIUM_AMM_V4_PROGRAM_ID = exports.RAYDIUM_CLMM_PROGRAM_ID = exports.RAYDIUM_CPMM_PROGRAM_ID = exports.RAYDIUM_LAUNCHLAB_PROGRAM_ID = exports.PUMP_FEES_PROGRAM_ID = exports.PUMPSWAP_FEES_PROGRAM_ID = exports.PUMPSWAP_PROGRAM_ID = exports.PUMPFUN_PROGRAM_ID = exports.PROTOCOL_PROGRAM_IDS = exports.all_event_types = exports.ALL_EVENT_TYPES = exports.eventTypeFilterAllowsInstructionParsing = exports.eventTypeFilterIncludesPumpFees = exports.eventTypeFilterIncludesRaydiumLaunchlab = exports.eventTypeFilterIncludesOrcaWhirlpool = exports.eventTypeFilterIncludesRaydiumAmmV4 = exports.eventTypeFilterIncludesRaydiumCpmm = exports.eventTypeFilterIncludesRaydiumClmm = exports.eventTypeFilterIncludesMeteoraDlmm = exports.eventTypeFilterIncludesMeteoraPools = exports.eventTypeFilterIncludesMeteoraDbc = exports.eventTypeFilterIncludesMeteoraDammV2 = exports.eventTypeFilterIncludesPumpswap = exports.eventTypeFilterIncludesPumpfun = exports.eventTypeFilterExclude = exports.eventTypeFilterIncludeOnly = exports.accountFilterMemcmp = exports.accountFilterFromProgramOwners = exports.slotFilterMaxSlot = exports.slotFilterMinSlot = exports.newSlotFilter = exports.newAccountFilter = exports.transactionFilterFromProgramIds = exports.newTransactionFilter = exports.highThroughputClientConfig = exports.lowLatencyClientConfig = exports.defaultClientConfig = exports.try_yellowstone_signature = exports.collect_watch_transfer_counterparty_pairs = exports.spl_token_counterparty_by_owner = exports.token_balance_raw_amount = exports.heuristic_sol_counterparties_for_watched_keys = exports.lamport_balance_deltas = exports.collect_account_keys_bs58 = exports.pubkey_bytes_to_bs58 = exports.tryYellowstoneSignature = exports.collectWatchTransferCounterpartyPairs = exports.splTokenCounterpartyByOwner = exports.tokenBalanceRawAmount = void 0;
38
+ exports.parseAccountUnified = exports.u64leDiscriminator = exports.PUMPSWAP_DISC = exports.PROGRAM_LOG_DISC = exports.parseMeteoraDammLog = exports.lookup_discriminator = exports.lookupDiscriminator = exports.discriminator_to_protocol = exports.discriminatorToProtocol = exports.discriminator_to_name = exports.discriminatorToName = exports.parse_log_unified = exports.parse_log_optimized = exports.parse_meteora_dlmm_log = exports.parse_meteora_damm_log = exports.parseLogOptimized = exports.parseLogUnified = exports.build_subscribe_transaction_filters_named = exports.build_subscribe_request_with_commitment = exports.build_subscribe_request = exports.CommitmentLevel = exports.buildSubscribeTransactionFiltersNamed = exports.buildSubscribeRequestWithCommitment = exports.buildSubscribeRequest = exports.exclude_types = exports.include_only = exports.event_type_filter_exclude = exports.event_type_filter_include_only = exports.account_filter_memcmp = exports.account_filter_from_program_owners = exports.slot_filter_max_slot = exports.slot_filter_min_slot = exports.new_slot_filter = exports.new_account_filter = exports.transaction_filter_from_program_ids = exports.new_transaction_filter = exports.high_throughput_client_config = exports.low_latency_client_config = exports.default_client_config = exports.account_filter_for_protocols = exports.transaction_filter_for_protocols = exports.get_program_ids_for_protocols = exports.protocol_program_ids = exports.accountFilterForProtocols = exports.transactionFilterForProtocols = exports.getProgramIdsForProtocols = exports.METEORA_DBC_PROGRAM_ID = exports.METEORA_DLMM_PROGRAM_ID = exports.METEORA_DAMM_V2_PROGRAM_ID = exports.METEORA_POOLS_PROGRAM_ID = void 0;
39
+ exports.fullAccountKeyStringsFromShredTx = exports.dexEventsFromShredWasmTxWithFullKeys = exports.dexEventsFromShredWasmTx = exports.ShredEventQueue = exports.ShredStreamClient = exports.geyser_grpc_channel_options = exports.default_geyser_connect_config = exports.connect_yellowstone_geyser = exports.event_parser = exports.geyserGrpcChannelOptions = exports.defaultGeyserConnectConfig = exports.connectYellowstoneGeyser = exports.YellowstoneGrpc = exports.programIds = exports.parse_pump_fees_instruction = exports.parse_meteora_pools_instruction = exports.parse_meteora_dlmm_instruction = exports.parse_meteora_damm_instruction = exports.parse_pumpswap_instruction = exports.parse_pumpfun_instruction = exports.parse_instruction_unified = exports.parsePumpFeesInstruction = exports.parseMeteoraPoolsInstruction = exports.parseMeteoraDlmmInstruction = exports.parseMeteoraDammInstruction = exports.parsePumpswapInstruction = exports.parsePumpfunInstruction = exports.parseInstructionUnified = exports.user_wallet_pubkey_for_onchain_account = exports.rpc_resolve_user_wallet_pubkey = exports.parse_pumpswap_pool = exports.parse_pumpswap_global_config = exports.parse_pumpfun_global = exports.parse_token_account = exports.parse_nonce_account = exports.parse_account_unified = exports.rpcResolveUserWalletPubkey = exports.userWalletPubkeyForOnchainAccount = exports.hasDiscriminator = exports.isPoolAccount = exports.isGlobalConfigAccount = exports.parsePumpswapAccount = exports.parsePumpswapPool = exports.parsePumpswapGlobalConfig = exports.isPumpfunGlobalAccount = exports.parsePumpfunAccount = exports.parsePumpfunGlobal = exports.parseTokenAccount = exports.isNonceAccount = exports.parseNonceAccount = void 0;
40
+ exports.high_throughput_shred_stream_config = exports.low_latency_shred_stream_config = exports.default_shred_stream_config = exports.highThroughputShredStreamConfig = exports.lowLatencyShredStreamConfig = exports.defaultShredStreamConfig = exports.wireBytesToShredWasmTx = exports.decodeShredstreamEntriesBincode = exports.decodeEntriesBincodeNested = exports.decodeEntriesBincodeFlat = exports.bincodeVecEntryCount = exports.loadAddressLookupTableAccounts = void 0;
40
41
  var constants_js_1 = require("./common/constants.js");
41
42
  Object.defineProperty(exports, "DEFAULT_CHANNEL_SIZE", { enumerable: true, get: function () { return constants_js_1.DEFAULT_CHANNEL_SIZE; } });
42
43
  Object.defineProperty(exports, "DEFAULT_CONNECT_TIMEOUT", { enumerable: true, get: function () { return constants_js_1.DEFAULT_CONNECT_TIMEOUT; } });
@@ -54,6 +55,7 @@ Object.defineProperty(exports, "dexEventToJsonString", { enumerable: true, get:
54
55
  var error_js_1 = require("./core/error.js");
55
56
  Object.defineProperty(exports, "formatParseError", { enumerable: true, get: function () { return error_js_1.formatParseError; } });
56
57
  var pumpfun_fee_enrich_js_1 = require("./core/pumpfun_fee_enrich.js");
58
+ Object.defineProperty(exports, "enrichCreateV2FromCreateEvents", { enumerable: true, get: function () { return pumpfun_fee_enrich_js_1.enrichCreateV2FromCreateEvents; } });
57
59
  Object.defineProperty(exports, "enrichCreateV2ObservedFeeRecipient", { enumerable: true, get: function () { return pumpfun_fee_enrich_js_1.enrichCreateV2ObservedFeeRecipient; } });
58
60
  Object.defineProperty(exports, "enrichPumpfunTradesFromCreateInstructions", { enumerable: true, get: function () { return pumpfun_fee_enrich_js_1.enrichPumpfunTradesFromCreateInstructions; } });
59
61
  Object.defineProperty(exports, "enrichPumpfunSameTxPostMerge", { enumerable: true, get: function () { return pumpfun_fee_enrich_js_1.enrichPumpfunSameTxPostMerge; } });
@@ -71,6 +73,11 @@ var clock_js_1 = require("./core/clock.js");
71
73
  Object.defineProperty(exports, "nowMicros", { enumerable: true, get: function () { return clock_js_1.nowMicros; } });
72
74
  Object.defineProperty(exports, "nowNanos", { enumerable: true, get: function () { return clock_js_1.nowNanos; } });
73
75
  Object.defineProperty(exports, "elapsedMicrosSince", { enumerable: true, get: function () { return clock_js_1.elapsedMicrosSince; } });
76
+ var market_js_1 = require("./util/market.js");
77
+ Object.defineProperty(exports, "sqrtPriceX64ToPrice", { enumerable: true, get: function () { return market_js_1.sqrtPriceX64ToPrice; } });
78
+ Object.defineProperty(exports, "vaultPriceFromBalances", { enumerable: true, get: function () { return market_js_1.vaultPriceFromBalances; } });
79
+ Object.defineProperty(exports, "normalizeBuySellFromTokenDelta", { enumerable: true, get: function () { return market_js_1.normalizeBuySellFromTokenDelta; } });
80
+ Object.defineProperty(exports, "normalizeBuySellFromInputMint", { enumerable: true, get: function () { return market_js_1.normalizeBuySellFromInputMint; } });
74
81
  var account_pubkey_cache_js_1 = require("./core/account_pubkey_cache.js");
75
82
  Object.defineProperty(exports, "AccountPubkeyCache", { enumerable: true, get: function () { return account_pubkey_cache_js_1.AccountPubkeyCache; } });
76
83
  Object.defineProperty(exports, "buildAccountPubkeysWithCache", { enumerable: true, get: function () { return account_pubkey_cache_js_1.buildAccountPubkeysWithCache; } });
@@ -125,12 +132,14 @@ Object.defineProperty(exports, "eventTypeFilterExclude", { enumerable: true, get
125
132
  Object.defineProperty(exports, "eventTypeFilterIncludesPumpfun", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesPumpfun; } });
126
133
  Object.defineProperty(exports, "eventTypeFilterIncludesPumpswap", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesPumpswap; } });
127
134
  Object.defineProperty(exports, "eventTypeFilterIncludesMeteoraDammV2", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesMeteoraDammV2; } });
135
+ Object.defineProperty(exports, "eventTypeFilterIncludesMeteoraDbc", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesMeteoraDbc; } });
136
+ Object.defineProperty(exports, "eventTypeFilterIncludesMeteoraPools", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesMeteoraPools; } });
137
+ Object.defineProperty(exports, "eventTypeFilterIncludesMeteoraDlmm", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesMeteoraDlmm; } });
128
138
  Object.defineProperty(exports, "eventTypeFilterIncludesRaydiumClmm", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesRaydiumClmm; } });
129
139
  Object.defineProperty(exports, "eventTypeFilterIncludesRaydiumCpmm", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesRaydiumCpmm; } });
130
140
  Object.defineProperty(exports, "eventTypeFilterIncludesRaydiumAmmV4", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesRaydiumAmmV4; } });
131
141
  Object.defineProperty(exports, "eventTypeFilterIncludesOrcaWhirlpool", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesOrcaWhirlpool; } });
132
- Object.defineProperty(exports, "eventTypeFilterIncludesBonk", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesBonk; } });
133
- Object.defineProperty(exports, "eventTypeFilterIncludesRaydiumLaunchpad", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesRaydiumLaunchpad; } });
142
+ Object.defineProperty(exports, "eventTypeFilterIncludesRaydiumLaunchlab", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesRaydiumLaunchlab; } });
134
143
  Object.defineProperty(exports, "eventTypeFilterIncludesPumpFees", { enumerable: true, get: function () { return types_js_1.eventTypeFilterIncludesPumpFees; } });
135
144
  Object.defineProperty(exports, "eventTypeFilterAllowsInstructionParsing", { enumerable: true, get: function () { return types_js_1.eventTypeFilterAllowsInstructionParsing; } });
136
145
  Object.defineProperty(exports, "ALL_EVENT_TYPES", { enumerable: true, get: function () { return types_js_1.ALL_EVENT_TYPES; } });
@@ -142,7 +151,7 @@ Object.defineProperty(exports, "PUMPFUN_PROGRAM_ID", { enumerable: true, get: fu
142
151
  Object.defineProperty(exports, "PUMPSWAP_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.PUMPSWAP_PROGRAM_ID; } });
143
152
  Object.defineProperty(exports, "PUMPSWAP_FEES_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.PUMPSWAP_FEES_PROGRAM_ID; } });
144
153
  Object.defineProperty(exports, "PUMP_FEES_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.PUMP_FEES_PROGRAM_ID; } });
145
- Object.defineProperty(exports, "BONK_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.BONK_PROGRAM_ID; } });
154
+ Object.defineProperty(exports, "RAYDIUM_LAUNCHLAB_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.RAYDIUM_LAUNCHLAB_PROGRAM_ID; } });
146
155
  Object.defineProperty(exports, "RAYDIUM_CPMM_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.RAYDIUM_CPMM_PROGRAM_ID; } });
147
156
  Object.defineProperty(exports, "RAYDIUM_CLMM_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.RAYDIUM_CLMM_PROGRAM_ID; } });
148
157
  Object.defineProperty(exports, "RAYDIUM_AMM_V4_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.RAYDIUM_AMM_V4_PROGRAM_ID; } });
@@ -150,6 +159,7 @@ Object.defineProperty(exports, "ORCA_WHIRLPOOL_PROGRAM_ID", { enumerable: true,
150
159
  Object.defineProperty(exports, "METEORA_POOLS_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.METEORA_POOLS_PROGRAM_ID; } });
151
160
  Object.defineProperty(exports, "METEORA_DAMM_V2_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.METEORA_DAMM_V2_PROGRAM_ID; } });
152
161
  Object.defineProperty(exports, "METEORA_DLMM_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.METEORA_DLMM_PROGRAM_ID; } });
162
+ Object.defineProperty(exports, "METEORA_DBC_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.METEORA_DBC_PROGRAM_ID; } });
153
163
  Object.defineProperty(exports, "getProgramIdsForProtocols", { enumerable: true, get: function () { return program_ids_js_1.getProgramIdsForProtocols; } });
154
164
  Object.defineProperty(exports, "transactionFilterForProtocols", { enumerable: true, get: function () { return program_ids_js_1.transactionFilterForProtocols; } });
155
165
  Object.defineProperty(exports, "accountFilterForProtocols", { enumerable: true, get: function () { return program_ids_js_1.accountFilterForProtocols; } });
@@ -239,6 +249,8 @@ Object.defineProperty(exports, "parseInstructionUnified", { enumerable: true, ge
239
249
  Object.defineProperty(exports, "parsePumpfunInstruction", { enumerable: true, get: function () { return mod_js_2.parsePumpfunInstruction; } });
240
250
  Object.defineProperty(exports, "parsePumpswapInstruction", { enumerable: true, get: function () { return mod_js_2.parsePumpswapInstruction; } });
241
251
  Object.defineProperty(exports, "parseMeteoraDammInstruction", { enumerable: true, get: function () { return mod_js_2.parseMeteoraDammInstruction; } });
252
+ Object.defineProperty(exports, "parseMeteoraDlmmInstruction", { enumerable: true, get: function () { return mod_js_2.parseMeteoraDlmmInstruction; } });
253
+ Object.defineProperty(exports, "parseMeteoraPoolsInstruction", { enumerable: true, get: function () { return mod_js_2.parseMeteoraPoolsInstruction; } });
242
254
  Object.defineProperty(exports, "parsePumpFeesInstruction", { enumerable: true, get: function () { return mod_js_2.parsePumpFeesInstruction; } });
243
255
  /** Rust `instr` 根模块蛇形命名别名 */
244
256
  var rust_aliases_js_3 = require("./instr/rust_aliases.js");
@@ -246,6 +258,8 @@ Object.defineProperty(exports, "parse_instruction_unified", { enumerable: true,
246
258
  Object.defineProperty(exports, "parse_pumpfun_instruction", { enumerable: true, get: function () { return rust_aliases_js_3.parse_pumpfun_instruction; } });
247
259
  Object.defineProperty(exports, "parse_pumpswap_instruction", { enumerable: true, get: function () { return rust_aliases_js_3.parse_pumpswap_instruction; } });
248
260
  Object.defineProperty(exports, "parse_meteora_damm_instruction", { enumerable: true, get: function () { return rust_aliases_js_3.parse_meteora_damm_instruction; } });
261
+ Object.defineProperty(exports, "parse_meteora_dlmm_instruction", { enumerable: true, get: function () { return rust_aliases_js_3.parse_meteora_dlmm_instruction; } });
262
+ Object.defineProperty(exports, "parse_meteora_pools_instruction", { enumerable: true, get: function () { return rust_aliases_js_3.parse_meteora_pools_instruction; } });
249
263
  Object.defineProperty(exports, "parse_pump_fees_instruction", { enumerable: true, get: function () { return rust_aliases_js_3.parse_pump_fees_instruction; } });
250
264
  exports.programIds = __importStar(require("./instr/program_ids.js"));
251
265
  var client_js_1 = require("./grpc/client.js");
@@ -154,11 +154,14 @@ function parseOuterRemoveAllLiquidityIx(instructionData, accounts, meta) {
154
154
  const token_a_amount_threshold = (0, utils_js_1.readU64LE)(instructionData, 8) ?? 0n;
155
155
  const token_b_amount_threshold = (0, utils_js_1.readU64LE)(instructionData, 16) ?? 0n;
156
156
  return {
157
- MeteoraDammV2RemoveAllLiquidity: {
157
+ MeteoraDammV2RemoveLiquidity: {
158
158
  metadata: meta,
159
159
  pool: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
160
160
  position: (0, utils_js_1.getAccount)(accounts, 2) ?? Z,
161
161
  owner: (0, utils_js_1.getAccount)(accounts, 10) ?? Z,
162
+ token_a_amount: 0n,
163
+ token_b_amount: 0n,
164
+ liquidity_delta: 0n,
162
165
  token_a_amount_threshold,
163
166
  token_b_amount_threshold,
164
167
  },
@@ -0,0 +1,2 @@
1
+ import type { DexEvent } from "../core/dex_event.js";
2
+ export declare function parseMeteoraDlmmInstruction(instructionData: Uint8Array, accounts: string[], signature: string, slot: number, txIndex: number, blockTimeUs: number | undefined, grpcRecvUs: number): DexEvent | null;
@@ -0,0 +1,134 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseMeteoraDlmmInstruction = parseMeteoraDlmmInstruction;
4
+ const dex_event_js_1 = require("../core/dex_event.js");
5
+ const binary_js_1 = require("../util/binary.js");
6
+ const utils_js_1 = require("./utils.js");
7
+ const Z = (0, dex_event_js_1.defaultPubkey)();
8
+ function parseMeteoraDlmmInstruction(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs) {
9
+ if (instructionData.length === 0)
10
+ return null;
11
+ const pool = (0, utils_js_1.getAccount)(accounts, 0);
12
+ if (!pool)
13
+ return null;
14
+ const metadata = (0, utils_js_1.ixMeta)(signature, slot, txIndex, blockTimeUs, grpcRecvUs);
15
+ const kind = instructionData[0];
16
+ if (kind === 0) {
17
+ if (instructionData.length < 1 + 4 + 2)
18
+ return null;
19
+ const active_bin_id = (0, binary_js_1.readI32LE)(instructionData, 1);
20
+ const bin_step = (0, binary_js_1.readU16LE)(instructionData, 5);
21
+ if (active_bin_id === null || bin_step === null)
22
+ return null;
23
+ return {
24
+ MeteoraDlmmInitializePool: {
25
+ metadata,
26
+ pool,
27
+ creator: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
28
+ active_bin_id,
29
+ bin_step,
30
+ },
31
+ };
32
+ }
33
+ if (kind === 1) {
34
+ if (instructionData.length < 1 + 8)
35
+ return null;
36
+ return {
37
+ MeteoraDlmmInitializeBinArray: {
38
+ metadata,
39
+ pool,
40
+ bin_array: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
41
+ index: (0, binary_js_1.readU64LE)(instructionData, 1) ?? 0n,
42
+ },
43
+ };
44
+ }
45
+ if (kind === 2) {
46
+ if (instructionData.length < 1 + 32)
47
+ return null;
48
+ return {
49
+ MeteoraDlmmAddLiquidity: {
50
+ metadata,
51
+ pool,
52
+ from: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
53
+ position: (0, utils_js_1.getAccount)(accounts, 2) ?? Z,
54
+ amounts: [0n, 0n],
55
+ active_bin_id: 0,
56
+ },
57
+ };
58
+ }
59
+ if (kind === 7) {
60
+ if (instructionData.length < 1 + 32)
61
+ return null;
62
+ return {
63
+ MeteoraDlmmRemoveLiquidity: {
64
+ metadata,
65
+ pool,
66
+ from: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
67
+ position: (0, utils_js_1.getAccount)(accounts, 2) ?? Z,
68
+ amounts: [0n, 0n],
69
+ active_bin_id: 0,
70
+ },
71
+ };
72
+ }
73
+ if (kind === 8) {
74
+ if (instructionData.length < 1 + 4 + 4)
75
+ return null;
76
+ const lower_bin_id = (0, binary_js_1.readI32LE)(instructionData, 1);
77
+ const width = (0, binary_js_1.readU32LE)(instructionData, 5);
78
+ if (lower_bin_id === null || width === null)
79
+ return null;
80
+ return {
81
+ MeteoraDlmmCreatePosition: {
82
+ metadata,
83
+ pool,
84
+ position: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
85
+ owner: (0, utils_js_1.getAccount)(accounts, 2) ?? Z,
86
+ lower_bin_id,
87
+ width,
88
+ },
89
+ };
90
+ }
91
+ if (kind === 11) {
92
+ if (instructionData.length < 1 + 8 + 8)
93
+ return null;
94
+ return {
95
+ MeteoraDlmmSwap: {
96
+ metadata,
97
+ pool,
98
+ from: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
99
+ start_bin_id: 0,
100
+ end_bin_id: 0,
101
+ amount_in: (0, binary_js_1.readU64LE)(instructionData, 1) ?? 0n,
102
+ amount_out: 0n,
103
+ swap_for_y: false,
104
+ fee: 0n,
105
+ protocol_fee: 0n,
106
+ fee_bps: 0n,
107
+ host_fee: 0n,
108
+ },
109
+ };
110
+ }
111
+ if (kind === 13) {
112
+ return {
113
+ MeteoraDlmmClaimFee: {
114
+ metadata,
115
+ pool,
116
+ position: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
117
+ owner: (0, utils_js_1.getAccount)(accounts, 2) ?? Z,
118
+ fee_x: 0n,
119
+ fee_y: 0n,
120
+ },
121
+ };
122
+ }
123
+ if (kind === 14) {
124
+ return {
125
+ MeteoraDlmmClosePosition: {
126
+ metadata,
127
+ pool,
128
+ position: (0, utils_js_1.getAccount)(accounts, 1) ?? Z,
129
+ owner: (0, utils_js_1.getAccount)(accounts, 2) ?? Z,
130
+ },
131
+ };
132
+ }
133
+ return null;
134
+ }
@@ -0,0 +1,2 @@
1
+ import type { DexEvent } from "../core/dex_event.js";
2
+ export declare function parseMeteoraPoolsInstruction(instructionData: Uint8Array, accounts: string[], signature: string, slot: number, txIndex: number, blockTimeUs: number | undefined, grpcRecvUs: number): DexEvent | null;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseMeteoraPoolsInstruction = parseMeteoraPoolsInstruction;
4
+ const dex_event_js_1 = require("../core/dex_event.js");
5
+ const binary_js_1 = require("../util/binary.js");
6
+ const program_log_discriminators_js_1 = require("../logs/program_log_discriminators.js");
7
+ const utils_js_1 = require("./utils.js");
8
+ const Z = (0, dex_event_js_1.defaultPubkey)();
9
+ const DISC = {
10
+ SWAP: (0, program_log_discriminators_js_1.u64leDiscriminator)([248, 198, 158, 145, 225, 117, 135, 200]),
11
+ ADD_LIQUIDITY: (0, program_log_discriminators_js_1.u64leDiscriminator)([181, 157, 89, 67, 143, 182, 52, 72]),
12
+ REMOVE_LIQUIDITY: (0, program_log_discriminators_js_1.u64leDiscriminator)([80, 85, 209, 72, 24, 206, 177, 108]),
13
+ CREATE_POOL: (0, program_log_discriminators_js_1.u64leDiscriminator)([95, 180, 10, 172, 84, 174, 232, 40]),
14
+ };
15
+ function discEq(data, disc) {
16
+ if (data.length < 8)
17
+ return false;
18
+ return (0, binary_js_1.readU64LE)(data, 0) === disc;
19
+ }
20
+ function parseMeteoraPoolsInstruction(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs) {
21
+ if (instructionData.length < 8)
22
+ return null;
23
+ const metadata = (0, utils_js_1.ixMeta)(signature, slot, txIndex, blockTimeUs, grpcRecvUs);
24
+ const pool = (0, utils_js_1.getAccount)(accounts, 0);
25
+ if (discEq(instructionData, DISC.SWAP)) {
26
+ if (!pool || instructionData.length < 24)
27
+ return null;
28
+ return {
29
+ MeteoraPoolsSwap: {
30
+ metadata,
31
+ in_amount: (0, binary_js_1.readU64LE)(instructionData, 8) ?? 0n,
32
+ out_amount: (0, binary_js_1.readU64LE)(instructionData, 16) ?? 0n,
33
+ trade_fee: 0n,
34
+ admin_fee: 0n,
35
+ host_fee: 0n,
36
+ },
37
+ };
38
+ }
39
+ if (discEq(instructionData, DISC.ADD_LIQUIDITY)) {
40
+ if (!pool || instructionData.length < 32)
41
+ return null;
42
+ return {
43
+ MeteoraPoolsAddLiquidity: {
44
+ metadata,
45
+ lp_mint_amount: (0, binary_js_1.readU64LE)(instructionData, 8) ?? 0n,
46
+ token_a_amount: (0, binary_js_1.readU64LE)(instructionData, 16) ?? 0n,
47
+ token_b_amount: (0, binary_js_1.readU64LE)(instructionData, 24) ?? 0n,
48
+ },
49
+ };
50
+ }
51
+ if (discEq(instructionData, DISC.REMOVE_LIQUIDITY)) {
52
+ if (!pool || instructionData.length < 32)
53
+ return null;
54
+ return {
55
+ MeteoraPoolsRemoveLiquidity: {
56
+ metadata,
57
+ lp_unmint_amount: (0, binary_js_1.readU64LE)(instructionData, 8) ?? 0n,
58
+ token_a_out_amount: (0, binary_js_1.readU64LE)(instructionData, 16) ?? 0n,
59
+ token_b_out_amount: (0, binary_js_1.readU64LE)(instructionData, 24) ?? 0n,
60
+ },
61
+ };
62
+ }
63
+ if (discEq(instructionData, DISC.CREATE_POOL)) {
64
+ if (instructionData.length < 8 + 1 + 6 * 8 || accounts.length <= 9)
65
+ return null;
66
+ return {
67
+ MeteoraPoolsPoolCreated: {
68
+ metadata,
69
+ lp_mint: (0, utils_js_1.getAccount)(accounts, 4) ?? Z,
70
+ token_a_mint: (0, utils_js_1.getAccount)(accounts, 8) ?? Z,
71
+ token_b_mint: (0, utils_js_1.getAccount)(accounts, 9) ?? Z,
72
+ pool_type: (0, binary_js_1.readU8)(instructionData, 8) ?? 0,
73
+ pool: pool ?? Z,
74
+ },
75
+ };
76
+ }
77
+ return null;
78
+ }
@@ -6,11 +6,13 @@ import type { EventTypeFilter } from "../grpc/types.js";
6
6
  export { parsePumpfunInstruction } from "./pumpfun_ix.js";
7
7
  export { parsePumpswapInstruction } from "./pumpswap_ix.js";
8
8
  export { parseMeteoraDammInstruction } from "./meteora_damm_ix.js";
9
+ export { parseMeteoraDlmmInstruction } from "./meteora_dlmm_ix.js";
10
+ export { parseMeteoraPoolsInstruction } from "./meteora_pools_ix.js";
9
11
  export { parseRaydiumClmmInstruction } from "./raydium_clmm_ix.js";
10
12
  export { parseRaydiumCpmmInstruction } from "./raydium_cpmm_ix.js";
11
13
  export { parseRaydiumAmmV4Instruction } from "./raydium_amm_v4_ix.js";
12
14
  export { parseOrcaWhirlpoolInstruction } from "./orca_whirlpool_ix.js";
13
- export { parseBonkInstruction } from "./bonk_ix.js";
15
+ export { parseRaydiumLaunchlabInstruction } from "./raydium_launchlab_ix.js";
14
16
  export { parsePumpFeesInstruction } from "./pump_fees_ix.js";
15
17
  export * from "./program_ids.js";
16
18
  export declare function parseInstructionUnified(instructionData: Uint8Array, accounts: string[], signature: string, slot: number, txIndex: number, blockTimeUs: number | undefined, grpcRecvUs: number, eventTypeFilter: EventTypeFilter | undefined, programId: string): DexEvent | null;
package/dist/instr/mod.js CHANGED
@@ -14,23 +14,23 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.parsePumpFeesInstruction = exports.parseBonkInstruction = exports.parseOrcaWhirlpoolInstruction = exports.parseRaydiumAmmV4Instruction = exports.parseRaydiumCpmmInstruction = exports.parseRaydiumClmmInstruction = exports.parseMeteoraDammInstruction = exports.parsePumpswapInstruction = exports.parsePumpfunInstruction = void 0;
17
+ exports.parsePumpFeesInstruction = exports.parseRaydiumLaunchlabInstruction = exports.parseOrcaWhirlpoolInstruction = exports.parseRaydiumAmmV4Instruction = exports.parseRaydiumCpmmInstruction = exports.parseRaydiumClmmInstruction = exports.parseMeteoraPoolsInstruction = exports.parseMeteoraDlmmInstruction = exports.parseMeteoraDammInstruction = exports.parsePumpswapInstruction = exports.parsePumpfunInstruction = void 0;
18
18
  exports.parseInstructionUnified = parseInstructionUnified;
19
19
  const types_js_1 = require("../grpc/types.js");
20
20
  const program_ids_js_1 = require("./program_ids.js");
21
21
  const pumpfun_ix_js_1 = require("./pumpfun_ix.js");
22
22
  const pumpswap_ix_js_1 = require("./pumpswap_ix.js");
23
23
  const meteora_damm_ix_js_1 = require("./meteora_damm_ix.js");
24
+ const meteora_dlmm_ix_js_1 = require("./meteora_dlmm_ix.js");
25
+ const meteora_pools_ix_js_1 = require("./meteora_pools_ix.js");
24
26
  const raydium_clmm_ix_js_1 = require("./raydium_clmm_ix.js");
25
27
  const raydium_cpmm_ix_js_1 = require("./raydium_cpmm_ix.js");
26
28
  const raydium_amm_v4_ix_js_1 = require("./raydium_amm_v4_ix.js");
27
29
  const orca_whirlpool_ix_js_1 = require("./orca_whirlpool_ix.js");
28
- const bonk_ix_js_1 = require("./bonk_ix.js");
30
+ const raydium_launchlab_ix_js_1 = require("./raydium_launchlab_ix.js");
29
31
  const pump_fees_ix_js_1 = require("./pump_fees_ix.js");
30
- function isBonkProgram(programId) {
31
- return (programId === program_ids_js_1.BONK_PROGRAM_ID ||
32
- programId === program_ids_js_1.BONK_LAUNCHPAD_PROGRAM_ID ||
33
- programId === program_ids_js_1.BONK_PROGRAM_ID_LEGACY);
32
+ function isRaydiumLaunchlabProgram(programId) {
33
+ return programId === program_ids_js_1.RAYDIUM_LAUNCHLAB_PROGRAM_ID;
34
34
  }
35
35
  var pumpfun_ix_js_2 = require("./pumpfun_ix.js");
36
36
  Object.defineProperty(exports, "parsePumpfunInstruction", { enumerable: true, get: function () { return pumpfun_ix_js_2.parsePumpfunInstruction; } });
@@ -38,6 +38,10 @@ var pumpswap_ix_js_2 = require("./pumpswap_ix.js");
38
38
  Object.defineProperty(exports, "parsePumpswapInstruction", { enumerable: true, get: function () { return pumpswap_ix_js_2.parsePumpswapInstruction; } });
39
39
  var meteora_damm_ix_js_2 = require("./meteora_damm_ix.js");
40
40
  Object.defineProperty(exports, "parseMeteoraDammInstruction", { enumerable: true, get: function () { return meteora_damm_ix_js_2.parseMeteoraDammInstruction; } });
41
+ var meteora_dlmm_ix_js_2 = require("./meteora_dlmm_ix.js");
42
+ Object.defineProperty(exports, "parseMeteoraDlmmInstruction", { enumerable: true, get: function () { return meteora_dlmm_ix_js_2.parseMeteoraDlmmInstruction; } });
43
+ var meteora_pools_ix_js_2 = require("./meteora_pools_ix.js");
44
+ Object.defineProperty(exports, "parseMeteoraPoolsInstruction", { enumerable: true, get: function () { return meteora_pools_ix_js_2.parseMeteoraPoolsInstruction; } });
41
45
  var raydium_clmm_ix_js_2 = require("./raydium_clmm_ix.js");
42
46
  Object.defineProperty(exports, "parseRaydiumClmmInstruction", { enumerable: true, get: function () { return raydium_clmm_ix_js_2.parseRaydiumClmmInstruction; } });
43
47
  var raydium_cpmm_ix_js_2 = require("./raydium_cpmm_ix.js");
@@ -46,11 +50,16 @@ var raydium_amm_v4_ix_js_2 = require("./raydium_amm_v4_ix.js");
46
50
  Object.defineProperty(exports, "parseRaydiumAmmV4Instruction", { enumerable: true, get: function () { return raydium_amm_v4_ix_js_2.parseRaydiumAmmV4Instruction; } });
47
51
  var orca_whirlpool_ix_js_2 = require("./orca_whirlpool_ix.js");
48
52
  Object.defineProperty(exports, "parseOrcaWhirlpoolInstruction", { enumerable: true, get: function () { return orca_whirlpool_ix_js_2.parseOrcaWhirlpoolInstruction; } });
49
- var bonk_ix_js_2 = require("./bonk_ix.js");
50
- Object.defineProperty(exports, "parseBonkInstruction", { enumerable: true, get: function () { return bonk_ix_js_2.parseBonkInstruction; } });
53
+ var raydium_launchlab_ix_js_2 = require("./raydium_launchlab_ix.js");
54
+ Object.defineProperty(exports, "parseRaydiumLaunchlabInstruction", { enumerable: true, get: function () { return raydium_launchlab_ix_js_2.parseRaydiumLaunchlabInstruction; } });
51
55
  var pump_fees_ix_js_2 = require("./pump_fees_ix.js");
52
56
  Object.defineProperty(exports, "parsePumpFeesInstruction", { enumerable: true, get: function () { return pump_fees_ix_js_2.parsePumpFeesInstruction; } });
53
57
  __exportStar(require("./program_ids.js"), exports);
58
+ function filterParsedEvent(ev, eventTypeFilter) {
59
+ if (!ev || !eventTypeFilter)
60
+ return ev;
61
+ return (0, types_js_1.eventTypeFilterShouldIncludeDexEvent)(eventTypeFilter, ev) ? ev : null;
62
+ }
54
63
  function parseInstructionUnified(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs, eventTypeFilter, programId) {
55
64
  if (instructionData.length === 0)
56
65
  return null;
@@ -62,47 +71,57 @@ function parseInstructionUnified(instructionData, accounts, signature, slot, txI
62
71
  if (programId === program_ids_js_1.PUMPFUN_PROGRAM_ID) {
63
72
  if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesPumpfun)(eventTypeFilter))
64
73
  return null;
65
- return (0, pumpfun_ix_js_1.parsePumpfunInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs);
74
+ return filterParsedEvent((0, pumpfun_ix_js_1.parsePumpfunInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
66
75
  }
67
76
  if (programId === program_ids_js_1.PUMPSWAP_PROGRAM_ID) {
68
77
  if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesPumpswap)(eventTypeFilter))
69
78
  return null;
70
- return (0, pumpswap_ix_js_1.parsePumpswapInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs);
79
+ return filterParsedEvent((0, pumpswap_ix_js_1.parsePumpswapInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
71
80
  }
72
81
  if (programId === program_ids_js_1.METEORA_DAMM_V2_PROGRAM_ID) {
73
82
  if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesMeteoraDammV2)(eventTypeFilter))
74
83
  return null;
75
- return (0, meteora_damm_ix_js_1.parseMeteoraDammInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs);
84
+ return filterParsedEvent((0, meteora_damm_ix_js_1.parseMeteoraDammInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
85
+ }
86
+ if (programId === program_ids_js_1.METEORA_POOLS_PROGRAM_ID) {
87
+ if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesMeteoraPools)(eventTypeFilter))
88
+ return null;
89
+ return filterParsedEvent((0, meteora_pools_ix_js_1.parseMeteoraPoolsInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
90
+ }
91
+ if (programId === program_ids_js_1.METEORA_DLMM_PROGRAM_ID) {
92
+ if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesMeteoraDlmm)(eventTypeFilter))
93
+ return null;
94
+ return filterParsedEvent((0, meteora_dlmm_ix_js_1.parseMeteoraDlmmInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
76
95
  }
77
96
  if (programId === program_ids_js_1.PUMP_FEES_PROGRAM_ID) {
78
97
  if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesPumpFees)(eventTypeFilter))
79
98
  return null;
80
- return (0, pump_fees_ix_js_1.parsePumpFeesInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs);
99
+ return filterParsedEvent((0, pump_fees_ix_js_1.parsePumpFeesInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
81
100
  }
82
101
  if (programId === program_ids_js_1.RAYDIUM_CLMM_PROGRAM_ID) {
83
102
  if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesRaydiumClmm)(eventTypeFilter))
84
103
  return null;
85
- return (0, raydium_clmm_ix_js_1.parseRaydiumClmmInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs);
104
+ return filterParsedEvent((0, raydium_clmm_ix_js_1.parseRaydiumClmmInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
86
105
  }
87
106
  if (programId === program_ids_js_1.RAYDIUM_CPMM_PROGRAM_ID) {
88
107
  if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesRaydiumCpmm)(eventTypeFilter))
89
108
  return null;
90
- return (0, raydium_cpmm_ix_js_1.parseRaydiumCpmmInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs);
109
+ return filterParsedEvent((0, raydium_cpmm_ix_js_1.parseRaydiumCpmmInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
91
110
  }
92
111
  if (programId === program_ids_js_1.RAYDIUM_AMM_V4_PROGRAM_ID) {
93
112
  if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesRaydiumAmmV4)(eventTypeFilter))
94
113
  return null;
95
- return (0, raydium_amm_v4_ix_js_1.parseRaydiumAmmV4Instruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs);
114
+ return filterParsedEvent((0, raydium_amm_v4_ix_js_1.parseRaydiumAmmV4Instruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
96
115
  }
97
116
  if (programId === program_ids_js_1.ORCA_WHIRLPOOL_PROGRAM_ID) {
98
117
  if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesOrcaWhirlpool)(eventTypeFilter))
99
118
  return null;
100
- return (0, orca_whirlpool_ix_js_1.parseOrcaWhirlpoolInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs);
119
+ return filterParsedEvent((0, orca_whirlpool_ix_js_1.parseOrcaWhirlpoolInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
101
120
  }
102
- if (isBonkProgram(programId)) {
103
- if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesBonk)(eventTypeFilter))
121
+ if (isRaydiumLaunchlabProgram(programId)) {
122
+ if (eventTypeFilter && !(0, types_js_1.eventTypeFilterIncludesRaydiumLaunchlab)(eventTypeFilter))
104
123
  return null;
105
- return (0, bonk_ix_js_1.parseBonkInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs);
124
+ return filterParsedEvent((0, raydium_launchlab_ix_js_1.parseRaydiumLaunchlabInstruction)(instructionData, accounts, signature, slot, txIndex, blockTimeUs, grpcRecvUs), eventTypeFilter);
106
125
  }
107
126
  return null;
108
127
  }
@@ -1,8 +1,4 @@
1
1
  /**
2
2
  * 各 DEX 程序 ID(Base58)。与 Rust 对齐的常量来自 `grpc/program_ids.ts`。
3
3
  */
4
- export { PUMPFUN_PROGRAM_ID, PUMPSWAP_PROGRAM_ID, PUMPSWAP_FEES_PROGRAM_ID, PUMP_FEES_PROGRAM_ID, BONK_PROGRAM_ID, RAYDIUM_CPMM_PROGRAM_ID, RAYDIUM_CLMM_PROGRAM_ID, RAYDIUM_AMM_V4_PROGRAM_ID, ORCA_WHIRLPOOL_PROGRAM_ID, METEORA_POOLS_PROGRAM_ID, METEORA_DAMM_V2_PROGRAM_ID, METEORA_DLMM_PROGRAM_ID, } from "../grpc/program_ids.js";
5
- /** Launchpad 等场景使用的程序 ID(非 Rust `Protocol` 映射项) */
6
- export declare const BONK_LAUNCHPAD_PROGRAM_ID = "LanCh3hDdY7M6x8urBSLJhsQBgPNGKHNqJqGwzAEmBm";
7
- /** 旧版 TS 包中的 Bonk ID,仅作兼容保留 */
8
- export declare const BONK_PROGRAM_ID_LEGACY = "DjVE6JNiYqPL2QXyCUUh8rNjHrbz9hXHNYt99MQ59qw1";
4
+ export { PUMPFUN_PROGRAM_ID, PUMPSWAP_PROGRAM_ID, PUMPSWAP_FEES_PROGRAM_ID, PUMP_FEES_PROGRAM_ID, RAYDIUM_LAUNCHLAB_PROGRAM_ID, RAYDIUM_CPMM_PROGRAM_ID, RAYDIUM_CLMM_PROGRAM_ID, RAYDIUM_AMM_V4_PROGRAM_ID, ORCA_WHIRLPOOL_PROGRAM_ID, METEORA_POOLS_PROGRAM_ID, METEORA_DAMM_V2_PROGRAM_ID, METEORA_DLMM_PROGRAM_ID, METEORA_DBC_PROGRAM_ID, } from "../grpc/program_ids.js";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BONK_PROGRAM_ID_LEGACY = exports.BONK_LAUNCHPAD_PROGRAM_ID = exports.METEORA_DLMM_PROGRAM_ID = exports.METEORA_DAMM_V2_PROGRAM_ID = exports.METEORA_POOLS_PROGRAM_ID = exports.ORCA_WHIRLPOOL_PROGRAM_ID = exports.RAYDIUM_AMM_V4_PROGRAM_ID = exports.RAYDIUM_CLMM_PROGRAM_ID = exports.RAYDIUM_CPMM_PROGRAM_ID = exports.BONK_PROGRAM_ID = exports.PUMP_FEES_PROGRAM_ID = exports.PUMPSWAP_FEES_PROGRAM_ID = exports.PUMPSWAP_PROGRAM_ID = exports.PUMPFUN_PROGRAM_ID = void 0;
3
+ exports.METEORA_DBC_PROGRAM_ID = exports.METEORA_DLMM_PROGRAM_ID = exports.METEORA_DAMM_V2_PROGRAM_ID = exports.METEORA_POOLS_PROGRAM_ID = exports.ORCA_WHIRLPOOL_PROGRAM_ID = exports.RAYDIUM_AMM_V4_PROGRAM_ID = exports.RAYDIUM_CLMM_PROGRAM_ID = exports.RAYDIUM_CPMM_PROGRAM_ID = exports.RAYDIUM_LAUNCHLAB_PROGRAM_ID = exports.PUMP_FEES_PROGRAM_ID = exports.PUMPSWAP_FEES_PROGRAM_ID = exports.PUMPSWAP_PROGRAM_ID = exports.PUMPFUN_PROGRAM_ID = void 0;
4
4
  /**
5
5
  * 各 DEX 程序 ID(Base58)。与 Rust 对齐的常量来自 `grpc/program_ids.ts`。
6
6
  */
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "PUMPFUN_PROGRAM_ID", { enumerable: true, get: fu
9
9
  Object.defineProperty(exports, "PUMPSWAP_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.PUMPSWAP_PROGRAM_ID; } });
10
10
  Object.defineProperty(exports, "PUMPSWAP_FEES_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.PUMPSWAP_FEES_PROGRAM_ID; } });
11
11
  Object.defineProperty(exports, "PUMP_FEES_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.PUMP_FEES_PROGRAM_ID; } });
12
- Object.defineProperty(exports, "BONK_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.BONK_PROGRAM_ID; } });
12
+ Object.defineProperty(exports, "RAYDIUM_LAUNCHLAB_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.RAYDIUM_LAUNCHLAB_PROGRAM_ID; } });
13
13
  Object.defineProperty(exports, "RAYDIUM_CPMM_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.RAYDIUM_CPMM_PROGRAM_ID; } });
14
14
  Object.defineProperty(exports, "RAYDIUM_CLMM_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.RAYDIUM_CLMM_PROGRAM_ID; } });
15
15
  Object.defineProperty(exports, "RAYDIUM_AMM_V4_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.RAYDIUM_AMM_V4_PROGRAM_ID; } });
@@ -17,7 +17,4 @@ Object.defineProperty(exports, "ORCA_WHIRLPOOL_PROGRAM_ID", { enumerable: true,
17
17
  Object.defineProperty(exports, "METEORA_POOLS_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.METEORA_POOLS_PROGRAM_ID; } });
18
18
  Object.defineProperty(exports, "METEORA_DAMM_V2_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.METEORA_DAMM_V2_PROGRAM_ID; } });
19
19
  Object.defineProperty(exports, "METEORA_DLMM_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.METEORA_DLMM_PROGRAM_ID; } });
20
- /** Launchpad 等场景使用的程序 ID(非 Rust `Protocol` 映射项) */
21
- exports.BONK_LAUNCHPAD_PROGRAM_ID = "LanCh3hDdY7M6x8urBSLJhsQBgPNGKHNqJqGwzAEmBm";
22
- /** 旧版 TS 包中的 Bonk ID,仅作兼容保留 */
23
- exports.BONK_PROGRAM_ID_LEGACY = "DjVE6JNiYqPL2QXyCUUh8rNjHrbz9hXHNYt99MQ59qw1";
20
+ Object.defineProperty(exports, "METEORA_DBC_PROGRAM_ID", { enumerable: true, get: function () { return program_ids_js_1.METEORA_DBC_PROGRAM_ID; } });