Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions clients/js/src/generated/instructions/requestHeapFrame.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ import {
} from '@solana/web3.js';
import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';

export const REQUEST_HEAP_FRAME_DISCRIMINATOR = 1;

export function getRequestHeapFrameDiscriminatorBytes() {
return getU8Encoder().encode(REQUEST_HEAP_FRAME_DISCRIMINATOR);
}

export type RequestHeapFrameInstruction<
TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
Expand Down Expand Up @@ -56,7 +62,7 @@ export function getRequestHeapFrameInstructionDataEncoder(): Encoder<RequestHeap
['discriminator', getU8Encoder()],
['bytes', getU32Encoder()],
]),
(value) => ({ ...value, discriminator: 1 })
(value) => ({ ...value, discriminator: REQUEST_HEAP_FRAME_DISCRIMINATOR })
);
}

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

export function getRequestHeapFrameInstruction(
input: RequestHeapFrameInput
): RequestHeapFrameInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {
export function getRequestHeapFrameInstruction<
TProgramAddress extends Address = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
>(
input: RequestHeapFrameInput,
config?: { programAddress?: TProgramAddress }
): RequestHeapFrameInstruction<TProgramAddress> {
// Program address.
const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
const programAddress =
config?.programAddress ?? COMPUTE_BUDGET_PROGRAM_ADDRESS;

// Original args.
const args = { ...input };
Expand All @@ -95,7 +105,7 @@ export function getRequestHeapFrameInstruction(
data: getRequestHeapFrameInstructionDataEncoder().encode(
args as RequestHeapFrameInstructionDataArgs
),
} as RequestHeapFrameInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;
} as RequestHeapFrameInstruction<TProgramAddress>;

return instruction;
}
Expand Down
22 changes: 16 additions & 6 deletions clients/js/src/generated/instructions/requestUnits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ import {
} from '@solana/web3.js';
import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';

export const REQUEST_UNITS_DISCRIMINATOR = 0;

export function getRequestUnitsDiscriminatorBytes() {
return getU8Encoder().encode(REQUEST_UNITS_DISCRIMINATOR);
}

export type RequestUnitsInstruction<
TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
Expand Down Expand Up @@ -55,7 +61,7 @@ export function getRequestUnitsInstructionDataEncoder(): Encoder<RequestUnitsIns
['units', getU32Encoder()],
['additionalFee', getU32Encoder()],
]),
(value) => ({ ...value, discriminator: 0 })
(value) => ({ ...value, discriminator: REQUEST_UNITS_DISCRIMINATOR })
);
}

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

export function getRequestUnitsInstruction(
input: RequestUnitsInput
): RequestUnitsInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {
export function getRequestUnitsInstruction<
TProgramAddress extends Address = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
>(
input: RequestUnitsInput,
config?: { programAddress?: TProgramAddress }
): RequestUnitsInstruction<TProgramAddress> {
// Program address.
const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
const programAddress =
config?.programAddress ?? COMPUTE_BUDGET_PROGRAM_ADDRESS;

// Original args.
const args = { ...input };
Expand All @@ -96,7 +106,7 @@ export function getRequestUnitsInstruction(
data: getRequestUnitsInstructionDataEncoder().encode(
args as RequestUnitsInstructionDataArgs
),
} as RequestUnitsInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;
} as RequestUnitsInstruction<TProgramAddress>;

return instruction;
}
Expand Down
25 changes: 19 additions & 6 deletions clients/js/src/generated/instructions/setComputeUnitLimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ import {
} from '@solana/web3.js';
import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';

export const SET_COMPUTE_UNIT_LIMIT_DISCRIMINATOR = 2;

export function getSetComputeUnitLimitDiscriminatorBytes() {
return getU8Encoder().encode(SET_COMPUTE_UNIT_LIMIT_DISCRIMINATOR);
}

export type SetComputeUnitLimitInstruction<
TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
Expand All @@ -50,7 +56,10 @@ export function getSetComputeUnitLimitInstructionDataEncoder(): Encoder<SetCompu
['discriminator', getU8Encoder()],
['units', getU32Encoder()],
]),
(value) => ({ ...value, discriminator: 2 })
(value) => ({
...value,
discriminator: SET_COMPUTE_UNIT_LIMIT_DISCRIMINATOR,
})
);
}

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

export function getSetComputeUnitLimitInstruction(
input: SetComputeUnitLimitInput
): SetComputeUnitLimitInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {
export function getSetComputeUnitLimitInstruction<
TProgramAddress extends Address = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
>(
input: SetComputeUnitLimitInput,
config?: { programAddress?: TProgramAddress }
): SetComputeUnitLimitInstruction<TProgramAddress> {
// Program address.
const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
const programAddress =
config?.programAddress ?? COMPUTE_BUDGET_PROGRAM_ADDRESS;

// Original args.
const args = { ...input };
Expand All @@ -89,7 +102,7 @@ export function getSetComputeUnitLimitInstruction(
data: getSetComputeUnitLimitInstructionDataEncoder().encode(
args as SetComputeUnitLimitInstructionDataArgs
),
} as SetComputeUnitLimitInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;
} as SetComputeUnitLimitInstruction<TProgramAddress>;

return instruction;
}
Expand Down
25 changes: 19 additions & 6 deletions clients/js/src/generated/instructions/setComputeUnitPrice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ import {
} from '@solana/web3.js';
import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';

export const SET_COMPUTE_UNIT_PRICE_DISCRIMINATOR = 3;

export function getSetComputeUnitPriceDiscriminatorBytes() {
return getU8Encoder().encode(SET_COMPUTE_UNIT_PRICE_DISCRIMINATOR);
}

export type SetComputeUnitPriceInstruction<
TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
Expand All @@ -50,7 +56,10 @@ export function getSetComputeUnitPriceInstructionDataEncoder(): Encoder<SetCompu
['discriminator', getU8Encoder()],
['microLamports', getU64Encoder()],
]),
(value) => ({ ...value, discriminator: 3 })
(value) => ({
...value,
discriminator: SET_COMPUTE_UNIT_PRICE_DISCRIMINATOR,
})
);
}

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

export function getSetComputeUnitPriceInstruction(
input: SetComputeUnitPriceInput
): SetComputeUnitPriceInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS> {
export function getSetComputeUnitPriceInstruction<
TProgramAddress extends Address = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
>(
input: SetComputeUnitPriceInput,
config?: { programAddress?: TProgramAddress }
): SetComputeUnitPriceInstruction<TProgramAddress> {
// Program address.
const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
const programAddress =
config?.programAddress ?? COMPUTE_BUDGET_PROGRAM_ADDRESS;

// Original args.
const args = { ...input };
Expand All @@ -89,7 +102,7 @@ export function getSetComputeUnitPriceInstruction(
data: getSetComputeUnitPriceInstructionDataEncoder().encode(
args as SetComputeUnitPriceInstructionDataArgs
),
} as SetComputeUnitPriceInstruction<typeof COMPUTE_BUDGET_PROGRAM_ADDRESS>;
} as SetComputeUnitPriceInstruction<TProgramAddress>;

return instruction;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ import {
} from '@solana/web3.js';
import { COMPUTE_BUDGET_PROGRAM_ADDRESS } from '../programs';

export const SET_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_DISCRIMINATOR = 4;

export function getSetLoadedAccountsDataSizeLimitDiscriminatorBytes() {
return getU8Encoder().encode(
SET_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_DISCRIMINATOR
);
}

export type SetLoadedAccountsDataSizeLimitInstruction<
TProgram extends string = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
TRemainingAccounts extends readonly IAccountMeta<string>[] = [],
Expand All @@ -48,7 +56,10 @@ export function getSetLoadedAccountsDataSizeLimitInstructionDataEncoder(): Encod
['discriminator', getU8Encoder()],
['accountDataSizeLimit', getU32Encoder()],
]),
(value) => ({ ...value, discriminator: 4 })
(value) => ({
...value,
discriminator: SET_LOADED_ACCOUNTS_DATA_SIZE_LIMIT_DISCRIMINATOR,
})
);
}

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

export function getSetLoadedAccountsDataSizeLimitInstruction(
input: SetLoadedAccountsDataSizeLimitInput
): SetLoadedAccountsDataSizeLimitInstruction<
typeof COMPUTE_BUDGET_PROGRAM_ADDRESS
> {
export function getSetLoadedAccountsDataSizeLimitInstruction<
TProgramAddress extends Address = typeof COMPUTE_BUDGET_PROGRAM_ADDRESS,
>(
input: SetLoadedAccountsDataSizeLimitInput,
config?: { programAddress?: TProgramAddress }
): SetLoadedAccountsDataSizeLimitInstruction<TProgramAddress> {
// Program address.
const programAddress = COMPUTE_BUDGET_PROGRAM_ADDRESS;
const programAddress =
config?.programAddress ?? COMPUTE_BUDGET_PROGRAM_ADDRESS;

// Original args.
const args = { ...input };
Expand All @@ -89,9 +102,7 @@ export function getSetLoadedAccountsDataSizeLimitInstruction(
data: getSetLoadedAccountsDataSizeLimitInstructionDataEncoder().encode(
args as SetLoadedAccountsDataSizeLimitInstructionDataArgs
),
} as SetLoadedAccountsDataSizeLimitInstruction<
typeof COMPUTE_BUDGET_PROGRAM_ADDRESS
>;
} as SetLoadedAccountsDataSizeLimitInstruction<TProgramAddress>;

return instruction;
}
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
},
"devDependencies": {
"@iarna/toml": "^2.2.5",
"@kinobi-so/renderers-js": "^0.21.2",
"@kinobi-so/renderers-rust": "^0.21.0",
"kinobi": "^0.21.0",
"@kinobi-so/renderers-js": "^0.21.9",
"@kinobi-so/renderers-rust": "^0.21.7",
"kinobi": "^0.21.5",
"typescript": "^5.5.2",
"zx": "^7.2.3"
},
Expand Down
Loading