@fundedfast/sdk 1.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/CHANGELOG.md +104 -0
- package/README.md +352 -0
- package/dist/cjs/client.d.ts +130 -0
- package/dist/cjs/client.d.ts.map +1 -0
- package/dist/cjs/client.js +362 -0
- package/dist/cjs/client.js.map +1 -0
- package/dist/cjs/index.d.ts +27 -0
- package/dist/cjs/index.d.ts.map +1 -0
- package/dist/cjs/index.js +33 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/package.json +1 -0
- package/dist/cjs/resources/admin.d.ts +597 -0
- package/dist/cjs/resources/admin.d.ts.map +1 -0
- package/dist/cjs/resources/admin.js +842 -0
- package/dist/cjs/resources/admin.js.map +1 -0
- package/dist/cjs/resources/public.d.ts +519 -0
- package/dist/cjs/resources/public.d.ts.map +1 -0
- package/dist/cjs/resources/public.js +588 -0
- package/dist/cjs/resources/public.js.map +1 -0
- package/dist/cjs/types.d.ts +651 -0
- package/dist/cjs/types.d.ts.map +1 -0
- package/dist/cjs/types.js +11 -0
- package/dist/cjs/types.js.map +1 -0
- package/dist/cjs/webhooks.d.ts +104 -0
- package/dist/cjs/webhooks.d.ts.map +1 -0
- package/dist/cjs/webhooks.js +199 -0
- package/dist/cjs/webhooks.js.map +1 -0
- package/dist/esm/client.d.ts +130 -0
- package/dist/esm/client.d.ts.map +1 -0
- package/dist/esm/client.js +355 -0
- package/dist/esm/client.js.map +1 -0
- package/dist/esm/index.d.ts +27 -0
- package/dist/esm/index.d.ts.map +1 -0
- package/dist/esm/index.js +26 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/resources/admin.d.ts +597 -0
- package/dist/esm/resources/admin.d.ts.map +1 -0
- package/dist/esm/resources/admin.js +816 -0
- package/dist/esm/resources/admin.js.map +1 -0
- package/dist/esm/resources/public.d.ts +519 -0
- package/dist/esm/resources/public.d.ts.map +1 -0
- package/dist/esm/resources/public.js +578 -0
- package/dist/esm/resources/public.js.map +1 -0
- package/dist/esm/types.d.ts +651 -0
- package/dist/esm/types.d.ts.map +1 -0
- package/dist/esm/types.js +10 -0
- package/dist/esm/types.js.map +1 -0
- package/dist/esm/webhooks.d.ts +104 -0
- package/dist/esm/webhooks.d.ts.map +1 -0
- package/dist/esm/webhooks.js +159 -0
- package/dist/esm/webhooks.js.map +1 -0
- package/package.json +72 -0
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fundedfast/sdk/webhooks - Webhook Signature Verification
|
|
3
|
+
*
|
|
4
|
+
* Helpers for verifying FAST webhook deliveries in your backend.
|
|
5
|
+
* FAST signs all webhook payloads with HMAC-SHA256 using your webhook secret.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { verifyWebhookSignature, parseWebhookEvent } from '@fundedfast/sdk/webhooks';
|
|
10
|
+
*
|
|
11
|
+
* app.post('/webhooks/fast', express.raw({ type: 'application/json' }), async (req, res) => {
|
|
12
|
+
* const signature = req.headers['x-webhook-signature'] as string;
|
|
13
|
+
* const rawBody = req.body.toString('utf-8'); // the raw bytes, not parsed JSON
|
|
14
|
+
*
|
|
15
|
+
* // It is async: without `await` the check is a Promise, always truthy, and
|
|
16
|
+
* // every request passes.
|
|
17
|
+
* if (!await verifyWebhookSignature(rawBody, signature, process.env.FAST_WEBHOOK_SECRET!)) {
|
|
18
|
+
* return res.status(401).send('Invalid signature');
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* const event = parseWebhookEvent(rawBody);
|
|
22
|
+
* switch (event.eventType) {
|
|
23
|
+
* case 'challenge.completed':
|
|
24
|
+
* handleChallengeCompleted(event.userId, event.data);
|
|
25
|
+
* break;
|
|
26
|
+
* case 'funded_account.revoked':
|
|
27
|
+
* handleRevocation(event.userId, event.data);
|
|
28
|
+
* break;
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* res.status(200).send({ received: true });
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @module webhooks
|
|
36
|
+
*/
|
|
37
|
+
import type { WebhookPayload, WebhookEventType } from './types.js';
|
|
38
|
+
/**
|
|
39
|
+
* Verify the HMAC-SHA256 signature of a webhook payload.
|
|
40
|
+
*
|
|
41
|
+
* Uses timing-safe comparison to prevent timing attacks.
|
|
42
|
+
* Works in Node.js (crypto module) and edge runtimes (Web Crypto API).
|
|
43
|
+
*
|
|
44
|
+
* @param rawBody - The raw request body as a string (NOT parsed JSON)
|
|
45
|
+
* @param signature - The X-Webhook-Signature header value
|
|
46
|
+
* @param secret - Your webhook secret (from tenant setup)
|
|
47
|
+
* @returns true if signature is valid
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* // Express with raw body parser
|
|
52
|
+
* app.use('/webhooks', express.raw({ type: 'application/json' }));
|
|
53
|
+
*
|
|
54
|
+
* app.post('/webhooks/fast', async (req, res) => {
|
|
55
|
+
* const rawBody = req.body.toString('utf-8');
|
|
56
|
+
* const sig = req.headers['x-webhook-signature'] as string;
|
|
57
|
+
*
|
|
58
|
+
* if (!await verifyWebhookSignature(rawBody, sig, WEBHOOK_SECRET)) {
|
|
59
|
+
* return res.status(401).json({ error: 'invalid_signature' });
|
|
60
|
+
* }
|
|
61
|
+
* // ... handle event
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
export declare function verifyWebhookSignature(rawBody: string, signature: string, secret: string): Promise<boolean>;
|
|
66
|
+
/**
|
|
67
|
+
* Synchronous signature verification using Web Crypto (browser/edge compatible).
|
|
68
|
+
*
|
|
69
|
+
* NOTE: This is async because Web Crypto API is async.
|
|
70
|
+
* If you need sync verification in Node.js, import crypto directly:
|
|
71
|
+
*
|
|
72
|
+
* ```typescript
|
|
73
|
+
* import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
74
|
+
* const expected = createHmac('sha256', secret).update(rawBody).digest('hex');
|
|
75
|
+
* const valid = timingSafeEqual(Buffer.from(expected, 'hex'), Buffer.from(signature, 'hex'));
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
/**
|
|
79
|
+
* Parse a webhook event payload.
|
|
80
|
+
*
|
|
81
|
+
* @param rawBody - The raw request body as a string or parsed object
|
|
82
|
+
* @returns Typed webhook payload with eventId, eventType, userId, timestamp, and data
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* ```typescript
|
|
86
|
+
* const event = parseWebhookEvent(rawBody);
|
|
87
|
+
* console.log(event.eventType); // 'challenge.completed'
|
|
88
|
+
* console.log(event.data); // { challengeId: '...', balance: 105.50, ... }
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
91
|
+
export declare function parseWebhookEvent<T = Record<string, unknown>>(rawBody: string | Record<string, unknown>): WebhookPayload<T>;
|
|
92
|
+
/**
|
|
93
|
+
* Check if an event type is one of the challenge lifecycle events.
|
|
94
|
+
*/
|
|
95
|
+
export declare function isChallengeEvent(eventType: WebhookEventType): boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Check if an event type is one of the funded account lifecycle events.
|
|
98
|
+
*/
|
|
99
|
+
export declare function isFundedAccountEvent(eventType: WebhookEventType): boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Check if an event type is one of the user lifecycle events.
|
|
102
|
+
*/
|
|
103
|
+
export declare function isUserEvent(eventType: WebhookEventType): boolean;
|
|
104
|
+
//# sourceMappingURL=webhooks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.d.ts","sourceRoot":"","sources":["../../src/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,OAAO,CAAC,CAuClB;AAED;;;;;;;;;;;GAWG;AAIH;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,cAAc,CAAC,CAAC,CAAC,CAG3H;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAErE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAEzE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAEhE"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fundedfast/sdk/webhooks - Webhook Signature Verification
|
|
3
|
+
*
|
|
4
|
+
* Helpers for verifying FAST webhook deliveries in your backend.
|
|
5
|
+
* FAST signs all webhook payloads with HMAC-SHA256 using your webhook secret.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```typescript
|
|
9
|
+
* import { verifyWebhookSignature, parseWebhookEvent } from '@fundedfast/sdk/webhooks';
|
|
10
|
+
*
|
|
11
|
+
* app.post('/webhooks/fast', express.raw({ type: 'application/json' }), async (req, res) => {
|
|
12
|
+
* const signature = req.headers['x-webhook-signature'] as string;
|
|
13
|
+
* const rawBody = req.body.toString('utf-8'); // the raw bytes, not parsed JSON
|
|
14
|
+
*
|
|
15
|
+
* // It is async: without `await` the check is a Promise, always truthy, and
|
|
16
|
+
* // every request passes.
|
|
17
|
+
* if (!await verifyWebhookSignature(rawBody, signature, process.env.FAST_WEBHOOK_SECRET!)) {
|
|
18
|
+
* return res.status(401).send('Invalid signature');
|
|
19
|
+
* }
|
|
20
|
+
*
|
|
21
|
+
* const event = parseWebhookEvent(rawBody);
|
|
22
|
+
* switch (event.eventType) {
|
|
23
|
+
* case 'challenge.completed':
|
|
24
|
+
* handleChallengeCompleted(event.userId, event.data);
|
|
25
|
+
* break;
|
|
26
|
+
* case 'funded_account.revoked':
|
|
27
|
+
* handleRevocation(event.userId, event.data);
|
|
28
|
+
* break;
|
|
29
|
+
* }
|
|
30
|
+
*
|
|
31
|
+
* res.status(200).send({ received: true });
|
|
32
|
+
* });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @module webhooks
|
|
36
|
+
*/
|
|
37
|
+
/**
|
|
38
|
+
* Verify the HMAC-SHA256 signature of a webhook payload.
|
|
39
|
+
*
|
|
40
|
+
* Uses timing-safe comparison to prevent timing attacks.
|
|
41
|
+
* Works in Node.js (crypto module) and edge runtimes (Web Crypto API).
|
|
42
|
+
*
|
|
43
|
+
* @param rawBody - The raw request body as a string (NOT parsed JSON)
|
|
44
|
+
* @param signature - The X-Webhook-Signature header value
|
|
45
|
+
* @param secret - Your webhook secret (from tenant setup)
|
|
46
|
+
* @returns true if signature is valid
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* // Express with raw body parser
|
|
51
|
+
* app.use('/webhooks', express.raw({ type: 'application/json' }));
|
|
52
|
+
*
|
|
53
|
+
* app.post('/webhooks/fast', async (req, res) => {
|
|
54
|
+
* const rawBody = req.body.toString('utf-8');
|
|
55
|
+
* const sig = req.headers['x-webhook-signature'] as string;
|
|
56
|
+
*
|
|
57
|
+
* if (!await verifyWebhookSignature(rawBody, sig, WEBHOOK_SECRET)) {
|
|
58
|
+
* return res.status(401).json({ error: 'invalid_signature' });
|
|
59
|
+
* }
|
|
60
|
+
* // ... handle event
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export async function verifyWebhookSignature(rawBody, signature, secret) {
|
|
65
|
+
if (!rawBody || !signature || !secret)
|
|
66
|
+
return false;
|
|
67
|
+
// SHA-256 hex is exactly 64 hex characters. Anything else is not a signature
|
|
68
|
+
// FAST produced; refuse it before parsing rather than let parseInt guess.
|
|
69
|
+
if (typeof signature !== 'string' || !/^[0-9a-f]{64}$/i.test(signature))
|
|
70
|
+
return false;
|
|
71
|
+
signature = signature.toLowerCase();
|
|
72
|
+
// Try Node.js crypto first (fastest path)
|
|
73
|
+
try {
|
|
74
|
+
const crypto = await import('node:crypto');
|
|
75
|
+
const expected = crypto.createHmac('sha256', secret).update(rawBody).digest('hex');
|
|
76
|
+
if (expected.length !== signature.length)
|
|
77
|
+
return false;
|
|
78
|
+
const a = new Uint8Array(expected.length / 2);
|
|
79
|
+
const b = new Uint8Array(signature.length / 2);
|
|
80
|
+
for (let i = 0; i < a.length; i++) {
|
|
81
|
+
a[i] = parseInt(expected.slice(i * 2, i * 2 + 2), 16);
|
|
82
|
+
b[i] = parseInt(signature.slice(i * 2, i * 2 + 2), 16);
|
|
83
|
+
}
|
|
84
|
+
return crypto.timingSafeEqual(a, b);
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// Not in Node.js - fall through to Web Crypto
|
|
88
|
+
}
|
|
89
|
+
// Web Crypto API (edge runtimes, Deno, Bun, Cloudflare Workers)
|
|
90
|
+
try {
|
|
91
|
+
const encoder = new TextEncoder();
|
|
92
|
+
const key = await crypto.subtle.importKey('raw', encoder.encode(secret), { name: 'HMAC', hash: 'SHA-256' }, false, ['sign']);
|
|
93
|
+
const sig = await crypto.subtle.sign('HMAC', key, encoder.encode(rawBody));
|
|
94
|
+
const expected = Array.from(new Uint8Array(sig)).map(b => b.toString(16).padStart(2, '0')).join('');
|
|
95
|
+
return timingSafeCompare(expected, signature);
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Synchronous signature verification using Web Crypto (browser/edge compatible).
|
|
103
|
+
*
|
|
104
|
+
* NOTE: This is async because Web Crypto API is async.
|
|
105
|
+
* If you need sync verification in Node.js, import crypto directly:
|
|
106
|
+
*
|
|
107
|
+
* ```typescript
|
|
108
|
+
* import { createHmac, timingSafeEqual } from 'node:crypto';
|
|
109
|
+
* const expected = createHmac('sha256', secret).update(rawBody).digest('hex');
|
|
110
|
+
* const valid = timingSafeEqual(Buffer.from(expected, 'hex'), Buffer.from(signature, 'hex'));
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
// Re-export verifyWebhookSignature as the primary API - it works everywhere.
|
|
114
|
+
/**
|
|
115
|
+
* Parse a webhook event payload.
|
|
116
|
+
*
|
|
117
|
+
* @param rawBody - The raw request body as a string or parsed object
|
|
118
|
+
* @returns Typed webhook payload with eventId, eventType, userId, timestamp, and data
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* const event = parseWebhookEvent(rawBody);
|
|
123
|
+
* console.log(event.eventType); // 'challenge.completed'
|
|
124
|
+
* console.log(event.data); // { challengeId: '...', balance: 105.50, ... }
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
127
|
+
export function parseWebhookEvent(rawBody) {
|
|
128
|
+
const parsed = typeof rawBody === 'string' ? JSON.parse(rawBody) : rawBody;
|
|
129
|
+
return parsed;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Check if an event type is one of the challenge lifecycle events.
|
|
133
|
+
*/
|
|
134
|
+
export function isChallengeEvent(eventType) {
|
|
135
|
+
return eventType.startsWith('challenge.');
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Check if an event type is one of the funded account lifecycle events.
|
|
139
|
+
*/
|
|
140
|
+
export function isFundedAccountEvent(eventType) {
|
|
141
|
+
return eventType.startsWith('funded_account.');
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Check if an event type is one of the user lifecycle events.
|
|
145
|
+
*/
|
|
146
|
+
export function isUserEvent(eventType) {
|
|
147
|
+
return eventType.startsWith('user.');
|
|
148
|
+
}
|
|
149
|
+
// ---- Internals ----
|
|
150
|
+
function timingSafeCompare(a, b) {
|
|
151
|
+
if (a.length !== b.length)
|
|
152
|
+
return false;
|
|
153
|
+
let result = 0;
|
|
154
|
+
for (let i = 0; i < a.length; i++) {
|
|
155
|
+
result |= a.charCodeAt(i) ^ b.charCodeAt(i);
|
|
156
|
+
}
|
|
157
|
+
return result === 0;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=webhooks.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"webhooks.js","sourceRoot":"","sources":["../../src/webhooks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAIH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,CAAC,KAAK,UAAU,sBAAsB,CAC1C,OAAe,EACf,SAAiB,EACjB,MAAc;IAEd,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,IAAI,CAAC,MAAM;QAAE,OAAO,KAAK,CAAC;IACpD,6EAA6E;IAC7E,0EAA0E;IAC1E,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC;QAAE,OAAO,KAAK,CAAC;IACtF,SAAS,GAAG,SAAS,CAAC,WAAW,EAAE,CAAC;IAEpC,0CAA0C;IAC1C,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,aAAa,CAAC,CAAC;QAC3C,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnF,IAAI,QAAQ,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QACvD,MAAM,CA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AU,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9C,CAAC;IACD,OAAO,MAAM,KAAK,CAAC,CAAC;AACtB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fundedfast/sdk",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"description": "Official TypeScript SDK for the FAST platform - Skill Challenge engine for sportsbook operators",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/cjs/index.js",
|
|
7
|
+
"module": "dist/esm/index.js",
|
|
8
|
+
"types": "dist/esm/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/esm/index.d.ts",
|
|
13
|
+
"default": "./dist/esm/index.js"
|
|
14
|
+
},
|
|
15
|
+
"require": {
|
|
16
|
+
"types": "./dist/cjs/index.d.ts",
|
|
17
|
+
"default": "./dist/cjs/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
"./webhooks": {
|
|
21
|
+
"import": {
|
|
22
|
+
"types": "./dist/esm/webhooks.d.ts",
|
|
23
|
+
"default": "./dist/esm/webhooks.js"
|
|
24
|
+
},
|
|
25
|
+
"require": {
|
|
26
|
+
"types": "./dist/cjs/webhooks.d.ts",
|
|
27
|
+
"default": "./dist/cjs/webhooks.js"
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"CHANGELOG.md"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"build": "npm run build:esm && npm run build:cjs && npm run build:cjs:package",
|
|
38
|
+
"build:esm": "tsc -p tsconfig.json",
|
|
39
|
+
"build:cjs": "tsc -p tsconfig.cjs.json",
|
|
40
|
+
"build:cjs:package": "echo '{\"type\":\"commonjs\"}' > dist/cjs/package.json",
|
|
41
|
+
"dev": "tsc -p tsconfig.json --watch",
|
|
42
|
+
"clean": "rm -rf dist",
|
|
43
|
+
"test": "vitest --run",
|
|
44
|
+
"test:watch": "vitest",
|
|
45
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
46
|
+
"typecheck": "tsc --noEmit"
|
|
47
|
+
},
|
|
48
|
+
"keywords": [
|
|
49
|
+
"fast",
|
|
50
|
+
"fundedfast",
|
|
51
|
+
"sportsbook",
|
|
52
|
+
"funded-accounts",
|
|
53
|
+
"skill-challenge",
|
|
54
|
+
"betting-api",
|
|
55
|
+
"bet-validation",
|
|
56
|
+
"prop-trading",
|
|
57
|
+
"typescript",
|
|
58
|
+
"sdk"
|
|
59
|
+
],
|
|
60
|
+
"author": "BLACKLINE CONSULTING d.o.o. <support@fundedfast.eu>",
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"homepage": "https://fundedfast.eu",
|
|
63
|
+
"engines": {
|
|
64
|
+
"node": ">=18"
|
|
65
|
+
},
|
|
66
|
+
"sideEffects": false,
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@types/node": "^26.5.0",
|
|
69
|
+
"typescript": "^5.5.0",
|
|
70
|
+
"vitest": "^5.0.0"
|
|
71
|
+
}
|
|
72
|
+
}
|