{"version":3,"sources":["../src/sysvar.ts","../src/clock.ts","../src/epoch-rewards.ts","../src/epoch-schedule.ts","../src/last-restart-slot.ts","../src/recent-blockhashes.ts","../src/rent.ts","../src/slot-hashes.ts","../src/slot-history.ts","../src/stake-history.ts"],"names":["fetchEncodedAccount","fetchJsonParsedAccount","getStructEncoder","getU64Encoder","getI64Encoder","getStructDecoder","getU64Decoder","getI64Decoder","combineCodec","assertAccountExists","decodeAccount","getBlockhashEncoder","getU128Encoder","getDefaultLamportsEncoder","getBooleanEncoder","getBlockhashDecoder","getU128Decoder","getDefaultLamportsDecoder","getBooleanDecoder","getArrayEncoder","getArrayDecoder","getF64Encoder","getU8Encoder","getF64Decoder","getU8Decoder","getArrayCodec","getU64Codec","createEncoder","createDecoder","SolanaError","SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH","SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE","SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS"],"mappings":";;;;;;;;AAYO,IAAM,oBAAA,GACT;AACG,IAAM,4BAAA,GACT;AACG,IAAM,6BAAA,GACT;AACG,IAAM,2BAAA,GACT;AACG,IAAM,gCAAA,GACT;AACG,IAAM,iCAAA,GACT;AACG,IAAM,mBAAA,GACT;AACG,IAAM,0BAAA,GACT;AACG,IAAM,2BAAA,GACT;AACG,IAAM,4BAAA,GACT;AAoBJ,eAAsB,yBAAA,CAClB,GAAA,EACA,OAAA,EACA,MAAA,EACsC;AACtC,EAAA,OAAO,MAAMA,4BAAA,CAA8B,GAAA,EAAK,OAAA,EAAS,MAAM,CAAA;AACnE;AAQA,eAAsB,4BAAA,CAClB,GAAA,EACA,OAAA,EACA,MAAA,EACwF;AACxF,EAAA,OAAO,MAAMC,+BAAA,CAA0D,GAAA,EAAK,OAAA,EAAS,MAAM,CAAA;AAC/F;;;ACzBO,SAAS,qBAAA,GAAwE;AACpF,EAAA,OAAOC,uBAAA,CAAiB;AAAA,IACpB,CAAC,M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AAA,EAA2B;AAAA,SAC/C;AAAA;AACL,KACH,CAAA;AAAA,IACD,EAAE,IAAA,EAAMX,oBAAAA,EAAc;AAAE,GAC5B;AACJ;AAQO,SAAS,0BAAA,GAAoE;AAChF,EAAA,OAAOE,mBAAAA,CAAa,4BAAA,EAA6B,EAAG,4BAAA,EAA8B,CAAA;AACtF;AAMA,eAAsB,uBAAA,CAClB,KACA,MAAA,EAC2B;AAC3B,EAAA,MAAM,OAAA,GAAU,MAAM,yBAAA,CAA0B,GAAA,EAAK,8BAA8B,MAAM,CAAA;AACzF,EAAAC,6BAAoB,OAAO,CAAA;AAC3B,EAAA,MAAM,OAAA,GAAUC,sBAAAA,CAAc,OAAA,EAAS,4BAAA,EAA8B,CAAA;AACrE,EAAA,OAAO,OAAA,CAAQ,IAAA;AACnB","file":"index.node.cjs","sourcesContent":["import {\n type FetchAccountConfig,\n fetchEncodedAccount,\n fetchJsonParsedAccount,\n type MaybeAccount,\n type MaybeEncodedAccount,\n} from '@solana/accounts';\nimport type { Address } from '@solana/addresses';\nimport type { GetAccountInfoApi } from '@solana/rpc-api';\nimport type { JsonParsedSysvarAccount } from '@solana/rpc-parsed-types';\nimport type { Rpc } from '@solana/rpc-spec';\n\nexport const SYSVAR_CLOCK_ADDRESS =\n 'SysvarC1ock11111111111111111111111111111111' as Address<'SysvarC1ock11111111111111111111111111111111'>;\nexport const SYSVAR_EPOCH_REWARDS_ADDRESS =\n 'SysvarEpochRewards1111111111111111111111111' as Address<'SysvarEpochRewards1111111111111111111111111'>;\nexport const SYSVAR_EPOCH_SCHEDULE_ADDRESS =\n 'SysvarEpochSchedu1e111111111111111111111111' as Address<'SysvarEpochSchedu1e111111111111111111111111'>;\nexport const SYSVAR_INSTRUCTIONS_ADDRESS =\n 'Sysvar1nstructions1111111111111111111111111' as Address<'Sysvar1nstructions1111111111111111111111111'>;\nexport const SYSVAR_LAST_RESTART_SLOT_ADDRESS =\n 'SysvarLastRestartS1ot1111111111111111111111' as Address<'SysvarLastRestartS1ot1111111111111111111111'>;\nexport const SYSVAR_RECENT_BLOCKHASHES_ADDRESS =\n 'SysvarRecentB1ockHashes11111111111111111111' as Address<'SysvarRecentB1ockHashes11111111111111111111'>;\nexport const SYSVAR_RENT_ADDRESS =\n 'SysvarRent111111111111111111111111111111111' as Address<'SysvarRent111111111111111111111111111111111'>;\nexport const SYSVAR_SLOT_HASHES_ADDRESS =\n 'SysvarS1otHashes111111111111111111111111111' as Address<'SysvarS1otHashes111111111111111111111111111'>;\nexport const SYSVAR_SLOT_HISTORY_ADDRESS =\n 'SysvarS1otHistory11111111111111111111111111' as Address<'SysvarS1otHistory11111111111111111111111111'>;\nexport const SYSVAR_STAKE_HISTORY_ADDRESS =\n 'SysvarStakeHistory1111111111111111111111111' as Address<'SysvarStakeHistory1111111111111111111111111'>;\n\ntype SysvarAddress =\n | typeof SYSVAR_CLOCK_ADDRESS\n | typeof SYSVAR_EPOCH_REWARDS_ADDRESS\n | typeof SYSVAR_EPOCH_SCHEDULE_ADDRESS\n | typeof SYSVAR_INSTRUCTIONS_ADDRESS\n | typeof SYSVAR_LAST_RESTART_SLOT_ADDRESS\n | typeof SYSVAR_RECENT_BLOCKHASHES_ADDRESS\n | typeof SYSVAR_RENT_ADDRESS\n | typeof SYSVAR_SLOT_HASHES_ADDRESS\n | typeof SYSVAR_SLOT_HISTORY_ADDRESS\n | typeof SYSVAR_STAKE_HISTORY_ADDRESS;\n\n/**\n * Fetch an encoded sysvar account.\n *\n * Sysvars are special accounts that contain dynamically-updated data about the network cluster, the\n * blockchain history, and the executing transaction.\n */\nexport async function fetchEncodedSysvarAccount(\n rpc: Rpc,\n address: TAddress,\n config?: FetchAccountConfig,\n): Promise> {\n return await fetchEncodedAccount(rpc, address, config);\n}\n\n/**\n * Fetch a JSON-parsed sysvar account.\n *\n * Sysvars are special accounts that contain dynamically-updated data about the network cluster, the\n * blockchain history, and the executing transaction.\n */\nexport async function fetchJsonParsedSysvarAccount(\n rpc: Rpc,\n address: TAddress,\n config?: FetchAccountConfig,\n): Promise | MaybeEncodedAccount> {\n return await fetchJsonParsedAccount(rpc, address, config);\n}\n","import { assertAccountExists, decodeAccount, type FetchAccountConfig } from '@solana/accounts';\nimport {\n combineCodec,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n getI64Decoder,\n getI64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n} from '@solana/codecs';\nimport type { GetAccountInfoApi } from '@solana/rpc-api';\nimport type { Rpc } from '@solana/rpc-spec';\nimport type { Epoch, Slot, UnixTimestamp } from '@solana/rpc-types';\n\nimport { fetchEncodedSysvarAccount, SYSVAR_CLOCK_ADDRESS } from './sysvar';\n\ntype SysvarClockSize = 40;\n\n/**\n * Contains data on cluster time, including the current slot, epoch, and estimated wall-clock Unix\n * timestamp. It is updated every slot.\n */\nexport type SysvarClock = Readonly<{\n /** The current epoch */\n epoch: Epoch;\n /**\n * The Unix timestamp of the first slot in this epoch.\n *\n * In the first slot of an epoch, this timestamp is identical to the `unixTimestamp`.\n */\n epochStartTimestamp: UnixTimestamp;\n /** The most recent epoch for which the leader schedule has already been generated */\n leaderScheduleEpoch: Epoch;\n /** The current slot */\n slot: Slot;\n /** The Unix timestamp of this slot */\n unixTimestamp: UnixTimestamp;\n}>;\n\n/**\n * Returns an encoder that you can use to encode a {@link SysvarClock} to a byte array representing\n * the `Clock` sysvar's account data.\n */\nexport function getSysvarClockEncoder(): FixedSizeEncoder {\n return getStructEncoder([\n ['slot', getU64Encoder()],\n ['epochStartTimestamp', getI64Encoder()],\n ['epoch', getU64Encoder()],\n ['leaderScheduleEpoch', getU64Encoder()],\n ['unixTimestamp', getI64Encoder()],\n ]) as FixedSizeEncoder;\n}\n\n/**\n * Returns a decoder that you can use to decode a byte array representing the `Clock` sysvar's\n * account data to a {@link SysvarClock}.\n */\nexport function getSysvarClockDecoder(): FixedSizeDecoder {\n return getStructDecoder([\n ['slot', getU64Decoder()],\n ['epochStartTimestamp', getI64Decoder()],\n ['epoch', getU64Decoder()],\n ['leaderScheduleEpoch', getU64Decoder()],\n ['unixTimestamp', getI64Decoder()],\n ]) as FixedSizeDecoder;\n}\n\n/**\n * Returns a codec that you can use to encode from or decode to {@link SysvarClock}\n *\n * @see {@link getSysvarClockDecoder}\n * @see {@link getSysvarClockEncoder}\n */\nexport function getSysvarClockCodec(): FixedSizeCodec {\n return combineCodec(getSysvarClockEncoder(), getSysvarClockDecoder());\n}\n\n/**\n * Fetches the `Clock` sysvar account using any RPC that supports the {@link GetAccountInfoApi}.\n */\nexport async function fetchSysvarClock(rpc: Rpc, config?: FetchAccountConfig): Promise {\n const account = await fetchEncodedSysvarAccount(rpc, SYSVAR_CLOCK_ADDRESS, config);\n assertAccountExists(account);\n const decoded = decodeAccount(account, getSysvarClockDecoder());\n return decoded.data;\n}\n","import { assertAccountExists, decodeAccount, type FetchAccountConfig } from '@solana/accounts';\nimport {\n combineCodec,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n getU128Decoder,\n getU128Encoder,\n} from '@solana/codecs';\nimport type { GetAccountInfoApi } from '@solana/rpc-api';\nimport type { Rpc } from '@solana/rpc-spec';\nimport {\n Blockhash,\n getBlockhashDecoder,\n getBlockhashEncoder,\n getDefaultLamportsDecoder,\n getDefaultLamportsEncoder,\n Lamports,\n} from '@solana/rpc-types';\n\nimport { fetchEncodedSysvarAccount, SYSVAR_EPOCH_REWARDS_ADDRESS } from './sysvar';\n\ntype SysvarEpochRewardsSize = 81;\n\n/**\n * Tracks whether the rewards period (including calculation and distribution) is in progress, as\n * well as the details needed to resume distribution when starting from a snapshot during the\n * rewards period.\n *\n * The sysvar is repopulated at the start of the first block of each epoch. Therefore, the sysvar\n * contains data about the current epoch until a new epoch begins.\n */\nexport type SysvarEpochRewards = Readonly<{\n /** Whether the rewards period (including calculation and distribution) is active */\n active: boolean;\n /** The rewards currently distributed for the current epoch, in {@link Lamports} */\n distributedRewards: Lamports;\n /** The starting block height of the rewards distribution in the current epoch */\n distributionStartingBlockHeight: bigint;\n /**\n * Number of partitions in the rewards distribution in the current epoch, used to generate an\n * `EpochRewardsHasher`\n */\n numPartitions: bigint;\n /**\n * The {@link Blockhash} of the parent block of the first block in the epoch, used to seed an\n * `EpochRewardsHasher`\n */\n parentBlockhash: Blockhash;\n /**\n * The total rewards points calculated for the current epoch, where points equals the sum of\n * (delegated stake * credits observed) for all delegations\n */\n totalPoints: bigint;\n /** The total rewards for the current epoch, in {@link Lamports} */\n totalRewards: Lamports;\n}>;\n\n/**\n * Returns an encoder that you can use to encode a {@link SysvarEpochRewards} to a byte array\n * representing the `EpochRewards` sysvar's account data.\n */\nexport function getSysvarEpochRewardsEncoder(): FixedSizeEncoder {\n return getStructEncoder([\n ['distributionStartingBlockHeight', getU64Encoder()],\n ['numPartitions', getU64Encoder()],\n ['parentBlockhash', getBlockhashEncoder()],\n ['totalPoints', getU128Encoder()],\n ['totalRewards', getDefaultLamportsEncoder()],\n ['distributedRewards', getDefaultLamportsEncoder()],\n ['active', getBooleanEncoder()],\n ]) as FixedSizeEncoder;\n}\n\n/**\n * Returns a decoder that you can use to decode a byte array representing the `EpochRewards`\n * sysvar's account data to a {@link SysvarEpochRewards}.\n */\nexport function getSysvarEpochRewardsDecoder(): FixedSizeDecoder {\n return getStructDecoder([\n ['distributionStartingBlockHeight', getU64Decoder()],\n ['numPartitions', getU64Decoder()],\n ['parentBlockhash', getBlockhashDecoder()],\n ['totalPoints', getU128Decoder()],\n ['totalRewards', getDefaultLamportsDecoder()],\n ['distributedRewards', getDefaultLamportsDecoder()],\n ['active', getBooleanDecoder()],\n ]) as FixedSizeDecoder;\n}\n\n/**\n * Returns a codec that you can use to encode from or decode to {@link SysvarEpochRewards}\n *\n * @see {@link getSysvarEpochRewardsDecoder}\n * @see {@link getSysvarEpochRewardsEncoder}\n */\nexport function getSysvarEpochRewardsCodec(): FixedSizeCodec<\n SysvarEpochRewards,\n SysvarEpochRewards,\n SysvarEpochRewardsSize\n> {\n return combineCodec(getSysvarEpochRewardsEncoder(), getSysvarEpochRewardsDecoder());\n}\n\n/**\n * Fetch the `EpochRewards` sysvar account using any RPC that supports the\n * {@link GetAccountInfoApi}.\n */\nexport async function fetchSysvarEpochRewards(\n rpc: Rpc,\n config?: FetchAccountConfig,\n): Promise {\n const account = await fetchEncodedSysvarAccount(rpc, SYSVAR_EPOCH_REWARDS_ADDRESS, config);\n assertAccountExists(account);\n const decoded = decodeAccount(account, getSysvarEpochRewardsDecoder());\n return decoded.data;\n}\n","import { assertAccountExists, decodeAccount, type FetchAccountConfig } from '@solana/accounts';\nimport {\n combineCodec,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n getBooleanDecoder,\n getBooleanEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n} from '@solana/codecs';\nimport type { GetAccountInfoApi } from '@solana/rpc-api';\nimport type { Rpc } from '@solana/rpc-spec';\nimport type { Epoch, Slot } from '@solana/rpc-types';\n\nimport { fetchEncodedSysvarAccount, SYSVAR_EPOCH_SCHEDULE_ADDRESS } from './sysvar';\n\ntype SysvarEpochScheduleSize = 33;\n\n/**\n * Includes the number of slots per epoch, timing of leader schedule selection, and information\n * about epoch warm-up time.\n */\nexport type SysvarEpochSchedule = Readonly<{\n /**\n * First normal-length epoch after the warmup period,\n * log2(slotsPerEpoch) - log2(MINIMUM_SLOTS_PER_EPOCH)\n */\n firstNormalEpoch: Epoch;\n /**\n * The first slot after the warmup period, MINIMUM_SLOTS_PER_EPOCH * (2^(firstNormalEpoch) - 1)\n */\n firstNormalSlot: Slot;\n /**\n * A number of slots before beginning of an epoch to calculate a leader schedule for that\n * epoch.\n */\n leaderScheduleSlotOffset: bigint;\n /** The maximum number of slots in each epoch */\n slotsPerEpoch: bigint;\n /** Whether epochs start short and grow */\n warmup: boolean;\n}>;\n\n/**\n * Returns an encoder that you can use to encode a {@link SysvarEpochSchedule} to a byte array\n * representing the `EpochSchedule` sysvar's account data.\n */\nexport function getSysvarEpochScheduleEncoder(): FixedSizeEncoder {\n return getStructEncoder([\n ['slotsPerEpoch', getU64Encoder()],\n ['leaderScheduleSlotOffset', getU64Encoder()],\n ['warmup', getBooleanEncoder()],\n ['firstNormalEpoch', getU64Encoder()],\n ['firstNormalSlot', getU64Encoder()],\n ]) as FixedSizeEncoder;\n}\n\n/**\n * Returns a decoder that you can use to decode a byte array representing the `EpochSchedule`\n * sysvar's account data to a {@link SysvarEpochSchedule}.\n */\nexport function getSysvarEpochScheduleDecoder(): FixedSizeDecoder {\n return getStructDecoder([\n ['slotsPerEpoch', getU64Decoder()],\n ['leaderScheduleSlotOffset', getU64Decoder()],\n ['warmup', getBooleanDecoder()],\n ['firstNormalEpoch', getU64Decoder()],\n ['firstNormalSlot', getU64Decoder()],\n ]) as FixedSizeDecoder;\n}\n\n/**\n * Returns a codec that you can use to encode from or decode to {@link SysvarEpochSchedule}\n *\n * @see {@link getSysvarEpochScheduleDecoder}\n * @see {@link getSysvarEpochScheduleEncoder}\n */\nexport function getSysvarEpochScheduleCodec(): FixedSizeCodec<\n SysvarEpochSchedule,\n SysvarEpochSchedule,\n SysvarEpochScheduleSize\n> {\n return combineCodec(getSysvarEpochScheduleEncoder(), getSysvarEpochScheduleDecoder());\n}\n\n/**\n * Fetches the `EpochSchedule` sysvar account using any RPC that supports the\n * {@link GetAccountInfoApi}.\n */\nexport async function fetchSysvarEpochSchedule(\n rpc: Rpc,\n config?: FetchAccountConfig,\n): Promise {\n const account = await fetchEncodedSysvarAccount(rpc, SYSVAR_EPOCH_SCHEDULE_ADDRESS, config);\n assertAccountExists(account);\n const decoded = decodeAccount(account, getSysvarEpochScheduleDecoder());\n return decoded.data;\n}\n","import { assertAccountExists, decodeAccount, type FetchAccountConfig } from '@solana/accounts';\nimport {\n combineCodec,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n} from '@solana/codecs';\nimport type { GetAccountInfoApi } from '@solana/rpc-api';\nimport type { Rpc } from '@solana/rpc-spec';\nimport type { Slot } from '@solana/rpc-types';\n\nimport { fetchEncodedSysvarAccount, SYSVAR_LAST_RESTART_SLOT_ADDRESS } from './sysvar';\n\ntype SysvarLastRestartSlotSize = 8;\n\n/**\n * Information about the last restart slot (hard fork).\n *\n * The `LastRestartSlot` sysvar provides access to the last restart slot kept in the bank fork for\n * the slot on the fork that executes the current transaction. In case there was no fork it returns\n * `0`.\n */\nexport type SysvarLastRestartSlot = Readonly<{\n /** The last restart {@link Slot} */\n lastRestartSlot: Slot;\n}>;\n\n/**\n * Returns an encoder that you can use to encode a {@link SysvarLastRestartSlot} to a byte array\n * representing the `LastRestartSlot` sysvar's account data.\n */\nexport function getSysvarLastRestartSlotEncoder(): FixedSizeEncoder {\n return getStructEncoder([['lastRestartSlot', getU64Encoder()]]) as FixedSizeEncoder<\n SysvarLastRestartSlot,\n SysvarLastRestartSlotSize\n >;\n}\n\n/**\n * Returns a decoder that you can use to decode a byte array representing the `LastRestartSlot`\n * sysvar's account data to a {@link SysvarLastRestartSlot}.\n */\nexport function getSysvarLastRestartSlotDecoder(): FixedSizeDecoder {\n return getStructDecoder([['lastRestartSlot', getU64Decoder()]]) as FixedSizeDecoder<\n SysvarLastRestartSlot,\n SysvarLastRestartSlotSize\n >;\n}\n\n/**\n * Returns a codec that you can use to encode from or decode to {@link SysvarLastRestartSlot}\n *\n * @see {@link getSysvarLastRestartSlotDecoder}\n * @see {@link getSysvarLastRestartSlotEncoder}\n */\nexport function getSysvarLastRestartSlotCodec(): FixedSizeCodec<\n SysvarLastRestartSlot,\n SysvarLastRestartSlot,\n SysvarLastRestartSlotSize\n> {\n return combineCodec(getSysvarLastRestartSlotEncoder(), getSysvarLastRestartSlotDecoder());\n}\n\n/**\n * Fetches the `LastRestartSlot` sysvar account using any RPC that supports the\n * {@link GetAccountInfoApi}.\n */\nexport async function fetchSysvarLastRestartSlot(\n rpc: Rpc,\n config?: FetchAccountConfig,\n): Promise {\n const account = await fetchEncodedSysvarAccount(rpc, SYSVAR_LAST_RESTART_SLOT_ADDRESS, config);\n assertAccountExists(account);\n const decoded = decodeAccount(account, getSysvarLastRestartSlotDecoder());\n return decoded.data;\n}\n","import { assertAccountExists, decodeAccount, type FetchAccountConfig } from '@solana/accounts';\nimport {\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n type VariableSizeCodec,\n type VariableSizeDecoder,\n type VariableSizeEncoder,\n} from '@solana/codecs';\nimport type { GetAccountInfoApi } from '@solana/rpc-api';\nimport type { Rpc } from '@solana/rpc-spec';\nimport {\n type Blockhash,\n getBlockhashDecoder,\n getBlockhashEncoder,\n getDefaultLamportsDecoder,\n getDefaultLamportsEncoder,\n type Lamports,\n} from '@solana/rpc-types';\n\nimport { fetchEncodedSysvarAccount, SYSVAR_RECENT_BLOCKHASHES_ADDRESS } from './sysvar';\n\ntype FeeCalculator = Readonly<{\n /**\n * The current cost of a signature.\n *\n * This amount may increase/decrease over time based on cluster processing load\n */\n lamportsPerSignature: Lamports;\n}>;\ntype Entry = Readonly<{\n blockhash: Blockhash;\n feeCalculator: FeeCalculator;\n}>;\n\n/**\n * Information about recent blocks and their fee calculators.\n *\n * @deprecated Transaction fees should be determined with the\n * {@link GetFeeForMessageApi.getFeeForMessage} RPC method. For additional context see the\n * [Comprehensive Compute Fees proposal](https://docs.anza.xyz/proposals/comprehensive-compute-fees/).\n */\nexport type SysvarRecentBlockhashes = Entry[];\n\n/**\n * Returns an encoder that you can use to encode a {@link SysvarRecentBlockhashes} to a byte array\n * representing the `RecentBlockhashes` sysvar's account data.\n *\n * @deprecated Transaction fees should be determined with the\n * {@link GetFeeForMessageApi.getFeeForMessage} RPC method. For additional context see the\n * [Comprehensive Compute Fees proposal](https://docs.anza.xyz/proposals/comprehensive-compute-fees/).\n */\nexport function getSysvarRecentBlockhashesEncoder(): VariableSizeEncoder {\n return getArrayEncoder(\n getStructEncoder([\n ['blockhash', getBlockhashEncoder()],\n ['feeCalculator', getStructEncoder([['lamportsPerSignature', getDefaultLamportsEncoder()]])],\n ]),\n );\n}\n\n/**\n * Returns a decoder that you can use to decode a byte array representing the `RecentBlockhashes`\n * sysvar's account data to a {@link SysvarRecentBlockhashes}.\n *\n * @deprecated Transaction fees should be determined with the\n * {@link GetFeeForMessageApi.getFeeForMessage} RPC method. For additional context see the\n * [Comprehensive Compute Fees proposal](https://docs.anza.xyz/proposals/comprehensive-compute-fees/).\n */\nexport function getSysvarRecentBlockhashesDecoder(): VariableSizeDecoder {\n return getArrayDecoder(\n getStructDecoder([\n ['blockhash', getBlockhashDecoder()],\n ['feeCalculator', getStructDecoder([['lamportsPerSignature', getDefaultLamportsDecoder()]])],\n ]),\n );\n}\n\n/**\n * Returns a codec that you can use to encode from or decode to {@link SysvarRecentBlockhashes}\n *\n * @deprecated Transaction fees should be determined with the\n * {@link GetFeeForMessageApi.getFeeForMessage} RPC method. For additional context see the\n * [Comprehensive Compute Fees proposal](https://docs.anza.xyz/proposals/comprehensive-compute-fees/).\n *\n * @see {@link getSysvarRecentBlockhashesDecoder}\n * @see {@link getSysvarRecentBlockhashesEncoder}\n */\nexport function getSysvarRecentBlockhashesCodec(): VariableSizeCodec {\n return combineCodec(getSysvarRecentBlockhashesEncoder(), getSysvarRecentBlockhashesDecoder());\n}\n\n/**\n * Fetches the `RecentBlockhashes` sysvar account using any RPC that supports the\n * {@link GetAccountInfoApi}.\n *\n * @deprecated Transaction fees should be determined with the\n * {@link GetFeeForMessageApi.getFeeForMessage} RPC method. For additional context see the\n * [Comprehensive Compute Fees proposal](https://docs.anza.xyz/proposals/comprehensive-compute-fees/).\n */\nexport async function fetchSysvarRecentBlockhashes(\n rpc: Rpc,\n config?: FetchAccountConfig,\n): Promise {\n const account = await fetchEncodedSysvarAccount(rpc, SYSVAR_RECENT_BLOCKHASHES_ADDRESS, config);\n assertAccountExists(account);\n const decoded = decodeAccount(account, getSysvarRecentBlockhashesDecoder());\n return decoded.data;\n}\n","import { assertAccountExists, decodeAccount, type FetchAccountConfig } from '@solana/accounts';\nimport {\n combineCodec,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n getF64Decoder,\n getF64Encoder,\n getStructDecoder,\n getStructEncoder,\n getU8Decoder,\n getU8Encoder,\n} from '@solana/codecs';\nimport type { GetAccountInfoApi } from '@solana/rpc-api';\nimport type { Rpc } from '@solana/rpc-spec';\nimport {\n F64UnsafeSeeDocumentation,\n getDefaultLamportsDecoder,\n getDefaultLamportsEncoder,\n type Lamports,\n} from '@solana/rpc-types';\n\nimport { fetchEncodedSysvarAccount, SYSVAR_RENT_ADDRESS } from './sysvar';\n\ntype SysvarRentSize = 17;\n\n/**\n * Configuration for network rent.\n */\nexport type SysvarRent = Readonly<{\n /**\n * The percentage of collected rent that is burned.\n *\n * Valid values are in the range [0, 100]. The remaining percentage is distributed to\n * validators.\n */\n burnPercent: number;\n /** Amount of time (in years) a balance must include rent for the account to be rent exempt */\n exemptionThreshold: F64UnsafeSeeDocumentation;\n /** Rental rate in {@link Lamports}/byte-year. */\n lamportsPerByteYear: Lamports;\n}>;\n\n/**\n * Returns an encoder that you can use to encode a {@link SysvarRent} to a byte array representing\n * the `Rent` sysvar's account data.\n */\nexport function getSysvarRentEncoder(): FixedSizeEncoder {\n return getStructEncoder([\n ['lamportsPerByteYear', getDefaultLamportsEncoder()],\n ['exemptionThreshold', getF64Encoder()],\n ['burnPercent', getU8Encoder()],\n ]) as FixedSizeEncoder;\n}\n\n/**\n * Returns a decoder that you can use to decode a byte array representing the `Rent` sysvar's\n * account data to a {@link SysvarRent}.\n */\nexport function getSysvarRentDecoder(): FixedSizeDecoder {\n return getStructDecoder([\n ['lamportsPerByteYear', getDefaultLamportsDecoder()],\n ['exemptionThreshold', getF64Decoder()],\n ['burnPercent', getU8Decoder()],\n ]) as FixedSizeDecoder;\n}\n\n/**\n * Returns a codec that you can use to encode from or decode to {@link SysvarRent}\n *\n * @see {@link getSysvarRentDecoder}\n * @see {@link getSysvarRentEncoder}\n */\nexport function getSysvarRentCodec(): FixedSizeCodec {\n return combineCodec(getSysvarRentEncoder(), getSysvarRentDecoder());\n}\n\n/**\n * Fetches the `Rent` sysvar account using any RPC that supports the {@link GetAccountInfoApi}.\n */\nexport async function fetchSysvarRent(rpc: Rpc, config?: FetchAccountConfig): Promise {\n const account = await fetchEncodedSysvarAccount(rpc, SYSVAR_RENT_ADDRESS, config);\n assertAccountExists(account);\n const decoded = decodeAccount(account, getSysvarRentDecoder());\n return decoded.data;\n}\n","import { assertAccountExists, decodeAccount, type FetchAccountConfig } from '@solana/accounts';\nimport {\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type VariableSizeCodec,\n type VariableSizeDecoder,\n type VariableSizeEncoder,\n} from '@solana/codecs';\nimport type { GetAccountInfoApi } from '@solana/rpc-api';\nimport type { Rpc } from '@solana/rpc-spec';\nimport { type Blockhash, getBlockhashDecoder, getBlockhashEncoder, type Slot } from '@solana/rpc-types';\n\nimport { fetchEncodedSysvarAccount, SYSVAR_SLOT_HASHES_ADDRESS } from './sysvar';\n\ntype Entry = Readonly<{\n hash: Blockhash;\n slot: Slot;\n}>;\n\n/** The most recent hashes of a slot's parent banks. */\nexport type SysvarSlotHashes = Entry[];\n\n/**\n * Returns an encoder that you can use to encode a {@link SysvarSlotHashes} to a byte array\n * representing the `SlotHashes` sysvar's account data.\n */\nexport function getSysvarSlotHashesEncoder(): VariableSizeEncoder {\n return getArrayEncoder(\n getStructEncoder([\n ['slot', getU64Encoder()],\n ['hash', getBlockhashEncoder()],\n ]),\n );\n}\n\n/**\n * Returns a decoder that you can use to decode a byte array representing the `SlotHashes` sysvar's\n * account data to a {@link SysvarSlotHashes}.\n */\nexport function getSysvarSlotHashesDecoder(): VariableSizeDecoder {\n return getArrayDecoder(\n getStructDecoder([\n ['slot', getU64Decoder()],\n ['hash', getBlockhashDecoder()],\n ]),\n );\n}\n\n/**\n * Returns a codec that you can use to encode from or decode to {@link SysvarSlotHashes}\n *\n * @see {@link getSysvarSlotHashesDecoder}\n * @see {@link getSysvarSlotHashesEncoder}\n */\nexport function getSysvarSlotHashesCodec(): VariableSizeCodec {\n return combineCodec(getSysvarSlotHashesEncoder(), getSysvarSlotHashesDecoder());\n}\n\n/**\n * Fetches the `SlotHashes` sysvar account using any RPC that supports the {@link GetAccountInfoApi}.\n */\nexport async function fetchSysvarSlotHashes(\n rpc: Rpc,\n config?: FetchAccountConfig,\n): Promise {\n const account = await fetchEncodedSysvarAccount(rpc, SYSVAR_SLOT_HASHES_ADDRESS, config);\n assertAccountExists(account);\n const decoded = decodeAccount(account, getSysvarSlotHashesDecoder());\n return decoded.data;\n}\n","import { assertAccountExists, decodeAccount, type FetchAccountConfig } from '@solana/accounts';\nimport {\n combineCodec,\n createDecoder,\n createEncoder,\n type FixedSizeCodec,\n type FixedSizeDecoder,\n type FixedSizeEncoder,\n getArrayCodec,\n getU64Codec,\n getU64Decoder,\n getU64Encoder,\n ReadonlyUint8Array,\n} from '@solana/codecs';\nimport {\n SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE,\n SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH,\n SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS,\n SolanaError,\n} from '@solana/errors';\nimport type { GetAccountInfoApi } from '@solana/rpc-api';\nimport type { Rpc } from '@solana/rpc-spec';\nimport type { Slot } from '@solana/rpc-types';\n\nimport { fetchEncodedSysvarAccount, SYSVAR_SLOT_HISTORY_ADDRESS } from './sysvar';\n\nconst BITVEC_DISCRIMINATOR = 1;\n// Max number of bits in the bitvector.\n// The Solana SDK defines a constant `MAX_ENTRIES` representing the maximum\n// number of bits that can be represented by the bitvector in the `SlotHistory`\n// sysvar. This value is 1024 * 1024 = 1_048_576.\n// See https://github.com/anza-xyz/agave/blob/e0203f22dc83cb792fa97f91dbe6e924cbd08af1/sdk/program/src/slot_history.rs#L43\nconst BITVEC_NUM_BITS = 1024 * 1024;\n// The length of the bitvector in blocks.\n// At 64 bits per block, this is 1024 * 1024 / 64 = 16_384.\nconst BITVEC_LENGTH = BITVEC_NUM_BITS / 64;\n\nconst SLOT_HISTORY_ACCOUNT_DATA_STATIC_SIZE =\n 1 + // Discriminator\n 8 + // bitvector length (u64)\n BITVEC_LENGTH * 8 +\n 8 + // Number of bits (u64)\n 8; // Next slot (u64)\n\nlet memoizedU64Encoder: FixedSizeEncoder | undefined;\nlet memoizedU64Decoder: FixedSizeDecoder | undefined;\nlet memoizedU64ArrayEncoder: FixedSizeEncoder | undefined;\nlet memoizedU64ArrayDecoder: FixedSizeDecoder | undefined;\n\nfunction getMemoizedU64Encoder(): FixedSizeEncoder {\n if (!memoizedU64Encoder) memoizedU64Encoder = getU64Encoder();\n return memoizedU64Encoder;\n}\nfunction getMemoizedU64Decoder(): FixedSizeDecoder {\n if (!memoizedU64Decoder) memoizedU64Decoder = getU64Decoder();\n return memoizedU64Decoder;\n}\nfunction getMemoizedU64ArrayEncoder(): FixedSizeEncoder {\n if (!memoizedU64ArrayEncoder) memoizedU64ArrayEncoder = getArrayCodec(getU64Codec(), { size: BITVEC_LENGTH });\n return memoizedU64ArrayEncoder;\n}\nfunction getMemoizedU64ArrayDecoder(): FixedSizeDecoder {\n if (!memoizedU64ArrayDecoder) memoizedU64ArrayDecoder = getArrayCodec(getU64Codec(), { size: BITVEC_LENGTH });\n return memoizedU64ArrayDecoder;\n}\n\ntype SysvarSlotHistorySize = typeof SLOT_HISTORY_ACCOUNT_DATA_STATIC_SIZE;\n\n/** A bitvector of slots present over the last epoch. */\nexport type SysvarSlotHistory = {\n /**\n * A vector of 64-bit numbers which, when their bits are strung together, represent a record of\n * non-skipped slots.\n *\n * The bit in position (slot % MAX_ENTRIES) is 0 if the slot was skipped and 1 otherwise, valid\n * only when the candidate slot is less than `nextSlot` and greater than or equal to\n * `MAX_ENTRIES - nextSlot`.\n */\n bits: bigint[];\n /** The number of the slot one newer than tracked by the bitvector */\n nextSlot: Slot;\n};\n\n/**\n * Returns an encoder that you can use to encode a {@link SysvarSlotHistory} to a byte array\n * representing the `SlotHistory` sysvar's account data.\n */\nexport function getSysvarSlotHistoryEncoder(): FixedSizeEncoder {\n return createEncoder({\n fixedSize: SLOT_HISTORY_ACCOUNT_DATA_STATIC_SIZE,\n write: (value: SysvarSlotHistory, bytes, offset) => {\n // First byte is the bitvector discriminator.\n bytes.set([BITVEC_DISCRIMINATOR], offset);\n offset += 1;\n // Next 8 bytes are the bitvector length.\n getMemoizedU64Encoder().write(BigInt(BITVEC_LENGTH), bytes, offset);\n offset += 8;\n // Next `BITVEC_LENGTH` bytes are the bitvector.\n // Any missing bits are assumed to be 0.\n getMemoizedU64ArrayEncoder().write(value.bits, bytes, offset);\n offset += BITVEC_LENGTH * 8;\n // Next 8 bytes are the number of bits.\n getMemoizedU64Encoder().write(BigInt(BITVEC_NUM_BITS), bytes, offset);\n offset += 8;\n // Next 8 bytes are the next slot.\n getMemoizedU64Encoder().write(value.nextSlot, bytes, offset);\n offset += 8;\n return offset;\n },\n });\n}\n\n/**\n * Returns a decoder that you can use to decode a byte array representing the `SlotHistory` sysvar's\n * account data to a {@link SysvarSlotHistory}.\n */\nexport function getSysvarSlotHistoryDecoder(): FixedSizeDecoder {\n return createDecoder({\n fixedSize: SLOT_HISTORY_ACCOUNT_DATA_STATIC_SIZE,\n read: (bytes: ReadonlyUint8Array | Uint8Array, offset) => {\n // Byte length should be exact.\n if (bytes.length != SLOT_HISTORY_ACCOUNT_DATA_STATIC_SIZE) {\n throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_BYTE_LENGTH, {\n actual: bytes.length,\n expected: SLOT_HISTORY_ACCOUNT_DATA_STATIC_SIZE,\n });\n }\n // First byte is the bitvector discriminator.\n const discriminator = bytes[offset];\n offset += 1;\n if (discriminator !== BITVEC_DISCRIMINATOR) {\n throw new SolanaError(SOLANA_ERROR__CODECS__ENUM_DISCRIMINATOR_OUT_OF_RANGE, {\n actual: discriminator,\n expected: BITVEC_DISCRIMINATOR,\n });\n }\n // Next 8 bytes are the bitvector length.\n const bitVecLength = getMemoizedU64Decoder().read(bytes, offset)[0];\n offset += 8;\n if (bitVecLength !== BigInt(BITVEC_LENGTH)) {\n throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS, {\n actual: bitVecLength,\n codecDescription: 'SysvarSlotHistoryCodec',\n expected: BITVEC_LENGTH,\n });\n }\n // Next `BITVEC_LENGTH` bytes are the bitvector.\n const bits = getMemoizedU64ArrayDecoder().read(bytes, offset)[0];\n offset += BITVEC_LENGTH * 8;\n // Next 8 bytes are the number of bits.\n const numBits = getMemoizedU64Decoder().read(bytes, offset)[0];\n offset += 8;\n if (numBits !== BigInt(BITVEC_NUM_BITS)) {\n throw new SolanaError(SOLANA_ERROR__CODECS__INVALID_NUMBER_OF_ITEMS, {\n actual: numBits,\n codecDescription: 'SysvarSlotHistoryCodec',\n expected: BITVEC_NUM_BITS,\n });\n }\n // Next 8 bytes are the next slot.\n const nextSlot = getMemoizedU64Decoder().read(bytes, offset)[0];\n offset += 8;\n return [\n {\n bits,\n nextSlot,\n },\n offset,\n ];\n },\n });\n}\n\n/**\n * Returns a codec that you can use to encode from or decode to {@link SysvarSlotHistory}\n *\n * @see {@link getSysvarSlotHistoryDecoder}\n * @see {@link getSysvarSlotHistoryEncoder}\n */\nexport function getSysvarSlotHistoryCodec(): FixedSizeCodec<\n SysvarSlotHistory,\n SysvarSlotHistory,\n SysvarSlotHistorySize\n> {\n return combineCodec(getSysvarSlotHistoryEncoder(), getSysvarSlotHistoryDecoder());\n}\n\n/**\n * Fetches the `SlotHistory` sysvar account using any RPC that supports the\n * {@link GetAccountInfoApi}.\n */\nexport async function fetchSysvarSlotHistory(\n rpc: Rpc,\n config?: FetchAccountConfig,\n): Promise {\n const account = await fetchEncodedSysvarAccount(rpc, SYSVAR_SLOT_HISTORY_ADDRESS, config);\n assertAccountExists(account);\n const decoded = decodeAccount(account, getSysvarSlotHistoryDecoder());\n return decoded.data;\n}\n","import { assertAccountExists, decodeAccount, type FetchAccountConfig } from '@solana/accounts';\nimport {\n combineCodec,\n getArrayDecoder,\n getArrayEncoder,\n getStructDecoder,\n getStructEncoder,\n getU64Decoder,\n getU64Encoder,\n type VariableSizeCodec,\n type VariableSizeDecoder,\n type VariableSizeEncoder,\n} from '@solana/codecs';\nimport type { GetAccountInfoApi } from '@solana/rpc-api';\nimport type { Rpc } from '@solana/rpc-spec';\nimport { Epoch, getDefaultLamportsDecoder, getDefaultLamportsEncoder, type Lamports } from '@solana/rpc-types';\n\nimport { fetchEncodedSysvarAccount, SYSVAR_STAKE_HISTORY_ADDRESS } from './sysvar';\n\ntype Entry = Readonly<{\n /** The epoch to which this stake history entry pertains */\n epoch: Epoch;\n stakeHistory: Readonly<{\n /**\n * Sum of portion of stakes requested to be warmed up, but not fully activated yet, in\n * {@link Lamports}\n */\n activating: Lamports;\n /**\n * Sum of portion of stakes requested to be cooled down, but not fully deactivated yet, in\n * {@link Lamports}\n */\n deactivating: Lamports;\n /** Effective stake at this epoch, in {@link Lamports} */\n effective: Lamports;\n }>;\n}>;\n\n/** History of stake activations and de-activations. */\nexport type SysvarStakeHistory = Entry[];\n\n/**\n * Returns an encoder that you can use to encode a {@link SysvarStakeHistory} to a byte array\n * representing the `StakeHistory` sysvar's account data.\n */\nexport function getSysvarStakeHistoryEncoder(): VariableSizeEncoder {\n return getArrayEncoder(\n getStructEncoder([\n ['epoch', getU64Encoder()],\n [\n 'stakeHistory',\n getStructEncoder([\n ['effective', getDefaultLamportsEncoder()],\n ['activating', getDefaultLamportsEncoder()],\n ['deactivating', getDefaultLamportsEncoder()],\n ]),\n ],\n ]),\n { size: getU64Encoder() },\n );\n}\n\n/**\n * Returns a decoder that you can use to decode a byte array representing the `StakeHistory`\n * sysvar's account data to a {@link SysvarStakeHistory}.\n */\nexport function getSysvarStakeHistoryDecoder(): VariableSizeDecoder {\n return getArrayDecoder(\n getStructDecoder([\n ['epoch', getU64Decoder()],\n [\n 'stakeHistory',\n getStructDecoder([\n ['effective', getDefaultLamportsDecoder()],\n ['activating', getDefaultLamportsDecoder()],\n ['deactivating', getDefaultLamportsDecoder()],\n ]),\n ],\n ]),\n { size: getU64Decoder() },\n );\n}\n\n/**\n * Returns a codec that you can use to encode from or decode to {@link SysvarStakeHistory}\n *\n * @see {@link getSysvarStakeHistoryDecoder}\n * @see {@link getSysvarStakeHistoryEncoder}\n */\nexport function getSysvarStakeHistoryCodec(): VariableSizeCodec {\n return combineCodec(getSysvarStakeHistoryEncoder(), getSysvarStakeHistoryDecoder());\n}\n\n/**\n * Fetches the `StakeHistory` sysvar account using any RPC that supports the\n * {@link GetAccountInfoApi}.\n */\nexport async function fetchSysvarStakeHistory(\n rpc: Rpc,\n config?: FetchAccountConfig,\n): Promise {\n const account = await fetchEncodedSysvarAccount(rpc, SYSVAR_STAKE_HISTORY_ADDRESS, config);\n assertAccountExists(account);\n const decoded = decodeAccount(account, getSysvarStakeHistoryDecoder());\n return decoded.data;\n}\n"]}