{"_id":"@atlaschain/sysvars","name":"@atlaschain/sysvars","dist-tags":{"latest":"3.0.0"},"versions":{"3.0.0":{"name":"@atlaschain/sysvars","version":"3.0.0","description":"An abstraction layer over signing messages and transactions in Atlas","exports":{"edge-light":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"workerd":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"react-native":"./dist/index.native.mjs","types":"./dist/types/index.d.ts"},"browser":{"./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs"},"main":"./dist/index.node.cjs","module":"./dist/index.node.mjs","react-native":"./dist/index.native.mjs","types":"./dist/types/index.d.ts","type":"commonjs","sideEffects":false,"keywords":["blockchain","atlas","web3"],"author":{"name":"Atlas Chain Foundation"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/anza-xyz/kit.git"},"bugs":{"url":"https://github.com/anza-xyz/kit/issues"},"browserslist":["supports bigint and not dead","maintained node versions"],"dependencies":{"@atlaschain/accounts":"3.0.0","@atlaschain/codecs":"3.0.0","@atlaschain/rpc-types":"3.0.0","@atlaschain/errors":"3.0.0"},"peerDependencies":{"typescript":">=5.3.3"},"engines":{"node":">=20.18.0"},"scripts":{"compile:docs":"typedoc","compile:js":"tsup --config build-scripts/tsup.config.package.ts","compile:typedefs":"tsc -p ./tsconfig.declarations.json","dev":"jest -c ../../node_modules/@atlaschain/test-config/jest-dev.config.ts --rootDir . --watch","publish-impl":"npm view $npm_package_name@$npm_package_version > /dev/null 2>&1 || (pnpm publish --tag ${PUBLISH_TAG:-canary} --access public --no-git-checks && (([ -n \"${GITHUB_OUTPUT:-}\" ] && echo 'published=true' >> \"$GITHUB_OUTPUT\") || true) && (([ \"$PUBLISH_TAG\" != \"canary\" ] && ../build-scripts/maybe-tag-latest.ts $npm_package_name@$npm_package_version) || true))","publish-packages":"pnpm prepublishOnly && pnpm publish-impl","style:fix":"pnpm eslint --fix src && pnpm prettier --log-level warn --ignore-unknown --write ./*","test:lint":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@atlaschain/test-config/jest-lint.config.ts --rootDir . --silent","test:prettier":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@atlaschain/test-config/jest-prettier.config.ts --rootDir . --silent","test:treeshakability:browser":"agadoo dist/index.browser.mjs","test:treeshakability:native":"agadoo dist/index.native.mjs","test:treeshakability:node":"agadoo dist/index.node.mjs","test:typecheck":"tsc --noEmit","test:unit:browser":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@atlaschain/test-config/jest-unit.config.browser.ts --globalSetup @atlaschain/test-config/test-validator-setup.js --globalTeardown @atlaschain/test-config/test-validator-teardown.js --rootDir . --silent","test:unit:node":"TERM_OVERRIDE=\"${TURBO_HASH:+dumb}\" TERM=${TERM_OVERRIDE:-$TERM} jest -c ../../node_modules/@atlaschain/test-config/jest-unit.config.node.ts --globalSetup @atlaschain/test-config/test-validator-setup.js --globalTeardown @atlaschain/test-config/test-validator-teardown.js --rootDir . --silent"},"_id":"@atlaschain/sysvars@3.0.0","homepage":"https://github.com/anza-xyz/kit#readme","_integrity":"sha512-Q4gAPTIgKtEv9GDjtP/u2eDVjnst5fLjRt2StypgMDrtdfBLZ8gKZ5y78rMWxc3UQcg2RuLJtdABS/hWaQkjTg==","_resolved":"/private/var/folders/q8/nr55p0wd491c6fjmbky17kd00000gn/T/9835d7b4e54d26078c01106b56831a1a/atlaschain-sysvars-3.0.0.tgz","_from":"file:atlaschain-sysvars-3.0.0.tgz","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-Q4gAPTIgKtEv9GDjtP/u2eDVjnst5fLjRt2StypgMDrtdfBLZ8gKZ5y78rMWxc3UQcg2RuLJtdABS/hWaQkjTg==","shasum":"0e821e187aa14d5cfd6ae120f1e6aa994dbb25dc","tarball":"https://registry.npmjs.org/@atlaschain/sysvars/-/sysvars-3.0.0.tgz","fileCount":5,"unpackedSize":13589,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCgYyck0lYN6Av3+NDpVeR5w9TiUoogw9s8yUmu/m8DMwIgHyIfnNSWkVegKPnHID9pDb0DHQNYGum5Je4JGpKIVD0="}]},"_npmUser":{"name":"atlaschain","email":"jq@atlaschain.org"},"directories":{},"maintainers":[{"name":"atlaschain","email":"jq@atlaschain.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sysvars_3.0.0_1764611554855_0.8552643463935456"},"_hasShrinkwrap":false}},"time":{"created":"2025-12-01T17:52:34.775Z","3.0.0":"2025-12-01T17:52:35.061Z","modified":"2025-12-01T17:52:35.378Z"},"maintainers":[{"name":"atlaschain","email":"jq@atlaschain.org"}],"description":"An abstraction layer over signing messages and transactions in Atlas","homepage":"https://github.com/anza-xyz/kit#readme","keywords":["blockchain","atlas","web3"],"repository":{"type":"git","url":"git+https://github.com/anza-xyz/kit.git"},"author":{"name":"Atlas Chain Foundation"},"bugs":{"url":"https://github.com/anza-xyz/kit/issues"},"license":"MIT","readme":"[![npm][npm-image]][npm-url]\n[![npm-downloads][npm-downloads-image]][npm-url]\n<br />\n[![code-style-prettier][code-style-prettier-image]][code-style-prettier-url]\n\n[code-style-prettier-image]: https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\n[code-style-prettier-url]: https://github.com/prettier/prettier\n[npm-downloads-image]: https://img.shields.io/npm/dm/@atlas/sysvars?style=flat\n[npm-image]: https://img.shields.io/npm/v/@atlas/sysvars?style=flat\n[npm-url]: https://www.npmjs.com/package/@atlas/sysvars\n\n# @atlas/sysvars\n\nThis package contains types and helpers for fetching and decoding Atlas sysvars. It can be used standalone, but it is also exported as part of Kit [`@atlas/kit`](https://github.com/anza-xyz/kit/tree/main/packages/kit).\n\nMore information about the available sysvars on Atlas can be found in the docs\nat <https://docs.atlaslabs.com/runtime/sysvars>.\n\nAll currently available sysvars can be retrieved and/or decoded using this\nlibrary.\n\n## Sysvar API\n\nThis package offers a simple API for working with sysvars.\n\nOne can fetch an encoded sysvar account using an RPC client.\n\n```ts\nconst maybeEncodedClock = await fetchEncodedSysvarAccount(rpc, SYSVAR_CLOCK_ADDRESS);\nmaybeEncodedClock satisfies MaybeEncodedAccount<'SysvarC1ock11111111111111111111111111111111'>;\n```\n\nOne can also attempt to fetch a JSON-parsed sysvar account.\n\n```ts\nconst maybeJsonParsedClock = await fetchJsonParsedSysvarAccount(rpc, SYSVAR_CLOCK_ADDRESS);\nmaybeJsonParsedClock satisfies\n    | MaybeAccount<JsonParsedSysvarAccount, 'SysvarC1ock11111111111111111111111111111111'>\n    | MaybeEncodedAccount<'SysvarC1ock11111111111111111111111111111111'>;\n```\n\nEach sysvar within the library ships with its own\n[codec](https://github.com/anza-xyz/kit/tree/main/packages/codecs)\nfor deserializing the account data.\n\nYou can pair this codec with the helpers from\n[`@atlas/accounts`](https://github.com/anza-xyz/kit/tree/main/packages/accounts)\nto assert and decode sysvar account data.\n\n```ts\n// Fetch.\nconst clock = await fetchEncodedSysvarAccount(rpc, SYSVAR_CLOCK_ADDRESS);\nclock satisfies MaybeEncodedAccount<'SysvarC1ock11111111111111111111111111111111'>;\n\n// Assert.\nassertAccountExists(clock);\nclock satisfies EncodedAccount<'SysvarC1ock11111111111111111111111111111111'>;\n\n// Decode.\nconst decodedClock = decodeAccount(clock, getSysvarClockDecoder());\ndecodedClock satisfies Account<SysvarClock, 'SysvarC1ock11111111111111111111111111111111'>;\n```\n\nEach supported sysvar also ships with its own fetch-and-decode function to\nperform the steps above and return the decoded sysvar data.\n\n```ts\nconst clock: SysvarClock = await fetchSysvarClock(rpc);\n```\n\n## Supported Sysvars:\n\nThis package supports the following Atlas sysvars:\n\n- [`Clock`](https://github.com/anza-xyz/kit/tree/main/packages/sysvars/src/clock.ts)\n- [`EpochRewards`](https://github.com/anza-xyz/kit/tree/main/packages/sysvars/src/epoch-rewards.ts)\n- [`EpochSchedule`](https://github.com/anza-xyz/kit/tree/main/packages/sysvars/src/epoch-schedule.ts)\n- [`Fees`](https://github.com/anza-xyz/kit/tree/main/packages/sysvars/src/fees.ts)\n- [`LastRestartSlot`](https://github.com/anza-xyz/kit/tree/main/packages/sysvars/src/last-restart-slot.ts)\n- [`RecentBlockhashes`](https://github.com/anza-xyz/kit/tree/main/packages/sysvars/src/recent-blockhashes.ts)\n- [`Rent`](https://github.com/anza-xyz/kit/tree/main/packages/sysvars/src/rent.ts)\n- [`SlotHashes`](https://github.com/anza-xyz/kit/tree/main/packages/sysvars/src/slot-hashes.ts)\n- [`SlotHistory`](https://github.com/anza-xyz/kit/tree/main/packages/sysvars/src/slot-history.ts)\n- [`StakeHistory`](https://github.com/anza-xyz/kit/tree/main/packages/sysvars/src/stake-history.ts)\n\nThe `Instructions` sysvar is also supported but does not exist on-chain,\ntherefore has no corresponding module or codec.\n","readmeFilename":"README.md","_rev":"1-9294f57d9860c37246114ced09487c5a"}