-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf631a9
commit 5b1d0a1
Showing
1,651 changed files
with
227,829 additions
and
87,005 deletions.
There are no files selected for viewing
124 changes: 124 additions & 0 deletions
124
example-outputs/binance-with-zod/api/v3/account/getCommission.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './getCommission'; |
93 changes: 93 additions & 0 deletions
93
example-outputs/binance-with-zod/api/v3/deleteOpenOrders.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
); | ||
} |
Oops, something went wrong.