@mobula_labs/types 0.1.0 → 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 +14 -14
- package/dist/cjs/index.cjs +3689 -3391
- package/dist/cjs/index.cjs.map +27 -20
- package/dist/esm/index.js +3689 -3391
- package/dist/esm/index.js.map +27 -20
- package/dist/index.d.ts +7 -0
- package/dist/misc/ApiKeysQueries.d.ts +4 -0
- package/dist/utils/schemas/BaseMessage.d.ts +6 -6
- package/dist/utils/schemas/CurrencySchema.d.ts +21 -0
- package/dist/utils/schemas/EnrichedHoldersData.d.ts +3 -3
- package/dist/utils/schemas/EnrichedMarketData.d.ts +453 -1567
- package/dist/utils/schemas/LLMSecuritySchemas.d.ts +260 -0
- package/dist/utils/schemas/MarketDetailsOutput.d.ts +22 -31
- package/dist/utils/schemas/SecuritySchemas.d.ts +3 -11
- package/dist/utils/schemas/TokenDetailsOutput.d.ts +9 -15
- package/dist/utils/schemas/WalletDeployerSchema.d.ts +30 -36
- package/dist/v1/all/BlockchainSchema.d.ts +6 -6
- package/dist/v1/market/MarketBlockchainPairsSchema.d.ts +10 -10
- package/dist/v1/market/MarketHistoryPairSchema.d.ts +8 -8
- package/dist/v1/market/MarketMultiDataSchema.d.ts +4 -4
- package/dist/v1/market/MarketMultiPricesSchema.d.ts +4 -4
- package/dist/v1/market/MarketPairSchema.d.ts +76 -106
- package/dist/v1/market/MarketPairsSchema.d.ts +12 -25
- package/dist/v1/market/MarketTradesPairSchema.d.ts +22 -2
- package/dist/v1/metadata/MetadataTrendingsSchema.d.ts +2 -2
- package/dist/v1/pulse/PulseSchema.d.ts +138 -294
- package/dist/v1/search/SearchSchema.d.ts +20 -24
- package/dist/v1/wallet/DeployerSchema.d.ts +17 -19
- package/dist/v1/wallet/WalletPortfolioSchema.d.ts +8 -24
- package/dist/v1/wallet/WalletTradesSchema.d.ts +13 -15
- package/dist/v1/wallet/WalletTransactionSchema.d.ts +8 -8
- package/dist/v2/asset/AssetDetailsSchema.d.ts +46 -60
- package/dist/v2/explorer/BlockQuerySchema.d.ts +23 -0
- package/dist/v2/market/MarketDetailsSchema.d.ts +61 -62
- package/dist/v2/perp/PerpBlocksSchema.d.ts +183 -0
- package/dist/v2/perp/PerpModels.d.ts +10 -10
- package/dist/v2/swap/SwapQuotingBatchOutput.d.ts +18 -18
- package/dist/v2/swap/SwapQuotingBatchSchema.d.ts +158 -0
- package/dist/v2/swap/SwapQuotingInstructionsOutput.d.ts +2044 -0
- package/dist/v2/swap/SwapQuotingOutput.d.ts +18 -18
- package/dist/v2/swap/SwapQuotingSchema.d.ts +90 -0
- package/dist/v2/token/TokenDetailsSchema.d.ts +33 -30
- package/dist/v2/token/TokenKlineBsPointSchema.d.ts +2 -6
- package/dist/v2/token/TokenMarketsSchema.d.ts +44 -62
- package/dist/v2/token/TokenPositionsSchema.d.ts +3 -0
- package/dist/v2/token/TokenSecurityOutput.d.ts +122 -0
- package/dist/v2/token/TokenSecurityQuery.d.ts +3 -0
- package/dist/v2/token/TokenTradesSchema.d.ts +242 -154
- package/dist/v2/wallet/WalletActivityV2Schema.d.ts +11 -15
- package/dist/v2/wallet/WalletDefiPositionsSchema.d.ts +12 -0
- package/dist/v2/wallet/WalletDeployerSchema.d.ts +17 -19
- package/dist/v2/wallet/WalletPerpsPositionsSchema.d.ts +6 -6
- package/dist/v2/wallet/WalletPositionsSchema.d.ts +3795 -38
- package/dist/v2/wallet/WalletTokenBalancesSchema.d.ts +6 -22
- package/dist/wss/BalancePayloadSchema.d.ts +6 -6
- package/dist/wss/FastTradePayloadSchema.d.ts +5 -0
- package/dist/wss/OhlcvPayloadSchema.d.ts +2 -2
- package/dist/wss/PairsPayloadSchema.d.ts +2 -2
- package/dist/wss/PositionPayloadSchema.d.ts +2 -2
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @
|
|
1
|
+
# @mobula_labs/types
|
|
2
2
|
|
|
3
3
|
Centralized TypeScript types and Zod schemas for Mobula SDK and applications.
|
|
4
4
|
|
|
@@ -20,11 +20,11 @@ This package provides a comprehensive set of TypeScript types and Zod schemas fo
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
22
22
|
```bash
|
|
23
|
-
npm install @
|
|
23
|
+
npm install @mobula_labs/types zod
|
|
24
24
|
# or
|
|
25
|
-
bun add @
|
|
25
|
+
bun add @mobula_labs/types zod
|
|
26
26
|
# or
|
|
27
|
-
pnpm add @
|
|
27
|
+
pnpm add @mobula_labs/types zod
|
|
28
28
|
```
|
|
29
29
|
|
|
30
30
|
> **Note:** `zod` (^3.0.0) is a required peer dependency for runtime validation.
|
|
@@ -32,7 +32,7 @@ pnpm add @mobula/types zod
|
|
|
32
32
|
## Quick Start
|
|
33
33
|
|
|
34
34
|
```typescript
|
|
35
|
-
import { MarketDataResponseSchema, TokenDetailsResponseSchema } from '@
|
|
35
|
+
import { MarketDataResponseSchema, TokenDetailsResponseSchema } from '@mobula_labs/types';
|
|
36
36
|
import type { z } from 'zod';
|
|
37
37
|
|
|
38
38
|
// Fetch and validate market data
|
|
@@ -56,13 +56,13 @@ import {
|
|
|
56
56
|
AssetDetailsSchema,
|
|
57
57
|
MarketDataResponseSchema,
|
|
58
58
|
TokenDetailsResponseSchema
|
|
59
|
-
} from '@
|
|
59
|
+
} from '@mobula_labs/types';
|
|
60
60
|
```
|
|
61
61
|
|
|
62
62
|
### Type Inference from Schemas
|
|
63
63
|
|
|
64
64
|
```typescript
|
|
65
|
-
import { AssetDetailsSchema } from '@
|
|
65
|
+
import { AssetDetailsSchema } from '@mobula_labs/types';
|
|
66
66
|
import type { z } from 'zod';
|
|
67
67
|
|
|
68
68
|
// Infer TypeScript type from Zod schema
|
|
@@ -104,7 +104,7 @@ import {
|
|
|
104
104
|
MetadataSchema,
|
|
105
105
|
MetadataTrendingsSchema,
|
|
106
106
|
MetadataNewsSchema,
|
|
107
|
-
} from '@
|
|
107
|
+
} from '@mobula_labs/types';
|
|
108
108
|
```
|
|
109
109
|
|
|
110
110
|
#### V2 API Schemas
|
|
@@ -131,7 +131,7 @@ import {
|
|
|
131
131
|
// Wallets
|
|
132
132
|
WalletPositionsSchema,
|
|
133
133
|
WalletTokenBalancesSchema,
|
|
134
|
-
} from '@
|
|
134
|
+
} from '@mobula_labs/types';
|
|
135
135
|
```
|
|
136
136
|
|
|
137
137
|
### WebSocket Types
|
|
@@ -144,7 +144,7 @@ import {
|
|
|
144
144
|
OhlcvPayloadSchema,
|
|
145
145
|
PositionPayloadSchema,
|
|
146
146
|
FeedSchema,
|
|
147
|
-
} from '@
|
|
147
|
+
} from '@mobula_labs/types';
|
|
148
148
|
|
|
149
149
|
// Example: Validate WebSocket message
|
|
150
150
|
const message = await ws.receive();
|
|
@@ -161,7 +161,7 @@ import {
|
|
|
161
161
|
zodUtils,
|
|
162
162
|
extractZodSchemaKeys,
|
|
163
163
|
extractAllZodKeys,
|
|
164
|
-
} from '@
|
|
164
|
+
} from '@mobula_labs/types';
|
|
165
165
|
|
|
166
166
|
// Use bigint utilities
|
|
167
167
|
const absoluteValue = bigintAbs(-100n); // 100n
|
|
@@ -246,10 +246,10 @@ The package supports multiple module formats with proper exports configuration:
|
|
|
246
246
|
|
|
247
247
|
```typescript
|
|
248
248
|
// ESM (Recommended)
|
|
249
|
-
import { MarketDataSchema } from '@
|
|
249
|
+
import { MarketDataSchema } from '@mobula_labs/types';
|
|
250
250
|
|
|
251
251
|
// CommonJS
|
|
252
|
-
const { MarketDataSchema } = require('@
|
|
252
|
+
const { MarketDataSchema } = require('@mobula_labs/types');
|
|
253
253
|
|
|
254
254
|
// TypeScript
|
|
255
255
|
import type { z } from 'zod';
|
|
@@ -263,7 +263,7 @@ import {
|
|
|
263
263
|
MarketDataResponseSchema,
|
|
264
264
|
TokenDetailsResponseSchema,
|
|
265
265
|
WalletPortfolioSchema
|
|
266
|
-
} from '@
|
|
266
|
+
} from '@mobula_labs/types';
|
|
267
267
|
import type { z } from 'zod';
|
|
268
268
|
|
|
269
269
|
// Define types
|