Merge pull request #61 from lbryio/go_sdk38_client_updates

Add updated structure for response api call based on SDK 38 release.
This commit is contained in:
Mark 2019-07-09 21:47:30 -04:00 committed by GitHub
commit 461ae6a16b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -287,29 +287,25 @@ type Support struct {
type Claim struct { type Claim struct {
Address string `json:"address"` Address string `json:"address"`
Amount string `json:"amount"` Amount string `json:"amount"`
CanonicalURL string `json:"canonical_url"`
ClaimID string `json:"claim_id"` ClaimID string `json:"claim_id"`
ClaimOp string `json:"claim_op,omitempty"` ClaimOp string `json:"claim_op,omitempty"`
Confirmations int `json:"confirmations"` Confirmations int `json:"confirmations"`
Height int `json:"height"` Height int `json:"height"`
IsChange bool `json:"is_change,omitempty"` IsChange bool `json:"is_change,omitempty"`
IsChannelSignatureValid bool `json:"is_channel_signature_valid,omitempty"` IsChannelSignatureValid bool `json:"is_channel_signature_valid,omitempty"`
IsMine bool `json:"is_mine,omitempty"` Meta Meta `json:"meta,omitempty"`
Name string `json:"name"` Name string `json:"name"`
NormalizedName string `json:"normalized_name"`
Nout uint64 `json:"nout"` Nout uint64 `json:"nout"`
PermanentURL string `json:"permanent_url"` PermanentURL string `json:"permanent_url"`
SigningChannel struct { ShortURL string `json:"short_url"`
ClaimID string `json:"claim_id"` SigningChannel *Claim `json:"signing_channel,omitempty"`
Name string `json:"name"`
Value struct {
PublicKey string `json:"public_key"`
Title string `json:"title"`
} `json:"value"`
} `json:"signing_channel,omitempty"`
Timestamp int `json:"timestamp"` Timestamp int `json:"timestamp"`
Txid string `json:"txid"` Txid string `json:"txid"`
Type string `json:"type,omitempty"` Type string `json:"type,omitempty"`
ValueType string `json:"value_type,omitempty"`
Value lbryschema.Claim `json:"protobuf,omitempty"` Value lbryschema.Claim `json:"protobuf,omitempty"`
ValueType string `json:"value_type,omitempty"`
AbsoluteChannelPosition int `json:"absolute_channel_position,omitempty"` AbsoluteChannelPosition int `json:"absolute_channel_position,omitempty"`
ChannelName string `json:"channel_name,omitempty"` ChannelName string `json:"channel_name,omitempty"`
ClaimSequence int64 `json:"claim_sequence,omitempty"` ClaimSequence int64 `json:"claim_sequence,omitempty"`
@ -321,6 +317,20 @@ type Claim struct {
ValidAtHeight int `json:"valid_at_height,omitempty"` ValidAtHeight int `json:"valid_at_height,omitempty"`
} }
type Meta struct {
ActivationHeight int64 `json:"activation_height,omitempty"`
CreationHeight int64 `json:"creation_height,omitempty"`
CreationTimestamp int `json:"creation_timestamp,omitempty"`
EffectiveAmount string `json:"effective_amount,omitempty"`
ExpirationHeight int64 `json:"expiration_height,omitempty"`
IsControlling bool `json:"is_controlling,omitempty"`
SupportAmount string `json:"support_amount,omitempty"`
TrendingGlobal float64 `json:"trending_global,omitempty"`
TrendingGroup float64 `json:"trending_group,omitempty"`
TrendingLocal float64 `json:"trending_local,omitempty"`
TrendingMixed float64 `json:"trending_mixed,omitempty"`
}
const reflectorURL = "http://blobs.lbry.io/" const reflectorURL = "http://blobs.lbry.io/"
// GetStreamSizeByMagic uses "magic" to not just estimate, but actually return the exact size of a stream // GetStreamSizeByMagic uses "magic" to not just estimate, but actually return the exact size of a stream
@ -469,13 +479,7 @@ type VersionResponse struct {
PythonVersion string `json:"python_version"` PythonVersion string `json:"python_version"`
} }
type ResolveResponse map[string]ResolveResponseItem type ResolveResponse map[string]Claim
type ResolveResponseItem struct {
Certificate *Claim `json:"certificate,omitempty"`
Claim *Claim `json:"claim,omitempty"`
ClaimsInChannel *uint64 `json:"claims_in_channel,omitempty"`
Error *string `json:"error,omitempty"`
}
type NumClaimsInChannelResponse map[string]struct { type NumClaimsInChannelResponse map[string]struct {
ClaimsInChannel *uint64 `json:"claims_in_channel,omitempty"` ClaimsInChannel *uint64 `json:"claims_in_channel,omitempty"`