This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 0x14d06788090769F669427B6AEA1c0240d2321f34 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function validProof(bytes proof, bytes32 root, bytes32 hash) constant returns (bool) { | |
| bytes32 el; | |
| for (uint256 i = 32; i <= proof.length; i += 32) { | |
| assembly { | |
| el := mload(add(proof, i)) | |
| } | |
| if (hash < el) { | |
| hash = sha3(hash, el); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.18; | |
| /* | |
| Copyright 2016, Jordi Baylina | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation, either version 3 of the License, or | |
| (at your option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pragma solidity ^0.4.18; | |
| /* | |
| Copyright 2016, Jordi Baylina | |
| This program is free software: you can redistribute it and/or modify | |
| it under the terms of the GNU General Public License as published by | |
| the Free Software Foundation, either version 3 of the License, or | |
| (at your option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const token = 'ZRX' | |
| efx.contract.approve(token) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const token = 'ZRX' | |
| const amount = 15 // Number of tokens to lock | |
| const forTime = 48 // Time after which unlocking does not require permission | |
| const response = await efx.contract.lock(token, amount, forTime) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const BFX = require('bitfinex-api-node') | |
| const { Order } = require('./node_modules/bitfinex-api-node/lib/models') | |
| const bfx = new BFX({ | |
| apiKey: '', | |
| apiSecret: '', | |
| ws: { | |
| autoReconnect: true, | |
| seqAudit: false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const EFX = require('efx-api-node') | |
| const web3 = new EFX.Web3(/*your web3 provider*/) | |
| const efx = await EFX( web3 ) | |
| const exchangeConf = await efx.getConfig() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const symbol = 'ZRXETH' | |
| const amount = -15 | |
| const price = 0.0025 | |
| const orderId = await efx.submitOrder(symbol, amount, price) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Get all open orders | |
| const openOrders = await efx.getOrders() | |
| // Get all historical orders | |
| const historicalOrders = await efx.getOrderHist() |
OlderNewer