Skip to content

Commit

Permalink
fixup rpcserver doc and existing account response
Browse files Browse the repository at this point in the history
  • Loading branch information
chappjc committed Jan 31, 2023
1 parent f1b0209 commit 121df1c
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions client/rpcserver/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,9 @@ func handlePostBond(s *RPCServer, params *RawParams) *msgjson.ResponsePayload {
resErr := &msgjson.Error{Code: msgjson.RPCPostBondError, Message: err.Error()}
return createResponse(postBondRoute, nil, resErr)
}
if res.BondID == "" {
return createResponse(postBondRoute, "existing account configured - no bond posted", nil)
}
return createResponse(postBondRoute, res, nil)
}

Expand Down Expand Up @@ -1134,29 +1137,29 @@ Registration is complete after the fee transaction has been confirmed.`,
pwArgsShort: `"appPass"`,
argsShort: `"addr" bond assetID (lockTime "cert" maintain)`,
cmdSummary: `Post new bond for DEX. An ok response does not mean that the bond is active.
Bond is active after the bond transaction has been confirmed and the server notified.`,
Bond is active after the bond transaction has been confirmed and the server notified.`,
pwArgsLong: `Password Args:
appPass (string): The DEX client password.`,
appPass (string): The DEX client password.`,
argsLong: `Args:
addr (string): The DEX address to post bond for for.
bond (int): The bond amount (in DCR presently).
assetID (int): The asset ID with which to pay the fee.
addr (string): The DEX address to post bond for for.
bond (int): The bond amount (in DCR presently).
assetID (int): The asset ID with which to pay the fee.
cert (string): Optional. The TLS certificate path. Only applicable when registering.
maintain (bool): Optional. Whether to maintain the trading tier established by this bond. Only applicable when registering. (default is true)`,
maintain (bool): Optional. Whether to maintain the trading tier established by this bond. Only applicable when registering. (default is true)`,
returns: `Returns:
{
"bondID" (string): The bond transactions's txid and output index.
"reqConfirms" (int): The number of confirmations required to start trading.
}`,
{
"bondID" (string): The bond transactions's txid and output index.
"reqConfirms" (int): The number of confirmations required to start trading.
}`,
},
bondOptionsRoute: {
argsShort: `"addr" targetTier (maxBondedAmt bondAssetID)`,
cmdSummary: `Change bond options for a DEX.`,
argsLong: `Args:
addr (string): The DEX address to post bond for for.
targetTier (int): The target trading tier.
maxBondedAmt (int): The maximum amount that may be locked in bonds.
bondAssetID (int): The asset ID with which to auto-post bonds.`,
addr (string): The DEX address to post bond for for.
targetTier (int): The target trading tier.
maxBondedAmt (int): The maximum amount that may be locked in bonds.
bondAssetID (int): The asset ID with which to auto-post bonds.`,
returns: `Returns: "ok"`,
},
exchangesRoute: {
Expand Down

0 comments on commit 121df1c

Please sign in to comment.