Skip to content

Commit 364578e

Browse files
authored
Remove I prefixes in Kit types (#713)
1 parent b2181b9 commit 364578e

File tree

88 files changed

+1054
-1124
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

88 files changed

+1054
-1124
lines changed

.changeset/olive-candles-hunt.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@codama/renderers-js': minor
3+
'@codama/renderers-vixen-parser': patch
4+
'@codama/nodes-from-anchor': patch
5+
'@codama/renderers-js-umi': patch
6+
'@codama/dynamic-parsers': patch
7+
'@codama/dynamic-codecs': patch
8+
'@codama/renderers-rust': patch
9+
---
10+
11+
Update `@solana/kit` dependencies and remove `I` prefixes in types

packages/dynamic-codecs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
"@codama/errors": "workspace:*",
5454
"@codama/nodes": "workspace:*",
5555
"@codama/visitors-core": "workspace:*",
56-
"@solana/codecs": "2.3.0"
56+
"@solana/codecs": "^2.3.0"
5757
},
5858
"license": "MIT",
5959
"repository": {

packages/dynamic-parsers/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ if (parsedData) {
6363

6464
### `parseInstruction(rootNode, instruction)`
6565

66-
This function accepts a `RootNode` and an `IInstruction` type — as defined in `@solana/instructions` — in order to return a `ParsedData<InstructionNode>` object that also includes an `accounts` array that match each `IAccountMeta` with its corresponding account name.
66+
This function accepts a `RootNode` and an `Instruction` type — as defined in `@solana/instructions` — in order to return a `ParsedData<InstructionNode>` object that also includes an `accounts` array that match each `AccountMeta` with its corresponding account name.
6767

6868
```ts
6969
const parsedData = parseInstruction(rootNode, instruction);
7070

7171
if (parsedData) {
7272
const namedAccounts = parsedData.accounts;
73-
// ^ Array<IAccountMeta & { name: string }>
73+
// ^ Array<AccountMeta & { name: string }>
7474
}
7575
```
7676

packages/dynamic-parsers/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@
5454
"@codama/errors": "workspace:*",
5555
"@codama/nodes": "workspace:*",
5656
"@codama/visitors-core": "workspace:*",
57-
"@solana/instructions": "2.3.0"
57+
"@solana/instructions": "^2.3.0"
5858
},
5959
"devDependencies": {
60-
"@solana/codecs": "2.3.0"
60+
"@solana/codecs": "^2.3.0"
6161
},
6262
"license": "MIT",
6363
"repository": {

packages/dynamic-parsers/src/parsers.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import { getNodeCodec, ReadonlyUint8Array } from '@codama/dynamic-codecs';
22
import { AccountNode, CamelCaseString, GetNodeFromKind, InstructionNode, RootNode } from '@codama/nodes';
33
import { getLastNodeFromPath, NodePath } from '@codama/visitors-core';
44
import type {
5-
IAccountLookupMeta,
6-
IAccountMeta,
7-
IInstruction,
8-
IInstructionWithAccounts,
9-
IInstructionWithData,
5+
AccountLookupMeta,
6+
AccountMeta,
7+
Instruction,
8+
InstructionWithAccounts,
9+
InstructionWithData,
1010
} from '@solana/instructions';
1111

1212
import { identifyData } from './identify';
@@ -42,14 +42,14 @@ export function parseData<TKind extends 'accountNode' | 'instructionNode'>(
4242
return { data, path };
4343
}
4444

45-
type ParsedInstructionAccounts = ReadonlyArray<IAccountMeta & { name: CamelCaseString }>;
45+
type ParsedInstructionAccounts = ReadonlyArray<AccountMeta & { name: CamelCaseString }>;
4646
type ParsedInstruction = ParsedData<InstructionNode> & { accounts: ParsedInstructionAccounts };
4747

4848
export function parseInstruction(
4949
root: RootNode,
50-
instruction: IInstruction &
51-
IInstructionWithAccounts<readonly (IAccountLookupMeta | IAccountMeta)[]> &
52-
IInstructionWithData<Uint8Array>,
50+
instruction: Instruction &
51+
InstructionWithAccounts<readonly (AccountLookupMeta | AccountMeta)[]> &
52+
InstructionWithData<Uint8Array>,
5353
): ParsedInstruction | undefined {
5454
const parsedData = parseInstructionData(root, instruction.data);
5555
if (!parsedData) return undefined;

packages/nodes-from-anchor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"@codama/errors": "workspace:*",
5353
"@codama/nodes": "workspace:*",
5454
"@codama/visitors": "workspace:*",
55-
"@solana/codecs": "2.3.0",
55+
"@solana/codecs": "^2.3.0",
5656
"@noble/hashes": "^1.8.0"
5757
},
5858
"license": "MIT",

packages/renderers-js-umi/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
"@codama/renderers-core": "workspace:*",
4949
"@codama/validators": "workspace:*",
5050
"@codama/visitors-core": "workspace:*",
51-
"@solana/codecs-strings": "rc",
51+
"@solana/codecs-strings": "^2.3.0",
5252
"nunjucks": "^3.2.4",
5353
"prettier": "^3.6.2"
5454
},

packages/renderers-js/e2e/anchor/src/generated/instructions/createGuard.ts

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ import {
2727
getUtf8Decoder,
2828
getUtf8Encoder,
2929
transformEncoder,
30+
type AccountMeta,
31+
type AccountSignerMeta,
3032
type Address,
3133
type Codec,
3234
type Decoder,
3335
type Encoder,
34-
type IAccountMeta,
35-
type IAccountSignerMeta,
36-
type IInstruction,
37-
type IInstructionWithAccounts,
38-
type IInstructionWithData,
36+
type Instruction,
37+
type InstructionWithAccounts,
38+
type InstructionWithData,
3939
type Option,
4040
type OptionOrNullable,
4141
type ReadonlyAccount,
@@ -78,41 +78,41 @@ export function getCreateGuardDiscriminatorBytes() {
7878

7979
export type CreateGuardInstruction<
8080
TProgram extends string = typeof WEN_TRANSFER_GUARD_PROGRAM_ADDRESS,
81-
TAccountGuard extends string | IAccountMeta<string> = string,
82-
TAccountMint extends string | IAccountMeta<string> = string,
83-
TAccountMintTokenAccount extends string | IAccountMeta<string> = string,
84-
TAccountGuardAuthority extends string | IAccountMeta<string> = string,
85-
TAccountPayer extends string | IAccountMeta<string> = string,
81+
TAccountGuard extends string | AccountMeta<string> = string,
82+
TAccountMint extends string | AccountMeta<string> = string,
83+
TAccountMintTokenAccount extends string | AccountMeta<string> = string,
84+
TAccountGuardAuthority extends string | AccountMeta<string> = string,
85+
TAccountPayer extends string | AccountMeta<string> = string,
8686
TAccountAssociatedTokenProgram extends
8787
| string
88-
| IAccountMeta<string> = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
88+
| AccountMeta<string> = 'ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL',
8989
TAccountTokenProgram extends
9090
| string
91-
| IAccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
91+
| AccountMeta<string> = 'TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb',
9292
TAccountSystemProgram extends
9393
| string
94-
| IAccountMeta<string> = '11111111111111111111111111111111',
95-
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
96-
> = IInstruction<TProgram> &
97-
IInstructionWithData<Uint8Array> &
98-
IInstructionWithAccounts<
94+
| AccountMeta<string> = '11111111111111111111111111111111',
95+
TRemainingAccounts extends readonly AccountMeta<string>[] = [],
96+
> = Instruction<TProgram> &
97+
InstructionWithData<Uint8Array> &
98+
InstructionWithAccounts<
9999
[
100100
TAccountGuard extends string
101101
? WritableAccount<TAccountGuard>
102102
: TAccountGuard,
103103
TAccountMint extends string
104-
? WritableSignerAccount<TAccountMint> & IAccountSignerMeta<TAccountMint>
104+
? WritableSignerAccount<TAccountMint> & AccountSignerMeta<TAccountMint>
105105
: TAccountMint,
106106
TAccountMintTokenAccount extends string
107107
? WritableAccount<TAccountMintTokenAccount>
108108
: TAccountMintTokenAccount,
109109
TAccountGuardAuthority extends string
110110
? ReadonlySignerAccount<TAccountGuardAuthority> &
111-
IAccountSignerMeta<TAccountGuardAuthority>
111+
AccountSignerMeta<TAccountGuardAuthority>
112112
: TAccountGuardAuthority,
113113
TAccountPayer extends string
114114
? WritableSignerAccount<TAccountPayer> &
115-
IAccountSignerMeta<TAccountPayer>
115+
AccountSignerMeta<TAccountPayer>
116116
: TAccountPayer,
117117
TAccountAssociatedTokenProgram extends string
118118
? ReadonlyAccount<TAccountAssociatedTokenProgram>
@@ -489,7 +489,7 @@ export function getCreateGuardInstruction<
489489

490490
export type ParsedCreateGuardInstruction<
491491
TProgram extends string = typeof WEN_TRANSFER_GUARD_PROGRAM_ADDRESS,
492-
TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],
492+
TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
493493
> = {
494494
programAddress: Address<TProgram>;
495495
accounts: {
@@ -507,11 +507,11 @@ export type ParsedCreateGuardInstruction<
507507

508508
export function parseCreateGuardInstruction<
509509
TProgram extends string,
510-
TAccountMetas extends readonly IAccountMeta[],
510+
TAccountMetas extends readonly AccountMeta[],
511511
>(
512-
instruction: IInstruction<TProgram> &
513-
IInstructionWithAccounts<TAccountMetas> &
514-
IInstructionWithData<Uint8Array>
512+
instruction: Instruction<TProgram> &
513+
InstructionWithAccounts<TAccountMetas> &
514+
InstructionWithData<Uint8Array>
515515
): ParsedCreateGuardInstruction<TProgram, TAccountMetas> {
516516
if (instruction.accounts.length < 8) {
517517
// TODO: Coded error.

packages/renderers-js/e2e/anchor/src/generated/instructions/execute.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ import {
1919
getU64Decoder,
2020
getU64Encoder,
2121
transformEncoder,
22+
type AccountMeta,
2223
type Address,
2324
type Codec,
2425
type Decoder,
2526
type Encoder,
26-
type IAccountMeta,
27-
type IInstruction,
28-
type IInstructionWithAccounts,
29-
type IInstructionWithData,
27+
type Instruction,
28+
type InstructionWithAccounts,
29+
type InstructionWithData,
3030
type ReadonlyAccount,
3131
type ReadonlyUint8Array,
3232
} from '@solana/kit';
@@ -47,19 +47,19 @@ export function getExecuteDiscriminatorBytes() {
4747

4848
export type ExecuteInstruction<
4949
TProgram extends string = typeof WEN_TRANSFER_GUARD_PROGRAM_ADDRESS,
50-
TAccountSourceAccount extends string | IAccountMeta<string> = string,
51-
TAccountMint extends string | IAccountMeta<string> = string,
52-
TAccountDestinationAccount extends string | IAccountMeta<string> = string,
53-
TAccountOwnerDelegate extends string | IAccountMeta<string> = string,
54-
TAccountExtraMetasAccount extends string | IAccountMeta<string> = string,
55-
TAccountGuard extends string | IAccountMeta<string> = string,
50+
TAccountSourceAccount extends string | AccountMeta<string> = string,
51+
TAccountMint extends string | AccountMeta<string> = string,
52+
TAccountDestinationAccount extends string | AccountMeta<string> = string,
53+
TAccountOwnerDelegate extends string | AccountMeta<string> = string,
54+
TAccountExtraMetasAccount extends string | AccountMeta<string> = string,
55+
TAccountGuard extends string | AccountMeta<string> = string,
5656
TAccountInstructionSysvarAccount extends
5757
| string
58-
| IAccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
59-
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
60-
> = IInstruction<TProgram> &
61-
IInstructionWithData<Uint8Array> &
62-
IInstructionWithAccounts<
58+
| AccountMeta<string> = 'Sysvar1nstructions1111111111111111111111111',
59+
TRemainingAccounts extends readonly AccountMeta<string>[] = [],
60+
> = Instruction<TProgram> &
61+
InstructionWithData<Uint8Array> &
62+
InstructionWithAccounts<
6363
[
6464
TAccountSourceAccount extends string
6565
? ReadonlyAccount<TAccountSourceAccount>
@@ -368,7 +368,7 @@ export function getExecuteInstruction<
368368

369369
export type ParsedExecuteInstruction<
370370
TProgram extends string = typeof WEN_TRANSFER_GUARD_PROGRAM_ADDRESS,
371-
TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],
371+
TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
372372
> = {
373373
programAddress: Address<TProgram>;
374374
accounts: {
@@ -385,11 +385,11 @@ export type ParsedExecuteInstruction<
385385

386386
export function parseExecuteInstruction<
387387
TProgram extends string,
388-
TAccountMetas extends readonly IAccountMeta[],
388+
TAccountMetas extends readonly AccountMeta[],
389389
>(
390-
instruction: IInstruction<TProgram> &
391-
IInstructionWithAccounts<TAccountMetas> &
392-
IInstructionWithData<Uint8Array>
390+
instruction: Instruction<TProgram> &
391+
InstructionWithAccounts<TAccountMetas> &
392+
InstructionWithData<Uint8Array>
393393
): ParsedExecuteInstruction<TProgram, TAccountMetas> {
394394
if (instruction.accounts.length < 7) {
395395
// TODO: Coded error.

packages/renderers-js/e2e/anchor/src/generated/instructions/initialize.ts

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ import {
1717
getStructDecoder,
1818
getStructEncoder,
1919
transformEncoder,
20+
type AccountMeta,
21+
type AccountSignerMeta,
2022
type Address,
2123
type Codec,
2224
type Decoder,
2325
type Encoder,
24-
type IAccountMeta,
25-
type IAccountSignerMeta,
26-
type IInstruction,
27-
type IInstructionWithAccounts,
28-
type IInstructionWithData,
26+
type Instruction,
27+
type InstructionWithAccounts,
28+
type InstructionWithData,
2929
type ReadonlyAccount,
3030
type ReadonlyUint8Array,
3131
type TransactionSigner,
@@ -49,18 +49,18 @@ export function getInitializeDiscriminatorBytes() {
4949

5050
export type InitializeInstruction<
5151
TProgram extends string = typeof WEN_TRANSFER_GUARD_PROGRAM_ADDRESS,
52-
TAccountExtraMetasAccount extends string | IAccountMeta<string> = string,
53-
TAccountGuard extends string | IAccountMeta<string> = string,
54-
TAccountMint extends string | IAccountMeta<string> = string,
55-
TAccountTransferHookAuthority extends string | IAccountMeta<string> = string,
52+
TAccountExtraMetasAccount extends string | AccountMeta<string> = string,
53+
TAccountGuard extends string | AccountMeta<string> = string,
54+
TAccountMint extends string | AccountMeta<string> = string,
55+
TAccountTransferHookAuthority extends string | AccountMeta<string> = string,
5656
TAccountSystemProgram extends
5757
| string
58-
| IAccountMeta<string> = '11111111111111111111111111111111',
59-
TAccountPayer extends string | IAccountMeta<string> = string,
60-
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
61-
> = IInstruction<TProgram> &
62-
IInstructionWithData<Uint8Array> &
63-
IInstructionWithAccounts<
58+
| AccountMeta<string> = '11111111111111111111111111111111',
59+
TAccountPayer extends string | AccountMeta<string> = string,
60+
TRemainingAccounts extends readonly AccountMeta<string>[] = [],
61+
> = Instruction<TProgram> &
62+
InstructionWithData<Uint8Array> &
63+
InstructionWithAccounts<
6464
[
6565
TAccountExtraMetasAccount extends string
6666
? WritableAccount<TAccountExtraMetasAccount>
@@ -73,14 +73,14 @@ export type InitializeInstruction<
7373
: TAccountMint,
7474
TAccountTransferHookAuthority extends string
7575
? WritableSignerAccount<TAccountTransferHookAuthority> &
76-
IAccountSignerMeta<TAccountTransferHookAuthority>
76+
AccountSignerMeta<TAccountTransferHookAuthority>
7777
: TAccountTransferHookAuthority,
7878
TAccountSystemProgram extends string
7979
? ReadonlyAccount<TAccountSystemProgram>
8080
: TAccountSystemProgram,
8181
TAccountPayer extends string
8282
? WritableSignerAccount<TAccountPayer> &
83-
IAccountSignerMeta<TAccountPayer>
83+
AccountSignerMeta<TAccountPayer>
8484
: TAccountPayer,
8585
...TRemainingAccounts,
8686
]
@@ -327,7 +327,7 @@ export function getInitializeInstruction<
327327

328328
export type ParsedInitializeInstruction<
329329
TProgram extends string = typeof WEN_TRANSFER_GUARD_PROGRAM_ADDRESS,
330-
TAccountMetas extends readonly IAccountMeta[] = readonly IAccountMeta[],
330+
TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
331331
> = {
332332
programAddress: Address<TProgram>;
333333
accounts: {
@@ -343,11 +343,11 @@ export type ParsedInitializeInstruction<
343343

344344
export function parseInitializeInstruction<
345345
TProgram extends string,
346-
TAccountMetas extends readonly IAccountMeta[],
346+
TAccountMetas extends readonly AccountMeta[],
347347
>(
348-
instruction: IInstruction<TProgram> &
349-
IInstructionWithAccounts<TAccountMetas> &
350-
IInstructionWithData<Uint8Array>
348+
instruction: Instruction<TProgram> &
349+
InstructionWithAccounts<TAccountMetas> &
350+
InstructionWithData<Uint8Array>
351351
): ParsedInitializeInstruction<TProgram, TAccountMetas> {
352352
if (instruction.accounts.length < 6) {
353353
// TODO: Coded error.

0 commit comments

Comments
 (0)