Skip to content

Commit

Permalink
refresh outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
inkognitro committed Oct 9, 2024
1 parent bf631a9 commit 5b1d0a1
Show file tree
Hide file tree
Showing 1,651 changed files with 227,829 additions and 87,005 deletions.
124 changes: 124 additions & 0 deletions example-outputs/binance-with-zod/api/v3/account/getCommission.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
import {z_Error, Error} from '@example-outputs/binance-with-zod';
import {z} from 'zod';
import {
RequestUnion,
ResponseBodyData,
ResponseUnion,
RequestResult,
SimpleRequestHandler,
createRequest,
RequestHandlerExecutionConfig,
RequestPayload,
} from '@example-outputs/binance-with-zod/core';

export const getCommissionEndpointSchema = {
path: '/api/v3/account/commission',
method: 'get',
supportedSecuritySchemas: [{name: 'ApiKeyAuth', scopes: []}],
queryParamsZodSchema: z.object({
symbol: z.string(),
timestamp: z.number().int().safe().finite(),
signature: z.string(),
}),
bodyByContentType: {},
responseByStatus: {
'200': {
bodyByContentType: {
'application/json': {
zodSchema: z.object({
symbol: z.string(),
standardCommission: z.object({
maker: z.string(),
taker: z.string(),
buyer: z.string(),
seller: z.string(),
}),
taxCommission: z.object({
maker: z.string(),
taker: z.string(),
buyer: z.string(),
seller: z.string(),
}),
discount: z.object({
enabledForAccount: z.boolean().optional(),
enabledForSymbol: z.boolean().optional(),
discountAsset: z.string().optional(),
discount: z.string().optional(),
}),
}),
},
},
},
'400': {
bodyByContentType: {
'application/json': {
zodSchema: z_Error,
},
},
},
'401': {
bodyByContentType: {
'application/json': {
zodSchema: z_Error,
},
},
},
},
};

export type GetCommissionRequest = RequestUnion<
any,
any,
{
symbol: string;
timestamp: number; // int
signature: string;
}
>;

export type GetCommissionResponse =
| ResponseUnion<
200,
ResponseBodyData<
'application/json',
{
symbol: string;
standardCommission: {
maker: string;
taker: string;
buyer: string;
seller: string;
};
taxCommission: {
maker: string;
taker: string;
buyer: string;
seller: string;
};
discount: {
enabledForAccount?: boolean;
enabledForSymbol?: boolean;
discountAsset?: string;
discount?: string;
};
}
>
>
| ResponseUnion<400, ResponseBodyData<'application/json', Error>>
| ResponseUnion<401, ResponseBodyData<'application/json', Error>>;

export type GetCommissionRequestResult = RequestResult<
GetCommissionRequest,
GetCommissionResponse
>;

export function getCommission(
requestHandler: SimpleRequestHandler,
payload: RequestPayload<GetCommissionRequest, 'queryParams', never>,
config?: RequestHandlerExecutionConfig
): Promise<GetCommissionRequestResult> {
return requestHandler.execute(
createRequest(getCommissionEndpointSchema, payload),
config
);
}
1 change: 1 addition & 0 deletions example-outputs/binance-with-zod/api/v3/account/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './getCommission';
93 changes: 93 additions & 0 deletions example-outputs/binance-with-zod/api/v3/deleteOpenOrders.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
import {
z_Order,
z_OcoOrder,
z_Error,
Order,
OcoOrder,
Error,
} from '@example-outputs/binance-with-zod';
import {z} from 'zod';
import {
RequestUnion,
ResponseBodyData,
ResponseUnion,
RequestResult,
SimpleRequestHandler,
createRequest,
RequestHandlerExecutionConfig,
RequestPayload,
} from '@example-outputs/binance-with-zod/core';

export const deleteOpenOrdersEndpointSchema = {
path: '/api/v3/openOrders',
method: 'delete',
supportedSecuritySchemas: [{name: 'ApiKeyAuth', scopes: []}],
queryParamsZodSchema: z.object({
symbol: z.string(),
recvWindow: z.number().int().safe().finite().optional(),
timestamp: z.number().int().safe().finite(),
signature: z.string(),
}),
bodyByContentType: {},
responseByStatus: {
'200': {
bodyByContentType: {
'application/json': {
zodSchema: z.array(z.union([z_Order, z_OcoOrder])),
},
},
},
'400': {
bodyByContentType: {
'application/json': {
zodSchema: z_Error,
},
},
},
'401': {
bodyByContentType: {
'application/json': {
zodSchema: z_Error,
},
},
},
},
};

export type DeleteOpenOrdersRequest = RequestUnion<
any,
any,
{
symbol: string;
recvWindow?: number; // int
timestamp: number; // int
signature: string;
}
>;

export type DeleteOpenOrdersResponse =
| ResponseUnion<
200,
ResponseBodyData<
'application/json',
((Order | OcoOrder) & (Partial<Order> & Partial<OcoOrder>))[]
>
>
| ResponseUnion<400, ResponseBodyData<'application/json', Error>>
| ResponseUnion<401, ResponseBodyData<'application/json', Error>>;

export type DeleteOpenOrdersRequestResult = RequestResult<
DeleteOpenOrdersRequest,
DeleteOpenOrdersResponse
>;

export function deleteOpenOrders(
requestHandler: SimpleRequestHandler,
payload: RequestPayload<DeleteOpenOrdersRequest, 'queryParams', never>,
config?: RequestHandlerExecutionConfig
): Promise<DeleteOpenOrdersRequestResult> {
return requestHandler.execute(
createRequest(deleteOpenOrdersEndpointSchema, payload),
config
);
}
95 changes: 95 additions & 0 deletions example-outputs/binance-with-zod/api/v3/deleteOrder.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import {
z_Order,
z_Error,
Order,
Error,
} from '@example-outputs/binance-with-zod';
import {z} from 'zod';
import {
RequestUnion,
ResponseBodyData,
ResponseUnion,
RequestResult,
SimpleRequestHandler,
createRequest,
RequestHandlerExecutionConfig,
RequestPayload,
} from '@example-outputs/binance-with-zod/core';

export const deleteOrderEndpointSchema = {
path: '/api/v3/order',
method: 'delete',
supportedSecuritySchemas: [{name: 'ApiKeyAuth', scopes: []}],
queryParamsZodSchema: z.object({
symbol: z.string(),
orderId: z.number().int().safe().finite().optional(),
origClientOrderId: z.string().optional(),
newClientOrderId: z.string().optional(),
cancelRestrictions: z
.enum(['ONLY_NEW', 'ONLY_PARTIALLY_FILLED'])
.optional(),
recvWindow: z.number().int().safe().finite().optional(),
timestamp: z.number().int().safe().finite(),
signature: z.string(),
}),
bodyByContentType: {},
responseByStatus: {
'200': {
bodyByContentType: {
'application/json': {
zodSchema: z_Order,
},
},
},
'400': {
bodyByContentType: {
'application/json': {
zodSchema: z_Error,
},
},
},
'401': {
bodyByContentType: {
'application/json': {
zodSchema: z_Error,
},
},
},
},
};

export type DeleteOrderRequest = RequestUnion<
any,
any,
{
symbol: string;
orderId?: number; // int
origClientOrderId?: string;
newClientOrderId?: string;
cancelRestrictions?: 'ONLY_NEW' | 'ONLY_PARTIALLY_FILLED';
recvWindow?: number; // int
timestamp: number; // int
signature: string;
}
>;

export type DeleteOrderResponse =
| ResponseUnion<200, ResponseBodyData<'application/json', Order>>
| ResponseUnion<400, ResponseBodyData<'application/json', Error>>
| ResponseUnion<401, ResponseBodyData<'application/json', Error>>;

export type DeleteOrderRequestResult = RequestResult<
DeleteOrderRequest,
DeleteOrderResponse
>;

export function deleteOrder(
requestHandler: SimpleRequestHandler,
payload: RequestPayload<DeleteOrderRequest, 'queryParams', never>,
config?: RequestHandlerExecutionConfig
): Promise<DeleteOrderRequestResult> {
return requestHandler.execute(
createRequest(deleteOrderEndpointSchema, payload),
config
);
}
Loading

0 comments on commit 5b1d0a1

Please sign in to comment.