Creating a wallet and sending a transaction with Privy’s REST API
curl --request POST \ --url https://api.privy.io/v1/wallets \ --header 'Authorization: Basic <encoded-value>' \ --header 'Content-Type: application/json' \ --header 'privy-app-id: <privy-app-id>' \ --data '{ "chain_type": "ethereum" }'
{ "id": "jf4mev19seymsqulciv8on0c", "address": "0x7Ef5363308127128969618240eDcB9F8f61e90F6", "chain_type": "ethereum", "policy_ids": [], "created_at": 1741362961254 }
curl --request POST \ --url https://api.privy.io/v1/wallets/{wallet_id}/rpc \ --header 'Authorization: Basic <encoded-value>' \ --header 'Content-Type: application/json' \ --header 'privy-app-id: <privy-app-id>' \ --data '{ "method": "personal_sign", "params": { "message": "Hello from Privy!", "encoding": "utf-8" } }'
{ "method": "personal_sign", "data": { "signature": "0x292d67e9c5178447f1c5344b3122997dfba8f00e43102d0b746301e9b4afbbf67d952bf870878d92b8eb066da205840458c0a5fb3f53253dbe1adf9c143678311c", "encoding": "hex" } }
curl --request POST \ --url https://api.privy.io/v1/wallets/{wallet_id}/rpc \ --header 'Authorization: Basic <encoded-value>' \ --header 'Content-Type: application/json' \ --header 'privy-app-id: <privy-app-id>' \ --data '{ "method": "eth_sendTransaction", "caip2": "eip155:11155111", "chain_type": "ethereum", "params": { "transaction": { "to": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045", "value": 1000000000000000 } } }'
{ "method": "eth_sendTransaction", "data": { "hash": "0x7c91ba85d67ef92cc15f3e9c8d8c5788e982cf83fabe9bfcc66a747aa0bd3701", "caip2": "eip155:11155111", "transaction_id": "d2obiyxnblv7jzp73b8scqa8" } }