Skip to content

接口 v1.0

李大狗 edited this page May 12, 2020 · 2 revisions

1 Generate Address

接口描述: 生成地址

Path: /api/v1/generate_addr

1.1 GET 方法

Method: GET

Args: None 或 priv = privkey

Successful Response:

{
   "result":"success",
   "payload":{
      "addr":"0x0582ca0Bf553F2603d7A28831586DA4af310dbb8",
      "priv":"0x64d5a044db52a6bcb2a643864ac5d171af4567e3ccda6da13d054c32144e42cc"
   }
}

1.2 POST 方法

Method: POST

Params: {"priv": privkey}

Successful Response:

{
   "result":"success",
   "payload":{
      "addr":"0x0582ca0Bf553F2603d7A28831586DA4af310dbb8",
      "priv":"0x64d5a044db52a6bcb2a643864ac5d171af4567e3ccda6da13d054c32144e42cc"
   }
}

2 Translate Signature

接口描述: 转换 hex Signature 为 r,s,v

Path: /api/v1/translate_sig

2.1 GET 方法

Method: GET

Args: sig = signature

Successful Response:

{
   "result":"success",
   "payload":{
      "r":"0x1e094a83a1a1a8fe48cb2f8ed2844633fa0a6ea9f4ca1b5aa87f159a03ee7304",
      "s":"0x6ecb5a16704d91922fe62abee1f8a2f41c5a8ea8e95a0d7b22614f18da1c3000",
      "v":28
   }
}

1.2 POST 方法

Method: POST

Params: {"sig": signature}

Successful Response:

{
   "result":"success",
   "payload":{
      "r":"0x1e094a83a1a1a8fe48cb2f8ed2844633fa0a6ea9f4ca1b5aa87f159a03ee7304",
      "s":"0x6ecb5a16704d91922fe62abee1f8a2f41c5a8ea8e95a0d7b22614f18da1c3000",
      "v":28
   }
}
Clone this wiki locally