Skip to content

Commit 158a48c

Browse files
authored
Bump Kinobi to 0.21.5 (#9)
1 parent b188138 commit 158a48c

File tree

7 files changed

+189
-138
lines changed

7 files changed

+189
-138
lines changed

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ import {
2626
} from '@solana/web3.js';
2727
import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';
2828

29+
export const REQUEST_HEAP_FRAME_DISCRIMINATOR = 1;
30+
31+
export function getRequestHeapFrameDiscriminatorBytes() {
32+
return getU8Encoder().encode(REQUEST_HEAP_FRAME_DISCRIMINATOR);
33+
}
34+
2935
export type RequestHeapFrameInstruction<
3036
TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
3137
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
@@ -56,7 +62,7 @@ export function getRequestHeapFrameInstructionDataEncoder(): Encoder<RequestHeap
5662
['discriminator', getU8Encoder()],
5763
['bytes', getU32Encoder()],
5864
]),
59-
(value) => ({ ...value, discriminator: 1 })
65+
(value) => ({ ...value, discriminator: REQUEST_HEAP_FRAME_DISCRIMINATOR })
6066
);
6167
}
6268

@@ -81,11 +87,15 @@ export type RequestHeapFrameInput = {
8187
bytes: RequestHeapFrameInstructionDataArgs['bytes'];
8288
};
8389

84-
export function getRequestHeapFrameInstruction(
85-
input: RequestHeapFrameInput
86-
): RequestHeapFrameInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {
90+
export function getRequestHeapFrameInstruction<
91+
TProgramAddress extends Address = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
92+
>(
93+
input: RequestHeapFrameInput,
94+
config?: { programAddress?: TProgramAddress }
95+
): RequestHeapFrameInstruction<TProgramAddress> {
8796
// Program address.
88-
const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
97+
const programAddress =
98+
config?.programAddress ?? COMPUTE_BUDGET_PROGRAM_ADDRESS;
8999

90100
// Original args.
91101
const args = { ...input };
@@ -95,7 +105,7 @@ export function getRequestHeapFrameInstruction(
95105
data: getRequestHeapFrameInstructionDataEncoder().encode(
96106
args as RequestHeapFrameInstructionDataArgs
97107
),
98-
} as RequestHeapFrameInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;
108+
} as RequestHeapFrameInstruction<TProgramAddress>;
99109

100110
return instruction;
101111
}

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

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ import {
2626
} from '@solana/web3.js';
2727
import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';
2828

29+
export const REQUEST_UNITS_DISCRIMINATOR = 0;
30+
31+
export function getRequestUnitsDiscriminatorBytes() {
32+
return getU8Encoder().encode(REQUEST_UNITS_DISCRIMINATOR);
33+
}
34+
2935
export type RequestUnitsInstruction<
3036
TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
3137
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
@@ -55,7 +61,7 @@ export function getRequestUnitsInstructionDataEncoder(): Encoder<RequestUnitsIns
5561
['units', getU32Encoder()],
5662
['additionalFee', getU32Encoder()],
5763
]),
58-
(value) => ({ ...value, discriminator: 0 })
64+
(value) => ({ ...value, discriminator: REQUEST_UNITS_DISCRIMINATOR })
5965
);
6066
}
6167

@@ -82,11 +88,15 @@ export type RequestUnitsInput = {
8288
additionalFee: RequestUnitsInstructionDataArgs['additionalFee'];
8389
};
8490

85-
export function getRequestUnitsInstruction(
86-
input: RequestUnitsInput
87-
): RequestUnitsInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {
91+
export function getRequestUnitsInstruction<
92+
TProgramAddress extends Address = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
93+
>(
94+
input: RequestUnitsInput,
95+
config?: { programAddress?: TProgramAddress }
96+
): RequestUnitsInstruction<TProgramAddress> {
8897
// Program address.
89-
const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
98+
const programAddress =
99+
config?.programAddress ?? COMPUTE_BUDGET_PROGRAM_ADDRESS;
90100

91101
// Original args.
92102
const args = { ...input };
@@ -96,7 +106,7 @@ export function getRequestUnitsInstruction(
96106
data: getRequestUnitsInstructionDataEncoder().encode(
97107
args as RequestUnitsInstructionDataArgs
98108
),
99-
} as RequestUnitsInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;
109+
} as RequestUnitsInstruction<TProgramAddress>;
100110

101111
return instruction;
102112
}

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

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ import {
2626
} from '@solana/web3.js';
2727
import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';
2828

29+
export const SET_COMPUTE_UNIT_LIMIT_DISCRIMINATOR = 2;
30+
31+
export function getSetComputeUnitLimitDiscriminatorBytes() {
32+
return getU8Encoder().encode(SET_COMPUTE_UNIT_LIMIT_DISCRIMINATOR);
33+
}
34+
2935
export type SetComputeUnitLimitInstruction<
3036
TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
3137
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
@@ -50,7 +56,10 @@ export function getSetComputeUnitLimitInstructionDataEncoder(): Encoder<SetCompu
5056
['discriminator', getU8Encoder()],
5157
['units', getU32Encoder()],
5258
]),
53-
(value) => ({ ...value, discriminator: 2 })
59+
(value) => ({
60+
...value,
61+
discriminator: SET_COMPUTE_UNIT_LIMIT_DISCRIMINATOR,
62+
})
5463
);
5564
}
5665

@@ -75,11 +84,15 @@ export type SetComputeUnitLimitInput = {
7584
units: SetComputeUnitLimitInstructionDataArgs['units'];
7685
};
7786

78-
export function getSetComputeUnitLimitInstruction(
79-
input: SetComputeUnitLimitInput
80-
): SetComputeUnitLimitInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {
87+
export function getSetComputeUnitLimitInstruction<
88+
TProgramAddress extends Address = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
89+
>(
90+
input: SetComputeUnitLimitInput,
91+
config?: { programAddress?: TProgramAddress }
92+
): SetComputeUnitLimitInstruction<TProgramAddress> {
8193
// Program address.
82-
const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
94+
const programAddress =
95+
config?.programAddress ?? COMPUTE_BUDGET_PROGRAM_ADDRESS;
8396

8497
// Original args.
8598
const args = { ...input };
@@ -89,7 +102,7 @@ export function getSetComputeUnitLimitInstruction(
89102
data: getSetComputeUnitLimitInstructionDataEncoder().encode(
90103
args as SetComputeUnitLimitInstructionDataArgs
91104
),
92-
} as SetComputeUnitLimitInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;
105+
} as SetComputeUnitLimitInstruction<TProgramAddress>;
93106

94107
return instruction;
95108
}

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

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ import {
2626
} from '@solana/web3.js';
2727
import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';
2828

29+
export const SET_COMPUTE_UNIT_PRICE_DISCRIMINATOR = 3;
30+
31+
export function getSetComputeUnitPriceDiscriminatorBytes() {
32+
return getU8Encoder().encode(SET_COMPUTE_UNIT_PRICE_DISCRIMINATOR);
33+
}
34+
2935
export type SetComputeUnitPriceInstruction<
3036
TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
3137
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
@@ -50,7 +56,10 @@ export function getSetComputeUnitPriceInstructionDataEncoder(): Encoder<SetCompu
5056
['discriminator', getU8Encoder()],
5157
['microLamports', getU64Encoder()],
5258
]),
53-
(value) => ({ ...value, discriminator: 3 })
59+
(value) => ({
60+
...value,
61+
discriminator: SET_COMPUTE_UNIT_PRICE_DISCRIMINATOR,
62+
})
5463
);
5564
}
5665

@@ -75,11 +84,15 @@ export type SetComputeUnitPriceInput = {
7584
microLamports: SetComputeUnitPriceInstructionDataArgs['microLamports'];
7685
};
7786

78-
export function getSetComputeUnitPriceInstruction(
79-
input: SetComputeUnitPriceInput
80-
): SetComputeUnitPriceInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {
87+
export function getSetComputeUnitPriceInstruction<
88+
TProgramAddress extends Address = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
89+
>(
90+
input: SetComputeUnitPriceInput,
91+
config?: { programAddress?: TProgramAddress }
92+
): SetComputeUnitPriceInstruction<TProgramAddress> {
8193
// Program address.
82-
const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
94+
const programAddress =
95+
config?.programAddress ?? COMPUTE_BUDGET_PROGRAM_ADDRESS;
8396

8497
// Original args.
8598
const args = { ...input };
@@ -89,7 +102,7 @@ export function getSetComputeUnitPriceInstruction(
89102
data: getSetComputeUnitPriceInstructionDataEncoder().encode(
90103
args as SetComputeUnitPriceInstructionDataArgs
91104
),
92-
} as SetComputeUnitPriceInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;
105+
} as SetComputeUnitPriceInstruction<TProgramAddress>;
93106

94107
return instruction;
95108
}

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

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,14 @@ import {
2626
} from '@solana/web3.js';
2727
import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';
2828

29+
export const SET_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_DISCRIMINATOR = 4;
30+
31+
export function getSetLoadedAccountsDataSizeLimitDiscriminatorBytes() {
32+
return getU8Encoder().encode(
33+
SET_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_DISCRIMINATOR
34+
);
35+
}
36+
2937
export type SetLoadedAccountsDataSizeLimitInstruction<
3038
TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
3139
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
@@ -48,7 +56,10 @@ export function getSetLoadedAccountsDataSizeLimitInstructionDataEncoder(): Encod
4856
['discriminator', getU8Encoder()],
4957
['accountDataSizeLimit', getU32Encoder()],
5058
]),
51-
(value) => ({ ...value, discriminator: 4 })
59+
(value) => ({
60+
...value,
61+
discriminator: SET_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_DISCRIMINATOR,
62+
})
5263
);
5364
}
5465

@@ -73,13 +84,15 @@ export type SetLoadedAccountsDataSizeLimitInput = {
7384
accountDataSizeLimit: SetLoadedAccountsDataSizeLimitInstructionDataArgs['accountDataSizeLimit'];
7485
};
7586

76-
export function getSetLoadedAccountsDataSizeLimitInstruction(
77-
input: SetLoadedAccountsDataSizeLimitInput
78-
): SetLoadedAccountsDataSizeLimitInstruction<
79-
typeof COMPUTE_BUDGET_PROGRAM_ADDRESS
80-
> {
87+
export function getSetLoadedAccountsDataSizeLimitInstruction<
88+
TProgramAddress extends Address = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
89+
>(
90+
input: SetLoadedAccountsDataSizeLimitInput,
91+
config?: { programAddress?: TProgramAddress }
92+
): SetLoadedAccountsDataSizeLimitInstruction<TProgramAddress> {
8193
// Program address.
82-
const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
94+
const programAddress =
95+
config?.programAddress ?? COMPUTE_BUDGET_PROGRAM_ADDRESS;
8396

8497
// Original args.
8598
const args = { ...input };
@@ -89,9 +102,7 @@ export function getSetLoadedAccountsDataSizeLimitInstruction(
89102
data: getSetLoadedAccountsDataSizeLimitInstructionDataEncoder().encode(
90103
args as SetLoadedAccountsDataSizeLimitInstructionDataArgs
91104
),
92-
} as SetLoadedAccountsDataSizeLimitInstruction<
93-
typeof COMPUTE_BUDGET_PROGRAM_ADDRESS
94-
>;
105+
} as SetLoadedAccountsDataSizeLimitInstruction<TProgramAddress>;
95106

96107
return instruction;
97108
}

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
},
2121
"devDependencies": {
2222
"@iarna/toml": "^2.2.5",
23-
"@kinobi-so/renderers-js": "^0.21.2",
24-
"@kinobi-so/renderers-rust": "^0.21.0",
25-
"kinobi": "^0.21.0",
23+
"@kinobi-so/renderers-js": "^0.21.9",
24+
"@kinobi-so/renderers-rust": "^0.21.7",
25+
"kinobi": "^0.21.5",
2626
"typescript": "^5.5.2",
2727
"zx": "^7.2.3"
2828
},

0 commit comments

Comments
 (0)