Skip to content

Commit 35552c7

Browse files
committed
docs: Add GPT link to readme
1 parent 94952d9 commit 35552c7

File tree

8 files changed

+152
-4
lines changed

8 files changed

+152
-4
lines changed

.changeset/wicked-feet-cheat.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@data-client/endpoint': patch
3+
'@data-client/react': patch
4+
'@data-client/rest': patch
5+
---
6+
7+
Include GPT link badge in readme

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@ Schema driven. Zero updater functions.
1919
[![bundle size](https://img.shields.io/bundlephobia/minzip/@data-client/react?style=flat-square)](https://bundlephobia.com/result?p=@data-client/react)
2020
[![npm version](https://img.shields.io/npm/v/@data-client/react.svg?style=flat-square)](https://www.npmjs.com/package/@data-client/react)
2121
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
22+
[![Codegen GPT](https://img.shields.io/badge/chatGPT-74aa9c?style=flat-square&logo=openai&logoColor=white)](https://chatgpt.com/g/g-682609591fe48191a6850901521b4e4b-typescript-rest-codegen)
2223
[![Chat](https://img.shields.io/discord/768254430381735967.svg?style=flat-square&colorB=758ED3)](https://discord.gg/35nb8Mz)
2324

24-
**[📖Read The Docs](https://dataclient.io/docs)** &nbsp;|&nbsp; [🏁Getting Started](https://dataclient.io/docs/getting-started/installation) <br/>🎮 Demos: &nbsp;
25+
**[📖Read The Docs](https://dataclient.io/docs)** &nbsp;|&nbsp; [🏁Getting Started](https://dataclient.io/docs/getting-started/installation) &nbsp;|&nbsp; [🤖Codgen GPT](https://chatgpt.com/g/g-682609591fe48191a6850901521b4e4b-typescript-rest-codegen)<br/>🎮 Demos: &nbsp;
2526
[Todo](https://stackblitz.com/github/reactive/data-client/tree/master/examples/todo-app?file=src%2Fpages%2FHome%2FTodoList.tsx) &nbsp;|&nbsp;
2627
[Github Social](https://stackblitz.com/github/reactive/data-client/tree/master/examples/github-app?file=src%2Fpages%2FIssueList.tsx) &nbsp;|&nbsp;
2728
[NextJS SSR](https://stackblitz.com/github/reactive/data-client/tree/master/examples/nextjs?file=components%2Ftodo%2FTodoList.tsx) &nbsp;|&nbsp;
Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
import { RestEndpoint, Entity } from '@data-client/rest';
2+
3+
export class BinanceTicker24hr extends Entity {
4+
symbol = '';
5+
priceChange = '';
6+
priceChangePercent = '';
7+
weightedAvgPrice = '';
8+
prevClosePrice = '';
9+
lastPrice = '';
10+
lastQty = '';
11+
bidPrice = '';
12+
bidQty = '';
13+
askPrice = '';
14+
askQty = '';
15+
openPrice = '';
16+
highPrice = '';
17+
lowPrice = '';
18+
volume = '';
19+
quoteVolume = '';
20+
openTime = 0;
21+
closeTime = 0;
22+
firstId = 0;
23+
lastId = 0;
24+
count = 0;
25+
static key = 'BinanceTicker24hr';
26+
}
27+
28+
export class BinanceKline extends Entity {
29+
openTime = 0;
30+
open = '';
31+
high = '';
32+
low = '';
33+
close = '';
34+
volume = '';
35+
closeTime = 0;
36+
quoteAssetVolume = '';
37+
numberOfTrades = 0;
38+
takerBuyBaseAssetVolume = '';
39+
takerBuyQuoteAssetVolume = '';
40+
static key = 'BinanceKline';
41+
}
42+
43+
export class BinanceTrade extends Entity {
44+
id = 0;
45+
price = '';
46+
qty = '';
47+
quoteQty = '';
48+
time = 0;
49+
isBuyerMaker = false;
50+
isBestMatch = false;
51+
static key = 'BinanceTrade';
52+
}
53+
54+
/**
55+
* Get 24hr ticker price change statistics for a symbol or symbols
56+
* GET /api/v3/ticker/24hr
57+
* Example: /api/v3/ticker/24hr?symbol=BTCUSDT
58+
*/
59+
export const getBinanceTicker24hr = new RestEndpoint({
60+
urlPrefix: 'https://api.binance.com',
61+
path: '/api/v3/ticker/24hr',
62+
searchParams: {} as {
63+
symbol?: string;
64+
},
65+
schema: [BinanceTicker24hr],
66+
pollFrequency: 60 * 1000, // poll every minute
67+
});
68+
69+
/**
70+
* Get Kline/candlestick data for a symbol
71+
* GET /api/v3/klines
72+
* Example: /api/v3/klines?symbol=BTCUSDT&interval=1m
73+
*/
74+
export const getBinanceKlines = new RestEndpoint({
75+
urlPrefix: 'https://api.binance.com',
76+
path: '/api/v3/klines',
77+
searchParams: {} as {
78+
symbol: string;
79+
interval: string;
80+
startTime?: number;
81+
endTime?: number;
82+
limit?: number;
83+
},
84+
schema: [BinanceKline],
85+
pollFrequency: 60 * 1000, // poll every minute
86+
process(value: any[][]) {
87+
return value.map(kline => ({
88+
openTime: kline[0],
89+
open: kline[1],
90+
high: kline[2],
91+
low: kline[3],
92+
close: kline[4],
93+
volume: kline[5],
94+
closeTime: kline[6],
95+
quoteAssetVolume: kline[7],
96+
numberOfTrades: kline[8],
97+
takerBuyBaseAssetVolume: kline[9],
98+
takerBuyQuoteAssetVolume: kline[10],
99+
}));
100+
},
101+
});
102+
103+
/**
104+
* Get recent trades for a symbol
105+
* GET /api/v3/trades
106+
* Example: /api/v3/trades?symbol=BTCUSDT&limit=10
107+
* https://binance-docs.github.io/apidocs/spot/en/#recent-trades-list
108+
*/
109+
export const getBinanceRecentTrades = new RestEndpoint({
110+
urlPrefix: 'https://api.binance.com',
111+
path: '/api/v3/trades',
112+
searchParams: {} as {
113+
symbol: string;
114+
limit?: number;
115+
},
116+
schema: [BinanceTrade],
117+
pollFrequency: 60 * 1000, // poll every minute
118+
});

packages/endpoint/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
[![bundle size](https://img.shields.io/bundlephobia/minzip/@data-client/endpoint?style=flat-square)](https://bundlephobia.com/result?p=@data-client/endpoint)
66
[![npm version](https://img.shields.io/npm/v/@data-client/endpoint.svg?style=flat-square)](https://www.npmjs.com/package/@data-client/endpoint)
77
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
8+
[![Codegen GPT](https://img.shields.io/badge/chatGPT-74aa9c?style=flat-square&logo=openai&logoColor=white)](https://chatgpt.com/g/g-682609591fe48191a6850901521b4e4b-typescript-rest-codegen)
89

910
Declarative, strongly typed, reusable network definitions for networking libraries.
1011

1112
<div align="center">
1213

13-
**[📖Read The Docs](https://dataclient.io/docs/guides/custom-protocol)**
14+
**[📖Read The Docs](https://dataclient.io/docs/guides/custom-protocol) &nbsp;|&nbsp; [🤖Codgen GPT](https://chatgpt.com/g/g-682609591fe48191a6850901521b4e4b-typescript-rest-codegen)**
1415

1516
</div>
1617

packages/react/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ Schema driven. Zero updater functions.
2121
[![bundle size](https://img.shields.io/bundlephobia/minzip/@data-client/react?style=flat-square)](https://bundlephobia.com/result?p=@data-client/react)
2222
[![npm version](https://img.shields.io/npm/v/@data-client/react.svg?style=flat-square)](https://www.npmjs.com/package/@data-client/react)
2323
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
24+
[![Codegen GPT](https://img.shields.io/badge/chatGPT-74aa9c?style=flat-square&logo=openai&logoColor=white)](https://chatgpt.com/g/g-682609591fe48191a6850901521b4e4b-typescript-rest-codegen)
2425
[![Chat](https://img.shields.io/discord/768254430381735967.svg?style=flat-square&colorB=758ED3)](https://discord.gg/35nb8Mz)
2526

26-
**[📖Read The Docs](https://dataclient.io/docs)** &nbsp;|&nbsp; [🏁Getting Started](https://dataclient.io/docs/getting-started/installation) <br/>🎮 **Demos:** &nbsp;
27+
**[📖Read The Docs](https://dataclient.io/docs)** &nbsp;|&nbsp; [🏁Getting Started](https://dataclient.io/docs/getting-started/installation) &nbsp;|&nbsp; [🤖Codgen GPT](https://chatgpt.com/g/g-682609591fe48191a6850901521b4e4b-typescript-rest-codegen) <br/>🎮 **Demos:** &nbsp;
2728
[Todo](https://stackblitz.com/github/reactive/data-client/tree/master/examples/todo-app?file=src%2Fpages%2FHome%2FTodoList.tsx) &nbsp;|&nbsp;
2829
[Github](https://stackblitz.com/github/reactive/data-client/tree/master/examples/github-app?file=src%2Fpages%2FIssueList.tsx) &nbsp;|&nbsp;
2930
[NextJS SSR](https://stackblitz.com/github/reactive/data-client/tree/master/examples/nextjs?file=components%2Ftodo%2FTodoList.tsx) &nbsp;|&nbsp;

packages/rest/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
[![bundle size](https://img.shields.io/bundlephobia/minzip/@data-client/rest?style=flat-square)](https://bundlephobia.com/result?p=@data-client/rest)
77
[![npm version](https://img.shields.io/npm/v/@data-client/rest.svg?style=flat-square)](https://www.npmjs.com/package/@data-client/rest)
88
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
9+
[![Codegen GPT](https://img.shields.io/badge/chatGPT-74aa9c?style=flat-square&logo=openai&logoColor=white)](https://chatgpt.com/g/g-682609591fe48191a6850901521b4e4b-typescript-rest-codegen)
910
[![Chat](https://img.shields.io/discord/768254430381735967.svg?style=flat-square&colorB=758ED3)](https://discord.gg/35nb8Mz)
1011

1112
<div align="center">
1213

13-
**[📖Read The Docs](https://dataclient.io/rest)** &nbsp;|&nbsp; [🎮Todo Demo](https://stackblitz.com/github/reactive/data-client/tree/master/examples/todo-app?file=src%2Fresources%2FTodoResource.ts) &nbsp;|&nbsp; [🎮Github Demo](https://stackblitz.com/github/reactive/data-client/tree/master/examples/github-app?file=src%2Fresources%2FIssue.tsx)
14+
**[📖Read The Docs](https://dataclient.io/rest)** &nbsp;|&nbsp; [🤖Codgen GPT](https://chatgpt.com/g/g-682609591fe48191a6850901521b4e4b-typescript-rest-codegen) &nbsp;|&nbsp; [🎮Todo Demo](https://stackblitz.com/github/reactive/data-client/tree/master/examples/todo-app?file=src%2Fresources%2FTodoResource.ts) &nbsp;|&nbsp; [🎮Github Demo](https://stackblitz.com/github/reactive/data-client/tree/master/examples/github-app?file=src%2Fresources%2FIssue.tsx)
1415

1516
</div>
1617

website/docusaurus.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -474,6 +474,12 @@ const config: Config = {
474474
className: 'header-discord-link',
475475
'aria-label': 'Discord chat support',
476476
},
477+
{
478+
href: 'https://chatgpt.com/g/g-682609591fe48191a6850901521b4e4b-typescript-rest-codegen',
479+
position: 'right',
480+
className: 'header-gpt-link',
481+
'aria-label': 'Codegeneration with ChatGPT',
482+
},
477483
],
478484
},
479485
footer: {

website/src/css/customTheme.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,19 @@ html[data-theme='dark'] .docusaurus-highlight-code-line {
4444
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 640 512'%3E%3Cpath d='M524.531 69.836a1.5 1.5 0 0 0-.764-.7A485.065 485.065 0 0 0 404.081 32.03a1.816 1.816 0 0 0-1.923.91 337.461 337.461 0 0 0-14.9 30.6 447.848 447.848 0 0 0-134.426 0 309.541 309.541 0 0 0-15.135-30.6 1.89 1.89 0 0 0-1.924-.91A483.689 483.689 0 0 0 116.085 69.137a1.712 1.712 0 0 0-.788.676C39.068 183.651 18.186 294.69 28.43 404.354a2.016 2.016 0 0 0 .765 1.375A487.666 487.666 0 0 0 176.02 479.918a1.9 1.9 0 0 0 2.063-.676A348.2 348.2 0 0 0 208.12 430.4a1.86 1.86 0 0 0-1.019-2.588 321.173 321.173 0 0 1-45.868-21.853 1.885 1.885 0 0 1-.185-3.126c3.082-2.309 6.166-4.711 9.109-7.137a1.819 1.819 0 0 1 1.9-.256c96.229 43.917 200.41 43.917 295.5 0a1.812 1.812 0 0 1 1.924.233c2.944 2.426 6.027 4.851 9.132 7.16a1.884 1.884 0 0 1-.162 3.126 301.407 301.407 0 0 1-45.89 21.83 1.875 1.875 0 0 0-1 2.611 391.055 391.055 0 0 0 30.014 48.815 1.864 1.864 0 0 0 2.063.7A486.048 486.048 0 0 0 610.7 405.729a1.882 1.882 0 0 0 .765-1.352C623.729 277.594 590.933 167.465 524.531 69.836ZM222.491 337.58c-28.972 0-52.844-26.587-52.844-59.239S193.056 219.1 222.491 219.1c29.665 0 53.306 26.82 52.843 59.239C275.334 310.993 251.924 337.58 222.491 337.58Zm195.38 0c-28.971 0-52.843-26.587-52.843-59.239S388.437 219.1 417.871 219.1c29.667 0 53.307 26.82 52.844 59.239C470.715 310.993 447.538 337.58 417.871 337.58Z'/%3E%3C/svg%3E");
4545
}
4646

47+
.header-gpt-link:hover {
48+
opacity: 0.6;
49+
}
50+
51+
.header-gpt-link:before {
52+
content: '';
53+
width: 20px;
54+
height: 20px;
55+
display: flex;
56+
background-color: var(--ifm-navbar-link-color);
57+
mask-image: url('data:image/svg+xml;utf8,<svg width=\'20\' height=\'20\' viewBox=\'0 0 24 24\' fill=\'none\' xmlns=\'http://www.w3.org/2000/svg\'><path d=\'M9.20509 8.76511V6.50545C9.20509 6.31513 9.27649 6.17234 9.44293 6.0773L13.9861 3.46088C14.6046 3.10413 15.342 2.93769 16.103 2.93769C18.9573 2.93769 20.7651 5.14983 20.7651 7.50454C20.7651 7.67098 20.7651 7.86129 20.7412 8.05161L16.0316 5.2924C15.7462 5.12596 15.4607 5.12596 15.1753 5.2924L9.20509 8.76511ZM19.8135 17.5659V12.1664C19.8135 11.8333 19.6708 11.5955 19.3854 11.429L13.4152 7.95633L15.3656 6.83833C15.5321 6.74328 15.6749 6.74328 15.8413 6.83833L20.3845 9.45474C21.6928 10.216 22.5728 11.8333 22.5728 13.4031C22.5728 15.2108 21.5025 16.8758 19.8135 17.5657V17.5659ZM7.80173 12.8088L5.8513 11.6671C5.68486 11.5721 5.61346 11.4293 5.61346 11.239V6.00613C5.61346 3.46111 7.56389 1.53433 10.2042 1.53433C11.2033 1.53433 12.1307 1.86743 12.9159 2.46202L8.2301 5.17371C7.94475 5.34015 7.80195 5.57798 7.80195 5.91109V12.809L7.80173 12.8088ZM12 15.2349L9.20509 13.6651V10.3351L12 8.76534L14.7947 10.3351V13.6651L12 15.2349ZM13.7958 22.4659C12.7967 22.4659 11.8693 22.1328 11.0841 21.5382L15.7699 18.8265C16.0553 18.6601 16.198 18.4222 16.198 18.0891V11.1912L18.1723 12.3329C18.3388 12.4279 18.4102 12.5707 18.4102 12.761V17.9939C18.4102 20.5389 16.4359 22.4657 13.7958 22.4657V22.4659ZM8.15848 17.1617L3.61528 14.5452C2.30696 13.784 1.42701 12.1667 1.42701 10.5969C1.42701 8.76534 2.52115 7.12414 4.20987 6.43428V11.8574C4.20987 12.1905 4.35266 12.4284 4.63802 12.5948L10.5846 16.0436L8.63415 17.1617C8.46771 17.2567 8.32492 17.2567 8.15848 17.1617ZM7.897 21.0625C5.20919 21.0625 3.23488 19.0407 3.23488 16.5432C3.23488 16.3529 3.25875 16.1626 3.2824 15.9723L7.96817 18.6839C8.25352 18.8504 8.53911 18.8504 8.82446 18.6839L14.7947 15.2351V17.4948C14.7947 17.6851 14.7233 17.8279 14.5568 17.9229L10.0136 20.5393C9.39518 20.8961 8.6578 21.0625 7.89677 21.0625H7.897ZM13.7958 23.8929C16.6739 23.8929 19.0762 21.8474 19.6235 19.1357C22.2874 18.4459 24 15.9484 24 13.4034C24 11.7383 23.2865 10.121 22.002 8.95542C22.121 8.45588 22.1924 7.95633 22.1924 7.45702C22.1924 4.0557 19.4331 1.51045 16.2458 1.51045C15.6037 1.51045 14.9852 1.60549 14.3668 1.81968C13.2963 0.773071 11.8215 0.107086 10.2042 0.107086C7.32606 0.107086 4.92383 2.15256 4.37653 4.86425C1.7126 5.55411 0 8.05161 0 10.5966C0 12.2617 0.713506 13.879 1.99795 15.0446C1.87904 15.5441 1.80764 16.0436 1.80764 16.543C1.80764 19.9443 4.56685 22.4895 7.75421 22.4895C8.39632 22.4895 9.01478 22.3945 9.63324 22.1803C10.7035 23.2269 12.1783 23.8929 13.7958 23.8929Z\' fill=\'currentColor\'/></svg>');
58+
}
59+
4760
.header-demos-link:hover {
4861
opacity: 0.6;
4962
}

0 commit comments

Comments
 (0)