Skip to content

Commit b07b128

Browse files
authored
Bump Kinobi to 0.21.5 (#31)
1 parent af6ed40 commit b07b128

File tree

8 files changed

+189
-134
lines changed

8 files changed

+189
-134
lines changed

clients/js/src/generated/accounts/addressLookupTable.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ import {
4545
} from '@solana/web3.js';
4646
import { AddressLookupTableSeeds, findAddressLookupTablePda } from '../pdas';
4747

48+
export const ADDRESS_LOOKUP_TABLE_DISCRIMINATOR = 1;
49+
50+
export function getAddressLookupTableDiscriminatorBytes() {
51+
return getU32Encoder().encode(ADDRESS_LOOKUP_TABLE_DISCRIMINATOR);
52+
}
53+
4854
export type AddressLookupTable = {
4955
discriminator: number;
5056
deactivationSlot: bigint;
@@ -80,7 +86,11 @@ export function getAddressLookupTableEncoder(): Encoder<AddressLookupTableArgs>
8086
getArrayEncoder(getAddressEncoder(), { size: 'remainder' }),
8187
],
8288
]),
83-
(value) => ({ ...value, discriminator: 1, padding: 0 })
89+
(value) => ({
90+
...value,
91+
discriminator: ADDRESS_LOOKUP_TABLE_DISCRIMINATOR,
92+
padding: 0,
93+
})
8494
);
8595
}
8696

clients/js/src/generated/instructions/closeLookupTable.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ import {
2929
import { ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS } from '../programs';
3030
import { getAccountMetaFactory, type ResolvedAccount } from '../shared';
3131

32+
export const CLOSE_LOOKUP_TABLE_DISCRIMINATOR = 4;
33+
34+
export function getCloseLookupTableDiscriminatorBytes() {
35+
return getU32Encoder().encode(CLOSE_LOOKUP_TABLE_DISCRIMINATOR);
36+
}
37+
3238
export type CloseLookupTableInstruction<
3339
TProgram extends string = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
3440
TAccountAddress extends string | IAccountMeta<string> = string,
@@ -60,7 +66,7 @@ export type CloseLookupTableInstructionDataArgs = {};
6066
export function getCloseLookupTableInstructionDataEncoder(): Encoder<CloseLookupTableInstructionDataArgs> {
6167
return transformEncoder(
6268
getStructEncoder([['discriminator', getU32Encoder()]]),
63-
(value) => ({ ...value, discriminator: 4 })
69+
(value) => ({ ...value, discriminator: CLOSE_LOOKUP_TABLE_DISCRIMINATOR })
6470
);
6571
}
6672

@@ -92,20 +98,23 @@ export function getCloseLookupTableInstruction<
9298
TAccountAddress extends string,
9399
TAccountAuthority extends string,
94100
TAccountRecipient extends string,
101+
TProgramAddress extends Address = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
95102
>(
96103
input: CloseLookupTableInput<
97104
TAccountAddress,
98105
TAccountAuthority,
99106
TAccountRecipient
100-
>
107+
>,
108+
config?: { programAddress?: TProgramAddress }
101109
): CloseLookupTableInstruction<
102-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
110+
TProgramAddress,
103111
TAccountAddress,
104112
TAccountAuthority,
105113
TAccountRecipient
106114
> {
107115
// Program address.
108-
const programAddress = ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
116+
const programAddress =
117+
config?.programAddress ?? ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
109118

110119
// Original accounts.
111120
const originalAccounts = {
@@ -128,7 +137,7 @@ export function getCloseLookupTableInstruction<
128137
programAddress,
129138
data: getCloseLookupTableInstructionDataEncoder().encode({}),
130139
} as CloseLookupTableInstruction<
131-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
140+
TProgramAddress,
132141
TAccountAddress,
133142
TAccountAuthority,
134143
TAccountRecipient

clients/js/src/generated/instructions/createLookupTable.ts

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@ import {
4545
type ResolvedAccount,
4646
} from '../shared';
4747

48+
export const CREATE_LOOKUP_TABLE_DISCRIMINATOR = 0;
49+
50+
export function getCreateLookupTableDiscriminatorBytes() {
51+
return getU32Encoder().encode(CREATE_LOOKUP_TABLE_DISCRIMINATOR);
52+
}
53+
4854
export type CreateLookupTableInstruction<
4955
TProgram extends string = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
5056
TAccountAddress extends string | IAccountMeta<string> = string,
@@ -94,7 +100,7 @@ export function getCreateLookupTableInstructionDataEncoder(): Encoder<CreateLook
94100
['recentSlot', getU64Encoder()],
95101
['bump', getU8Encoder()],
96102
]),
97-
(value) => ({ ...value, discriminator: 0 })
103+
(value) => ({ ...value, discriminator: CREATE_LOOKUP_TABLE_DISCRIMINATOR })
98104
);
99105
}
100106

@@ -135,16 +141,18 @@ export async function getCreateLookupTableInstructionAsync<
135141
TAccountAuthority extends string,
136142
TAccountPayer extends string,
137143
TAccountSystemProgram extends string,
144+
TProgramAddress extends Address = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
138145
>(
139146
input: CreateLookupTableAsyncInput<
140147
TAccountAddress,
141148
TAccountAuthority,
142149
TAccountPayer,
143150
TAccountSystemProgram
144-
>
151+
>,
152+
config?: { programAddress?: TProgramAddress }
145153
): Promise<
146154
CreateLookupTableInstruction<
147-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
155+
TProgramAddress,
148156
TAccountAddress,
149157
TAccountAuthority,
150158
TAccountPayer,
@@ -153,7 +161,8 @@ export async function getCreateLookupTableInstructionAsync<
153161
IInstructionWithByteDelta
154162
> {
155163
// Program address.
156-
const programAddress = ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
164+
const programAddress =
165+
config?.programAddress ?? ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
157166

158167
// Original accounts.
159168
const originalAccounts = {
@@ -204,7 +213,7 @@ export async function getCreateLookupTableInstructionAsync<
204213
args as CreateLookupTableInstructionDataArgs
205214
),
206215
} as CreateLookupTableInstruction<
207-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
216+
TProgramAddress,
208217
TAccountAddress,
209218
TAccountAuthority,
210219
TAccountPayer,
@@ -233,23 +242,26 @@ export function getCreateLookupTableInstruction<
233242
TAccountAuthority extends string,
234243
TAccountPayer extends string,
235244
TAccountSystemProgram extends string,
245+
TProgramAddress extends Address = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
236246
>(
237247
input: CreateLookupTableInput<
238248
TAccountAddress,
239249
TAccountAuthority,
240250
TAccountPayer,
241251
TAccountSystemProgram
242-
>
252+
>,
253+
config?: { programAddress?: TProgramAddress }
243254
): CreateLookupTableInstruction<
244-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
255+
TProgramAddress,
245256
TAccountAddress,
246257
TAccountAuthority,
247258
TAccountPayer,
248259
TAccountSystemProgram
249260
> &
250261
IInstructionWithByteDelta {
251262
// Program address.
252-
const programAddress = ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
263+
const programAddress =
264+
config?.programAddress ?? ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
253265

254266
// Original accounts.
255267
const originalAccounts = {
@@ -294,7 +306,7 @@ export function getCreateLookupTableInstruction<
294306
args as CreateLookupTableInstructionDataArgs
295307
),
296308
} as CreateLookupTableInstruction<
297-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
309+
TProgramAddress,
298310
TAccountAddress,
299311
TAccountAuthority,
300312
TAccountPayer,

clients/js/src/generated/instructions/deactivateLookupTable.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ import {
2929
import { ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS } from '../programs';
3030
import { getAccountMetaFactory, type ResolvedAccount } from '../shared';
3131

32+
export const DEACTIVATE_LOOKUP_TABLE_DISCRIMINATOR = 3;
33+
34+
export function getDeactivateLookupTableDiscriminatorBytes() {
35+
return getU32Encoder().encode(DEACTIVATE_LOOKUP_TABLE_DISCRIMINATOR);
36+
}
37+
3238
export type DeactivateLookupTableInstruction<
3339
TProgram extends string = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
3440
TAccountAddress extends string | IAccountMeta<string> = string,
@@ -56,7 +62,10 @@ export type DeactivateLookupTableInstructionDataArgs = {};
5662
export function getDeactivateLookupTableInstructionDataEncoder(): Encoder<DeactivateLookupTableInstructionDataArgs> {
5763
return transformEncoder(
5864
getStructEncoder([['discriminator', getU32Encoder()]]),
59-
(value) => ({ ...value, discriminator: 3 })
65+
(value) => ({
66+
...value,
67+
discriminator: DEACTIVATE_LOOKUP_TABLE_DISCRIMINATOR,
68+
})
6069
);
6170
}
6271

@@ -85,15 +94,18 @@ export type DeactivateLookupTableInput<
8594
export function getDeactivateLookupTableInstruction<
8695
TAccountAddress extends string,
8796
TAccountAuthority extends string,
97+
TProgramAddress extends Address = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
8898
>(
89-
input: DeactivateLookupTableInput<TAccountAddress, TAccountAuthority>
99+
input: DeactivateLookupTableInput<TAccountAddress, TAccountAuthority>,
100+
config?: { programAddress?: TProgramAddress }
90101
): DeactivateLookupTableInstruction<
91-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
102+
TProgramAddress,
92103
TAccountAddress,
93104
TAccountAuthority
94105
> {
95106
// Program address.
96-
const programAddress = ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
107+
const programAddress =
108+
config?.programAddress ?? ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
97109

98110
// Original accounts.
99111
const originalAccounts = {
@@ -114,7 +126,7 @@ export function getDeactivateLookupTableInstruction<
114126
programAddress,
115127
data: getDeactivateLookupTableInstructionDataEncoder().encode({}),
116128
} as DeactivateLookupTableInstruction<
117-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
129+
TProgramAddress,
118130
TAccountAddress,
119131
TAccountAuthority
120132
>;

clients/js/src/generated/instructions/extendLookupTable.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,12 @@ import {
4242
type ResolvedAccount,
4343
} from '../shared';
4444

45+
export const EXTEND_LOOKUP_TABLE_DISCRIMINATOR = 2;
46+
47+
export function getExtendLookupTableDiscriminatorBytes() {
48+
return getU32Encoder().encode(EXTEND_LOOKUP_TABLE_DISCRIMINATOR);
49+
}
50+
4551
export type ExtendLookupTableInstruction<
4652
TProgram extends string = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
4753
TAccountAddress extends string | IAccountMeta<string> = string,
@@ -91,7 +97,7 @@ export function getExtendLookupTableInstructionDataEncoder(): Encoder<ExtendLook
9197
getArrayEncoder(getAddressEncoder(), { size: getU64Encoder() }),
9298
],
9399
]),
94-
(value) => ({ ...value, discriminator: 2 })
100+
(value) => ({ ...value, discriminator: EXTEND_LOOKUP_TABLE_DISCRIMINATOR })
95101
);
96102
}
97103

@@ -133,23 +139,26 @@ export function getExtendLookupTableInstruction<
133139
TAccountAuthority extends string,
134140
TAccountPayer extends string,
135141
TAccountSystemProgram extends string,
142+
TProgramAddress extends Address = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
136143
>(
137144
input: ExtendLookupTableInput<
138145
TAccountAddress,
139146
TAccountAuthority,
140147
TAccountPayer,
141148
TAccountSystemProgram
142-
>
149+
>,
150+
config?: { programAddress?: TProgramAddress }
143151
): ExtendLookupTableInstruction<
144-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
152+
TProgramAddress,
145153
TAccountAddress,
146154
TAccountAuthority,
147155
TAccountPayer,
148156
TAccountSystemProgram
149157
> &
150158
IInstructionWithByteDelta {
151159
// Program address.
152-
const programAddress = ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
160+
const programAddress =
161+
config?.programAddress ?? ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
153162

154163
// Original accounts.
155164
const originalAccounts = {
@@ -193,7 +202,7 @@ export function getExtendLookupTableInstruction<
193202
args as ExtendLookupTableInstructionDataArgs
194203
),
195204
} as ExtendLookupTableInstruction<
196-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
205+
TProgramAddress,
197206
TAccountAddress,
198207
TAccountAuthority,
199208
TAccountPayer,

clients/js/src/generated/instructions/freezeLookupTable.ts

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ import {
2929
import { ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS } from '../programs';
3030
import { getAccountMetaFactory, type ResolvedAccount } from '../shared';
3131

32+
export const FREEZE_LOOKUP_TABLE_DISCRIMINATOR = 1;
33+
34+
export function getFreezeLookupTableDiscriminatorBytes() {
35+
return getU32Encoder().encode(FREEZE_LOOKUP_TABLE_DISCRIMINATOR);
36+
}
37+
3238
export type FreezeLookupTableInstruction<
3339
TProgram extends string = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
3440
TAccountAddress extends string | IAccountMeta<string> = string,
@@ -56,7 +62,7 @@ export type FreezeLookupTableInstructionDataArgs = {};
5662
export function getFreezeLookupTableInstructionDataEncoder(): Encoder<FreezeLookupTableInstructionDataArgs> {
5763
return transformEncoder(
5864
getStructEncoder([['discriminator', getU32Encoder()]]),
59-
(value) => ({ ...value, discriminator: 1 })
65+
(value) => ({ ...value, discriminator: FREEZE_LOOKUP_TABLE_DISCRIMINATOR })
6066
);
6167
}
6268

@@ -85,15 +91,18 @@ export type FreezeLookupTableInput<
8591
export function getFreezeLookupTableInstruction<
8692
TAccountAddress extends string,
8793
TAccountAuthority extends string,
94+
TProgramAddress extends Address = typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
8895
>(
89-
input: FreezeLookupTableInput<TAccountAddress, TAccountAuthority>
96+
input: FreezeLookupTableInput<TAccountAddress, TAccountAuthority>,
97+
config?: { programAddress?: TProgramAddress }
9098
): FreezeLookupTableInstruction<
91-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
99+
TProgramAddress,
92100
TAccountAddress,
93101
TAccountAuthority
94102
> {
95103
// Program address.
96-
const programAddress = ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
104+
const programAddress =
105+
config?.programAddress ?? ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS;
97106

98107
// Original accounts.
99108
const originalAccounts = {
@@ -114,7 +123,7 @@ export function getFreezeLookupTableInstruction<
114123
programAddress,
115124
data: getFreezeLookupTableInstructionDataEncoder().encode({}),
116125
} as FreezeLookupTableInstruction<
117-
typeof ADDRESS_LOOKUP_TABLE_PROGRAM_ADDRESS,
126+
TProgramAddress,
118127
TAccountAddress,
119128
TAccountAuthority
120129
>;

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@
2525
},
2626
"devDependencies": {
2727
"@iarna/toml": "^2.2.5",
28-
"@kinobi-so/renderers-js": "^0.21.2",
29-
"@kinobi-so/renderers-rust": "^0.21.0",
30-
"kinobi": "^0.21.0",
28+
"@kinobi-so/renderers-js": "^0.21.9",
29+
"@kinobi-so/renderers-rust": "^0.21.7",
30+
"kinobi": "^0.21.5",
3131
"typescript": "^5.5.2",
3232
"zx": "^7.2.3"
3333
},

0 commit comments

Comments
 (0)