Wallet Sign Transaction (beta)
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.
Body
-
If wallet specified by wallet ID is of ETH wallet type, eth_transaction must be provided. It is compatible with the Metamask
eth_sendTransactionTransaction object documented here undereth_sendTransactionRPC method.
POST
/v1/wallets/{wallet_id}/sign_transaction
curl \
--request POST 'https://api.streambird.io/v1/wallets/{wallet_id}/sign_transaction' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"eth_transaction":{"to":"0xE9534C9fAF3cDBc636c25E1981A80EfaE03f187a","gas":"0x5208","nonce":"0x8","value":"0x38d7ea4c68000","chainId":"0x5","maxFeePerGas":"0xdf8475800","maxPriorityFeePerGas":"0x77359400"}}'
Request example
{
"eth_transaction": {
"to": "0xE9534C9fAF3cDBc636c25E1981A80EfaE03f187a",
"gas": "0x5208",
"nonce": "0x8",
"value": "0x38d7ea4c68000",
"chainId": "0x5",
"maxFeePerGas": "0xdf8475800",
"maxPriorityFeePerGas": "0x77359400"
}
}
Response examples (200)
{
"wallet": {
"id": "wallet_26l6hdwAXQr0y573AhQTXNDkyqK",
"app_id": "app_25ldv51seNohTaYRsxdfoxMlAa2",
"user_id": "user_26l6ha8syVN8oqmaHaFShTxZ5RC",
"verified": true,
"created_at": 1647985945,
"is_default": true,
"updated_at": 1647985945,
"is_imported": false,
"wallet_type": "ETH",
"is_read_only": false,
"public_address": "0xb6acedc0cdcab7a4bb6c236976bb7df63bbcd567"
},
"signature": "0x744b61c44cdb250b89438709a9438a0b9e30c9c46e29776c93fb5e150e56021a",
"wallet_id": "wallet_26l6hdwAXQr0y573AhQTXNDkyqK",
"raw_transaction": "0xb87502f87205088477359400850df847580082520894e9534c9faf3cdbc636c25e1981a80efae03f187a87038d7ea4c6800080c001a0cd31b38c3e3a48230bee2d5c687a0b2a5efcb298c58cfc3b43449eefd17857cfa03f95b8bcad72f7bdca59025e797781f4ba3fde826f62b9d6997aaf19a7d7591b"
}