{"_id":"@axvn-vn/kit-plugin-signer","_rev":"3-6c16f0b5ff7fece440a9005345c72696","name":"@axvn-vn/kit-plugin-signer","dist-tags":{"latest":"0.0.0"},"versions":{"0.0.0":{"name":"@axvn-vn/kit-plugin-signer","version":"0.0.0","keywords":["identity","kit","payer","plugin","signer","solana"],"license":"MIT","_id":"@axvn-vn/kit-plugin-signer@0.0.0","maintainers":[{"name":"davidtran76","email":"Farm15ceo@gmail.com"}],"homepage":"https://github.com/anza-xyz/kit-plugins#readme","bugs":{"url":"http://github.com/anza-xyz/kit-plugins/issues"},"dist":{"shasum":"4db73a8779ec4049cd4aaf179e1897ca2ec9ef61","tarball":"https://registry.npmjs.org/@axvn-vn/kit-plugin-signer/-/kit-plugin-signer-0.0.0.tgz","fileCount":32,"integrity":"sha512-GTfSFmcBcGlyOG4pRZgnUlgNsZRCv2/dSplEXTXSbyTSqYIbmIAOy6tsHqW4laOT7kUzZ35LLMcLPoPpc6Re0A==","signatures":[{"sig":"MEUCIC9LTxtrqotZCa+DOr1XVuwB2eRnhh+5pqcffllnw9wDAiEAzGZiM8YoFZm2ETRvU4+BXWoc80G+NhU3R4mXJlL/iXQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":146958},"main":"./dist/index.node.cjs","type":"commonjs","types":"./dist/types/index.d.ts","module":"./dist/index.node.mjs","browser":{"./dist/index.node.cjs":"./dist/index.browser.cjs","./dist/index.node.mjs":"./dist/index.browser.mjs"},"exports":{"node":{"import":"./dist/index.node.mjs","require":"./dist/index.node.cjs"},"types":"./dist/types/index.d.ts","browser":{"import":"./dist/index.browser.mjs","require":"./dist/index.browser.cjs"},"react-native":"./dist/index.react-native.mjs"},"scripts":{"dev":"vitest --project node","test":"pnpm test:types && pnpm test:treeshakability && pnpm test:unit","test:unit":"vitest run","test:types":"tsc --noEmit","test:treeshakability":"for file in dist/index.*.mjs; do agadoo $file; done"},"_npmUser":{"name":"davidtran76","email":"Farm15ceo@gmail.com"},"repository":{"url":"git+https://github.com/anza-xyz/kit-plugins.git","type":"git"},"_npmVersion":"11.17.0","description":"Signer helpers for Kit clients","directories":{},"sideEffects":false,"_nodeVersion":"24.19.0","browserslist":["supports bigint and not dead","maintained node versions"],"react-native":"./dist/index.react-native.mjs","publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"peerDependencies":{"@axvn-vn/kit":"^8.0.0"},"_npmOperationalInternal":{"tmp":"tmp/kit-plugin-signer_0.0.0_1787355414650_0.4871277690756035","host":"s3://npm-registry-packages-npm-production"},"deprecated":"DEPRECATED: This package has been removed. Do not use."}},"time":{"created":"2026-08-21T23:36:54.480Z","modified":"2026-08-22T16:11:11.222Z","0.0.0":"2026-08-21T23:36:54.776Z"},"bugs":{"url":"http://github.com/anza-xyz/kit-plugins/issues"},"license":"MIT","homepage":"https://github.com/anza-xyz/kit-plugins#readme","keywords":["identity","kit","payer","plugin","signer","solana"],"repository":{"url":"git+https://github.com/anza-xyz/kit-plugins.git","type":"git"},"description":"Signer helpers for Kit clients","maintainers":[{"name":"davidtran76","email":"Farm15ceo@gmail.com"},{"name":"nhamhuan","email":"Nhamhuan@gmail.com"}],"readme":"# Kit Plugins ➤ Signer\n\n[![npm][npm-image]][npm-url]\n[![npm-downloads][npm-downloads-image]][npm-url]\n\n[npm-downloads-image]: https://img.shields.io/npm/dm/@solana/kit-plugin-signer.svg?style=flat\n[npm-image]: https://img.shields.io/npm/v/@solana/kit-plugin-signer.svg?style=flat&label=%40solana%2Fkit-plugin-signer\n[npm-url]: https://www.npmjs.com/package/@solana/kit-plugin-signer\n\nThis package offers plugins that set up the `payer` and `identity` signers on your Kit clients. Each plugin comes in three variants so you can set only the `payer`, only the `identity`, or both at once.\n\n## Installation\n\n```sh\npnpm install @solana/kit-plugin-signer\n```\n\n## Payer vs Identity\n\nKit clients can hold two distinct signer roles:\n\n- **`payer`** — the signer responsible for paying transaction fees and storage costs (i.e. the minimum balance required to keep newly created accounts alive based on their size).\n- **`identity`** — the signer representing the wallet that owns things in the application, such as the authority over accounts, tokens, or other on-chain assets.\n\nIn many cases both roles are filled by the same keypair. Every plugin in this package therefore comes in three variants:\n\n| Variant     | Sets                                          |\n| ----------- | --------------------------------------------- |\n| `signer*`   | Both `payer` **and** `identity` (same signer) |\n| `payer*`    | Only `payer`                                  |\n| `identity*` | Only `identity`                               |\n\nFor instance, `signer(mySigner)` is a shorthand for using both `payer(mySigner)` and `identity(mySigner)`.\n\n## `signer` / `payer` / `identity` plugins\n\nThese plugins accept an existing `TransactionSigner` and install it on the client.\n\n```ts\nimport { createClient } from '@solana/kit';\nimport { signer } from '@solana/kit-plugin-signer';\n\nconst client = createClient().use(signer(mySigner));\n```\n\nUse `payer(mySigner)` or `identity(mySigner)` to set only one role.\n\n## `generatedSigner` / `generatedPayer` / `generatedIdentity` plugins\n\nThese asynchronous plugins generate a new random `KeyPairSigner` and install it on the client.\n\n```ts\nimport { createClient } from '@solana/kit';\nimport { generatedSigner } from '@solana/kit-plugin-signer';\n\nconst client = await createClient().use(generatedSigner());\n```\n\nUse `generatedPayer()` or `generatedIdentity()` to generate a signer for only one role.\n\n## `generatedSignerWithSol` / `generatedPayerWithSol` / `generatedIdentityWithSol` plugins\n\nThese asynchronous plugins generate a new random `KeyPairSigner`, airdrop some SOL to it, and install it on the client. They require an airdrop function to already be available on the client (e.g. via `rpcAirdrop` or `litesvmAirdrop`).\n\n```ts\nimport { createClient, lamports } from '@solana/kit';\nimport { rpcAirdrop, solanaRpcConnection } from '@solana/kit-plugin-rpc';\nimport { generatedSignerWithSol } from '@solana/kit-plugin-signer';\n\nconst client = await createClient()\n    .use(solanaRpcConnection({ rpcUrl: 'http://127.0.0.1:8899' }))\n    .use(rpcAirdrop())\n    .use(generatedSignerWithSol(lamports(10_000_000_000n)));\n```\n\nUse `generatedPayerWithSol(amount)` or `generatedIdentityWithSol(amount)` to target only one role.\n\n## `airdropSigner` / `airdropPayer` / `airdropIdentity` plugins\n\nThese plugins airdrop SOL to a signer that is already installed on the client. They are particularly useful when the airdrop function is provided by a plugin that requires a signer to already be installed on the client. For instance, `solanaLocalRpc` bundles an airdrop function but requires a `payer` to be set first. In that case, you can generate the signer first, then install the RPC plugin, and then use `airdropSigner` to fund the signer after the fact.\n\n```ts\nimport { createClient, lamports } from '@solana/kit';\nimport { solanaLocalRpc } from '@solana/kit-plugin-rpc';\nimport { generatedSigner, airdropSigner } from '@solana/kit-plugin-signer';\n\nconst client = await createClient()\n    .use(generatedSigner())\n    .use(solanaLocalRpc())\n    .use(airdropSigner(lamports(1_000_000_000n)));\n```\n\nUse `airdropPayer(amount)` or `airdropIdentity(amount)` to target only one role. Note that `airdropSigner(amount)` will throw if the `payer` and `identity` on the client are not the same signer.\n\n## `signerFromFile` / `payerFromFile` / `identityFromFile` plugins\n\nThese plugins load a `KeyPairSigner` from a local JSON keypair file and install it on the client. Node.js only — other environments will throw an error.\n\n```ts\nimport { createClient } from '@solana/kit';\nimport { signerFromFile } from '@solana/kit-plugin-signer';\n\nconst client = await createClient().use(signerFromFile('~/.config/solana/id.json'));\n```\n\nUse `payerFromFile(path)` or `identityFromFile(path)` to load a signer for only one role.\n","readmeFilename":"README.md"}