Sign Transactions

📘

This feature is only available for EVM blockchains.

Endpoint

POST /api/v1-alpha1/wallets/<chain>:<address>/transactions/signatures

Required Scope

wallets:transactions.sign

📘

This API is in alpha. Contact us to get the scope added to your API key.

Signing a transaction

❗️

Server Side APIs

All of our APIs should be run from a server and NOT in the browser. Using these APIs in the client exposes your client secret, which WILL result in unauthorized access to your project.

Here's an example curl snippet to show how to send the request:

curl "https://staging.crossmint.com/api/v1-alpha1/wallets/ethereum:0x7e3c09cB46A351Db7834c0E0Bc0CB0cD79A/transactions/signatures" \
  -H "X-PROJECT-ID: your_project_id" \
  -H "X-CLIENT-SECRET: your_client_secret" \
  -H 'Content-Type: application/json' \
  --data '
  {
    "transaction": {
      "nonce": 5,
      "gasPrice": "34329341655",
      "gasLimit": 21000,
      "to": "0x4675c7e5baafbffbca748158becba61ef3b03",
      "value": "0",
      "data": "",
      "from": "0x199d5ed7f45f4ee35960cf22eade205b253f"
    }
  }
'

Transaction parameters explained:

ParameterTypeDescription
tostringThe destination address.
valuestringThe amount of Ether to send, in wei. (This MUST be set to 0)
gasLimitnumberThe maximum amount of gas to be used.
gasPricestringThe price of gas in Gwei.
noncenumberThe transaction nonce.
chainIdstringThe ID of the chain (e.g., 1 for the Ethereum mainnet).
datastringAny additional data to be included in the transaction.