@@ -25,10 +25,10 @@ import { formatIdl } from "./convertLegacyIdl";
25
25
*
26
26
* @example
27
27
* ```typescript
28
- * const idl = await getIDlbyPath ("./idl/program.json");
28
+ * const idl = await getIdlByPath ("./idl/program.json");
29
29
* ```
30
30
*/
31
- export async function getIDlbyPath < Idl > ( idlPath : string ) : Promise < Idl > {
31
+ export async function getIdlByPath < Idl > ( idlPath : string ) : Promise < Idl > {
32
32
const fs = await import ( "node:fs" ) ;
33
33
const path = await import ( "node:path" ) ;
34
34
@@ -48,13 +48,13 @@ export async function getIDlbyPath<Idl>(idlPath: string): Promise<Idl> {
48
48
*
49
49
* @example
50
50
* ```typescript
51
- * const idl = await getIDlByProgramId (
51
+ * const idl = await getIdlByProgramId (
52
52
* new PublicKey("Foo1111111111111111111111111111111111111"),
53
53
* connection
54
54
* );
55
55
* ```
56
56
*/
57
- export async function getIDlByProgramId < Idl > (
57
+ export async function getIdlByProgramId < Idl > (
58
58
programId : PublicKey ,
59
59
connection : Connection ,
60
60
) : Promise < Idl > {
@@ -73,7 +73,7 @@ export async function getIDlByProgramId<Idl>(
73
73
/**
74
74
* Fetches and parses an account's data using an Anchor IDL
75
75
*
76
- * @param idl - The Anchor IDL (use getIDlByProgramId or getIDlbyPath to obtain)
76
+ * @param idl - The Anchor IDL (use getIdlByProgramId or getIdlByPath to obtain)
77
77
* @param accountName - The name of the account as defined in the IDL
78
78
* @param accountAddress - The public key of the account to fetch
79
79
* @param connection - Optional connection object (uses default provider if not specified)
@@ -82,7 +82,7 @@ export async function getIDlByProgramId<Idl>(
82
82
*
83
83
* @example
84
84
* ```typescript
85
- * const idl = await getIDlByProgramId (programId, connection);
85
+ * const idl = await getIdlByProgramId (programId, connection);
86
86
* const data = await getIdlParsedAccountData(idl, "counter", accountAddress);
87
87
* ```
88
88
*/
@@ -115,15 +115,15 @@ export async function getIdlParsedAccountData<T = any>(
115
115
/**
116
116
* Parses Anchor events from a transaction
117
117
*
118
- * @param idl - The Anchor IDL (use getIDlByProgramId or getIDlbyPath to obtain)
118
+ * @param idl - The Anchor IDL (use getIdlByProgramId or getIdlByPath to obtain)
119
119
* @param signature - Transaction signature to parse events from
120
120
* @param connection - Connection object (uses default provider if not specified)
121
121
* @param programId - Optional program ID needed for legacy IDLs
122
122
* @returns Array of parsed events with their name and data
123
123
*
124
124
* @example
125
125
* ```typescript
126
- * const idl = await getIDlbyPath ("./idl/program.json");
126
+ * const idl = await getIdlByPath ("./idl/program.json");
127
127
* const events = await parseAnchorTransactionEvents(idl, signature);
128
128
* ```
129
129
*/
@@ -200,15 +200,15 @@ export type DecodedTransaction = {
200
200
/**
201
201
* Decodes all Anchor instructions and their involved accounts in a transaction
202
202
*
203
- * @param idl - The Anchor IDL (use getIDlByProgramId or getIDlbyPath to obtain)
203
+ * @param idl - The Anchor IDL (use getIdlByProgramId or getIdlByPath to obtain)
204
204
* @param signature - Transaction signature to decode
205
205
* @param connection - Optional connection object (uses default provider if not specified)
206
206
* @param programId - Optional program ID needed for legacy IDLs
207
207
* @returns Decoded transaction with instructions and accounts
208
208
*
209
209
* @example
210
210
* ```typescript
211
- * const idl = await getIDlByProgramId (programId, connection);
211
+ * const idl = await getIdlByProgramId (programId, connection);
212
212
* const decoded = await decodeAnchorTransaction(idl, signature);
213
213
* ```
214
214
*/
@@ -275,7 +275,11 @@ export async function decodeAnchorTransaction(
275
275
const accountType = idl . accounts ?. find ( ( acc ) =>
276
276
accountInfo . data
277
277
. slice ( 0 , 8 )
278
- . equals ( accountsCoder . accountDiscriminator ( acc . name . toLowerCase ( ) ) ) ,
278
+ . equals (
279
+ accountsCoder . accountDiscriminator (
280
+ acc . name . toLowerCase ( ) ,
281
+ ) ,
282
+ ) ,
279
283
) ;
280
284
if ( accountType ) {
281
285
accountData = accountsCoder . decode (
0 commit comments