Skip to content

Commit

Permalink
Merge branch 'fix/to_address' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sjatsh committed Dec 25, 2023
2 parents e86c812 + 12b3cc8 commit 27ef6c7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 11 deletions.
45 changes: 35 additions & 10 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -524,12 +524,14 @@ Please familiarize yourself with the meaning of some common parameters before re
* path: /v1/transaction/send
```json
{
"action": "create_approval",
"sign_key": "18feccf2347ed980f07bd3277f9ce626",
"action": "create_approval", // same with the api return
"sub_action": "", // same with the api return
"sign_address": "0x111...", // only sign_type='309' webauthn, You need to fill in this address
"sign_key": "18feccf2347ed980f07bd3277f9ce626", // same with the api return
"sign_list": [
{
"sign_type": 8,
"sign_msg": "0x0ea5ffd13bddbdb3f5a8b492cd6653816d371b9afebb7e6d4ecd8e2962d6b4ca"
"sign_type": 5, // same with the api return sign_list[0].sign_type
"sign_msg": "0x0ea5ffd13bddbdb3f5a8b492cd6653816d371b9afebb7e6d4ecd8e2962d6b4ca" // signature result
}
]
}
Expand Down Expand Up @@ -561,18 +563,20 @@ Please familiarize yourself with the meaning of some common parameters before re
"key": "0x111..."
},
"action": "enable_sub_account",
"sub_action": "",
"account": ""
}
```

#### Response

* status: 0: pending, 2: unsend
is pending or unsend

* status: 0: pending, 2: unsend
```json
{
"errno": 0,
"errmsg": "",
"err_no": 0,
"err_msg": "",
"data": {
"block_number": 0,
"hash": "",
Expand All @@ -581,6 +585,15 @@ Please familiarize yourself with the meaning of some common parameters before re
}
```

is committed
```json
{
"err_no": 11001,
"err_msg": "not exits tx",
"data": null
}
```

### Task Status

#### Request
Expand Down Expand Up @@ -1682,12 +1695,24 @@ Please familiarize yourself with the meaning of some common parameters before re

* path: /v1/approval/enable

Params:
- platform: platform key info
- type: blockchain
- key_info
- coin_type `platform coin_type only can be '60'`
- key
- owner: `account owner key info`
- to: `account to key info`
- account: `account name`
- protected_until: `protected until time, authorization irrevocable time, before this time can not call` [Approval Revoke](#Approval-Revoke)
- sealed_until: `sealed until time, authorization effective time, after this time every one can call` [Approval Fulfill](#Approval-Fulfill)
- evm_chain_id: `evm chain id, only the main account need this parameter`
```json
{
"platform": {
"type": "blockchain",
"key_info": {
"coin_type": "60", // platform coin_type only can be '60'
"coin_type": "60",
"key": "0xe58673b9bF0a57398e0C8A1BDAe01EEB730177C8"
}
},
Expand All @@ -1708,7 +1733,7 @@ Please familiarize yourself with the meaning of some common parameters before re
"account": "cross15.bit",
"protected_until": 1692696089,
"sealed_until": 1692762911,
"evm_chain_id": 5 // only the main account need this parameter
"evm_chain_id": 5
}
```

Expand Down Expand Up @@ -2024,7 +2049,7 @@ personal sign with `sign_list[0].sign_msg` and call [Send Transaction](#send-tra
"key": "0xdeeFC10a42cD84c072f2b0e2fA99061a74A0698c"
},
"account": "cross15.bit",
"sealed_until": 1692762911,
"sealed_until": 1692762911, // extend approval effective time
"evm_chain_id": 5 // only the main account need this parameter
}
```
Expand Down
2 changes: 1 addition & 1 deletion http_server/handle/approval_enable.go
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ func (h *HttpHandle) doApprovalEnableCheck(req *ReqApprovalEnable, apiResp *api_
return
}

toLock, _, err = req.To.FormatChainTypeAddressToScript(config.Cfg.Server.Net, true)
toLock, _, err = req.To.FormatChainTypeAddressToScript(config.Cfg.Server.Net, false)
if err != nil {
apiResp.ApiRespErr(api_code.ApiCodeParamsInvalid, "owner address invalid")
err = fmt.Errorf("FormatChainTypeAddress err:%s", err.Error())
Expand Down
2 changes: 2 additions & 0 deletions http_server/handle/transaction_status.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ func (h *HttpHandle) doTransactionStatus(req *ReqTransactionStatus, apiResp *api
record, err = h.DbDao.GetLatestSmtRecordByAccountIdAction(accountId, req.Action, req.SubAction)
case common.SubActionRenew:
record, err = h.DbDao.GetLatestSmtRecordByParentAccountIdAction(accountId, req.Action, req.SubAction)
case common.SubActionCreateApproval, common.SubActionDelayApproval, common.SubActionRevokeApproval, common.SubActionFullfillApproval:
record, err = h.DbDao.GetLatestSmtRecordByAccountIdAction(accountId, req.Action, req.SubAction)
default:
apiResp.ApiRespErr(api_code.ApiCodeParamsInvalid, fmt.Sprintf("not exist sub-action[%s]", req.SubAction))
return nil
Expand Down

0 comments on commit 27ef6c7

Please sign in to comment.