Skip to content

Commit

Permalink
Version 2.0.44
Browse files Browse the repository at this point in the history
  • Loading branch information
kipliklotrika committed Dec 17, 2018
2 parents 511bb31 + 87d8f89 commit b6dc37e
Show file tree
Hide file tree
Showing 44 changed files with 1,222 additions and 1,362 deletions.
12 changes: 6 additions & 6 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@
"blockchain": {
"blockchain_title": "Ethereum",
"network_id": "rinkeby",
"gas_limit": "1500000",
"gas_limit": "2000000",
"gas_price": "20000000000",
"hub_contract_address": "0xa13635b8D91BCdEC59067eE2Da7A17292578bB08",
"hub_contract_address": "0x056f4DA796C00766061158A01cE068D912be9c89",
"rpc_node_host": "https://rinkeby.infura.io/1WRiEqAQ9l4SW6fGdiDt",
"rpc_node_port": "",
"plugins": [
Expand Down Expand Up @@ -153,7 +153,7 @@
"blockchain": {
"blockchain_title": "Ethereum",
"network_id": "rinkeby",
"gas_limit": "1500000",
"gas_limit": "2000000",
"gas_price": "20000000000",
"hub_contract_address": "0x0A0253150F35D9a766e450D6F749fFFD2B21eEC6",
"rpc_node_host": "https://rinkeby.infura.io/1WRiEqAQ9l4SW6fGdiDt",
Expand Down Expand Up @@ -253,7 +253,7 @@
"blockchain": {
"blockchain_title": "Ethereum",
"network_id": "rinkeby",
"gas_limit": "1500000",
"gas_limit": "2000000",
"gas_price": "20000000000",
"hub_contract_address": "0x6C314872A7e97A6F1dC7De2dc43D28500dd36f22",
"rpc_node_host": "https://rinkeby.infura.io/1WRiEqAQ9l4SW6fGdiDt",
Expand Down Expand Up @@ -353,7 +353,7 @@
"blockchain": {
"blockchain_title": "Ethereum",
"network_id": "rinkeby",
"gas_limit": "1500000",
"gas_limit": "2000000",
"gas_price": "20000000000",
"hub_contract_address": "0xE2726Bc7c82d45601eF68DB9EED92af18D0C4E0f",
"rpc_node_host": "https://rinkeby.infura.io/1WRiEqAQ9l4SW6fGdiDt",
Expand Down Expand Up @@ -456,7 +456,7 @@
"blockchain": {
"blockchain_title": "Ethereum",
"network_id": "mainnet",
"gas_limit": "1500000",
"gas_limit": "2000000",
"gas_price": "20000000000",
"hub_contract_address": "0xa287d7134fb40bef071c932286bd2cd01efccf30",
"rpc_node_host": "https://mainnet.infura.io/7c072f60df864d22884e705c5bf3d83f",
Expand Down
79 changes: 63 additions & 16 deletions modules/Blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,22 @@ class Blockchain {

/**
* Creates node profile on the Bidding contract
* @param managementWallet - Management wallet
* @param profileNodeId - Network node ID
* @param initialBalance - Initial profile balance
* @param isSender725 - Is sender ERC 725?
* @param blockchainIdentity - ERC 725 identity (empty if there is none)
* @return {Promise<any>}
*/
createProfile(profileNodeId, initialBalance, isSender725, blockchainIdentity) {
createProfile(
managementWallet,
profileNodeId,
initialBalance,
isSender725,
blockchainIdentity,
) {
return this.blockchain.createProfile(
managementWallet,
profileNodeId, initialBalance, isSender725,
blockchainIdentity,
);
Expand Down Expand Up @@ -204,13 +212,13 @@ class Blockchain {
}

/**
* Subscribe to a particular event
* @param event
* @param importId
* @param endMs
* @param endCallback
* @param filterFn
*/
* Subscribe to a particular event
* @param event
* @param importId
* @param endMs
* @param endCallback
* @param filterFn
*/
subscribeToEvent(event, importId, endMs = 5 * 60 * 1000, endCallback, filterFn) {
return this.blockchain
.subscribeToEvent(event, importId, endMs, endCallback, filterFn);
Expand Down Expand Up @@ -282,10 +290,10 @@ class Blockchain {
}

/**
* Gets status of the offer
* @param importId
* @return {Promise<any>}
*/
* Gets status of the offer
* @param importId
* @return {Promise<any>}
*/
getOfferStatus(importId) {
return this.blockchain.getOfferStatus(importId);
}
Expand Down Expand Up @@ -345,6 +353,7 @@ class Blockchain {
async confirmPurchase(importId, dhWallet) {
return this.blockchain.confirmPurchase(importId, dhWallet);
}

async cancelPurchase(importId, correspondentWallet, senderIsDh) {
return this.blockchain.cancelPurchase(importId, correspondentWallet, senderIsDh);
}
Expand Down Expand Up @@ -421,17 +430,55 @@ class Blockchain {
return this.blockchain.nodeHasApproval(nodeId);
}

async hasEnoughFunds() {
return this.blockchain.hasEnoughFunds();
}

/**
* Token contract address getter
* @return {any|*}
*/
getTokenContractAddress() {
return this.blockchain.getTokenContractAddress();
}

/**
* Returns purposes of the wallet.
* @param {string} - erc725Identity
* @param {string} - wallet
* @return {Promise<[]>}
*/
getWalletPurposes(erc725Identity, wallet) {
return this.blockchain.getWalletPurposes(erc725Identity, wallet);
}

/**
* Transfers identity to new address.
* @param {string} - erc725identity
* @param {string} - managementWallet
*/
transferProfile(erc725identity, managementWallet) {
return this.blockchain.transferProfile(erc725identity, managementWallet);
}

/**
* Returns true if ERC725 contract is older version.
* @param {string} - address of ERC 725 identity.
* @return {Promise<boolean>}
*/
async isErc725IdentityOld(address) {
return this.blockchain.isErc725IdentityOld(address);
}

/**
* PayOut for multiple offers.
* @returns {Promise<any>}
*/
payOutMultiple(
blockchainIdentity,
offerIds,
) {
return this.blockchain.payOutMultiple(
blockchainIdentity,
offerIds,
);
}
}

module.exports = Blockchain;
Loading

0 comments on commit b6dc37e

Please sign in to comment.