@stackup-fi/sdk 1.0.7 → 1.0.8
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/dist/client.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/notify/notify.d.ts +4 -0
- package/dist/notify/notify.js +54 -0
- package/dist/notify/types.d.ts +48 -0
- package/dist/notify/types.js +8 -0
- package/dist/notify/util.d.ts +1 -0
- package/dist/notify/util.js +7 -0
- package/dist/v1/gen/sdk.gen.d.ts +61 -13
- package/dist/v1/gen/sdk.gen.js +38 -11
- package/dist/v1/gen/types.gen.d.ts +107 -24
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./v1/gen/types.gen.js";
|
|
2
2
|
import { type Config } from "./v1/gen/client/types.gen.js";
|
|
3
3
|
import { StackupClient } from "./v1/gen/sdk.gen.js";
|
|
4
|
-
export { type Config as
|
|
4
|
+
export { type Config as StackupClientConfig, StackupClient };
|
|
5
5
|
export declare function createStackupClient(config?: Config): StackupClient;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from "./client.js";
|
|
2
|
+
export * from "./notify/notify.js";
|
|
2
3
|
import { createStackupClient } from "./client.js";
|
|
3
4
|
export function createStackup(options) {
|
|
4
5
|
const client = createStackupClient({
|
|
5
|
-
baseUrl: options.baseUrl ?? "https://api.stackup.finance",
|
|
6
6
|
headers: {
|
|
7
7
|
Authorization: `Bearer ${options.accessToken}`,
|
|
8
8
|
},
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { createClient } from "../v1/gen/client/client.gen.js";
|
|
2
|
+
import { StackupClient } from "../v1/gen/sdk.gen.js";
|
|
3
|
+
import { verifyTimestamp } from "./util.js";
|
|
4
|
+
export * from "./types.js";
|
|
5
|
+
const DEFAULT_TOLERANCE = 300; // 5 minutes
|
|
6
|
+
export function notify(args) {
|
|
7
|
+
if (args.mode === "check")
|
|
8
|
+
return check(args);
|
|
9
|
+
return webhook(args);
|
|
10
|
+
}
|
|
11
|
+
async function check(args) {
|
|
12
|
+
const client = new StackupClient({
|
|
13
|
+
client: createClient({
|
|
14
|
+
baseUrl: args.baseUrl ?? "https://api.stackup.finance",
|
|
15
|
+
headers: {
|
|
16
|
+
Authorization: `Bearer ${args.accessToken}`,
|
|
17
|
+
},
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
return client.customer.check({
|
|
21
|
+
customerID: args.customerID,
|
|
22
|
+
productID: args.productID,
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function webhook(config) {
|
|
26
|
+
const tolerance = config.tolerance ?? DEFAULT_TOLERANCE;
|
|
27
|
+
return async (req) => {
|
|
28
|
+
const timestamp = req.headers.get("x-webhook-timestamp");
|
|
29
|
+
const signature = req.headers.get("x-webhook-signature");
|
|
30
|
+
if (!timestamp || !signature)
|
|
31
|
+
return Response.json({
|
|
32
|
+
code: "bad_request",
|
|
33
|
+
message: "Missing webhook timestamp or signature",
|
|
34
|
+
}, { status: 400 });
|
|
35
|
+
const payload = await req.text();
|
|
36
|
+
if (!verifyTimestamp(timestamp, tolerance))
|
|
37
|
+
return Response.json({ code: "bad_request", message: "Webhook timestamp expired" }, { status: 400 });
|
|
38
|
+
const allow = await (async () => {
|
|
39
|
+
const encoder = new TextEncoder();
|
|
40
|
+
const key = await crypto.subtle.importKey("raw", encoder.encode(config.secret), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
41
|
+
const bytes = await crypto.subtle.sign("HMAC", key, encoder.encode(`${timestamp}.${payload}`));
|
|
42
|
+
const expected = Array.from(new Uint8Array(bytes))
|
|
43
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
|
44
|
+
.join("");
|
|
45
|
+
return expected === signature.replace("sha256=", "");
|
|
46
|
+
})().catch(() => false);
|
|
47
|
+
if (!allow)
|
|
48
|
+
return Response.json({ code: "bad_request", message: "Invalid webhook signature" }, { status: 400 });
|
|
49
|
+
return await config
|
|
50
|
+
.handler(JSON.parse(payload))
|
|
51
|
+
.then(() => new Response(null, { status: 200 }))
|
|
52
|
+
.catch(() => Response.json({ code: "internal", message: "Internal server error" }, { status: 500 }));
|
|
53
|
+
};
|
|
54
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
type Address = `0x${string}`;
|
|
2
|
+
type Hex = `0x${string}`;
|
|
3
|
+
import type { CustomerCheckErrors, CustomerCheckResponses } from "../v1/gen/types.gen.js";
|
|
4
|
+
import type { RequestResult } from "../v1/gen/client/types.gen.js";
|
|
5
|
+
type Prettify<T> = {
|
|
6
|
+
[K in keyof T]: Prettify<T[K]>;
|
|
7
|
+
} & {};
|
|
8
|
+
export interface Customer {
|
|
9
|
+
walletAddress: Address;
|
|
10
|
+
email: string | null;
|
|
11
|
+
name: string | null;
|
|
12
|
+
externalID: string | null;
|
|
13
|
+
}
|
|
14
|
+
export interface Payment {
|
|
15
|
+
status: "succeeded" | "failed";
|
|
16
|
+
amount: string;
|
|
17
|
+
tokenAddress: string | null;
|
|
18
|
+
txHash: Hex;
|
|
19
|
+
blockNumber: number;
|
|
20
|
+
productID: string | null;
|
|
21
|
+
}
|
|
22
|
+
export type WebhookEvent = Prettify<{
|
|
23
|
+
type: "payment.succeeded";
|
|
24
|
+
payload: {
|
|
25
|
+
customer: Customer;
|
|
26
|
+
payment: Payment;
|
|
27
|
+
};
|
|
28
|
+
}>;
|
|
29
|
+
export interface CheckArgs {
|
|
30
|
+
mode: "check";
|
|
31
|
+
accessToken: string;
|
|
32
|
+
customerID: string;
|
|
33
|
+
productID: string;
|
|
34
|
+
baseUrl?: string;
|
|
35
|
+
}
|
|
36
|
+
export interface WebhookArgs {
|
|
37
|
+
mode: "webhook";
|
|
38
|
+
secret: string;
|
|
39
|
+
tolerance?: number;
|
|
40
|
+
handler: WebhookHandler;
|
|
41
|
+
}
|
|
42
|
+
export type CheckResult = RequestResult<CustomerCheckResponses, CustomerCheckErrors, false>;
|
|
43
|
+
export type WebhookHandler = (event: WebhookEvent) => Promise<void>;
|
|
44
|
+
export declare class WebhookError extends Error {
|
|
45
|
+
code: "invalid_signature" | "invalid_timestamp" | "invalid_payload";
|
|
46
|
+
constructor(message: string, code: "invalid_signature" | "invalid_timestamp" | "invalid_payload");
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function verifyTimestamp(timestamp: string, tolerance: number): boolean;
|
package/dist/v1/gen/sdk.gen.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Client, type Options as Options2, type TDataShape } from "./client/index.js";
|
|
2
|
-
import type { CheckoutSessionCreateErrors, CheckoutSessionCreateResponses, CustomerCreateErrors, CustomerCreateResponses, CustomerDeleteErrors, CustomerDeleteResponses, CustomerGetErrors, CustomerGetResponses, CustomerListResponses, CustomerUpdateErrors, CustomerUpdateResponses, ProductCreateErrors, ProductCreateResponses, ProductDeleteErrors, ProductDeleteResponses, ProductGetErrors, ProductGetResponses, ProductListResponses, ProductUpdateErrors, ProductUpdateResponses } from "./types.gen.js";
|
|
2
|
+
import type { CheckoutSessionCreateErrors, CheckoutSessionCreateResponses, CustomerCheckErrors, CustomerCheckResponses, CustomerCreateErrors, CustomerCreateResponses, CustomerDeleteErrors, CustomerDeleteResponses, CustomerGetErrors, CustomerGetResponses, CustomerListResponses, CustomerUpdateErrors, CustomerUpdateResponses, ProductCreateErrors, ProductCreateResponses, ProductDeleteErrors, ProductDeleteResponses, ProductGetErrors, ProductGetResponses, ProductListResponses, ProductUpdateErrors, ProductUpdateResponses } from "./types.gen.js";
|
|
3
3
|
export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean> = Options2<TData, ThrowOnError> & {
|
|
4
4
|
/**
|
|
5
5
|
* You can provide a client instance returned by `createClient()` instead of
|
|
@@ -29,10 +29,9 @@ export declare class Customer extends HeyApiClient {
|
|
|
29
29
|
/**
|
|
30
30
|
* Create customer
|
|
31
31
|
*
|
|
32
|
-
* Create a new customer
|
|
32
|
+
* Create a new customer
|
|
33
33
|
*/
|
|
34
34
|
create<ThrowOnError extends boolean = false>(parameters?: {
|
|
35
|
-
walletAddress?: unknown;
|
|
36
35
|
name?: string | null;
|
|
37
36
|
email?: string | null;
|
|
38
37
|
externalID?: string | null;
|
|
@@ -66,11 +65,19 @@ export declare class Customer extends HeyApiClient {
|
|
|
66
65
|
*/
|
|
67
66
|
update<ThrowOnError extends boolean = false>(parameters: {
|
|
68
67
|
id: string;
|
|
69
|
-
walletAddress?: unknown;
|
|
70
68
|
name?: string | null;
|
|
71
69
|
email?: string | null;
|
|
72
70
|
externalID?: string | null;
|
|
73
71
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<CustomerUpdateResponses, CustomerUpdateErrors, ThrowOnError, "fields">;
|
|
72
|
+
/**
|
|
73
|
+
* Check customer product payment
|
|
74
|
+
*
|
|
75
|
+
* Check if a customer has paid for a specific product
|
|
76
|
+
*/
|
|
77
|
+
check<ThrowOnError extends boolean = false>(parameters: {
|
|
78
|
+
customerID: string;
|
|
79
|
+
productID: string;
|
|
80
|
+
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<CustomerCheckResponses, CustomerCheckErrors, ThrowOnError, "fields">;
|
|
74
81
|
}
|
|
75
82
|
export declare class Product extends HeyApiClient {
|
|
76
83
|
/**
|
|
@@ -81,9 +88,10 @@ export declare class Product extends HeyApiClient {
|
|
|
81
88
|
create<ThrowOnError extends boolean = false>(parameters?: {
|
|
82
89
|
walletID?: string;
|
|
83
90
|
payoutWalletID?: string;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
91
|
+
assetType?: string;
|
|
92
|
+
pricing?: string | number | boolean | null | Array<unknown> | {
|
|
93
|
+
[key: string]: unknown;
|
|
94
|
+
};
|
|
87
95
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProductCreateResponses, ProductCreateErrors, ThrowOnError, "fields">;
|
|
88
96
|
/**
|
|
89
97
|
* List products
|
|
@@ -114,27 +122,67 @@ export declare class Product extends HeyApiClient {
|
|
|
114
122
|
*/
|
|
115
123
|
update<ThrowOnError extends boolean = false>(parameters: {
|
|
116
124
|
id: string;
|
|
117
|
-
|
|
125
|
+
pricing?: string | number | boolean | null | Array<unknown> | {
|
|
126
|
+
[key: string]: unknown;
|
|
127
|
+
};
|
|
118
128
|
paused?: boolean;
|
|
129
|
+
supply?: number | null;
|
|
119
130
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<ProductUpdateResponses, ProductUpdateErrors, ThrowOnError, "fields">;
|
|
120
131
|
}
|
|
121
132
|
export declare class Session extends HeyApiClient {
|
|
122
133
|
/**
|
|
123
134
|
* Create checkout session
|
|
124
135
|
*
|
|
125
|
-
* Generate a checkout session URL for a
|
|
136
|
+
* Generate a checkout session URL for one or more products. Customer is optional - if not provided, a customer will be created from the buyer's wallet address at payment time.
|
|
126
137
|
*
|
|
127
138
|
* ```ts
|
|
128
139
|
* const session = await client.checkout.session.create({
|
|
129
|
-
*
|
|
130
|
-
*
|
|
140
|
+
* items: [
|
|
141
|
+
* { product: "prd_01ABC123", qty: 1 },
|
|
142
|
+
* { product: "prd_01DEF456", qty: 2 },
|
|
143
|
+
* ],
|
|
144
|
+
* customer: "cus_01DEF456", // optional
|
|
145
|
+
* theme: {
|
|
146
|
+
* primary: { light: "#7c3aed", dark: "#a78bfa" },
|
|
147
|
+
* background: { light: "#ffffff", dark: "#0b1220" },
|
|
148
|
+
* radius: "lg",
|
|
149
|
+
* }
|
|
131
150
|
* });
|
|
132
151
|
* console.log(session.url);
|
|
133
152
|
* ```
|
|
134
153
|
*/
|
|
135
154
|
create<ThrowOnError extends boolean = false>(parameters?: {
|
|
136
|
-
|
|
137
|
-
|
|
155
|
+
items?: Array<{
|
|
156
|
+
product: string;
|
|
157
|
+
mode?: "required" | "optional" | "pick";
|
|
158
|
+
quantity?: number;
|
|
159
|
+
default?: boolean;
|
|
160
|
+
editable?: boolean;
|
|
161
|
+
max?: number | null;
|
|
162
|
+
group?: string | null;
|
|
163
|
+
}>;
|
|
164
|
+
customer?: string | null;
|
|
165
|
+
theme?: {
|
|
166
|
+
primary?: string | {
|
|
167
|
+
light: string;
|
|
168
|
+
dark: string;
|
|
169
|
+
};
|
|
170
|
+
background?: string | {
|
|
171
|
+
light: string;
|
|
172
|
+
dark: string;
|
|
173
|
+
};
|
|
174
|
+
radius?: "none" | "sm" | "md" | "lg" | "full";
|
|
175
|
+
font?: {
|
|
176
|
+
family?: string;
|
|
177
|
+
scale?: string;
|
|
178
|
+
};
|
|
179
|
+
logo?: string | {
|
|
180
|
+
light: string;
|
|
181
|
+
dark: string;
|
|
182
|
+
};
|
|
183
|
+
favicon?: string;
|
|
184
|
+
css?: string;
|
|
185
|
+
} | null;
|
|
138
186
|
}, options?: Options<never, ThrowOnError>): import("./client/types.gen.js").RequestResult<CheckoutSessionCreateResponses, CheckoutSessionCreateErrors, ThrowOnError, "fields">;
|
|
139
187
|
}
|
|
140
188
|
export declare class Checkout extends HeyApiClient {
|
package/dist/v1/gen/sdk.gen.js
CHANGED
|
@@ -25,13 +25,12 @@ export class Customer extends HeyApiClient {
|
|
|
25
25
|
/**
|
|
26
26
|
* Create customer
|
|
27
27
|
*
|
|
28
|
-
* Create a new customer
|
|
28
|
+
* Create a new customer
|
|
29
29
|
*/
|
|
30
30
|
create(parameters, options) {
|
|
31
31
|
const params = buildClientParams([parameters], [
|
|
32
32
|
{
|
|
33
33
|
args: [
|
|
34
|
-
{ in: "body", key: "walletAddress" },
|
|
35
34
|
{ in: "body", key: "name" },
|
|
36
35
|
{ in: "body", key: "email" },
|
|
37
36
|
{ in: "body", key: "externalID" },
|
|
@@ -93,7 +92,6 @@ export class Customer extends HeyApiClient {
|
|
|
93
92
|
{
|
|
94
93
|
args: [
|
|
95
94
|
{ in: "path", key: "id" },
|
|
96
|
-
{ in: "body", key: "walletAddress" },
|
|
97
95
|
{ in: "body", key: "name" },
|
|
98
96
|
{ in: "body", key: "email" },
|
|
99
97
|
{ in: "body", key: "externalID" },
|
|
@@ -111,6 +109,26 @@ export class Customer extends HeyApiClient {
|
|
|
111
109
|
},
|
|
112
110
|
});
|
|
113
111
|
}
|
|
112
|
+
/**
|
|
113
|
+
* Check customer product payment
|
|
114
|
+
*
|
|
115
|
+
* Check if a customer has paid for a specific product
|
|
116
|
+
*/
|
|
117
|
+
check(parameters, options) {
|
|
118
|
+
const params = buildClientParams([parameters], [
|
|
119
|
+
{
|
|
120
|
+
args: [
|
|
121
|
+
{ in: "path", key: "customerID" },
|
|
122
|
+
{ in: "path", key: "productID" },
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
]);
|
|
126
|
+
return (options?.client ?? this.client).get({
|
|
127
|
+
url: "/customer/{customerID}/products/{productID}/payment-status",
|
|
128
|
+
...options,
|
|
129
|
+
...params,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
114
132
|
}
|
|
115
133
|
export class Product extends HeyApiClient {
|
|
116
134
|
/**
|
|
@@ -124,9 +142,8 @@ export class Product extends HeyApiClient {
|
|
|
124
142
|
args: [
|
|
125
143
|
{ in: "body", key: "walletID" },
|
|
126
144
|
{ in: "body", key: "payoutWalletID" },
|
|
127
|
-
{ in: "body", key: "
|
|
128
|
-
{ in: "body", key: "
|
|
129
|
-
{ in: "body", key: "price" },
|
|
145
|
+
{ in: "body", key: "assetType" },
|
|
146
|
+
{ in: "body", key: "pricing" },
|
|
130
147
|
],
|
|
131
148
|
},
|
|
132
149
|
]);
|
|
@@ -185,8 +202,9 @@ export class Product extends HeyApiClient {
|
|
|
185
202
|
{
|
|
186
203
|
args: [
|
|
187
204
|
{ in: "path", key: "id" },
|
|
188
|
-
{ in: "body", key: "
|
|
205
|
+
{ in: "body", key: "pricing" },
|
|
189
206
|
{ in: "body", key: "paused" },
|
|
207
|
+
{ in: "body", key: "supply" },
|
|
190
208
|
],
|
|
191
209
|
},
|
|
192
210
|
]);
|
|
@@ -206,12 +224,20 @@ export class Session extends HeyApiClient {
|
|
|
206
224
|
/**
|
|
207
225
|
* Create checkout session
|
|
208
226
|
*
|
|
209
|
-
* Generate a checkout session URL for a
|
|
227
|
+
* Generate a checkout session URL for one or more products. Customer is optional - if not provided, a customer will be created from the buyer's wallet address at payment time.
|
|
210
228
|
*
|
|
211
229
|
* ```ts
|
|
212
230
|
* const session = await client.checkout.session.create({
|
|
213
|
-
*
|
|
214
|
-
*
|
|
231
|
+
* items: [
|
|
232
|
+
* { product: "prd_01ABC123", qty: 1 },
|
|
233
|
+
* { product: "prd_01DEF456", qty: 2 },
|
|
234
|
+
* ],
|
|
235
|
+
* customer: "cus_01DEF456", // optional
|
|
236
|
+
* theme: {
|
|
237
|
+
* primary: { light: "#7c3aed", dark: "#a78bfa" },
|
|
238
|
+
* background: { light: "#ffffff", dark: "#0b1220" },
|
|
239
|
+
* radius: "lg",
|
|
240
|
+
* }
|
|
215
241
|
* });
|
|
216
242
|
* console.log(session.url);
|
|
217
243
|
* ```
|
|
@@ -220,8 +246,9 @@ export class Session extends HeyApiClient {
|
|
|
220
246
|
const params = buildClientParams([parameters], [
|
|
221
247
|
{
|
|
222
248
|
args: [
|
|
223
|
-
{ in: "body", key: "
|
|
249
|
+
{ in: "body", key: "items" },
|
|
224
250
|
{ in: "body", key: "customer" },
|
|
251
|
+
{ in: "body", key: "theme" },
|
|
225
252
|
],
|
|
226
253
|
},
|
|
227
254
|
]);
|
|
@@ -13,7 +13,6 @@ export type NotFoundError = {
|
|
|
13
13
|
};
|
|
14
14
|
export type CustomerCreateData = {
|
|
15
15
|
body?: {
|
|
16
|
-
walletAddress: unknown;
|
|
17
16
|
name?: string | null;
|
|
18
17
|
email?: string | null;
|
|
19
18
|
externalID?: string | null;
|
|
@@ -39,7 +38,6 @@ export type CustomerCreateResponses = {
|
|
|
39
38
|
timeCreated: unknown;
|
|
40
39
|
timeUpdated: unknown;
|
|
41
40
|
timeDeleted: unknown | null;
|
|
42
|
-
walletAddress: unknown;
|
|
43
41
|
email: string | null;
|
|
44
42
|
name: string | null;
|
|
45
43
|
externalID: string | null;
|
|
@@ -62,7 +60,6 @@ export type CustomerListResponses = {
|
|
|
62
60
|
timeCreated: unknown;
|
|
63
61
|
timeUpdated: unknown;
|
|
64
62
|
timeDeleted: unknown | null;
|
|
65
|
-
walletAddress: unknown;
|
|
66
63
|
email: string | null;
|
|
67
64
|
name: string | null;
|
|
68
65
|
externalID: string | null;
|
|
@@ -124,7 +121,6 @@ export type CustomerGetResponses = {
|
|
|
124
121
|
timeCreated: unknown;
|
|
125
122
|
timeUpdated: unknown;
|
|
126
123
|
timeDeleted: unknown | null;
|
|
127
|
-
walletAddress: unknown;
|
|
128
124
|
email: string | null;
|
|
129
125
|
name: string | null;
|
|
130
126
|
externalID: string | null;
|
|
@@ -133,7 +129,6 @@ export type CustomerGetResponses = {
|
|
|
133
129
|
export type CustomerGetResponse = CustomerGetResponses[keyof CustomerGetResponses];
|
|
134
130
|
export type CustomerUpdateData = {
|
|
135
131
|
body?: {
|
|
136
|
-
walletAddress?: unknown;
|
|
137
132
|
name?: string | null;
|
|
138
133
|
email?: string | null;
|
|
139
134
|
externalID?: string | null;
|
|
@@ -165,20 +160,48 @@ export type CustomerUpdateResponses = {
|
|
|
165
160
|
timeCreated: unknown;
|
|
166
161
|
timeUpdated: unknown;
|
|
167
162
|
timeDeleted: unknown | null;
|
|
168
|
-
walletAddress: unknown;
|
|
169
163
|
email: string | null;
|
|
170
164
|
name: string | null;
|
|
171
165
|
externalID: string | null;
|
|
172
166
|
};
|
|
173
167
|
};
|
|
174
168
|
export type CustomerUpdateResponse = CustomerUpdateResponses[keyof CustomerUpdateResponses];
|
|
169
|
+
export type CustomerCheckData = {
|
|
170
|
+
body?: never;
|
|
171
|
+
path: {
|
|
172
|
+
customerID: string;
|
|
173
|
+
productID: string;
|
|
174
|
+
};
|
|
175
|
+
query?: never;
|
|
176
|
+
url: "/customer/{customerID}/products/{productID}/payment-status";
|
|
177
|
+
};
|
|
178
|
+
export type CustomerCheckErrors = {
|
|
179
|
+
/**
|
|
180
|
+
* Bad request
|
|
181
|
+
*/
|
|
182
|
+
400: BadRequestError;
|
|
183
|
+
};
|
|
184
|
+
export type CustomerCheckError = CustomerCheckErrors[keyof CustomerCheckErrors];
|
|
185
|
+
export type CustomerCheckResponses = {
|
|
186
|
+
/**
|
|
187
|
+
* Payment status
|
|
188
|
+
*/
|
|
189
|
+
200: {
|
|
190
|
+
allowed: boolean;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
export type CustomerCheckResponse = CustomerCheckResponses[keyof CustomerCheckResponses];
|
|
175
194
|
export type ProductCreateData = {
|
|
176
195
|
body?: {
|
|
177
196
|
walletID: string;
|
|
178
197
|
payoutWalletID: string;
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
198
|
+
/**
|
|
199
|
+
* CAIP-19 asset type (e.g. eip155:1/erc20:0x6b17...)
|
|
200
|
+
*/
|
|
201
|
+
assetType: string;
|
|
202
|
+
pricing: string | number | boolean | null | Array<unknown> | {
|
|
203
|
+
[key: string]: unknown;
|
|
204
|
+
};
|
|
182
205
|
};
|
|
183
206
|
path?: never;
|
|
184
207
|
query?: never;
|
|
@@ -203,12 +226,19 @@ export type ProductCreateResponses = {
|
|
|
203
226
|
timeDeleted: unknown | null;
|
|
204
227
|
walletID: string;
|
|
205
228
|
payoutWalletID: string;
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
229
|
+
/**
|
|
230
|
+
* CAIP-19 asset type (e.g. eip155:1/erc20:0x6b17...)
|
|
231
|
+
*/
|
|
232
|
+
assetType: string;
|
|
233
|
+
pricing: string | number | boolean | null | Array<unknown> | {
|
|
234
|
+
[key: string]: unknown;
|
|
235
|
+
};
|
|
236
|
+
supply: number | null;
|
|
237
|
+
sold: number;
|
|
209
238
|
paused: boolean;
|
|
210
239
|
name: string;
|
|
211
240
|
description: string | null;
|
|
241
|
+
tokens: Array<string> | null;
|
|
212
242
|
};
|
|
213
243
|
};
|
|
214
244
|
export type ProductCreateResponse = ProductCreateResponses[keyof ProductCreateResponses];
|
|
@@ -230,12 +260,19 @@ export type ProductListResponses = {
|
|
|
230
260
|
timeDeleted: unknown | null;
|
|
231
261
|
walletID: string;
|
|
232
262
|
payoutWalletID: string;
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
263
|
+
/**
|
|
264
|
+
* CAIP-19 asset type (e.g. eip155:1/erc20:0x6b17...)
|
|
265
|
+
*/
|
|
266
|
+
assetType: string;
|
|
267
|
+
pricing: string | number | boolean | null | Array<unknown> | {
|
|
268
|
+
[key: string]: unknown;
|
|
269
|
+
};
|
|
270
|
+
supply: number | null;
|
|
271
|
+
sold: number;
|
|
236
272
|
paused: boolean;
|
|
237
273
|
name: string;
|
|
238
274
|
description: string | null;
|
|
275
|
+
tokens: Array<string> | null;
|
|
239
276
|
}>;
|
|
240
277
|
};
|
|
241
278
|
export type ProductListResponse = ProductListResponses[keyof ProductListResponses];
|
|
@@ -296,19 +333,29 @@ export type ProductGetResponses = {
|
|
|
296
333
|
timeDeleted: unknown | null;
|
|
297
334
|
walletID: string;
|
|
298
335
|
payoutWalletID: string;
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
336
|
+
/**
|
|
337
|
+
* CAIP-19 asset type (e.g. eip155:1/erc20:0x6b17...)
|
|
338
|
+
*/
|
|
339
|
+
assetType: string;
|
|
340
|
+
pricing: string | number | boolean | null | Array<unknown> | {
|
|
341
|
+
[key: string]: unknown;
|
|
342
|
+
};
|
|
343
|
+
supply: number | null;
|
|
344
|
+
sold: number;
|
|
302
345
|
paused: boolean;
|
|
303
346
|
name: string;
|
|
304
347
|
description: string | null;
|
|
348
|
+
tokens: Array<string> | null;
|
|
305
349
|
};
|
|
306
350
|
};
|
|
307
351
|
export type ProductGetResponse = ProductGetResponses[keyof ProductGetResponses];
|
|
308
352
|
export type ProductUpdateData = {
|
|
309
353
|
body?: {
|
|
310
|
-
|
|
354
|
+
pricing?: string | number | boolean | null | Array<unknown> | {
|
|
355
|
+
[key: string]: unknown;
|
|
356
|
+
};
|
|
311
357
|
paused?: boolean;
|
|
358
|
+
supply?: number | null;
|
|
312
359
|
};
|
|
313
360
|
path: {
|
|
314
361
|
id: string;
|
|
@@ -339,19 +386,55 @@ export type ProductUpdateResponses = {
|
|
|
339
386
|
timeDeleted: unknown | null;
|
|
340
387
|
walletID: string;
|
|
341
388
|
payoutWalletID: string;
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
389
|
+
/**
|
|
390
|
+
* CAIP-19 asset type (e.g. eip155:1/erc20:0x6b17...)
|
|
391
|
+
*/
|
|
392
|
+
assetType: string;
|
|
393
|
+
pricing: string | number | boolean | null | Array<unknown> | {
|
|
394
|
+
[key: string]: unknown;
|
|
395
|
+
};
|
|
396
|
+
supply: number | null;
|
|
397
|
+
sold: number;
|
|
345
398
|
paused: boolean;
|
|
346
399
|
name: string;
|
|
347
400
|
description: string | null;
|
|
401
|
+
tokens: Array<string> | null;
|
|
348
402
|
};
|
|
349
403
|
};
|
|
350
404
|
export type ProductUpdateResponse = ProductUpdateResponses[keyof ProductUpdateResponses];
|
|
351
405
|
export type CheckoutSessionCreateData = {
|
|
352
406
|
body?: {
|
|
353
|
-
|
|
354
|
-
|
|
407
|
+
items: Array<{
|
|
408
|
+
product: string;
|
|
409
|
+
mode?: "required" | "optional" | "pick";
|
|
410
|
+
quantity?: number;
|
|
411
|
+
default?: boolean;
|
|
412
|
+
editable?: boolean;
|
|
413
|
+
max?: number | null;
|
|
414
|
+
group?: string | null;
|
|
415
|
+
}>;
|
|
416
|
+
customer?: string | null;
|
|
417
|
+
theme?: {
|
|
418
|
+
primary?: string | {
|
|
419
|
+
light: string;
|
|
420
|
+
dark: string;
|
|
421
|
+
};
|
|
422
|
+
background?: string | {
|
|
423
|
+
light: string;
|
|
424
|
+
dark: string;
|
|
425
|
+
};
|
|
426
|
+
radius?: "none" | "sm" | "md" | "lg" | "full";
|
|
427
|
+
font?: {
|
|
428
|
+
family?: string;
|
|
429
|
+
scale?: string;
|
|
430
|
+
};
|
|
431
|
+
logo?: string | {
|
|
432
|
+
light: string;
|
|
433
|
+
dark: string;
|
|
434
|
+
};
|
|
435
|
+
favicon?: string;
|
|
436
|
+
css?: string;
|
|
437
|
+
} | null;
|
|
355
438
|
};
|
|
356
439
|
path?: never;
|
|
357
440
|
query?: never;
|