Skip to content

feat: createBytesSigner for Wallet Standard / @solana/kit / Privy / MPC - #18

Open
NubsCarson wants to merge 1 commit into
mainfrom
feat/bytes-signer
Open

feat: createBytesSigner for Wallet Standard / @solana/kit / Privy / MPC #18
NubsCarson wants to merge 1 commit into
mainfrom
feat/bytes-signer

Conversation

@NubsCarson

Copy link
Copy Markdown
Contributor

Add a single adapter that converts any bytes-based signer ((Uint8Array) => Promise) into the WalletSigner shape the SDK writer methods already accept. Lives in src/sdk/utils/wallet.ts alongside toWalletSigner (Keypair → WalletSigner), so the SDK now covers every signer type in the ecosystem:

  • Keypair / legacy Signer → toWalletSigner (existing)
  • wallet-adapter WalletSigner → passed through as-is
  • Wallet Standard bytes signers → createBytesSigner (new)

The bytes primitive is the kit-era canonical signing form. Privy v3's useSignTransaction() hook, MPC services, kit-wrapped standard wallets, and custom backend signers all expose it. No vendor-specific code in the SDK — the helper is one factory function with a generic callback.

@solana/kit and @solana/web3.js@^1 are different npm packages and coexist fine; SDK keeps its v1 surface unchanged.

README documents usage with Privy as the prototypical example.

Add a single adapter that converts any bytes-based signer
((Uint8Array) => Promise<Uint8Array>) into the WalletSigner shape the
SDK writer methods already accept. Lives in src/sdk/utils/wallet.ts
alongside toWalletSigner (Keypair → WalletSigner), so the SDK now
covers every signer type in the ecosystem:

  - Keypair / legacy Signer        → toWalletSigner (existing)
  - wallet-adapter WalletSigner    → passed through as-is
  - Wallet Standard bytes signers  → createBytesSigner (new)

The bytes primitive is the kit-era canonical signing form. Privy v3's
useSignTransaction() hook, MPC services, kit-wrapped standard wallets,
and custom backend signers all expose it. No vendor-specific code in
the SDK — the helper is one factory function with a generic callback.

@solana/kit and @solana/web3.js@^1 are different npm packages and
coexist fine; SDK keeps its v1 surface unchanged.

README documents usage with Privy as the prototypical example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant