requestnetworkartifacts
Advanced tools
Comparing version 1.3.1 to 1.4.0
@@ -5,8 +5,8 @@ { | ||
"last-requestethereum": "RequestEthereum/RequestEthereum-0.0.5-test.json", | ||
"last-requesterc20-0x345ca3e014aaf5dca488057592ee47305d9b3e10": "RequestERC20/RequestERC20-0.2.2-test.json", | ||
"last-requestbitcoinnodesvalidation": "RequestBitcoinNodesValidation/RequestBitcoinNodesValidation-0.2.1-test.json", | ||
"last-requesterc20-0x345ca3e014aaf5dca488057592ee47305d9b3e10": "RequestERC20/RequestERC20-0.2.2-test-test.json", | ||
"0x8cdaf0cd259887258bc13a92c0a6da92698644c0": "RequestCore/RequestCore-0.0.5-test.json", | ||
"0xf12b5dd4ead5f743c6baa640b0216200e89b60da": "RequestEthereum/RequestEthereum-0.0.5-test.json", | ||
"0xf25186b5081ff5ce73482ad761db0eb0d25abfbf": "RequestERC20/RequestERC20-0.2.2-test.json", | ||
"0xf25186b5081ff5ce73482ad761db0eb0d25abfbf": "RequestERC20/RequestERC20-0.2.2-test-test.json", | ||
"0x8f0483125fcb9aaaefa9209d8e9d7b9c8b9fb90f": "RequestBitcoinNodesValidation/RequestBitcoinNodesValidation-0.2.1-test.json" | ||
@@ -28,2 +28,3 @@ }, | ||
"last-requestethereum": "RequestEthereum/RequestEthereum-0.0.5-prod.json", | ||
"last-requestbitcoinnodesvalidation": "RequestBitcoinNodesValidation/RequestBitcoinNodesValidation-0.2.1-prod.json", | ||
"last-requesterc20-0x8f8221afbb33998d8584a2b05749ba73c37a938a": "RequestERC20/RequestERC20-0.2.2-req-main.json", | ||
@@ -34,3 +35,2 @@ "last-requesterc20-0xdd974d5c2e2928dea5f71b9825b8b646686bd200": "RequestERC20/RequestERC20-0.2.2-knc-main.json", | ||
"last-requesterc20-0xd26114cd6ee289accf82350c8d8487fedb8a0c07": "RequestERC20/RequestERC20-0.2.2-omg-main.json", | ||
"last-requestbitcoinnodesvalidation": "RequestBitcoinNodesValidation/RequestBitcoinNodesValidation-0.2.1-prod.json", | ||
@@ -37,0 +37,0 @@ "0xdb600fda54568a35b78565b5257125bebc51eb27": "RequestCore/RequestCore-0.0.5-prod.json", |
19
index.js
@@ -22,3 +22,3 @@ const artifacts = require('./artifacts.json'); | ||
// Temporary hack that should be properly fixed. Needs some refactor to remove the default export | ||
// Returns the contract name of an address | ||
// Returns the contract name of an address, like 'RequestEthereum','RequestBitcoinNodesValidation','RequestERC20-req','RequestERC20-knc' | ||
exports.default.getContractNameForAddress = function(contractAddress) { | ||
@@ -28,4 +28,17 @@ const artifactPath = Object.keys(artifacts).reduce( | ||
'' | ||
); | ||
return artifactPath && artifactPath.split('/')[0]; | ||
); | ||
if (!artifactPath) { | ||
return null; | ||
} | ||
let contractName = artifactPath.split('/')[0]; | ||
// Handle ERC20 | ||
if (contractName === 'RequestERC20') { | ||
const dashSections = artifactPath.split('.json')[0].split('-'); | ||
const erc20currencyName = dashSections[dashSections.length-2]; | ||
contractName = `${contractName}-${erc20currencyName}`; | ||
} | ||
return contractName; | ||
} |
{ | ||
"name": "requestnetworkartifacts", | ||
"version": "1.3.1", | ||
"version": "1.4.0", | ||
"description": "Artifacts for Request Network Ethereum contracts", | ||
@@ -5,0 +5,0 @@ "homepage": "https://github.com/RequestNetwork/requestNetwork/tree/master/packages/requestNetworkArtifacts", |
# Request_Artifacts | ||
Artifacts for Request Network Ethereum contracts |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
@@ -0,0 +0,0 @@ { |
Sorry, the diff of this file is not supported yet
9060
306304