Example) Sign
Request
default
curl -X "POST" "https://api.kaiawallet.io/api/v1/k/prepare" \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{
"type": "sign",
"bapp": {
"name": "test app",
"callback": {
"success": "https://www.google.com/search?q=success",
"fail": "https://www.google.com/search?q=fail"
}
},
"sign": {
"message": "hello world"
}
}'
EIP-712 방식의 서명
request body의 ethereum_sign이 true이고, version이 v4이면 EIP-712 방식으로 서명됩니다. 현재, version v1, v2 는 지원되지 않고 v4 만 지원되고 있습니다.
더 자세한 사항은 EIP-712 타입의 데이터 문서에서 확인하세요.
curl -X "POST" "https://api.kaiawallet.io/api/v1/k/prepare" \
-H 'Content-Type: application/json; charset=utf-8' \
-d '{
"chain_id": "8217",
"bapp": {
"name": "string",
"callback": {
"success": "string",
"fail": "string"
}
},
"type": "sign",
"sign": {
"from": "0x707BEE6A8aa9eA84deDA42193Ed4210f93a9d1cc",
"message": "{\"domain\":{\"chainId\":1001,\"name\":\"Example App\",\"verifyingContract\":\"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\",\"version\":\"1\"},\"message\":{\"prompt\":\"Welcome! In order to authenticate to this website, sign this request and your public address will be sent to the server in a verifiable way.\",\"createdAt\":\"1764308134279\"},\"primaryType\":\"AuthRequest\",\"types\":{\"EIP712Domain\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"version\",\"type\":\"string\"},{\"name\":\"chainId\",\"type\":\"uint256\"},{\"name\":\"verifyingContract\",\"type\":\"address\"}],\"AuthRequest\":[{\"name\":\"prompt\",\"type\":\"string\"},{\"name\":\"createdAt\",\"type\":\"uint256\"}]}}",
"ethereum_sign": true,
"version": "v4"
}
}'
Response
{
"chain_id":"8217",
"request_key":"4a4f2d97-6ef7-44e0-8c06-2de9ef5cca6e",
"status":"prepared",
"expiration_time":1647663586
}