Skip to content

Commit

Permalink
feat(connext): add v2 vector support
Browse files Browse the repository at this point in the history
  • Loading branch information
Karl Ranna committed Nov 26, 2020
1 parent 5e3fc00 commit 6c9a12a
Show file tree
Hide file tree
Showing 42 changed files with 1,210 additions and 1,134 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.

1 change: 1 addition & 0 deletions lib/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ class Config {
port: 5040,
webhookhost: 'localhost',
webhookport: 8887,
nodeIdentifier: '',
};
}

Expand Down
14 changes: 1 addition & 13 deletions lib/Xud.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import InitService from './service/InitService';
import Service from './service/Service';
import SwapClientManager from './swaps/SwapClientManager';
import Swaps from './swaps/Swaps';
import { createSimnetChannels } from './utils/simnet-connext-channels';
import { UnitConverter } from './utils/UnitConverter';
import { createSimnetChannels } from './utils/simnet-connext-channels';

const version: string = require('../package.json').version;

Expand Down Expand Up @@ -244,19 +244,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 6c9a12a

Please sign in to comment.