-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.ts
80 lines (70 loc) · 1.58 KB
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { PublicKey, VersionedTransactionResponse } from "@solana/web3.js";
export type CreateTokenMetadata = {
name: string;
symbol: string;
description: string;
file: Blob;
twitter?: string;
telegram?: string;
website?: string;
};
export type TokenMetadata = {
name: string;
symbol: string;
description: string;
image: string;
showName: boolean;
createdOn: string;
twitter: string;
};
export type CreateEvent = {
name: string;
symbol: string;
uri: string;
mint: PublicKey;
bondingCurve: PublicKey;
user: PublicKey;
};
export type TradeEvent = {
mint: PublicKey;
solAmount: bigint;
tokenAmount: bigint;
isBuy: boolean;
user: PublicKey;
timestamp: number;
virtualSolReserves: bigint;
virtualTokenReserves: bigint;
realSolReserves: bigint;
realTokenReserves: bigint;
};
export type CompleteEvent = {
user: PublicKey;
mint: PublicKey;
bondingCurve: PublicKey;
timestamp: number;
};
export type SetParamsEvent = {
feeRecipient: PublicKey;
initialVirtualTokenReserves: bigint;
initialVirtualSolReserves: bigint;
initialRealTokenReserves: bigint;
tokenTotalSupply: bigint;
feeBasisPoints: bigint;
};
export interface PumpFunEventHandlers {
createEvent: CreateEvent;
tradeEvent: TradeEvent;
completeEvent: CompleteEvent;
setParamsEvent: SetParamsEvent;
}
export type PumpFunEventType = keyof PumpFunEventHandlers;
export type PriorityFee = {
unitLimit: number;
unitPrice: number;
};
export type TransactionResult = {
signature?: string;
error?: unknown;
results?: VersionedTransactionResponse;
success: boolean;
};