Update types and add missing param to SRA spec

This commit is contained in:
fragosti 2018-08-14 17:16:03 -07:00
parent 5c40c466f6
commit 80e5127a46
4 changed files with 31 additions and 19 deletions

View File

@ -53,7 +53,7 @@
"dependencies": { "dependencies": {
"@0xproject/assert": "^0.2.14", "@0xproject/assert": "^0.2.14",
"@0xproject/json-schemas": "^1.0.1-rc.4", "@0xproject/json-schemas": "^1.0.1-rc.4",
"@0xproject/types": "^0.8.2", "@0xproject/types": "^1.0.1-rc.4",
"@0xproject/typescript-typings": "^1.0.4", "@0xproject/typescript-typings": "^1.0.4",
"@0xproject/utils": "^1.0.5", "@0xproject/utils": "^1.0.5",
"lodash": "^4.17.5", "lodash": "^4.17.5",

View File

@ -94,14 +94,18 @@ export interface Asset {
} }
export interface OrdersRequestOpts { export interface OrdersRequestOpts {
makerAssetProxyId?: string;
takerAssetProxyId?: string;
makerAssetAddress?: string;
takerAssetAddress?: string;
exchangeAddress?: string; exchangeAddress?: string;
tokenAddress?: string; senderAddress?: string;
makerTokenAddress?: string; makerAssetData?: string;
takerTokenAddress?: string; takerAssetData?: string;
maker?: string; makerAddress?: string;
taker?: string; takerAddress?: string;
trader?: string; traderAddress?: string;
feeRecipient?: string; feeRecipientAddress?: string;
} }
export interface OrderbookRequest { export interface OrderbookRequest {
@ -122,21 +126,21 @@ export interface PaginatedCollection<T> {
} }
export interface OrderConfigRequest { export interface OrderConfigRequest {
makerAddress: string;
takerAddress: string;
makerAssetAmount: string;
takerAssetAmount: string;
makerAssetData: string;
takerAssetData: string;
exchangeAddress: string; exchangeAddress: string;
maker: string; expirationTimeSeconds: string;
taker: string;
makerTokenAddress: string;
takerTokenAddress: string;
makerAssetAmount: BigNumber;
takerAssetAmount: BigNumber;
expirationTimeSeconds: BigNumber;
salt: BigNumber;
} }
export interface OrderConfigResponse { export interface OrderConfigResponse {
feeRecipient: string;
makerFee: BigNumber; makerFee: BigNumber;
takerFee: BigNumber; takerFee: BigNumber;
feeRecipientAddress: string;
senderAddress: string;
} }
export interface PagedRequestOpts { export interface PagedRequestOpts {

View File

@ -14,11 +14,10 @@ export const assert = {
sharedAssert.doesConformToSchema( sharedAssert.doesConformToSchema(
variableName, variableName,
subscriptionOpts, subscriptionOpts,
schemas.relayerApiOrderbookChannelSubscribePayload, schemas.relayerApiOrdersChannelSubscribePayload,
); );
}, },
isOrderbookChannelHandler(variableName: string, handler: any): void { isOrderbookChannelHandler(variableName: string, handler: any): void {
sharedAssert.isFunction(`${variableName}.onSnapshot`, _.get(handler, 'onSnapshot'));
sharedAssert.isFunction(`${variableName}.onUpdate`, _.get(handler, 'onUpdate')); sharedAssert.isFunction(`${variableName}.onUpdate`, _.get(handler, 'onUpdate'));
sharedAssert.isFunction(`${variableName}.onError`, _.get(handler, 'onError')); sharedAssert.isFunction(`${variableName}.onError`, _.get(handler, 'onError'));
sharedAssert.isFunction(`${variableName}.onClose`, _.get(handler, 'onClose')); sharedAssert.isFunction(`${variableName}.onClose`, _.get(handler, 'onClose'));

View File

@ -150,6 +150,15 @@ export const api: OpenApiSpec = {
$ref: '#/components/schemas/addressSchema', $ref: '#/components/schemas/addressSchema',
}, },
}, },
{
name: 'takerAddress',
in: 'query',
description: `Same as takerAddress in the [0x Protocol v2 Specification](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#order-message-format)`,
example: '0xe41d2489571d322189246dafa5ebde1f4699f498',
schema: {
$ref: '#/components/schemas/addressSchema',
},
},
{ {
name: 'traderAddress', name: 'traderAddress',
in: 'query', in: 'query',