generateRandomArciumCommissionFeesAccountOffset
Umbra SDK reference for Generate Random Arcium Commission Fees Account Offset.
generateRandomArciumCommissionFeesAccountOffset(
_instructionSeed,_mintAddress):U16
Defined in: src/utils/miscellaneous.ts:320
Generates a cryptographically secure random offset for selecting an Arcium commission fees account.
Parameters
_instructionSeed
The instruction seed (currently unused, reserved for future deterministic generation)
_mintAddress
The mint address of the token (currently unused, reserved for future deterministic generation)
Returns
A random 16-bit unsigned integer (U16) account offset within the valid range
Throws
AccountOffsetGenerationError When random generation fails or conversion errors occur
Remarks
This function generates a random offset used to select a specific Arcium commission fees account from multiple available accounts. The offset is used to derive the Program Derived Address (PDA) for the selected commission fees account.
Security: This function uses cryptographically secure random number generation to ensure the offset is unpredictable and cannot be manipulated by attackers.
Current Implementation:
Currently, there is only one Arcium commission fees account (NUMBER_OF_ACCOUNTS = 1), so this
function will always return 0. The parameters _instructionSeed and _mintAddress are
currently unused but reserved for future deterministic generation based on instruction
context and token type.
Account Offset: The returned offset is a 16-bit unsigned integer (U16) that must be less than the number of available accounts. It's used as part of the seed derivation for the commission fees account PDA.
Example
// Generate a random offset for Arcium commission fees account selection
const offset = generateRandomArciumCommissionFeesAccountOffset(instructionSeed, mintAddress);
// Use the offset to derive the commission fees account address
const commissionAccount = deriveArciumCommissionFeesAccount(offset);