add ignore rebalances below flag

Signed-off-by: Nitesh Balusu <niteshbalusu@icloud.com>
This commit is contained in:
Nitesh Balusu 2022-12-27 11:41:40 -05:00 committed by Alex Bosworth
parent 8bba006f50
commit 7ea656c635
No known key found for this signature in database
GPG key ID: E80D2F3F311FD87E
4 changed files with 8 additions and 0 deletions

2
bos
View file

@ -1895,6 +1895,7 @@ prog
.option('--budget <amount>', 'Spending amount to allow', INT, Number())
.option('--connect <connect_code>', 'Connection code from /connect')
.option('--ignore-forwards-below <amount>', 'Ignore forwards of value', INT)
.option('--ignore-rebalances-below <amount>', 'Ignore rebalances of value', INT)
.option('--node <node_name>', 'Node to connect to Telegram', REPEATABLE)
.option('--reset-api-key', 'Reset the Telegram API key')
.option('--use-proxy <path>', 'Proxy agent to connect to Telegram')
@ -1915,6 +1916,7 @@ prog
id: options.connect,
is_small_units: options.useSmallUnits || undefined,
min_forward_tokens: options.ignoreForwardsBelow || undefined,
min_rebalance_tokens: options.ignoreRebalancesBelow || undefined,
nodes: flatten([options.node].filter(n => !!n)),
payments: {limit: options.budget},
proxy: options.useProxy || undefined,

View file

@ -28,6 +28,7 @@ const smallUnitsType = 'full';
is_small_units: <Formatting Should Use Small Units Bool>
logger: <Winston Logger Object>
[min_forward_tokens]: <Minimum Forward Tokens Number>
[min_rebalance_tokens]: <Minimum Rebalance Tokens Number>
[nodes]: [<Node Name String>]
payments: {
[limit]: <Total Spendable Budget Tokens Limit Number>
@ -125,6 +126,7 @@ module.exports = (args, cbk) => {
id: Number(args.id),
key: getBot.key,
min_forward_tokens: args.min_forward_tokens,
min_rebalance_tokens: args.min_rebalance_tokens,
logger: args.logger,
nodes: args.nodes,
payments_limit: limit || defaultPaymentsBudget,

View file

@ -24,6 +24,7 @@ const {isArray} = Array;
[id]: <Authorized User Id Number>
key: <Telegram Bot API Key String>
[min_forward_tokens]: <Minimum Forward Tokens To Notify Number>
[min_rebalance_tokens]: <Minimum Rebalance Tokens To Notify Number>
logger: <Winston Logger Object>
nodes: [<Node Name String>]
payments_limit: <Total Spendable Budget Tokens Limit Number>
@ -96,6 +97,7 @@ module.exports = (args, cbk) => {
id: args.id,
key: args.key,
min_forward_tokens: args.min_forward_tokens,
min_rebalance_tokens: args.min_rebalance_tokens,
lnds: getLnds.lnds,
logger: args.logger,
nodes: args.nodes,

View file

@ -76,6 +76,7 @@ const sanitize = n => (n || '').replace(/_/g, '\\_').replace(/[*~`]/g, '');
[id]: <Authorized User Id Number>
key: <Telegram API Key String>
[min_forward_tokens]: <Minimum Forward Tokens To Notify Number>
[min_rebalance_tokens]: <Minimum Rebalance Tokens To Notify Number>
lnds: [<Authenticated LND API Object>]
nodes: [<Saved Nodes String>]
logger: <Winston Logger Object>
@ -750,6 +751,7 @@ module.exports = (args, cbk) => {
},
key: node.public_key,
lnd: node.lnd,
min_rebalance_tokens: args.min_rebalance_tokens,
nodes: getNodes,
quiz: ({answers, correct, question}) => {
return args.bot.api.sendQuiz(