Wallet Sign Transaction (beta)

POST /v1/wallets/{wallet_id}/sign_transaction

Sign transaction using a managed wallet. Managed wallet means the private key is never exposed to the client and always stored encrypted in our vault. Currently, only Ethereum ETH wallet type signing is supported.

HTTP Request

POST /v1/auth/wallets/{wallet_id}/sign_transaction

Returns

A successful response returns a Wallet object, signature property, and raw_transaction for the signed transaction. For ethereum transactions, the raw_transaction can be used with RPC method eth_sendRawTransaction in EVM compatible RPC nodes.

Path parameters

  • wallet_id string Required

    Unique wallet ID of the wallet to retrieve.

application/json

Body

  • eth_transaction object Required

    If wallet specified by wallet ID is of ETH wallet type, eth_transaction must be provided. It is compatible with the Metamask eth_sendTransaction Transaction object documented here under eth_sendTransaction RPC method.

Responses

POST /v1/wallets/{wallet_id}/sign_transaction
curl \
 -X POST https://api.streambird.io/v1/wallets/{wallet_id}/sign_transaction \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"eth_transaction":{"to":"0xE9534C9fAF3cDBc636c25E1981A80EfaE03f187a","value":"0x38d7ea4c68000","nonce":"0x8","maxPriorityFeePerGas":"0x77359400","maxFeePerGas":"0xdf8475800","gas":"0x5208","chainId":"0x5"}}'
Request example
{
  "eth_transaction": {
    "to": "0xE9534C9fAF3cDBc636c25E1981A80EfaE03f187a",
    "value": "0x38d7ea4c68000",
    "nonce": "0x8",
    "maxPriorityFeePerGas": "0x77359400",
    "maxFeePerGas": "0xdf8475800",
    "gas": "0x5208",
    "chainId": "0x5"
  }
}
Response examples (200)
{
  "wallet_id": "wallet_26l6hdwAXQr0y573AhQTXNDkyqK",
  "wallet": {
    "id": "wallet_26l6hdwAXQr0y573AhQTXNDkyqK",
    "app_id": "app_25ldv51seNohTaYRsxdfoxMlAa2",
    "user_id": "user_26l6ha8syVN8oqmaHaFShTxZ5RC",
    "public_address": "0xb6acedc0cdcab7a4bb6c236976bb7df63bbcd567",
    "wallet_type": "ETH",
    "verified": true,
    "is_default": true,
    "is_read_only": false,
    "is_imported": false,
    "updated_at": 1647985945,
    "created_at": 1647985945
  },
  "signature": "0x744b61c44cdb250b89438709a9438a0b9e30c9c46e29776c93fb5e150e56021a",
  "raw_transaction": "0xb87502f87205088477359400850df847580082520894e9534c9faf3cdbc636c25e1981a80efae03f187a87038d7ea4c6800080c001a0cd31b38c3e3a48230bee2d5c687a0b2a5efcb298c58cfc3b43449eefd17857cfa03f95b8bcad72f7bdca59025e797781f4ba3fde826f62b9d6997aaf19a7d7591b"
}