Skip to content

Commit b21d5c7

Browse files
Copilot0xrinegade
andcommitted
Generate comprehensive IDL for Solana P2P Exchange Program
Co-authored-by: 0xrinegade <[email protected]>
1 parent b2ceb4a commit b21d5c7

File tree

4 files changed

+1783
-0
lines changed

4 files changed

+1783
-0
lines changed

idl/README.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# P2P Exchange Program IDL
2+
3+
This directory contains the Interface Description Language (IDL) files for the Solana P2P Exchange Program.
4+
5+
## Files
6+
7+
- `p2p_exchange.json` - Complete IDL specification for the P2P Exchange program
8+
9+
## Program ID
10+
11+
`FKkTQLgBE9vDZqgXKWrXZfAv5HgCQdsjDZDzPfJosPt9`
12+
13+
## Overview
14+
15+
The IDL defines the complete interface for the P2P Exchange Solana program, including:
16+
17+
### Instructions (21 total)
18+
- **Admin Functions**: `initializeAdmin`, `updateAdminAuthorities`
19+
- **Offer Management**: `createOffer`, `listOffer`, `acceptOffer`, `markFiatSent`, `confirmFiatReceipt`, `releaseSol`
20+
- **Dispute Resolution**: `openDispute`, `assignJurors`, `submitEvidence`, `castVote`, `executeVerdict`
21+
- **Reputation System**: `createReputation`, `updateReputation`
22+
- **Reward System**: `createRewardToken`, `updateRewardToken`, `createUserRewards`, `mintTradeRewards`, `mintVoteRewards`, `claimRewards`
23+
24+
### Account Types (8 total)
25+
- `Admin` - Program administration account
26+
- `EscrowAccount` - SOL escrow for trades
27+
- `Offer` - Trade offer details
28+
- `Dispute` - Dispute resolution data
29+
- `Vote` - Individual juror votes
30+
- `Reputation` - User reputation scores
31+
- `RewardToken` - Reward token configuration
32+
- `UserRewards` - User reward balances
33+
34+
### Events (16 total)
35+
Complete event emission for all major program actions including offer lifecycle, dispute resolution, reputation updates, and reward distribution.
36+
37+
### Error Codes (20 total)
38+
Comprehensive error handling covering all failure scenarios from invalid states to security violations.
39+
40+
## Usage
41+
42+
This IDL can be used with:
43+
- Anchor client libraries
44+
- TypeScript/JavaScript SDKs
45+
- Python clients
46+
- Rust clients
47+
- Any Solana SDK that supports IDL-based program interaction
48+
49+
## Security Features
50+
51+
The program includes enterprise-grade security features:
52+
- Multi-signature admin support
53+
- Input validation and sanitization
54+
- Mathematical overflow protection
55+
- Rate limiting mechanisms
56+
- Escrow balance validation
57+
- Dispute deadlines and expiration handling

0 commit comments

Comments
 (0)