@solana/keychain-crossmint
v2.0.0
Published
Crossmint wallet signer for Solana transactions
Maintainers
Readme
@solana/keychain-crossmint
Crossmint wallet signer for Solana transactions using Crossmint Wallets API.
Installation
pnpm add @solana/keychain-crossmintUsage
import { createCrossmintSigner } from '@solana/keychain-crossmint';
const signer = await createCrossmintSigner({
apiKey: process.env.CROSSMINT_API_KEY!,
walletLocator: process.env.CROSSMINT_WALLET_LOCATOR!,
});Configuration
| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| apiKey | string | Yes | - | Crossmint API key |
| walletLocator | string | Yes | - | Crossmint wallet locator |
| apiBaseUrl | string | No | https://www.crossmint.com/api | Base URL for Wallets API |
| pollIntervalMs | number | No | 1000 | Poll interval for managed transaction flow |
| maxPollAttempts | number | No | 60 | Max poll attempts before timeout |
| signer | string | No | - | Optional delegated signer locator |
Behavior Notes
- Crossmint executes transactions server-side and sponsors gas, which makes it the fee payer, so the message it signs generally differs from the one you submitted. Use
signAndSendTransactions()(orsignAndSendTransactionMessageWithSigners()): the returned value is the landed transaction's fee-payer signature, the identifier you can pass togetTransaction/confirmTransaction, not a signature over your message bytes. Under sponsorship the fee payer is Crossmint's sponsor key; your wallet's own signature is verified internally before the identifier is returned. - The signer is a
SolanaSendingSigner(from@solana/keychain-core): it exposes nosignTransactionsand nosignMessages. Kit classifies signers by method presence, so their absence is what routes the signer through Kit's sending flow instead of partial signing. Crossmint does not support message signing for Solana wallets. - Because it is a sending signer, it cannot be installed as a Kit client
payer/identity(@solana/keychain-kit-pluginrejects the config at compile time). Call it directly, or viasignAndSendTransactionMessageWithSigners(). - Not retry-safe: any failure after the create is accepted rejects with
SIGNER_BROADCAST_UNCONFIRMEDcarryingcontext.providerTransactionId; check that transaction with Crossmint before retrying. Each create carries anx-idempotency-keyderived from the message bytes, so retrying the exact same bytes cannot create a second Crossmint transaction; a retry built with a fresh blockhash is a new transaction.
const [signature] = await signer.signAndSendTransactions([transaction]);License
MIT
