@stackup-fi/sdk 1.0.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.
Files changed (36) hide show
  1. package/README.md +15 -0
  2. package/dist/client.d.ts +5 -0
  3. package/dist/client.js +19 -0
  4. package/dist/index.d.ts +8 -0
  5. package/dist/index.js +14 -0
  6. package/dist/v1/gen/client/client.gen.d.ts +2 -0
  7. package/dist/v1/gen/client/client.gen.js +228 -0
  8. package/dist/v1/gen/client/index.d.ts +8 -0
  9. package/dist/v1/gen/client/index.js +6 -0
  10. package/dist/v1/gen/client/types.gen.d.ts +117 -0
  11. package/dist/v1/gen/client/types.gen.js +2 -0
  12. package/dist/v1/gen/client/utils.gen.d.ts +33 -0
  13. package/dist/v1/gen/client/utils.gen.js +231 -0
  14. package/dist/v1/gen/client.gen.d.ts +12 -0
  15. package/dist/v1/gen/client.gen.js +3 -0
  16. package/dist/v1/gen/core/auth.gen.d.ts +18 -0
  17. package/dist/v1/gen/core/auth.gen.js +14 -0
  18. package/dist/v1/gen/core/bodySerializer.gen.d.ts +25 -0
  19. package/dist/v1/gen/core/bodySerializer.gen.js +57 -0
  20. package/dist/v1/gen/core/params.gen.d.ts +43 -0
  21. package/dist/v1/gen/core/params.gen.js +100 -0
  22. package/dist/v1/gen/core/pathSerializer.gen.d.ts +33 -0
  23. package/dist/v1/gen/core/pathSerializer.gen.js +114 -0
  24. package/dist/v1/gen/core/queryKeySerializer.gen.d.ts +18 -0
  25. package/dist/v1/gen/core/queryKeySerializer.gen.js +99 -0
  26. package/dist/v1/gen/core/serverSentEvents.gen.d.ts +71 -0
  27. package/dist/v1/gen/core/serverSentEvents.gen.js +137 -0
  28. package/dist/v1/gen/core/types.gen.d.ts +78 -0
  29. package/dist/v1/gen/core/types.gen.js +2 -0
  30. package/dist/v1/gen/core/utils.gen.d.ts +19 -0
  31. package/dist/v1/gen/core/utils.gen.js +87 -0
  32. package/dist/v1/gen/sdk.gen.d.ts +90 -0
  33. package/dist/v1/gen/sdk.gen.js +132 -0
  34. package/dist/v1/gen/types.gen.d.ts +290 -0
  35. package/dist/v1/gen/types.gen.js +2 -0
  36. package/package.json +22 -0
@@ -0,0 +1,132 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client } from "./client.gen.js";
3
+ import { buildClientParams, } from "./client/index.js";
4
+ class HeyApiClient {
5
+ client;
6
+ constructor(args) {
7
+ this.client = args?.client ?? client;
8
+ }
9
+ }
10
+ class HeyApiRegistry {
11
+ defaultKey = "default";
12
+ instances = new Map();
13
+ get(key) {
14
+ const instance = this.instances.get(key ?? this.defaultKey);
15
+ if (!instance) {
16
+ throw new Error(`No SDK client found. Create one with "new StackupClient()" to fix this error.`);
17
+ }
18
+ return instance;
19
+ }
20
+ set(value, key) {
21
+ this.instances.set(key ?? this.defaultKey, value);
22
+ }
23
+ }
24
+ export class Customer extends HeyApiClient {
25
+ /**
26
+ * Create customer
27
+ *
28
+ * Create a new customer with a wallet address
29
+ */
30
+ create(parameters, options) {
31
+ const params = buildClientParams([parameters], [{ args: [{ in: "body", key: "walletAddress" }] }]);
32
+ return (options?.client ?? this.client).post({
33
+ url: "/customer/create",
34
+ ...options,
35
+ ...params,
36
+ headers: {
37
+ "Content-Type": "application/json",
38
+ ...options?.headers,
39
+ ...params.headers,
40
+ },
41
+ });
42
+ }
43
+ /**
44
+ * List customers
45
+ *
46
+ * List all customers for the current workspace
47
+ */
48
+ list(options) {
49
+ return (options?.client ?? this.client).get({ url: "/customer", ...options });
50
+ }
51
+ /**
52
+ * Delete customer
53
+ *
54
+ * Delete a customer (soft delete)
55
+ */
56
+ delete(parameters, options) {
57
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "id" }] }]);
58
+ return (options?.client ?? this.client).delete({
59
+ url: "/customer/{id}",
60
+ ...options,
61
+ ...params,
62
+ });
63
+ }
64
+ /**
65
+ * Get customer
66
+ *
67
+ * Get a specific customer by ID
68
+ */
69
+ get(parameters, options) {
70
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "id" }] }]);
71
+ return (options?.client ?? this.client).get({
72
+ url: "/customer/{id}",
73
+ ...options,
74
+ ...params,
75
+ });
76
+ }
77
+ /**
78
+ * Update customer
79
+ *
80
+ * Update a customer's wallet address
81
+ */
82
+ update(parameters, options) {
83
+ const params = buildClientParams([parameters], [
84
+ {
85
+ args: [
86
+ { in: "path", key: "id" },
87
+ { in: "body", key: "walletAddress" },
88
+ ],
89
+ },
90
+ ]);
91
+ return (options?.client ?? this.client).patch({
92
+ url: "/customer/{id}",
93
+ ...options,
94
+ ...params,
95
+ headers: {
96
+ "Content-Type": "application/json",
97
+ ...options?.headers,
98
+ ...params.headers,
99
+ },
100
+ });
101
+ }
102
+ }
103
+ export class Checkout extends HeyApiClient {
104
+ /**
105
+ * Get checkout details
106
+ *
107
+ * Retrieve product, token, and chain information for checkout by product ID
108
+ */
109
+ create(parameters, options) {
110
+ const params = buildClientParams([parameters], [{ args: [{ in: "path", key: "id" }] }]);
111
+ return (options?.client ?? this.client).post({
112
+ url: "/checkout/{id}",
113
+ ...options,
114
+ ...params,
115
+ });
116
+ }
117
+ }
118
+ export class StackupClient extends HeyApiClient {
119
+ static __registry = new HeyApiRegistry();
120
+ constructor(args) {
121
+ super(args);
122
+ StackupClient.__registry.set(this, args?.key);
123
+ }
124
+ _customer;
125
+ get customer() {
126
+ return (this._customer ??= new Customer({ client: this.client }));
127
+ }
128
+ _checkout;
129
+ get checkout() {
130
+ return (this._checkout ??= new Checkout({ client: this.client }));
131
+ }
132
+ }
@@ -0,0 +1,290 @@
1
+ export type ClientOptions = {
2
+ baseUrl: `${string}://${string}` | (string & {});
3
+ };
4
+ export type BadRequestError = {
5
+ data: unknown;
6
+ errors: Array<{
7
+ [key: string]: unknown;
8
+ }>;
9
+ success: false;
10
+ };
11
+ export type NotFoundError = {
12
+ message: string;
13
+ };
14
+ export type CustomerCreateData = {
15
+ body?: {
16
+ /**
17
+ * Customer's EVM-compatible wallet address
18
+ */
19
+ walletAddress: unknown;
20
+ };
21
+ path?: never;
22
+ query?: never;
23
+ url: "/customer/create";
24
+ };
25
+ export type CustomerCreateErrors = {
26
+ /**
27
+ * Bad request
28
+ */
29
+ 400: BadRequestError;
30
+ };
31
+ export type CustomerCreateError = CustomerCreateErrors[keyof CustomerCreateErrors];
32
+ export type CustomerCreateResponses = {
33
+ /**
34
+ * Customer created successfully
35
+ */
36
+ 201: {
37
+ /**
38
+ * Unique customer identifier
39
+ */
40
+ id: string;
41
+ /**
42
+ * ID of the workspace this customer belongs to
43
+ */
44
+ workspaceID: string;
45
+ /**
46
+ * Timestamp when the customer was created
47
+ */
48
+ timeCreated: unknown;
49
+ /**
50
+ * Timestamp when the customer was last updated
51
+ */
52
+ timeUpdated: unknown;
53
+ /**
54
+ * Timestamp when the customer was deleted, null if active
55
+ */
56
+ timeDeleted: unknown | null;
57
+ /**
58
+ * Customer's EVM-compatible wallet address
59
+ */
60
+ walletAddress: unknown;
61
+ };
62
+ };
63
+ export type CustomerCreateResponse = CustomerCreateResponses[keyof CustomerCreateResponses];
64
+ export type CustomerListData = {
65
+ body?: never;
66
+ path?: never;
67
+ query?: never;
68
+ url: "/customer";
69
+ };
70
+ export type CustomerListResponses = {
71
+ /**
72
+ * List of customers
73
+ */
74
+ 200: Array<{
75
+ /**
76
+ * Unique customer identifier
77
+ */
78
+ id: string;
79
+ /**
80
+ * ID of the workspace this customer belongs to
81
+ */
82
+ workspaceID: string;
83
+ /**
84
+ * Timestamp when the customer was created
85
+ */
86
+ timeCreated: unknown;
87
+ /**
88
+ * Timestamp when the customer was last updated
89
+ */
90
+ timeUpdated: unknown;
91
+ /**
92
+ * Timestamp when the customer was deleted, null if active
93
+ */
94
+ timeDeleted: unknown | null;
95
+ /**
96
+ * Customer's EVM-compatible wallet address
97
+ */
98
+ walletAddress: unknown;
99
+ }>;
100
+ };
101
+ export type CustomerListResponse = CustomerListResponses[keyof CustomerListResponses];
102
+ export type CustomerDeleteData = {
103
+ body?: never;
104
+ path: {
105
+ /**
106
+ * Unique customer identifier
107
+ */
108
+ id: string;
109
+ };
110
+ query?: never;
111
+ url: "/customer/{id}";
112
+ };
113
+ export type CustomerDeleteErrors = {
114
+ /**
115
+ * Bad request
116
+ */
117
+ 400: BadRequestError;
118
+ /**
119
+ * Not found
120
+ */
121
+ 404: NotFoundError;
122
+ };
123
+ export type CustomerDeleteError = CustomerDeleteErrors[keyof CustomerDeleteErrors];
124
+ export type CustomerDeleteResponses = {
125
+ /**
126
+ * Customer deleted successfully
127
+ */
128
+ 204: void;
129
+ };
130
+ export type CustomerDeleteResponse = CustomerDeleteResponses[keyof CustomerDeleteResponses];
131
+ export type CustomerGetData = {
132
+ body?: never;
133
+ path: {
134
+ /**
135
+ * Unique customer identifier
136
+ */
137
+ id: string;
138
+ };
139
+ query?: never;
140
+ url: "/customer/{id}";
141
+ };
142
+ export type CustomerGetErrors = {
143
+ /**
144
+ * Bad request
145
+ */
146
+ 400: BadRequestError;
147
+ /**
148
+ * Not found
149
+ */
150
+ 404: NotFoundError;
151
+ };
152
+ export type CustomerGetError = CustomerGetErrors[keyof CustomerGetErrors];
153
+ export type CustomerGetResponses = {
154
+ /**
155
+ * Customer details
156
+ */
157
+ 200: {
158
+ /**
159
+ * Unique customer identifier
160
+ */
161
+ id: string;
162
+ /**
163
+ * ID of the workspace this customer belongs to
164
+ */
165
+ workspaceID: string;
166
+ /**
167
+ * Timestamp when the customer was created
168
+ */
169
+ timeCreated: unknown;
170
+ /**
171
+ * Timestamp when the customer was last updated
172
+ */
173
+ timeUpdated: unknown;
174
+ /**
175
+ * Timestamp when the customer was deleted, null if active
176
+ */
177
+ timeDeleted: unknown | null;
178
+ /**
179
+ * Customer's EVM-compatible wallet address
180
+ */
181
+ walletAddress: unknown;
182
+ };
183
+ };
184
+ export type CustomerGetResponse = CustomerGetResponses[keyof CustomerGetResponses];
185
+ export type CustomerUpdateData = {
186
+ body?: {
187
+ /**
188
+ * Customer's EVM-compatible wallet address
189
+ */
190
+ walletAddress?: unknown;
191
+ };
192
+ path: {
193
+ /**
194
+ * Unique customer identifier
195
+ */
196
+ id: string;
197
+ };
198
+ query?: never;
199
+ url: "/customer/{id}";
200
+ };
201
+ export type CustomerUpdateErrors = {
202
+ /**
203
+ * Bad request
204
+ */
205
+ 400: BadRequestError;
206
+ /**
207
+ * Not found
208
+ */
209
+ 404: NotFoundError;
210
+ };
211
+ export type CustomerUpdateError = CustomerUpdateErrors[keyof CustomerUpdateErrors];
212
+ export type CustomerUpdateResponses = {
213
+ /**
214
+ * Customer updated successfully
215
+ */
216
+ 200: {
217
+ /**
218
+ * Unique customer identifier
219
+ */
220
+ id: string;
221
+ /**
222
+ * ID of the workspace this customer belongs to
223
+ */
224
+ workspaceID: string;
225
+ /**
226
+ * Timestamp when the customer was created
227
+ */
228
+ timeCreated: unknown;
229
+ /**
230
+ * Timestamp when the customer was last updated
231
+ */
232
+ timeUpdated: unknown;
233
+ /**
234
+ * Timestamp when the customer was deleted, null if active
235
+ */
236
+ timeDeleted: unknown | null;
237
+ /**
238
+ * Customer's EVM-compatible wallet address
239
+ */
240
+ walletAddress: unknown;
241
+ };
242
+ };
243
+ export type CustomerUpdateResponse = CustomerUpdateResponses[keyof CustomerUpdateResponses];
244
+ export type CheckoutCreateData = {
245
+ body?: never;
246
+ path: {
247
+ id: string;
248
+ };
249
+ query?: never;
250
+ url: "/checkout/{id}";
251
+ };
252
+ export type CheckoutCreateErrors = {
253
+ /**
254
+ * Bad request
255
+ */
256
+ 400: BadRequestError;
257
+ /**
258
+ * Not found
259
+ */
260
+ 404: NotFoundError;
261
+ };
262
+ export type CheckoutCreateError = CheckoutCreateErrors[keyof CheckoutCreateErrors];
263
+ export type CheckoutCreateResponses = {
264
+ /**
265
+ * Checkout details retrieved successfully
266
+ */
267
+ 200: {
268
+ product: {
269
+ id: string;
270
+ name: string;
271
+ description: string;
272
+ price: string;
273
+ priceRaw: string;
274
+ payoutAddress: unknown;
275
+ };
276
+ token: {
277
+ address: unknown;
278
+ symbol: string;
279
+ name: string;
280
+ decimals: number;
281
+ logoURI: string;
282
+ };
283
+ chain: {
284
+ id: 1 | 8453;
285
+ name: string;
286
+ logoURI: string;
287
+ };
288
+ };
289
+ };
290
+ export type CheckoutCreateResponse = CheckoutCreateResponses[keyof CheckoutCreateResponses];
@@ -0,0 +1,2 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ export {};
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "@stackup-fi/sdk",
3
+ "version": "1.0.0",
4
+ "module": "index.ts",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./dist/index.js",
9
+ "types": "./dist/index.d.ts"
10
+ }
11
+ },
12
+ "scripts": {
13
+ "generate": "sst shell -- bun script/build.ts",
14
+ "publish": "bun script/publish.ts"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "peerDependencies": {
20
+ "typescript": "^5"
21
+ }
22
+ }