Skip to content

Commit 4cb24b2

Browse files
committed
added core to package exports
1 parent 4f8cc81 commit 4cb24b2

File tree

10 files changed

+126
-120
lines changed

10 files changed

+126
-120
lines changed

src/core/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './base';
2+
export * from './layout';
3+
export * from './utils';

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export * from './parser/pumpfun';
22
export * from './parser/raydium';
3+
export * from './core';

src/parser/pumpfun/layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { struct } from '@solana/buffer-layout';
22
import { CreateEvent, TradeEvent, CompleteEvent } from './types';
3-
import { stringLayout, pubKey, uint64, boolean } from '../../core/layout';
3+
import { stringLayout, pubKey, uint64, boolean } from '../../core';
44

55
export const CREATE_EVENT_LAYOUT = struct<CreateEvent>([
66
stringLayout('name'),

src/parser/pumpfun/parser.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { ParsedTransactionWithMeta, PublicKey } from '@solana/web3.js';
2-
import { BaseParser } from '../../core/base';
32
import {
43
PumpFunTransaction,
54
PumpFunAction,
@@ -8,8 +7,7 @@ import {
87
TRADE_EVENT_SIG,
98
ActionType,
109
} from './types';
11-
import { createAnchorSigHash } from '../../core/utils';
12-
import { anchorLogScanner } from '../../core/utils';
10+
import { BaseParser, createAnchorSigHash, anchorLogScanner } from '../../core';
1311
import { CREATE_EVENT_LAYOUT, COMPLETE_EVENT_LAYOUT, TRADE_EVENT_LAYOUT } from './layout';
1412

1513
export class PumpFunParser implements BaseParser<PumpFunTransaction> {

src/parser/pumpfun/types.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { PublicKey } from '@solana/web3.js';
2-
import { BaseParsedTransaction } from '../../core/base';
3-
import { BaseParsedAction } from '../../core/base';
2+
import { BaseParsedTransaction, BaseParsedAction } from '../../core';
43

54
export const CREATE_EVENT_SIG = 'event:CreateEvent';
65
export const COMPLETE_EVENT_SIG = 'event:CompleteEvent';

src/parser/raydium/v4/layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { struct, u8, blob } from '@solana/buffer-layout';
2-
import { pubKey, uint64, uint128 } from '../../../core/layout';
2+
import { pubKey, uint64, uint128 } from '../../../core';
33
import { InitPool, Deposit, Withdraw, SwapBaseIn, SwapBaseOut, PoolInfo } from './types';
44

55
export const INIT_POOL_LAYOUT = struct<InitPool>([

src/parser/raydium/v4/parser.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { Connection, ParsedTransactionWithMeta, PublicKey } from '@solana/web3.js';
2-
import { AsyncBaseParser } from '../../../core/base';
32
import { LRUCache } from '../../../core/lru';
43
import {
54
ActionType,
@@ -25,7 +24,7 @@ import {
2524
SWAP_BASE_OUT_LAYOUT,
2625
WITHDRAW_LAYOUT,
2726
} from './layout';
28-
import { flattenTransactionInstructions } from '../../../core/utils';
27+
import { AsyncBaseParser, flattenTransactionInstructions } from '../../../core';
2928

3029
export class RaydiumV4Parser implements AsyncBaseParser<RaydiumV4Transaction> {
3130
private poolInfoCache: LRUCache<PoolInfo>;

src/parser/raydium/v4/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { PublicKey } from '@solana/web3.js';
2-
import { BaseParsedAction, BaseParsedTransaction } from '../../../core/base';
2+
import { BaseParsedAction, BaseParsedTransaction } from '../../../core';
33

44
export const RayV4Program = new PublicKey('675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8');
55

tests/core/test.spec.ts

Lines changed: 115 additions & 110 deletions
Large diffs are not rendered by default.

tests/pumpfun/tests.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ParsedTransactionWithMeta } from '@solana/web3.js';
22
import { PumpFunParser } from '../../src';
33
import fs from 'fs';
44
import { CompleteInfo, CreateInfo, TradeInfo } from '../../src/parser/pumpfun/types';
5+
56
describe('PumpFunParser', () => {
67
const buyTransaction = JSON.parse(
78
fs.readFileSync('tests/pumpfun/parsed-buy-txn.json', 'utf-8')

0 commit comments

Comments
 (0)