Created
April 5, 2019 15:23
-
-
Save martinlowinski/ee735ff75d8dbfa77688a015e8eaef82 to your computer and use it in GitHub Desktop.
Patch for interledgerjs/moneyd-uplink-eth
This file contains 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
diff --git a/index.js b/index.js | |
index 9680bfe..167ff5b 100644 | |
--- a/index.js | |
+++ b/index.js | |
@@ -1,8 +1,14 @@ | |
'use strict' | |
+const { | |
+ AssetUnit, | |
+ convert, | |
+ eth, | |
+ gwei, | |
+ wei | |
+} = require('@kava-labs/crypto-rate-utils') | |
const { randomBytes, createHmac } = require('crypto') | |
const inquirer = require('inquirer') | |
-const { convert, Unit } = require('ilp-plugin-ethereum/build/account') | |
const connectorList = require('./connector_list.json') | |
const parentBtpHmacKey = 'parent_btp_uri' | |
@@ -38,7 +44,7 @@ async function configure ({ testnet, advanced }) { | |
// For now, use HTTP-RPC; Websocket provider has too many issues | |
const ethereumProvider = testnet | |
- ? 'https://kovan.infura.io/bXIbx0x6ofEuDANTSeKI' | |
+ ? 'kovan' | |
: 'https://mainnet.infura.io/bXIbx0x6ofEuDANTSeKI' | |
// Create btp server uri for upstream | |
@@ -57,14 +63,14 @@ async function configure ({ testnet, advanced }) { | |
ethereumPrivateKey: res.privateKey, | |
ethereumProvider, | |
// Open channels for ~$2 by default | |
- outgoingChannelAmount: convert('0.01', Unit.Eth, Unit.Gwei), | |
+ outgoingChannelAmount: convert(gwei(10000000), eth()), | |
balance: { | |
// Fulfill up to ~$1 without receiving money | |
- maximum: convert('0.01', Unit.Eth, Unit.Gwei), | |
+ maximum: convert(gwei(10000000), eth()), | |
// Stay prefunded by ~40¢ | |
- settleTo: convert('0.004', Unit.Eth, Unit.Gwei), | |
+ settleTo: convert(gwei(4000000), eth()), | |
// Settle up on every packet | |
- settleThreshold: convert('0.004', Unit.Eth, Unit.Gwei) | |
+ settleThreshold: convert(gwei(4000000), eth()) | |
}, | |
server: btpServer | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment