feat: add batch_id to cash_in_txs

feat: bitcoind sendmany request
feat: check if wallet supports transaction batching
This commit is contained in:
Sérgio Salgado 2021-05-21 16:21:54 +01:00
parent 24ed69244c
commit c8adaabf85
3 changed files with 43 additions and 0 deletions

View file

@ -0,0 +1,22 @@
var db = require('./db')
exports.up = function (next) {
var sql = [
`CREATE TYPE transaction_batch_status AS ENUM('open', 'failed', 'sent')`,
`CREATE TABLE transaction_batches (
id UUID PRIMARY KEY,
crypto_code TEXT NOT NULL,
status transaction_batch_status NOT NULL DEFAULT 'open',
created_at TIMESTAMPTZ NOT NULL DEFAULT now(),
closed_at TIMESTAMPTZ,
error_message TEXT
)`,
`ALTER TABLE cash_in_txs ADD COLUMN batch_id REFERENCES transaction_batches(id)`
]
db.multi(sql, next)
}
exports.down = function (next) {
next()
}