added missing takeover height and amount RPC fields

This commit is contained in:
Brannon King 2021-11-09 14:59:07 -05:00
parent 53f79b0979
commit a1771466b7
3 changed files with 34 additions and 26 deletions

View file

@ -55,11 +55,12 @@ type GetClaimsForNameBySeqCmd struct {
}
type GetClaimsForNameResult struct {
Hash string `json:"hash"`
Height int32 `json:"height"`
NormalizedName string `json:"normalizedname"`
Claims []ClaimResult `json:"claims"`
// UnclaimedSupports []SupportResult `json:"unclaimedSupports"` how would this work with other constraints?
Hash string `json:"hash"`
Height int32 `json:"height"`
LastTakeoverHeight int32 `json:"lasttakeoverheight"`
NormalizedName string `json:"normalizedname"`
Claims []ClaimResult `json:"claims"`
// UnclaimedSupports []SupportResult `json:"supportswithoutclaim"` how would this work with other constraints?
}
type SupportResult struct {
@ -80,6 +81,7 @@ type ClaimResult struct {
Sequence int32 `json:"sequence"`
Height int32 `json:"height"`
ValidAtHeight int32 `json:"validatheight"`
Amount int64 `json:"amount"`
EffectiveAmount int64 `json:"effectiveamount"`
Supports []SupportResult `json:"supports,omitempty"`
Address string `json:"address,omitempty"`

View file

@ -117,10 +117,11 @@ func handleGetClaimsForName(s *rpcServer, cmd interface{}, _ <-chan struct{}) (i
}
return btcjson.GetClaimsForNameResult{
Hash: hash,
Height: height,
NormalizedName: name,
Claims: results,
Hash: hash,
Height: height,
LastTakeoverHeight: n.TakenOverAt,
NormalizedName: name,
Claims: results,
}, nil
}
@ -155,10 +156,11 @@ func handleGetClaimsForNameByID(s *rpcServer, cmd interface{}, _ <-chan struct{}
}
return btcjson.GetClaimsForNameResult{
Hash: hash,
Height: height,
NormalizedName: name,
Claims: results,
Hash: hash,
Height: height,
LastTakeoverHeight: n.TakenOverAt,
NormalizedName: name,
Claims: results,
}, nil
}
@ -190,10 +192,11 @@ func handleGetClaimsForNameByBid(s *rpcServer, cmd interface{}, _ <-chan struct{
}
return btcjson.GetClaimsForNameResult{
Hash: hash,
Height: height,
NormalizedName: name,
Claims: results,
Hash: hash,
Height: height,
LastTakeoverHeight: n.TakenOverAt,
NormalizedName: name,
Claims: results,
}, nil
}
@ -230,10 +233,11 @@ func handleGetClaimsForNameBySeq(s *rpcServer, cmd interface{}, _ <-chan struct{
}
return btcjson.GetClaimsForNameResult{
Hash: hash,
Height: height,
NormalizedName: name,
Claims: results,
Hash: hash,
Height: height,
LastTakeoverHeight: n.TakenOverAt,
NormalizedName: name,
Claims: results,
}, nil
}
@ -248,6 +252,7 @@ func toClaimResult(s *rpcServer, i int32, node *node.Node, includeValues *bool)
TXID: claim.OutPoint.Hash.String(),
N: claim.OutPoint.Index,
Bid: i, // assuming sorted by bid
Amount: claim.Amount,
EffectiveAmount: claim.Amount + node.SupportSums[claim.ClaimID.Key()],
Sequence: claim.Sequence,
Supports: supports,

View file

@ -782,10 +782,11 @@ var helpDescsEnUS = map[string]string{
"getclaimsfornamebybid-includevalues": "Return the metadata and address",
"getclaimsfornamebyid-includevalues": "Return the metadata and address",
"getclaimsfornameresult-claims": "All the active claims on the given name",
"getclaimsfornameresult-normalizedname": "Lower-case version of the passed-in name",
"getclaimsfornameresult-height": "Height of the requested block",
"getclaimsfornameresult-hash": "Hash of the requested block",
"getclaimsfornameresult-claims": "All the active claims on the given name",
"getclaimsfornameresult-normalizedname": "Lower-case version of the passed-in name",
"getclaimsfornameresult-height": "Height of the requested block",
"getclaimsfornameresult-lasttakeoverheight": "Height of the most recent name takeover",
"getclaimsfornameresult-hash": "Hash of the requested block",
"getchangesinblock--synopsis": "Returns a list of names affected by a given block",
"getchangesinblockresult-names": "Names that changed (or were at least checked for change) on the given height",
@ -806,9 +807,9 @@ var helpDescsEnUS = map[string]string{
"claimresult-n": "The output (TXO) index",
"claimresult-address": "The destination address for the claim",
"claimresult-supports": "The list of supports active on the claim",
"claimresult-amount": "LBC staked",
"claimresult-validatheight": "The height when the stake becomes valid",
"claimresult-height": "The height when the stake was created or updated",
"claimresult-amount": "The stake amount in sats",
"claimresult-effectiveamount": "The stake amount plus the active supports' amounts",
"claimresult-sequence": "The order this claim was created compared to other claims on this name",
"claimresult-bid": "Bid of 0 means that this claim currently owns the name",