Actions7
- Wallet Actions
- Checkout Actions
Overview
The "Get or Create Wallet" operation in this node allows users to either retrieve an existing blockchain wallet or create a new one on the Crossmint platform. It supports wallets on two major blockchain types: Ethereum Virtual Machine (EVM) compatible chains and Solana. This operation is useful for applications that need to programmatically manage user wallets, such as crypto payment systems, NFT platforms, or decentralized finance (DeFi) services.
Typical scenarios include:
- Automatically provisioning a new wallet for a user identified by email, user ID, phone number, or social media handle.
- Creating a wallet with an externally provided private key (admin signer) to authorize transactions.
- Managing wallets across different blockchains with a unified interface.
Example use case:
- An e-commerce platform wants to create blockchain wallets for customers using their email addresses and a supplied private key to enable crypto payments and transfers.
Properties
| Name | Meaning |
|---|---|
| Chain Type | Blockchain type for the wallet. Options: EVM (Ethereum Virtual Machine compatible chains), Solana (Solana blockchain). |
| Owner Type (Optional) | Type of user identifier used to associate the wallet owner. Options: None, Email, User ID, Phone Number, Twitter Handle, X Handle. |
| Owner Email | Email address of the wallet owner. Required if Owner Type is Email. |
| Owner User ID | User ID of the wallet owner. Required if Owner Type is User ID. |
| Owner Phone Number | Phone number of the wallet owner including country code. Required if Owner Type is Phone Number. |
| Owner Twitter Handle | Twitter handle of the wallet owner (without @). Required if Owner Type is Twitter Handle. |
| Owner X Handle | X (formerly Twitter) handle of the wallet owner (without @). Required if Owner Type is X Handle. |
| Admin Signer | Private key authorizing all transactions from this wallet. For EVM, it must be a 32-byte hex string (optionally prefixed with 0x). For Solana, it must be a base58 encoded key. This is required to create the wallet. |
Output
The output JSON object contains details about the created or retrieved wallet:
derivedAddress: The blockchain address derived from the provided private key.derivedPublicKey: The public key corresponding to the private key.- Other fields returned by the Crossmint API describing the wallet, such as wallet type and chain type.
This output provides both raw API response data and simplified wallet identification information, enabling further blockchain interactions or record keeping.
Dependencies
- Requires an API key credential for the Crossmint API.
- Uses external libraries:
ethersfor handling EVM wallet keys and signing.@solana/web3.jsandbs58for Solana key decoding and wallet management.
- The node makes HTTP requests to the Crossmint API endpoints, switching between staging and production URLs based on the configured environment.
Troubleshooting
- Missing or invalid private key: The admin signer private key is mandatory. Errors will occur if the key is missing, incorrectly formatted, or of invalid length. Ensure the key is a 32-byte hex string for EVM or a valid base58 string for Solana.
- Invalid owner identifiers: If specifying an owner type other than "None", the corresponding owner property must be provided and valid (e.g., a properly formatted email or phone number).
- API errors: Network issues or invalid API keys will cause request failures. Verify the API key credential and network connectivity.
- Unsupported chain type: Only "evm" and "solana" are supported. Using other values will result in errors.
- Private key processing failure: Errors during key decoding or wallet address derivation indicate malformed keys.
Links and References
- Crossmint API documentation: https://www.crossmint.com/docs
- Ethereum ethers.js library: https://docs.ethers.io/v5/
- Solana web3.js SDK: https://solana-labs.github.io/solana-web3.js/
- Base58 encoding/decoding: https://en.wikipedia.org/wiki/Base58
This summary covers the static analysis of the "Get or Create Wallet" operation within the Crossmint node, focusing on its input properties, output structure, dependencies, and common troubleshooting points.