@faremeter/wallet-crossmint
@faremeter/wallet-crossmint adapts Crossmint Wallets to the shape expected by @faremeter/payment-solana. It authenticates with Crossmint’s API, fetches a wallet, and exposes the minimal interface required to build/send transactions.
Quick start
wallet implements:
network: string passed straight through ("devnet","mainnet-beta", etc.).publicKey: SolanaPublicKeyderived from the Crossmint wallet.sendTransaction(tx): sends aVersionedTransactionvia Crossmint’s API and resolves with the transaction hash.
@faremeter/payment-solana/exact.createPaymentHandler.
API surface
createCrossmintWallet(network, crossmintApiKey, walletAddress)
network: arbitrary label used by your application (matches the facilitator’s expectations).crossmintApiKey: Crossmint API key with thewalletsscope.walletAddress: Crossmint wallet identifier (obtained from their dashboard or API).
- Uses
createCrossmintandCrossmintWallets.fromunder the hood. - Fetches the wallet with
{ chain: "solana", signer: { type: "api-key" } }. - Wraps the wallet in Crossmint’s
SolanaWallethelper to getsendTransaction. - Converts the wallet’s base58 address into a
PublicKeyinstance.
Usage patterns
- Separate facilitator wallet: This adapter is client-facing. Pair it with
@faremeter/payment-solanafor buyers, while the facilitator can use a different wallet (local keypair, ledger, etc.). - Multiple wallets: Call
createCrossmintWalletonce per wallet identifier. Cache the result if you’re reusing the same wallet across requests. - Edge runtimes: The Crossmint SDK relies on
fetch; ensure the runtime you target supports it or polyfill accordingly.
Related references
@faremeter/payment-solana: consumes the wallet object to build transactions.@faremeter/wallet-ledger/@faremeter/wallet-solana: alternative wallet adapters with similar interfaces.- Source: GitHub › packages/wallet-crossmint