POST
/
2022-06-09
/
wallets
curl --request POST \
  --url https://staging.crossmint.com/api/2022-06-09/wallets \
  --header 'Content-Type: application/json' \
  --header 'X-API-KEY: <x-api-key>' \
  --data '{
  "type": "evm-smart-wallet",
  "config": {
    "adminSigner": {
      "type": "evm-keypair",
      "address": "0x1234567890123456789012345678901234567890"
    }
  },
  "linkedUser": "email:user@example.com"
}'
{
  "type": "evm-smart-wallet",
  "linkedUser": "email:user@example.com",
  "address": "0x1234567890123456789012345678901234567890",
  "config": {
    "adminSigner": {
      "type": "evm-keypair",
      "address": "0x1234567890123456789012345678901234567890",
      "locator": "evm-keypair:0x1234567890123456789012345678901234567890"
    }
  }
}

Headers

X-API-KEY
string
required

API key required for authentication

x-idempotency-key
string

Unique key to prevent duplicate wallet creation

Body

application/json

EVM smart wallet creation input

type
enum<string>
required
Available options:
evm-smart-wallet
config
object
linkedUser
string

A user locator can be of the format:

  • email:<email>
  • userId:<userId>
  • phoneNumber:<phoneNumber>
  • twitter:<handle>
  • x:<handle>
Example:
[
  "email:user@example.com",
  "userId:507f1f77bcf86cd799439011",
  "userId:did:example:cm4lr5piw0h6t1bjho0onryql",
  "phoneNumber:+12125551234",
  "twitter:johndoe",
  "x:@johndoe"
]

Response

201
application/json
Returns an existing wallet (200) if one already exists for the provided linkedUser or idempotencyKey, or creates and returns a new wallet (201). The response includes the wallet details and whether it was newly created.

Complete wallet configuration including type-specific settings

type
enum<string>
required

The type of wallet configuration

Available options:
evm-smart-wallet
config
object
required

EVM smart wallet type specific configuration settings

address
string
required

The onchain address of the wallet

Example:

"0x1234567890123456789012345678901234567890"

linkedUser
string

The user that is linked to this wallet in format <locatorType>:<value>

Example:

"email:test@test.com"

createdAt
number

ISO timestamp of when the wallet was created

Example:

"2024-01-01T00:00:00.000Z"