Identity
Sign Blockchain Transactions
Sign transactions and messages according to the EIP-191 or EIP-712 standard.
Signing a blockchain message
You can sign arbitrary messages for Identity accounts according to the EIP-191 standard.
const response = await fetch( 'https://api.utiliti.ai/wallets/' + wallet_address + '/signature', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-key': '<YOUR_API_KEY_HERE>', }, body: JSON.stringify({ message: 'Hello World', }), } )
SDK coming soon...
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.utiliti.ai/wallets/wallet_address/signature"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "accept: application/json"); headers = curl_slist_append(headers, "content-type: application/json"); headers = curl_slist_append(headers, "X-API-key: <YOUR_API_KEY_HERE>"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"message\":\"Hello World\"}"); CURLcode ret = curl_easy_perform(hnd);
curl --request POST \ --url https://api.utiliti.ai/wallets/wallet_address/signature \ --header 'X-API-key: <YOUR_API_KEY_HERE>' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data ' { "message": "Hello World" } '
$python -m pip install requests --- import requests url = "https://api.utiliti.ai/wallets/wallet_address/signature" payload = {"message": "Hello World"} headers = { "accept": "application/json", "content-type": "application/json", "X-API-key": "<YOUR_API_KEY_HERE>" } response = requests.post(url, json=payload, headers=headers) print(response.text)
You can also sign typed data according to the EIP-712 standard.
const response = await fetch( 'https://api.utiliti.ai/wallets/' + wallet_address + '/signature', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-API-key': '<YOUR_API_KEY_HERE>', }, body: JSON.stringify({ data: { types: { EIP712Domain: [ { name: 'name', type: 'string' }, { name: 'version', type: 'string' }, { name: 'chainId', type: 'uint256' }, { name: 'verifyingContract', type: 'address' }, ], Person: [ { name: 'name', type: 'string' }, { name: 'wallet', type: 'string' }, ], }, primaryType: 'Person', domain: { name: 'Person Signature Test', version: '1', chainId: 1, verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC', }, message: { name: 'User', wallet: 'User Wallet' }, }, }), } )
SDK coming soon...
CURL *hnd = curl_easy_init(); curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST"); curl_easy_setopt(hnd, CURLOPT_URL, "https://api.utiliti.ai/wallets/wallet_address/signature"); struct curl_slist *headers = NULL; headers = curl_slist_append(headers, "accept: application/json"); headers = curl_slist_append(headers, "content-type: application/json"); headers = curl_slist_append(headers, "X-API-key: <YOUR_API_KEY_HERE>"); curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers); curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\"data\":\"data: {types: {EIP712Domain: [{ name: 'name', type: 'string' },{ name: 'version', type: 'string' },{ name: 'chainId', type: 'uint256' },{ name: 'verifyingContract', type: 'address' },],Person: [{ name: 'name', type: 'string' },{ name: 'wallet', type: 'string' },],},primaryType: 'Person',domain: {name: 'Person Signature Test',version: '1',chainId: 1,verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',},message: { name: 'User', wallet: 'User Wallet' },}\"}"); CURLcode ret = curl_easy_perform(hnd);
curl --request POST \ --url https://api.utiliti.ai/wallets/wallet_address/signature \ --header 'X-API-key: <YOUR_API_KEY_HERE>' \ --header 'accept: application/json' \ --header 'content-type: application/json' \ --data @- <<EOF { "data": "data: {types: {EIP712Domain: [{ name: 'name', type:'string' },{ name: 'version', type: 'string' },{ name: 'chainId', type: 'uint256' },{ name: 'verifyingContract', type: 'address' },],Person: [{ name: 'name', type: 'string' },{ name: 'wallet', type: 'string' },],},primaryType: 'Person',domain: {name: 'Person Signature Test',version: '1',chainId: 1,verifyingContract:'0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',},message: { name: 'User', wallet: 'User Wallet' },}" } EOF
$python -m pip install requests --- import requests url = "https://api.utiliti.ai/wallets/wallet_address/signature" payload = {"data": "data: {types: {EIP712Domain: [{ name: 'name', type: 'string' },{ name: 'version', type: 'string' },{ name: 'chainId', type: 'uint256' },{ name: 'verifyingContract', type: 'address' },],Person: [{ name: 'name', type: 'string' },{ name: 'wallet', type: 'string' },],},primaryType: 'Person',domain: {name: 'Person Signature Test',version: '1',chainId: 1,verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',},message: { name: 'User', wallet: 'User Wallet' },}"} headers = { "accept": "application/json", "content-type": "application/json", "X-API-key": "<YOUR_API_KEY_HERE>" } response = requests.post(url, json=payload, headers=headers) print(response.text)