@torquefi/types 0.1.1 → 0.1.2

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/README.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # @torquefi/types
2
2
 
3
- Shared **TypeScript-only** types for Torque Platform API v1 — Intelligence feeds, Assistant chat, and v1 error JSON.
3
+ Shared **TypeScript-only** types for Torque Platform API v1 — Intelligence feeds, Assistant chat, **Opportunities** rate tiles, and v1 error JSON.
4
4
 
5
5
  Published as **`@torquefi/types`** because the unscoped name `torque-types` was unpublished on npm in 2024 and cannot be reclaimed without npm support.
6
6
 
7
7
  Zero runtime. Pair with `fetch`, axios, or the `torque-*` SDK clients.
8
8
 
9
+ **Current version:** **0.1.1** (Opportunities subpath)
10
+
9
11
  ## Install
10
12
 
11
13
  ```bash
@@ -26,17 +28,32 @@ import type {
26
28
  // Subpath imports
27
29
  import type { GetIntelligenceFeedParams } from '@torquefi/types/intelligence'
28
30
  import type { AssistantChatStreamEvent } from '@torquefi/types/assistant'
31
+ import type {
32
+ YieldOpportunitiesResponseV1,
33
+ LendingOpportunitiesResponseV1,
34
+ GetYieldOpportunitiesParams,
35
+ } from '@torquefi/types/opportunities'
29
36
  ```
30
37
 
38
+ ## Subpaths
39
+
40
+ | Import | Contents |
41
+ |--------|----------|
42
+ | `@torquefi/types/intelligence` | Feed items, query params |
43
+ | `@torquefi/types/assistant` | Chat body, SSE events |
44
+ | `@torquefi/types/opportunities` | Yield/lending responses, rate-backed action tiles |
45
+ | `@torquefi/types/platform` | Client config |
46
+
31
47
  ## Sync with app
32
48
 
33
49
  Canonical shapes live in `torque_webapp`:
34
50
 
35
51
  - `lib/api/torque-v1/intelligence/types.ts`
52
+ - `lib/api/torque-v1/opportunities/types.ts`
36
53
  - `lib/integrations/ai/chat/service-helpers.ts`
37
54
  - `lib/integrations/ai/surfaces/stream-assistant-chat.ts`
38
55
 
39
- See [`public/docs/developer/SDK_ROADMAP.md`](../../public/docs/developer/SDK_ROADMAP.md) for the full SDK publish plan.
56
+ See [`public/docs/developer/PLATFORM_API_SDK_COVERAGE.md`](../../public/docs/developer/PLATFORM_API_SDK_COVERAGE.md) and [`SDK_ROADMAP.md`](../../public/docs/developer/SDK_ROADMAP.md).
40
57
 
41
58
  ## License
42
59
 
@@ -0,0 +1,34 @@
1
+ export type WidgetMetaV1 = {
2
+ generatedAtMs: number;
3
+ homeWidgetId: string;
4
+ integratorTier: 'standard' | 'pro';
5
+ };
6
+ export type FundingRadarRowV1 = {
7
+ symbol: string;
8
+ displayName: string;
9
+ markPx: number | null;
10
+ change24hPct: number | null;
11
+ fundingHourly: number | null;
12
+ fundingAnnualizedPct: number | null;
13
+ };
14
+ export type FundingRadarWidgetResponseV1 = {
15
+ meta: WidgetMetaV1;
16
+ longBias: FundingRadarRowV1[];
17
+ shortBias: FundingRadarRowV1[];
18
+ };
19
+ export type EarningsSpotlightRowV1 = {
20
+ symbol: string;
21
+ date: string;
22
+ hour?: string;
23
+ hourLabel?: string;
24
+ epsEstimate: number | null;
25
+ revenueEstimate: number | null;
26
+ supportsPerp: boolean;
27
+ supportsTokenizedSpot: boolean;
28
+ impactScore: number;
29
+ };
30
+ export type EarningsSpotlightWidgetResponseV1 = {
31
+ meta: WidgetMetaV1;
32
+ rows: EarningsSpotlightRowV1[];
33
+ };
34
+ //# sourceMappingURL=widgets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widgets.d.ts","sourceRoot":"","sources":["../src/widgets.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG;IACzB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,cAAc,EAAE,UAAU,GAAG,KAAK,CAAA;CACnC,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAA;IAC5B,oBAAoB,EAAE,MAAM,GAAG,IAAI,CAAA;CACpC,CAAA;AAED,MAAM,MAAM,4BAA4B,GAAG;IACzC,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,iBAAiB,EAAE,CAAA;IAC7B,SAAS,EAAE,iBAAiB,EAAE,CAAA;CAC/B,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,YAAY,EAAE,OAAO,CAAA;IACrB,qBAAqB,EAAE,OAAO,CAAA;IAC9B,WAAW,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG;IAC9C,IAAI,EAAE,YAAY,CAAA;IAClB,IAAI,EAAE,sBAAsB,EAAE,CAAA;CAC/B,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.1",
6
+ "version": "0.1.2",
7
7
  "description": "Shared TypeScript types for Torque Platform API v1 (Intelligence, Assistant, errors)",
8
8
  "main": "dist/index.js",
9
9
  "module": "dist/index.js",
@@ -34,6 +34,11 @@
34
34
  "import": "./dist/opportunities.js",
35
35
  "require": "./dist/opportunities.js"
36
36
  },
37
+ "./widgets": {
38
+ "types": "./dist/widgets.d.ts",
39
+ "import": "./dist/widgets.js",
40
+ "require": "./dist/widgets.js"
41
+ },
37
42
  "./package.json": "./package.json"
38
43
  },
39
44
  "files": [