Skip to content

Commit

Permalink
Merge pull request #1938 from ExchangeUnion/feat/connext-vector
Browse files Browse the repository at this point in the history
feat: add connext vector support
  • Loading branch information
Karl Ranna authored Dec 7, 2020
2 parents ef003fc + d850f7e commit 2df5867
Show file tree
Hide file tree
Showing 37 changed files with 1,581 additions and 1,266 deletions.
3 changes: 3 additions & 0 deletions docs/api.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions lib/Xud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,19 +245,7 @@ class Xud extends EventEmitter {
// minimum channelBalance threshold
minChannelAmount: 100000000,
},
{
currency: 'USDT',
channelAmount: 100000000000,
minChannelAmount: 100000000,
},
{
currency: 'DAI',
channelAmount: 150000000000,
minChannelAmount: 100000000,
},
],
// we check the channel and on-chain balance every 10 seconds
// and refund from faucet if below the walletAmount
retryInterval: 10000,
}).subscribe({
next: (currency) => {
Expand Down
2 changes: 1 addition & 1 deletion lib/cli/commands/closechannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const builder = (argv: Argv) => argv
.example('$0 closechannel BTC CheeseMonkey', 'close BTC channels by alias')
.example('$0 closechannel BTC CheeseMonkey --force', 'force close BTC channels by alias')
.example('$0 closechannel BTC CheeseMonkey --fee 25', 'close BTC channels by alias with 25 sat/byte fee')
.example('$0 closechannel ETH --amount 0.1', 'remove 0.1 ETH from a Connext channel');
.example('$0 closechannel ETH --amount 0.1 --destination 0x7d3447e35c73903C971761AF3DBa76cDB1Cd07e2', 'remove 0.1 ETH from a Connext channel');

export const handler = async (argv: Arguments<any>) => {
const request = new CloseChannelRequest();
Expand Down
28 changes: 28 additions & 0 deletions lib/cli/commands/deposit.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { Arguments, Argv } from 'yargs';
import { DepositRequest, DepositResponse } from '../../proto/xudrpc_pb';
import { callback, loadXudClient } from '../command';

export const command = 'deposit <currency>';

export const describe = 'gets an address to deposit funds to a channel';

export const builder = (argv: Argv) => argv
.positional('currency', {
description: 'the ticker symbol of the currency to deposit.',
type: 'string',
})
.example('$0 deposit ETH', 'get a ETH deposit address');

const openChannelText = (depositAddressResponse: DepositResponse.AsObject) => {
console.log(`
You will receive your deposit in the connext channel.
Your deposit address is: ${depositAddressResponse.address}
`);
};

export const handler = async (argv: Arguments<any>) => {
const request = new DepositRequest();
request.setCurrency(argv.currency.toUpperCase());
(await loadXudClient(argv)).deposit(request, callback(argv, openChannelText));
};
Loading

0 comments on commit 2df5867

Please sign in to comment.