Skip to content

Commit

Permalink
chore: modified readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Tee-py committed Sep 7, 2024
1 parent c2eff34 commit bcc8c38
Showing 1 changed file with 29 additions and 5 deletions.
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ npm install git+https://github.com/Tee-py/solana-txn-parser.git

## 👨🏽‍💻 Usage

### PumpFun Parser
### ▶️ PumpFun Parser

```typescript
import { PumpFunParser } from 'solana-txn-parser';
Expand Down Expand Up @@ -44,11 +44,35 @@ const txn = JSON.parse(fs.readFileSync("<file_path>", "utf-8")) as unknown as Pa
const pumpTxn = parser.parse(txn)
```

### Raydium Parser [Comming soon]
#### Output Structure

### Jupiter Parser [Coming soon]
The parser returns a `PumpFunTransaction` object (or an array of `PumpFunTransaction` objects if `parseMultiple` is called):

### Creating Custom Parsers
```typescript
interface PumpFunTransaction extends BaseParsedTransaction<PumpFunAction> {
actions: PumpFunAction[];
}

type TradeInfo = {
solAmount: bigint; // Amount of SOL involved in the trade
tokenAmount: bigint; // Amount of tokens involved in the trade
tokenMint: PublicKey; // Public key of the token mint
traderTokenAccount: PublicKey; // Trader's associated token account
trader: PublicKey; // Public key of the trader
};

interface PumpFunAction extends BaseParsedAction {
info: TradeInfo;
}
```

Each `PumpFunTransaction` contains an array of `PumpFunAction`s, representing the trades made in the transaction. The `TradeInfo` provides detailed information about each trade, including the amounts of SOL and tokens involved, and relevant public keys.

### ▶️ Raydium Parser [Comming soon]

### ▶️ Jupiter Parser [Coming soon]

### ▶️ Creating Custom Parsers

You can create custom parsers for other DeFi platforms by extending the `BaseParser` class:

Expand Down Expand Up @@ -97,6 +121,6 @@ You can check the parser directory for more information on how to implement your

For all contributions, please ensure your code passes all existing tests. You can also help in improving the tests for the existing parsers.

## License
## 🗂️ License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

0 comments on commit bcc8c38

Please sign in to comment.