uvd-describe-sdk 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{client-RAhXcpdY.d.mts → client-BMfgl1zP.d.mts} +87 -1
- package/dist/{client-RAhXcpdY.d.ts → client-BMfgl1zP.d.ts} +87 -1
- package/dist/{config-uvI_GS-x.d.mts → config-DzzhWFYr.d.mts} +1 -1
- package/dist/{config-uvI_GS-x.d.ts → config-DzzhWFYr.d.ts} +1 -1
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +28 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +28 -1
- package/dist/index.mjs.map +1 -1
- package/dist/partner/index.d.mts +2 -2
- package/dist/partner/index.d.ts +2 -2
- package/dist/partner/index.js.map +1 -1
- package/dist/partner/index.mjs.map +1 -1
- package/dist/x402/index.d.mts +1 -1
- package/dist/x402/index.d.ts +1 -1
- package/package.json +1 -1
- package/src/config.ts +1 -1
- package/src/index.ts +2 -0
- package/src/parse.ts +41 -0
- package/src/types.ts +88 -0
|
@@ -812,10 +812,71 @@ interface SelfRated {
|
|
|
812
812
|
/** Distance between the self-rating and everyone else's. */
|
|
813
813
|
gap: number | null;
|
|
814
814
|
}
|
|
815
|
+
/**
|
|
816
|
+
* First and last rating by ON-CHAIN time.
|
|
817
|
+
*
|
|
818
|
+
* `lastRatingAt` is the last **eligible** rating — the one that holds up the
|
|
819
|
+
* score being shown. Since describe.net 2026-09-10 it is documented as a
|
|
820
|
+
* compatibility alias of `Freshness.lastEligibleRatingAt` and keeps that exact
|
|
821
|
+
* meaning for the life of v1. Read `WalletBreakdown.freshness` for the question
|
|
822
|
+
* this pair never could answer: *was this subject described recently, whether
|
|
823
|
+
* or not it counts?*
|
|
824
|
+
*/
|
|
815
825
|
interface Activity {
|
|
816
826
|
firstRatingAt: Timestamp;
|
|
817
827
|
lastRatingAt: Timestamp;
|
|
818
828
|
}
|
|
829
|
+
/**
|
|
830
|
+
* WHAT the dates are about. A date without a scope is a date that lies.
|
|
831
|
+
*
|
|
832
|
+
* `direction` is the field that matters most: `received` is reputation the
|
|
833
|
+
* subject GOT, `emitted` is the ratings a wallet WROTE
|
|
834
|
+
* (`GET /reputation/rater/{wallet}`). Reading the second as the first turns a
|
|
835
|
+
* busy rater into a much-described subject.
|
|
836
|
+
*/
|
|
837
|
+
interface FreshnessScope {
|
|
838
|
+
kind: string | null;
|
|
839
|
+
direction: string | null;
|
|
840
|
+
id: string | null;
|
|
841
|
+
network: string | null;
|
|
842
|
+
declaredType: string | null;
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* WHEN this subject was last described. Two dates, because two questions.
|
|
846
|
+
*
|
|
847
|
+
* - `lastReceivedFeedbackAt` — the last real NewFeedback in scope, whether or
|
|
848
|
+
* not it feeds the score.
|
|
849
|
+
* - `lastEligibleRatingAt` — the last rating that holds up the number shown.
|
|
850
|
+
*
|
|
851
|
+
* When the most recent rating was revoked the two differ, and **that difference
|
|
852
|
+
* is the information**: there was recent activity and the score does not
|
|
853
|
+
* reflect it.
|
|
854
|
+
*
|
|
855
|
+
* NEITHER is `refreshedAt`, which is when the index recomputed its own view and
|
|
856
|
+
* says nothing about the subject.
|
|
857
|
+
*
|
|
858
|
+
* `timestampCoverage` is `none` | `unknown` | `partial` | `complete` over
|
|
859
|
+
* `dated + undated`. **`none` and `unknown` are different facts**: nothing to
|
|
860
|
+
* date versus dates we do not have yet.
|
|
861
|
+
*
|
|
862
|
+
* NO RELATIVE TEXT, deliberately. The API publishes UTC and nothing else, so
|
|
863
|
+
* "3 days ago" is derived at the edge with the reader's clock — a serialised
|
|
864
|
+
* relative string freezes in the first cache.
|
|
865
|
+
*/
|
|
866
|
+
interface Freshness {
|
|
867
|
+
scope: FreshnessScope;
|
|
868
|
+
lastReceivedFeedbackAt: Timestamp;
|
|
869
|
+
lastEligibleRatingAt: Timestamp;
|
|
870
|
+
datedFeedbackCount: number;
|
|
871
|
+
undatedFeedbackCount: number;
|
|
872
|
+
timestampCoverage: string | null;
|
|
873
|
+
eligibleDatedCount: number;
|
|
874
|
+
eligibleUndatedCount: number;
|
|
875
|
+
eligibleTimestampCoverage: string | null;
|
|
876
|
+
refreshedAt: Timestamp;
|
|
877
|
+
indexerCheckedAt: Timestamp;
|
|
878
|
+
freshnessVersion: string | null;
|
|
879
|
+
}
|
|
819
880
|
/** One facet (`tag1`), as declared on-chain. */
|
|
820
881
|
interface Facet {
|
|
821
882
|
score: number | null;
|
|
@@ -872,6 +933,12 @@ interface WalletBreakdown extends Sealed {
|
|
|
872
933
|
concentration: Concentration | null;
|
|
873
934
|
confidence: Confidence | null;
|
|
874
935
|
activity: Activity | null;
|
|
936
|
+
/**
|
|
937
|
+
* WHEN, with its scope. Additive: `activity` above keeps its exact meaning.
|
|
938
|
+
* `null` when the server does not publish the block yet — never an empty
|
|
939
|
+
* object, so "not published" and "no dates" stay distinguishable.
|
|
940
|
+
*/
|
|
941
|
+
freshness: Freshness | null;
|
|
875
942
|
snapshot: Snapshot | null;
|
|
876
943
|
/** What was actually paid, if anything was. */
|
|
877
944
|
payment: PaymentEvidence | null;
|
|
@@ -1021,6 +1088,25 @@ interface IndexHealth {
|
|
|
1021
1088
|
orderingPolicy: string;
|
|
1022
1089
|
raterWeightPolicy: string;
|
|
1023
1090
|
confidencePolicy: string;
|
|
1091
|
+
/**
|
|
1092
|
+
* The frozen `M` of the per-chain credibility weight, `Z_k = R_k/(R_k+M)`.
|
|
1093
|
+
*
|
|
1094
|
+
* REQUIRED in the server schema since `credibility-weight-per-chain@1`
|
|
1095
|
+
* (2026-09-04) and untyped here until now — `types.schema.test.ts` caught it
|
|
1096
|
+
* the moment the snapshot was refreshed. It ships live because the number is
|
|
1097
|
+
* frozen and versioned: recomputing a `finalScore` by hand needs THIS M, not
|
|
1098
|
+
* a copy of it that went stale.
|
|
1099
|
+
*/
|
|
1100
|
+
credibilityM: number | null;
|
|
1101
|
+
/**
|
|
1102
|
+
* WHEN the index as a whole last received a description. The only free,
|
|
1103
|
+
* account-less, parameter-less place to read whether describe.net is still
|
|
1104
|
+
* taking in descriptions or merely still refreshing its views — the two look
|
|
1105
|
+
* identical from the outside, which is the confusion `Freshness` closes.
|
|
1106
|
+
*
|
|
1107
|
+
* `null` against a server that does not publish it yet.
|
|
1108
|
+
*/
|
|
1109
|
+
freshness: Freshness | null;
|
|
1024
1110
|
/** e.g. `{no_ratings: 0, low: 1, medium: 3, high: 6}` — live, never re-typed. */
|
|
1025
1111
|
confidenceThresholds: Record<string, number>;
|
|
1026
1112
|
/** e.g. `{min_raters: 3, campaign_per_rater: 20, top_share: 0.5, ...}`. */
|
|
@@ -1588,4 +1674,4 @@ declare class DescribeClient {
|
|
|
1588
1674
|
private assertPayableTo;
|
|
1589
1675
|
}
|
|
1590
1676
|
|
|
1591
|
-
export { type AgentReputation as A, type
|
|
1677
|
+
export { type AgentReputation as A, type SelfRated as B, CAVEAT_CODES as C, type DescribeErrorKind as D, type Snapshot as E, type Facet as F, type WalletChainRow as G, type HealthChain as H, type IndexHealth as I, type X402Payer as J, type KnownCaveatCode as K, type LeaderboardRow as L, failOpenCovers as M, type Network as N, type Ownership as O, type PaymentEvidence as P, failedAfterPaying as Q, type Rating as R, type Sealed as S, type Timestamp as T, hasCaveat as U, isKnownCaveatCode as V, type WalletBreakdown as W, type X402Challenge as X, type WalletReputation as a, type Activity as b, CAVEAT_SCOPE_FREE as c, CAVEAT_SCOPE_METERED as d, type Caveat as e, type CaveatCode as f, type Concentration as g, type Confidence as h, DescribeClient as i, type DescribeClientConfig as j, DescribeError as k, type DescribeFailure as l, DescribeHTTPError as m, DescribeMalformedHash as n, DescribeNotFound as o, DescribePartnerRejected as p, DescribePartnerUnsigned as q, DescribePaymentRefused as r, DescribePaymentRequired as s, DescribeTimeout as t, DescribeUnparseable as u, DescribeUnreachable as v, type Freshness as w, type FreshnessScope as x, type PartnerSigner as y, type PaymentAttempt as z };
|
|
@@ -812,10 +812,71 @@ interface SelfRated {
|
|
|
812
812
|
/** Distance between the self-rating and everyone else's. */
|
|
813
813
|
gap: number | null;
|
|
814
814
|
}
|
|
815
|
+
/**
|
|
816
|
+
* First and last rating by ON-CHAIN time.
|
|
817
|
+
*
|
|
818
|
+
* `lastRatingAt` is the last **eligible** rating — the one that holds up the
|
|
819
|
+
* score being shown. Since describe.net 2026-09-10 it is documented as a
|
|
820
|
+
* compatibility alias of `Freshness.lastEligibleRatingAt` and keeps that exact
|
|
821
|
+
* meaning for the life of v1. Read `WalletBreakdown.freshness` for the question
|
|
822
|
+
* this pair never could answer: *was this subject described recently, whether
|
|
823
|
+
* or not it counts?*
|
|
824
|
+
*/
|
|
815
825
|
interface Activity {
|
|
816
826
|
firstRatingAt: Timestamp;
|
|
817
827
|
lastRatingAt: Timestamp;
|
|
818
828
|
}
|
|
829
|
+
/**
|
|
830
|
+
* WHAT the dates are about. A date without a scope is a date that lies.
|
|
831
|
+
*
|
|
832
|
+
* `direction` is the field that matters most: `received` is reputation the
|
|
833
|
+
* subject GOT, `emitted` is the ratings a wallet WROTE
|
|
834
|
+
* (`GET /reputation/rater/{wallet}`). Reading the second as the first turns a
|
|
835
|
+
* busy rater into a much-described subject.
|
|
836
|
+
*/
|
|
837
|
+
interface FreshnessScope {
|
|
838
|
+
kind: string | null;
|
|
839
|
+
direction: string | null;
|
|
840
|
+
id: string | null;
|
|
841
|
+
network: string | null;
|
|
842
|
+
declaredType: string | null;
|
|
843
|
+
}
|
|
844
|
+
/**
|
|
845
|
+
* WHEN this subject was last described. Two dates, because two questions.
|
|
846
|
+
*
|
|
847
|
+
* - `lastReceivedFeedbackAt` — the last real NewFeedback in scope, whether or
|
|
848
|
+
* not it feeds the score.
|
|
849
|
+
* - `lastEligibleRatingAt` — the last rating that holds up the number shown.
|
|
850
|
+
*
|
|
851
|
+
* When the most recent rating was revoked the two differ, and **that difference
|
|
852
|
+
* is the information**: there was recent activity and the score does not
|
|
853
|
+
* reflect it.
|
|
854
|
+
*
|
|
855
|
+
* NEITHER is `refreshedAt`, which is when the index recomputed its own view and
|
|
856
|
+
* says nothing about the subject.
|
|
857
|
+
*
|
|
858
|
+
* `timestampCoverage` is `none` | `unknown` | `partial` | `complete` over
|
|
859
|
+
* `dated + undated`. **`none` and `unknown` are different facts**: nothing to
|
|
860
|
+
* date versus dates we do not have yet.
|
|
861
|
+
*
|
|
862
|
+
* NO RELATIVE TEXT, deliberately. The API publishes UTC and nothing else, so
|
|
863
|
+
* "3 days ago" is derived at the edge with the reader's clock — a serialised
|
|
864
|
+
* relative string freezes in the first cache.
|
|
865
|
+
*/
|
|
866
|
+
interface Freshness {
|
|
867
|
+
scope: FreshnessScope;
|
|
868
|
+
lastReceivedFeedbackAt: Timestamp;
|
|
869
|
+
lastEligibleRatingAt: Timestamp;
|
|
870
|
+
datedFeedbackCount: number;
|
|
871
|
+
undatedFeedbackCount: number;
|
|
872
|
+
timestampCoverage: string | null;
|
|
873
|
+
eligibleDatedCount: number;
|
|
874
|
+
eligibleUndatedCount: number;
|
|
875
|
+
eligibleTimestampCoverage: string | null;
|
|
876
|
+
refreshedAt: Timestamp;
|
|
877
|
+
indexerCheckedAt: Timestamp;
|
|
878
|
+
freshnessVersion: string | null;
|
|
879
|
+
}
|
|
819
880
|
/** One facet (`tag1`), as declared on-chain. */
|
|
820
881
|
interface Facet {
|
|
821
882
|
score: number | null;
|
|
@@ -872,6 +933,12 @@ interface WalletBreakdown extends Sealed {
|
|
|
872
933
|
concentration: Concentration | null;
|
|
873
934
|
confidence: Confidence | null;
|
|
874
935
|
activity: Activity | null;
|
|
936
|
+
/**
|
|
937
|
+
* WHEN, with its scope. Additive: `activity` above keeps its exact meaning.
|
|
938
|
+
* `null` when the server does not publish the block yet — never an empty
|
|
939
|
+
* object, so "not published" and "no dates" stay distinguishable.
|
|
940
|
+
*/
|
|
941
|
+
freshness: Freshness | null;
|
|
875
942
|
snapshot: Snapshot | null;
|
|
876
943
|
/** What was actually paid, if anything was. */
|
|
877
944
|
payment: PaymentEvidence | null;
|
|
@@ -1021,6 +1088,25 @@ interface IndexHealth {
|
|
|
1021
1088
|
orderingPolicy: string;
|
|
1022
1089
|
raterWeightPolicy: string;
|
|
1023
1090
|
confidencePolicy: string;
|
|
1091
|
+
/**
|
|
1092
|
+
* The frozen `M` of the per-chain credibility weight, `Z_k = R_k/(R_k+M)`.
|
|
1093
|
+
*
|
|
1094
|
+
* REQUIRED in the server schema since `credibility-weight-per-chain@1`
|
|
1095
|
+
* (2026-09-04) and untyped here until now — `types.schema.test.ts` caught it
|
|
1096
|
+
* the moment the snapshot was refreshed. It ships live because the number is
|
|
1097
|
+
* frozen and versioned: recomputing a `finalScore` by hand needs THIS M, not
|
|
1098
|
+
* a copy of it that went stale.
|
|
1099
|
+
*/
|
|
1100
|
+
credibilityM: number | null;
|
|
1101
|
+
/**
|
|
1102
|
+
* WHEN the index as a whole last received a description. The only free,
|
|
1103
|
+
* account-less, parameter-less place to read whether describe.net is still
|
|
1104
|
+
* taking in descriptions or merely still refreshing its views — the two look
|
|
1105
|
+
* identical from the outside, which is the confusion `Freshness` closes.
|
|
1106
|
+
*
|
|
1107
|
+
* `null` against a server that does not publish it yet.
|
|
1108
|
+
*/
|
|
1109
|
+
freshness: Freshness | null;
|
|
1024
1110
|
/** e.g. `{no_ratings: 0, low: 1, medium: 3, high: 6}` — live, never re-typed. */
|
|
1025
1111
|
confidenceThresholds: Record<string, number>;
|
|
1026
1112
|
/** e.g. `{min_raters: 3, campaign_per_rater: 20, top_share: 0.5, ...}`. */
|
|
@@ -1588,4 +1674,4 @@ declare class DescribeClient {
|
|
|
1588
1674
|
private assertPayableTo;
|
|
1589
1675
|
}
|
|
1590
1676
|
|
|
1591
|
-
export { type AgentReputation as A, type
|
|
1677
|
+
export { type AgentReputation as A, type SelfRated as B, CAVEAT_CODES as C, type DescribeErrorKind as D, type Snapshot as E, type Facet as F, type WalletChainRow as G, type HealthChain as H, type IndexHealth as I, type X402Payer as J, type KnownCaveatCode as K, type LeaderboardRow as L, failOpenCovers as M, type Network as N, type Ownership as O, type PaymentEvidence as P, failedAfterPaying as Q, type Rating as R, type Sealed as S, type Timestamp as T, hasCaveat as U, isKnownCaveatCode as V, type WalletBreakdown as W, type X402Challenge as X, type WalletReputation as a, type Activity as b, CAVEAT_SCOPE_FREE as c, CAVEAT_SCOPE_METERED as d, type Caveat as e, type CaveatCode as f, type Concentration as g, type Confidence as h, DescribeClient as i, type DescribeClientConfig as j, DescribeError as k, type DescribeFailure as l, DescribeHTTPError as m, DescribeMalformedHash as n, DescribeNotFound as o, DescribePartnerRejected as p, DescribePartnerUnsigned as q, DescribePaymentRefused as r, DescribePaymentRequired as s, DescribeTimeout as t, DescribeUnparseable as u, DescribeUnreachable as v, type Freshness as w, type FreshnessScope as x, type PartnerSigner as y, type PaymentAttempt as z };
|
|
@@ -138,7 +138,7 @@ declare const PARTNER_KEY_ENV = "DESCRIBE_PARTNER_PRIVATE_KEY";
|
|
|
138
138
|
* time instead of at runtime. Bumping the version without the constant is a
|
|
139
139
|
* red test, not a silent lie in someone's access log.
|
|
140
140
|
*/
|
|
141
|
-
declare const SDK_VERSION = "0.
|
|
141
|
+
declare const SDK_VERSION = "0.3.0";
|
|
142
142
|
/** `uvd-describe-sdk-ts/0.1.0`, plus `(+<product>)` when the caller names itself. */
|
|
143
143
|
declare const SDK_NAME = "uvd-describe-sdk-ts";
|
|
144
144
|
/**
|
|
@@ -138,7 +138,7 @@ declare const PARTNER_KEY_ENV = "DESCRIBE_PARTNER_PRIVATE_KEY";
|
|
|
138
138
|
* time instead of at runtime. Bumping the version without the constant is a
|
|
139
139
|
* red test, not a silent lie in someone's access log.
|
|
140
140
|
*/
|
|
141
|
-
declare const SDK_VERSION = "0.
|
|
141
|
+
declare const SDK_VERSION = "0.3.0";
|
|
142
142
|
/** `uvd-describe-sdk-ts/0.1.0`, plus `(+<product>)` when the caller names itself. */
|
|
143
143
|
declare const SDK_NAME = "uvd-describe-sdk-ts";
|
|
144
144
|
/**
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DescribeErrorKind, P as PaymentEvidence, A as AgentReputation, I as IndexHealth, L as LeaderboardRow, W as WalletBreakdown, a as WalletReputation } from './client-
|
|
2
|
-
export { b as Activity, C as CAVEAT_CODES, c as CAVEAT_SCOPE_FREE, d as CAVEAT_SCOPE_METERED, e as Caveat, f as CaveatCode, g as Concentration, h as Confidence, i as DescribeClient, j as DescribeClientConfig, k as DescribeError, l as DescribeFailure, m as DescribeHTTPError, n as DescribeMalformedHash, o as DescribeNotFound, p as DescribePartnerRejected, q as DescribePartnerUnsigned, r as DescribePaymentRefused, s as DescribePaymentRequired, t as DescribeTimeout, u as DescribeUnparseable, v as DescribeUnreachable, F as Facet, H as HealthChain, K as KnownCaveatCode, N as Network, O as Ownership,
|
|
3
|
-
export { D as DEFAULT_BASE_URL, a as DEFAULT_JITTER_MS, b as DEFAULT_SITE_URL, c as DEFAULT_TIMEOUT_MS, P as PARTNER_CHAIN_ID, d as PARTNER_KEY_ENV, S as SDK_NAME, e as SDK_VERSION, T as TREASURY_EVM, u as userAgent } from './config-
|
|
1
|
+
import { D as DescribeErrorKind, P as PaymentEvidence, A as AgentReputation, I as IndexHealth, L as LeaderboardRow, W as WalletBreakdown, a as WalletReputation } from './client-BMfgl1zP.mjs';
|
|
2
|
+
export { b as Activity, C as CAVEAT_CODES, c as CAVEAT_SCOPE_FREE, d as CAVEAT_SCOPE_METERED, e as Caveat, f as CaveatCode, g as Concentration, h as Confidence, i as DescribeClient, j as DescribeClientConfig, k as DescribeError, l as DescribeFailure, m as DescribeHTTPError, n as DescribeMalformedHash, o as DescribeNotFound, p as DescribePartnerRejected, q as DescribePartnerUnsigned, r as DescribePaymentRefused, s as DescribePaymentRequired, t as DescribeTimeout, u as DescribeUnparseable, v as DescribeUnreachable, F as Facet, w as Freshness, x as FreshnessScope, H as HealthChain, K as KnownCaveatCode, N as Network, O as Ownership, y as PartnerSigner, z as PaymentAttempt, R as Rating, S as Sealed, B as SelfRated, E as Snapshot, T as Timestamp, G as WalletChainRow, X as X402Challenge, J as X402Payer, M as failOpenCovers, Q as failedAfterPaying, U as hasCaveat, V as isKnownCaveatCode } from './client-BMfgl1zP.mjs';
|
|
3
|
+
export { D as DEFAULT_BASE_URL, a as DEFAULT_JITTER_MS, b as DEFAULT_SITE_URL, c as DEFAULT_TIMEOUT_MS, P as PARTNER_CHAIN_ID, d as PARTNER_KEY_ENV, S as SDK_NAME, e as SDK_VERSION, T as TREASURY_EVM, u as userAgent } from './config-DzzhWFYr.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* What to do INSTEAD — the sentence `transient` cannot say.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { D as DescribeErrorKind, P as PaymentEvidence, A as AgentReputation, I as IndexHealth, L as LeaderboardRow, W as WalletBreakdown, a as WalletReputation } from './client-
|
|
2
|
-
export { b as Activity, C as CAVEAT_CODES, c as CAVEAT_SCOPE_FREE, d as CAVEAT_SCOPE_METERED, e as Caveat, f as CaveatCode, g as Concentration, h as Confidence, i as DescribeClient, j as DescribeClientConfig, k as DescribeError, l as DescribeFailure, m as DescribeHTTPError, n as DescribeMalformedHash, o as DescribeNotFound, p as DescribePartnerRejected, q as DescribePartnerUnsigned, r as DescribePaymentRefused, s as DescribePaymentRequired, t as DescribeTimeout, u as DescribeUnparseable, v as DescribeUnreachable, F as Facet, H as HealthChain, K as KnownCaveatCode, N as Network, O as Ownership,
|
|
3
|
-
export { D as DEFAULT_BASE_URL, a as DEFAULT_JITTER_MS, b as DEFAULT_SITE_URL, c as DEFAULT_TIMEOUT_MS, P as PARTNER_CHAIN_ID, d as PARTNER_KEY_ENV, S as SDK_NAME, e as SDK_VERSION, T as TREASURY_EVM, u as userAgent } from './config-
|
|
1
|
+
import { D as DescribeErrorKind, P as PaymentEvidence, A as AgentReputation, I as IndexHealth, L as LeaderboardRow, W as WalletBreakdown, a as WalletReputation } from './client-BMfgl1zP.js';
|
|
2
|
+
export { b as Activity, C as CAVEAT_CODES, c as CAVEAT_SCOPE_FREE, d as CAVEAT_SCOPE_METERED, e as Caveat, f as CaveatCode, g as Concentration, h as Confidence, i as DescribeClient, j as DescribeClientConfig, k as DescribeError, l as DescribeFailure, m as DescribeHTTPError, n as DescribeMalformedHash, o as DescribeNotFound, p as DescribePartnerRejected, q as DescribePartnerUnsigned, r as DescribePaymentRefused, s as DescribePaymentRequired, t as DescribeTimeout, u as DescribeUnparseable, v as DescribeUnreachable, F as Facet, w as Freshness, x as FreshnessScope, H as HealthChain, K as KnownCaveatCode, N as Network, O as Ownership, y as PartnerSigner, z as PaymentAttempt, R as Rating, S as Sealed, B as SelfRated, E as Snapshot, T as Timestamp, G as WalletChainRow, X as X402Challenge, J as X402Payer, M as failOpenCovers, Q as failedAfterPaying, U as hasCaveat, V as isKnownCaveatCode } from './client-BMfgl1zP.js';
|
|
3
|
+
export { D as DEFAULT_BASE_URL, a as DEFAULT_JITTER_MS, b as DEFAULT_SITE_URL, c as DEFAULT_TIMEOUT_MS, P as PARTNER_CHAIN_ID, d as PARTNER_KEY_ENV, S as SDK_NAME, e as SDK_VERSION, T as TREASURY_EVM, u as userAgent } from './config-DzzhWFYr.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* What to do INSTEAD — the sentence `transient` cannot say.
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ var DEFAULT_JITTER_MS = 400;
|
|
|
8
8
|
var TREASURY_EVM = "0xe4dc963c56979E0260fc146b87eE24F18220e545";
|
|
9
9
|
var PARTNER_CHAIN_ID = 8453;
|
|
10
10
|
var PARTNER_KEY_ENV = "DESCRIBE_PARTNER_PRIVATE_KEY";
|
|
11
|
-
var SDK_VERSION = "0.
|
|
11
|
+
var SDK_VERSION = "0.3.0";
|
|
12
12
|
var SDK_NAME = "uvd-describe-sdk-ts";
|
|
13
13
|
function userAgent(product) {
|
|
14
14
|
const base = `${SDK_NAME}/${SDK_VERSION}`;
|
|
@@ -383,6 +383,30 @@ function parseActivity(v) {
|
|
|
383
383
|
if (!isObj(v)) return null;
|
|
384
384
|
return { firstRatingAt: optString(v.first_rating_at), lastRatingAt: optString(v.last_rating_at) };
|
|
385
385
|
}
|
|
386
|
+
function parseFreshness(v) {
|
|
387
|
+
if (!isObj(v)) return null;
|
|
388
|
+
const scope = isObj(v.scope) ? v.scope : {};
|
|
389
|
+
return {
|
|
390
|
+
scope: {
|
|
391
|
+
kind: optString(scope.kind),
|
|
392
|
+
direction: optString(scope.direction),
|
|
393
|
+
id: optString(scope.id),
|
|
394
|
+
network: optString(scope.network),
|
|
395
|
+
declaredType: optString(scope.declared_type)
|
|
396
|
+
},
|
|
397
|
+
lastReceivedFeedbackAt: optString(v.last_received_feedback_at),
|
|
398
|
+
lastEligibleRatingAt: optString(v.last_eligible_rating_at),
|
|
399
|
+
datedFeedbackCount: num(v.dated_feedback_count),
|
|
400
|
+
undatedFeedbackCount: num(v.undated_feedback_count),
|
|
401
|
+
timestampCoverage: optString(v.timestamp_coverage),
|
|
402
|
+
eligibleDatedCount: num(v.eligible_dated_count),
|
|
403
|
+
eligibleUndatedCount: num(v.eligible_undated_count),
|
|
404
|
+
eligibleTimestampCoverage: optString(v.eligible_timestamp_coverage),
|
|
405
|
+
refreshedAt: optString(v.refreshed_at),
|
|
406
|
+
indexerCheckedAt: optString(v.indexer_checked_at),
|
|
407
|
+
freshnessVersion: optString(v.freshness_version)
|
|
408
|
+
};
|
|
409
|
+
}
|
|
386
410
|
function parseSnapshot(v) {
|
|
387
411
|
if (!isObj(v)) return null;
|
|
388
412
|
const malformed = [];
|
|
@@ -505,6 +529,7 @@ function parseWalletBreakdown(payload, payment) {
|
|
|
505
529
|
concentration: parseConcentration(payload.concentration),
|
|
506
530
|
confidence: parseConfidence(payload.confidence),
|
|
507
531
|
activity: parseActivity(payload.activity),
|
|
532
|
+
freshness: parseFreshness(payload.freshness),
|
|
508
533
|
snapshot: parseSnapshot(payload.snapshot),
|
|
509
534
|
payment,
|
|
510
535
|
policyVersion: optString(payload.policy_version),
|
|
@@ -580,6 +605,8 @@ function parseHealth(payload) {
|
|
|
580
605
|
orderingPolicy: String(payload.ordering_policy ?? ""),
|
|
581
606
|
raterWeightPolicy: String(payload.rater_weight_policy ?? ""),
|
|
582
607
|
confidencePolicy: String(payload.confidence_policy ?? ""),
|
|
608
|
+
credibilityM: optNumber(payload.credibility_m),
|
|
609
|
+
freshness: parseFreshness(payload.freshness),
|
|
583
610
|
confidenceThresholds: isObj(payload.confidence_thresholds) ? payload.confidence_thresholds : {},
|
|
584
611
|
readingPolicy: isObj(payload.reading_policy) ? payload.reading_policy : {},
|
|
585
612
|
buildSha: optString(payload.build_sha),
|