aboutsummaryrefslogtreecommitdiffstats
path: root/packages/testnet-faucets
diff options
context:
space:
mode:
Diffstat (limited to 'packages/testnet-faucets')
-rw-r--r--packages/testnet-faucets/package.json12
-rw-r--r--packages/testnet-faucets/scripts/postpublish.js15
-rw-r--r--packages/testnet-faucets/src/ts/handler.ts18
3 files changed, 15 insertions, 30 deletions
diff --git a/packages/testnet-faucets/package.json b/packages/testnet-faucets/package.json
index 75b780d93..b1190bac7 100644
--- a/packages/testnet-faucets/package.json
+++ b/packages/testnet-faucets/package.json
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@0xproject/testnet-faucets",
- "version": "1.0.11",
+ "version": "1.0.13",
"description": "A faucet micro-service that dispenses test ERC20 tokens or Ether",
"main": "server.js",
"scripts": {
@@ -15,9 +15,9 @@
"author": "Fabio Berger",
"license": "Apache-2.0",
"dependencies": {
- "0x.js": "^0.32.1",
- "@0xproject/subproviders": "^0.4.0",
- "@0xproject/utils": "^0.3.1",
+ "0x.js": "^0.32.3",
+ "@0xproject/subproviders": "^0.4.2",
+ "@0xproject/utils": "^0.3.3",
"body-parser": "^1.17.1",
"ethereumjs-tx": "^1.3.3",
"ethereumjs-util": "^5.1.1",
@@ -28,7 +28,7 @@
"web3-provider-engine": "^13.0.1"
},
"devDependencies": {
- "@0xproject/tslint-config": "^0.4.7",
+ "@0xproject/tslint-config": "^0.4.9",
"@types/body-parser": "^1.16.1",
"@types/express": "^4.0.35",
"@types/lodash": "^4.14.86",
@@ -41,7 +41,7 @@
"types-bn": "^0.0.1",
"types-ethereumjs-util": "0xProject/types-ethereumjs-util",
"typescript": "2.7.1",
- "web3-typescript-typings": "^0.9.9",
+ "web3-typescript-typings": "^0.9.10",
"webpack": "^3.1.0",
"webpack-node-externals": "^1.6.0"
}
diff --git a/packages/testnet-faucets/scripts/postpublish.js b/packages/testnet-faucets/scripts/postpublish.js
deleted file mode 100644
index 16d67e03f..000000000
--- a/packages/testnet-faucets/scripts/postpublish.js
+++ /dev/null
@@ -1,15 +0,0 @@
-const postpublish_utils = require('../../../scripts/postpublish_utils');
-const packageJSON = require('../package.json');
-
-const subPackageName = packageJSON.name;
-
-postpublish_utils
- .getLatestTagAndVersionAsync(subPackageName)
- .then(function(result) {
- const releaseName = postpublish_utils.getReleaseName(subPackageName, result.version);
- const assets = [];
- return postpublish_utils.publishReleaseNotes(result.tag, releaseName, assets);
- })
- .catch(function(err) {
- throw err;
- });
diff --git a/packages/testnet-faucets/src/ts/handler.ts b/packages/testnet-faucets/src/ts/handler.ts
index 5ed9ce628..5f6ada186 100644
--- a/packages/testnet-faucets/src/ts/handler.ts
+++ b/packages/testnet-faucets/src/ts/handler.ts
@@ -129,18 +129,18 @@ export class Handler {
}
const zeroEx = networkConfig.zeroEx;
res.setHeader('Content-Type', 'application/json');
- const makerTokenAddress = await zeroEx.tokenRegistry.getTokenAddressBySymbolIfExistsAsync(requestedAssetType);
- if (_.isUndefined(makerTokenAddress)) {
+ const makerToken = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(requestedAssetType);
+ if (_.isUndefined(makerToken)) {
throw new Error(`Unsupported asset type: ${requestedAssetType}`);
}
const takerTokenSymbol =
requestedAssetType === RequestedAssetType.WETH ? RequestedAssetType.ZRX : RequestedAssetType.WETH;
- const takerTokenAddress = await zeroEx.tokenRegistry.getTokenAddressBySymbolIfExistsAsync(takerTokenSymbol);
- if (_.isUndefined(takerTokenAddress)) {
+ const takerToken = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(takerTokenSymbol);
+ if (_.isUndefined(takerToken)) {
throw new Error(`Unsupported asset type: ${requestedAssetType}`);
}
- const makerTokenAmount = new BigNumber(0.1);
- const takerTokenAmount = new BigNumber(0.1);
+ const makerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(0.1), makerToken.decimals);
+ const takerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(0.1), takerToken.decimals);
const order: Order = {
maker: configs.DISPENSER_ADDRESS,
taker: req.params.recipient,
@@ -148,8 +148,8 @@ export class Handler {
takerFee: new BigNumber(0),
makerTokenAmount,
takerTokenAmount,
- makerTokenAddress,
- takerTokenAddress,
+ makerTokenAddress: makerToken.address,
+ takerTokenAddress: takerToken.address,
salt: ZeroEx.generatePseudoRandomSalt(),
exchangeContractAddress: zeroEx.exchange.getContractAddress(),
feeRecipient: ZeroEx.NULL_ADDRESS,
@@ -159,7 +159,7 @@ export class Handler {
const signature = await zeroEx.signOrderHashAsync(orderHash, configs.DISPENSER_ADDRESS, false);
const signedOrder = {
...order,
- signature,
+ ecSignature: signature,
};
const signedOrderHash = ZeroEx.getOrderHashHex(signedOrder);
const payload = JSON.stringify(signedOrder);