Skip to content

Commit 84f7ad9

Browse files
committed
fix: use lean keychain-memory signer to avoid cloud SDK dep bloat
The umbrella @solana/keychain pulls in every backend signer (AWS KMS, GCP KMS, Fireblocks, ...), dragging the full AWS SDK into the lockfile and tripping the safe-chain minimum-package-age guard in CI. Use the config-based createMemorySigner from @solana/keychain-memory instead; the plugin-client signing path is unchanged.
1 parent 4829904 commit 84f7ad9

3 files changed

Lines changed: 7 additions & 938 deletions

File tree

packages/docs-examples/cookbook/wallets/sign-with-keychain/kit.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
// #region sign
22
import { createClient, generateKeyPairSigner, lamports } from "@solana/kit";
3-
import { createKeychainSigner } from "@solana/keychain";
3+
import { createMemorySigner } from "@solana/keychain-memory";
44
import { rpcAirdrop, solanaRpc } from "@solana/kit-plugin-rpc";
55
import { airdropSigner, signer } from "@solana/kit-plugin-signer";
66
import { getTransferSolInstruction } from "@solana-program/system";
77

8-
// One factory, one config shape for every backend. Swap `backend: "memory"`
9-
// for "aws-kms", "vault", "turnkey", ... and the rest of this file is
10-
// identical — each backend returns the same `SolanaSigner` interface.
11-
const keychainSigner = await createKeychainSigner({
12-
backend: "memory",
8+
// Every Keychain backend returns the same `SolanaSigner`. Swap this in-memory
9+
// signer for `createAwsKmsSigner`, `createVaultSigner`, ... and the rest of
10+
// this file is identical.
11+
const keychainSigner = await createMemorySigner({
1312
privateKey: crypto.getRandomValues(new Uint8Array(32)),
1413
});
1514

packages/docs-examples/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"@solana-program/system": "^0.12.0",
1717
"@solana-program/token": "^0.13.0",
1818
"@solana-program/token-2022": "^0.9.0",
19-
"@solana/keychain": "^1.3.0",
19+
"@solana/keychain-memory": "^1.3.0",
2020
"@solana/kit": "^6.8.0",
2121
"@solana/kit-plugin-rpc": "^0.11.1",
2222
"@solana/kit-plugin-signer": "^0.10.0",

0 commit comments

Comments
 (0)