Add defaults for networkId and pagination

This commit is contained in:
fragosti 2018-08-13 18:46:54 -07:00
parent 3b0fa1aa87
commit dd7e03c7d7
4 changed files with 10 additions and 7 deletions

View File

@ -33,7 +33,7 @@
},
"homepage": "https://github.com/0xProject/0x-monorepo/packages/sra-api/README.md",
"dependencies": {
"@0xproject/json-schemas": "1.0.1-rc.3"
"@0xproject/json-schemas": "^1.0.1-rc.3"
},
"devDependencies": {
"@0xproject/tslint-config": "^1.0.4",

File diff suppressed because one or more lines are too long

View File

@ -7,6 +7,7 @@ export const paginationParameters: ParameterObject[] = [
example: 3,
schema: {
type: 'number',
default: 1,
},
},
{
@ -16,6 +17,7 @@ export const paginationParameters: ParameterObject[] = [
example: 10,
schema: {
type: 'number',
default: 100,
},
},
];
@ -27,10 +29,11 @@ export const networkdIdParameter: ParameterObject = {
example: 42,
schema: {
type: 'number',
default: 1,
},
};
export const generateParameters = (parameters: ParameterObject[], isPaginated: boolean = false): ParameterObject[] => {
const optionalParameters = isPaginated ? paginationParameters : [];
return [networkdIdParameter, ...optionalParameters, ...parameters];
return [...parameters, networkdIdParameter, ...optionalParameters];
};

View File

@ -5275,9 +5275,9 @@ ethereumjs-wallet@0.6.0:
utf8 "^2.1.1"
uuid "^2.0.1"
ethers@0xproject/ethers.js#eip-838-reasons, ethers@3.0.22:
version "3.0.18"
resolved "https://codeload.github.com/0xproject/ethers.js/tar.gz/b91342bd200d142af0165d6befddf783c8ae8447"
ethers@3.0.22:
version "3.0.22"
resolved "https://registry.npmjs.org/ethers/-/ethers-3.0.22.tgz#7fab1ea16521705837aa43c15831877b2716b436"
dependencies:
aes-js "3.0.0"
bn.js "^4.4.0"
@ -6028,7 +6028,7 @@ ganache-core@0xProject/ganache-core#monorepo-dep:
ethereumjs-tx "0xProject/ethereumjs-tx#fake-tx-include-signature-by-default"
ethereumjs-util "^5.2.0"
ethereumjs-vm "2.3.5"
ethereumjs-wallet "0.6.0"
ethereumjs-wallet "~0.6.0"
fake-merkle-patricia-tree "~1.0.1"
heap "~0.2.6"
js-scrypt "^0.2.0"