@0xinsider/sdk 0.16.0 → 0.17.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/schema.d.ts CHANGED
@@ -87,7 +87,7 @@ export type ApiErrorBody = {
87
87
  message: string;
88
88
  doc_url?: string;
89
89
  param?: string;
90
- /** The recommended next retry instant (RFC3339). Present on every retryable error (reason=pick_not_released, code=rate_limited including reason=monthly_quota_exceeded, code=rate_limit_unavailable, reason=read_model_warming) and omitted otherwise. Always in the future. For pick_not_released: before the 11:00 UTC operating-window start, before a selected pick's stored release, or after a skipped day, it names the automatic system's next boundary. While no candidate exists in the live window it normally names the persisted next automatic selector attempt. Every value is advisory and can change before release. When the automatic schedule is absent/due or a pick is overdue it degrades to ~60s. Schedule one request and do not poll. Prefer Retry-After for the duration because it is immune to client clock skew. */
90
+ /** The recommended next retry instant (RFC3339). Present on every retryable error (reason=pick_not_released, code=rate_limited including reason=monthly_quota_exceeded, code=rate_limit_unavailable, reason=read_model_warming) and omitted otherwise. Always in the future. For pick_not_released: before the 07:00 UTC operating-window start, before a selected pick's stored release, or after a skipped day, it names the automatic system's next boundary. While no candidate exists in the live window it normally names the persisted next automatic selector attempt. Every value is advisory and can change before release. When the automatic schedule is absent/due or a pick is overdue it degrades to ~60s. Schedule one request and do not poll. Prefer Retry-After for the duration because it is immune to client clock skew. */
91
91
  retry_at?: string;
92
92
  freshness?: FreshnessFailure;
93
93
  /** ADDITIVE (#7209). The specific, actionable cause behind `code`, when there is one more specific than the code itself. `code` keeps its published values, so existing clients are unaffected; new clients branch on `reason`. Omitted when the code already says everything we know. pick_not_released: no Pick of the Day is published for the current product day; schedule one request against retry_at instead of polling. unknown_endpoint: the PATH is not a route on this API -- read GET /api/v1, do not retry. trader_not_tracked: the wallet is real and the URL is right, but the trader is outside the HOT/WARM sync tiers -- stop asking for this wallet. cursor_expired: pagination went stale mid-walk -- re-request the first page and continue. read_model_warming: the requested endpoint cannot serve its read model yet; exact causes are endpoint-specific and can include a cold or contended refresh or a dependency that prevented refresh. database_unavailable: the API's database or its connection pool is temporarily unreachable (a connection-class failure, not a query fault); code stays rate_limit_unavailable, nothing is rate-limited, retry after Retry-After / retry_at. idempotency_in_progress: retain the exact Idempotency-Key and request body, then retry shortly. webhook_delivery_in_progress: retry the URL or signing-secret configuration change after the destination's active request completes. request_accounting_unavailable: accounting capacity is unavailable before the handler executes; retry after Retry-After / retry_at. sandbox_api_key: the credential is a sandbox key (oxi_sk_test_) from POST /api/v1/agents/register, which only the sandbox server accepts -- call the sandbox base URL with it, or get a live key or OAuth access token; do not retry it here. api_key_in_query: the key was sent as a ?token= query parameter, which no route reads because URLs land in logs and history; the key itself was not checked -- resend it as Authorization: Bearer. subscription_inactive: the key is valid but the account's Pro subscription has lapsed (402 subscription_required); permanent until a person reactivates at https://0xinsider.com/billing, which the message names -- stop retrying on a schedule and surface the link. The key owner is emailed once per lapse. monthly_quota_exceeded: the account has used the requests Pro includes for the UTC calendar month (429 rate_limited); retry_at and Retry-After name the first of next month, the only retry that can succeed, and the message names https://0xinsider.com/developers, where pay as you go for requests over the quota is turned on. The X-Monthly-Quota-Limit, X-Monthly-Quota-Remaining and X-Monthly-Quota-Reset headers on every authenticated response say how close the account is. invalid_query, invalid_path, invalid_body (400 bad_request, #16146): a query parameter, a path segment or the JSON body did not parse or does not fit the route's schema, so no handler ran; param names the field when the parser named one (a query key, a path segment, a JSON path such as traders[0], or body); fix the request, never retry it as sent. unsupported_media_type (415 bad_request, param content-type): send the body with Content-Type: application/json. payload_too_large (413 bad_request, param body): the body is over 1048576 bytes. method_not_allowed (405 bad_request): the path is a route but not with this method; the Allow header names the methods it serves. ip_rate_limited (429 rate_limited, #16380): the per-address budget every caller behind one IP shares, counted before authentication, is spent; not the key's own window, and the RateLimit-* headers describe that bucket. ip_throttled (429 rate_limited): the address is in a cooldown after sustained over-limit traffic; Retry-After is minutes to days, and a request before it does not shorten the cooldown. */
@@ -254,6 +254,10 @@ export type CreateWebhookRequest = {
254
254
  event_types: WebhookEventType[];
255
255
  trade_filters?: LargeTradeSubscriptionFilters;
256
256
  };
257
+ export type CreateWebhookVerificationAttemptRequest = {
258
+ /** The original one-time token returned by webhook creation or a URL change. Sent only in the request body and signed receiver challenge. */
259
+ verification_token: string;
260
+ };
257
261
  /** Compact data age and coverage for a response body, always present on the operations that publish it. Read status and as_of to decide whether to use the body at all, and field_groups to see which part is weak. Everything here comes from stored observation clocks, so a cached body reports the same ages a freshly computed one does: meta.cached and meta.cache_age_s stay the only transport-time facts and neither makes this block newer. The per-field audit object is still available through expand=trust; this is the default summary of the same question. */
258
262
  export type DataQuality = {
259
263
  /** fresh when every group is fresh, unavailable when every group is unavailable, and partial in every other case. */
@@ -890,6 +894,7 @@ export type LeaderboardEntry = {
890
894
  markets_traded?: number;
891
895
  /** The wallet's win rate across ALL categories, not the filtered one. ?category= decides WHICH wallets are listed (the wallet must be ranked in that category); it does not rescope this field, so a soccer-filtered list still reports each wallet's overall rate. For a per-category record use GET /api/v1/trader/{address}/categories. */
892
896
  win_rate?: number;
897
+ /** Observed trading style identifier. New rows use two_sided, category_focused, high_activity, diversified, mixed, or unclassified. Historical identifiers remain readable during normal reclassification; style does not predict skill or intent. */
893
898
  strategy_type?: string;
894
899
  /** Provider platform. Always polymarket. */
895
900
  platform: "polymarket";
@@ -1395,7 +1400,7 @@ export type PickOfTheDayArchiveEntry = {
1395
1400
  * @deprecated
1396
1401
  */
1397
1402
  pick_rank?: number;
1398
- /** When this pick became public (RFC3339 UTC). pick_date above is the America/New_York product day, not an instant, so read this whenever you need a real time: reading the bare date as UTC midnight places it hours before the earliest instant a pick can drop (11:00 UTC on that date). A day's last pick can drop at 23:00 ET, which is the following UTC date. Omitted (not null) when the instant is unknown; additive and optional for mixed-version client compatibility. */
1403
+ /** When this pick became public (RFC3339 UTC). pick_date above is the America/New_York product day, not an instant, so read this whenever you need a real time: reading the bare date as UTC midnight places it hours before the earliest instant a pick can drop (07:00 UTC on that date). A day's last pick can drop at 23:00 ET, which is the following UTC date. Omitted (not null) when the instant is unknown; additive and optional for mixed-version client compatibility. */
1399
1404
  published_at?: string;
1400
1405
  /** Human-readable matchup (e.g. "Portugal vs. Uzbekistan"). */
1401
1406
  matchup: string;
@@ -1731,7 +1736,7 @@ export type PickSportsContext = {
1731
1736
  /** The two teams as a single whole-game label, joined "<home> – <away>" (en-dash) in provider display order (e.g. "Portugal – Uzbekistan"). Composed server-side from the provider team names (no title/slug parsing). Present when both teams resolve a name; omitted for single-subject, teamless, or non-two-team contexts. */
1732
1737
  matchup_title?: string;
1733
1738
  };
1734
- /** A single sports team or competitor in a Pick of the Day market's sports context. Identity and score fields are provider-owned and nullable. The structured score fields (`sets`, `format`, `sets_won`) and the tennis fields (`headshot`, `tour`) are backend-owned and are OMITTED rather than null when they do not apply, so a consumer must treat an absent key and a null the same way. */
1739
+ /** A single sports team or competitor in a Pick of the Day market's sports context. Identity and score fields are provider-owned and nullable. The structured score fields (`sets`, `format`, `sets_won`) and the tennis fields (`headshot`, `headshot_revision`, `tour`) are backend-owned and are OMITTED rather than null when they do not apply, so a consumer must treat an absent key and a null the same way. */
1735
1740
  export type PickSportsTeam = {
1736
1741
  /** Team display label as it appears on the market outcome (e.g. "Portugal"). */
1737
1742
  label: string | null;
@@ -1753,6 +1758,8 @@ export type PickSportsTeam = {
1753
1758
  score: string | null;
1754
1759
  /** Tennis player headshot URL, served same-origin. Present only for a tennis competitor the headshot resolver matched; absent for team sports and for unmatched players, where `logo` stays the fallback. */
1755
1760
  headshot?: string;
1761
+ /** Optional monotonic photo revision for this tennis player, independent of the sports score revision. Legacy stored photos start at zero. Successful new or changed image bytes advance it; source checks and attribution changes do not. Compare only for the same tour and provider_id: a higher revision replaces the portrait, an equal revision may fill a missing portrait, and a lower revision must not replace a newer one. Absent when no photo resolved. */
1762
+ headshot_revision?: number;
1756
1763
  /** Tennis tour this competitor belongs to. Present for every tennis entry whether or not `headshot` resolved, so a consumer can tell a tennis player with no photo from a non-tennis team. Absent for every other sport. Only `atp` and `wta` name a gender; the ITF World Tennis Tour runs men's and women's events and the provider does not say which, so `itf` means tennis with gender unknown. */
1757
1764
  tour?: "atp" | "wta" | "itf";
1758
1765
  /** Per-set score cells for this side, in set order. Backend-owned: render these rather than parsing `score`. Omitted entirely when the provider score is not a structured multi-set match or could not be parsed, so an absent array and an empty one carry the same meaning. */
@@ -2412,6 +2419,7 @@ export type Trader = {
2412
2419
  exact?: TraderStatsExact;
2413
2420
  };
2414
2421
  strategy?: {
2422
+ /** Observed trading style identifier. New rows use two_sided, category_focused, high_activity, diversified, mixed, or unclassified. Historical identifiers remain readable during normal reclassification; style does not predict skill or intent. */
2415
2423
  strategy_type?: string;
2416
2424
  description?: string;
2417
2425
  confidence?: number;
@@ -3014,6 +3022,29 @@ export type WebhookVerification = {
3014
3022
  token: string;
3015
3023
  expires_at: string;
3016
3024
  };
3025
+ export type WebhookVerificationAttempt = {
3026
+ id: string;
3027
+ object: "webhook_verification_attempt";
3028
+ webhook_id: number;
3029
+ /** queued/running are pending consent. verified means the same endpoint revision answered 2xx and activated atomically. failed/cancelled/expired are terminal and do not restart on polling or replay. */
3030
+ state: "queued" | "running" | "verified" | "failed" | "cancelled" | "expired";
3031
+ /** Sanitized last observation. Null before an observation; queued retries may retain their previous failure outcome. */
3032
+ outcome: "verified" | "target_rejected" | "challenge_timeout" | "transport_failed" | "receiver_rejected" | "token_expired" | "endpoint_changed" | "owner_revoked" | "attempts_exhausted" | "internal_error" | null;
3033
+ attempt_count: number;
3034
+ max_attempts: 4;
3035
+ /** Earlier of the verification-token deadline and 15 minutes after admission. Activation is forbidden at or after this instant. */
3036
+ expires_at: string;
3037
+ /** Scheduled retry/admission time while queued; null while running or terminal. */
3038
+ next_attempt_at: string | null;
3039
+ /** Actual receiver HTTP status, when one arrived. No receiver response body or resolved address is returned. */
3040
+ last_response_status: number | null;
3041
+ started_at: string | null;
3042
+ completed_at: string | null;
3043
+ created_at: string;
3044
+ updated_at: string;
3045
+ /** Relative authorized API path for this attempt. Uses the same bearer credential as admission. */
3046
+ status_url: string;
3047
+ };
3017
3048
  export type WhaleDatasetArtifactManifest = {
3018
3049
  /** Version of the artifact manifest contract. */
3019
3050
  manifest_version: string;
@@ -3263,6 +3294,7 @@ export interface OperationData {
3263
3294
  };
3264
3295
  };
3265
3296
  createWebhook: WebhookEndpoint;
3297
+ createWebhookVerificationAttempt: WebhookVerificationAttempt;
3266
3298
  deleteWebhook: WebhookEndpoint;
3267
3299
  exploreMarkets: ExploreEntry[];
3268
3300
  getAccountIdentity: {
@@ -3417,6 +3449,7 @@ export interface OperationData {
3417
3449
  } | null;
3418
3450
  };
3419
3451
  getWebhook: WebhookEndpoint;
3452
+ getWebhookVerificationAttempt: WebhookVerificationAttempt;
3420
3453
  getWeeklyReportSnapshot: ReportSnapshot;
3421
3454
  getWhaleDatasetStatus: {
3422
3455
  job_id: number;
@@ -3615,6 +3648,7 @@ export interface OperationQuery {
3615
3648
  cancelWhaleDataset: Record<string, never>;
3616
3649
  createMcpJsonRpcResponse: Record<string, never>;
3617
3650
  createWebhook: Record<string, never>;
3651
+ createWebhookVerificationAttempt: Record<string, never>;
3618
3652
  deleteWebhook: Record<string, never>;
3619
3653
  exploreMarkets: {
3620
3654
  /** Filter by market category (case-insensitive). A canonical bucket name (e.g. Basketball) matches every provider member that folds into it (NBA, WNBA, NCAAB); a raw provider value also resolves to its bucket. Facet values are returned as the canonical bucket. */
@@ -3777,6 +3811,7 @@ export interface OperationQuery {
3777
3811
  };
3778
3812
  getUsage: Record<string, never>;
3779
3813
  getWebhook: Record<string, never>;
3814
+ getWebhookVerificationAttempt: Record<string, never>;
3780
3815
  getWeeklyReportSnapshot: {
3781
3816
  /** UTC source-range start in YYYY-MM-DD format; required with to. Together with to, selects an exact ephemeral range of at most 31 inclusive UTC days. A start after tomorrow UTC returns 400 bad_request with error.param=from. */
3782
3817
  from?: string;
@@ -3900,8 +3935,8 @@ export interface OperationQuery {
3900
3935
  cursor?: string;
3901
3936
  /** Filter by category. Values are matched to canonical category buckets: political variants (Elections, Global Politics, U.S. Politics, ...) fold into Politics, Geopolitics stays distinct, Culture/Entertainment map to Pop Culture, Science maps to Science & Tech, and Finance/Business map to Stocks. Mapped buckets are case-insensitive; passthrough categories (Crypto, NBA, and the sports leagues) match case-sensitively against the provider-native bucket key, so use exact casing (e.g. Crypto, NBA). */
3902
3937
  category?: string;
3903
- /** Filter by ML-detected strategy type. Values come from backend/crates/analytics/src/trader_analysis/classification/decision_tree.rs and are matched exactly against ml_trader_category.primary_type. Values outside the declared enum return HTTP 400. */
3904
- strategy?: "accumulator" | "algo_trader" | "arbitrageur" | "directional" | "event_driven" | "market_maker" | "momentum" | "scalper" | "speculator" | "swing_trader";
3938
+ /** Filter by observed trading style. Current styles: two_sided, category_focused, high_activity, diversified, mixed, unclassified. The original ten archetype identifiers remain accepted for historical rows until normal reclassification. Style describes recorded behavior; grade measures performance. */
3939
+ strategy?: "accumulator" | "algo_trader" | "arbitrageur" | "category_focused" | "directional" | "diversified" | "event_driven" | "high_activity" | "market_maker" | "mixed" | "momentum" | "scalper" | "speculator" | "swing_trader" | "two_sided" | "unclassified";
3905
3940
  };
3906
3941
  listPositions: {
3907
3942
  /** Maximum number of current positions to return. Out-of-range values are clamped to 1..100. */
@@ -4145,6 +4180,10 @@ export interface OperationPath {
4145
4180
  };
4146
4181
  createMcpJsonRpcResponse: Record<string, never>;
4147
4182
  createWebhook: Record<string, never>;
4183
+ createWebhookVerificationAttempt: {
4184
+ /** Webhook endpoint id owned by the authenticated API key user. */
4185
+ id: number;
4186
+ };
4148
4187
  deleteWebhook: {
4149
4188
  /** Webhook endpoint id owned by the authenticated API key user. */
4150
4189
  id: number;
@@ -4252,6 +4291,12 @@ export interface OperationPath {
4252
4291
  /** Webhook endpoint id owned by the authenticated API key user. */
4253
4292
  id: number;
4254
4293
  };
4294
+ getWebhookVerificationAttempt: {
4295
+ /** Webhook endpoint id owned by the authenticated API key user. */
4296
+ id: number;
4297
+ /** Verification attempt UUID returned by admission. Must belong to this webhook and account. */
4298
+ attempt_id: string;
4299
+ };
4255
4300
  getWeeklyReportSnapshot: Record<string, never>;
4256
4301
  getWhaleDatasetStatus: {
4257
4302
  /** Dataset job ID returned by submit; another owner or a trader export returns 404. */
@@ -4373,6 +4418,7 @@ export interface OperationBody {
4373
4418
  params?: Record<string, unknown>;
4374
4419
  };
4375
4420
  createWebhook: CreateWebhookRequest;
4421
+ createWebhookVerificationAttempt: CreateWebhookVerificationAttemptRequest;
4376
4422
  deleteWebhook: never;
4377
4423
  exploreMarkets: never;
4378
4424
  getAccountIdentity: never;
@@ -4411,6 +4457,7 @@ export interface OperationBody {
4411
4457
  getTraderPnl: never;
4412
4458
  getUsage: never;
4413
4459
  getWebhook: never;
4460
+ getWebhookVerificationAttempt: never;
4414
4461
  getWeeklyReportSnapshot: never;
4415
4462
  getWhaleDatasetStatus: never;
4416
4463
  getWhaleTrade: never;
@@ -4499,6 +4546,11 @@ export interface OperationResponse {
4499
4546
  data: OperationData["createWebhook"];
4500
4547
  meta: ResponseMeta;
4501
4548
  };
4549
+ createWebhookVerificationAttempt: {
4550
+ object: "webhook_verification_attempt";
4551
+ data: OperationData["createWebhookVerificationAttempt"];
4552
+ meta: ResponseMeta;
4553
+ };
4502
4554
  deleteWebhook: {
4503
4555
  object: "webhook";
4504
4556
  data: OperationData["deleteWebhook"];
@@ -4694,6 +4746,11 @@ export interface OperationResponse {
4694
4746
  data: OperationData["getWebhook"];
4695
4747
  meta: ResponseMeta;
4696
4748
  };
4749
+ getWebhookVerificationAttempt: {
4750
+ object: "webhook_verification_attempt";
4751
+ data: OperationData["getWebhookVerificationAttempt"];
4752
+ meta: ResponseMeta;
4753
+ };
4697
4754
  getWeeklyReportSnapshot: {
4698
4755
  object: "report_snapshot";
4699
4756
  data: OperationData["getWeeklyReportSnapshot"];