1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22<?xml version="1.0" encoding="utf-8"?>
<!-- Uploaded to: SVG Repo, www.svgrepo.com, Generator: SVG Repo Mixer Tools -->
<svg fill="#000000" width="800px" height="800px" viewBox="0 0 32 32" version="1.1" xmlns="http://www.w3.org/2000/svg">
<title>perspective-dice-random</title>
<path d="M15.676 17.312h0.048c-0.114-0.273-0.263-0.539-0.436-0.78l-11.114-6.346c-0.37 0.13-0.607 0.519-0.607 1.109v9.84c0 1.034 0.726 2.291 1.621 2.808l9.168 5.294c0.544 0.314 1.026 0.282 1.32-0.023v-11.902h-0zM10.049 24.234l-1.83-1.057v-1.918l1.83 1.057v1.918zM11.605 19.993c-0.132 0.2-0.357 0.369-0.674 0.505l-0.324 0.12c-0.23 0.090-0.38 0.183-0.451 0.278-0.071 0.092-0.106 0.219-0.106 0.38v0.242l-1.83-1.056v-0.264c0-0.294 0.056-0.523 0.167-0.685 0.111-0.165 0.346-0.321 0.705-0.466l0.324-0.125c0.193-0.076 0.333-0.171 0.421-0.285 0.091-0.113 0.137-0.251 0.137-0.417 0-0.251-0.081-0.494-0.243-0.728-0.162-0.237-0.389-0.44-0.679-0.608-0.274-0.158-0.569-0.268-0.887-0.329-0.318-0.065-0.649-0.078-0.994-0.040v-1.691c0.409 0.085 0.782 0.19 1.12 0.313s0.664 0.276 0.978 0.457c0.825 0.476 1.453 1.019 1.886 1.627 0.433 0.605 0.649 1.251 0.649 1.937 0 0.352-0.066 0.63-0.198 0.834zM27.111 8.247l-9.531-5.514c-0.895-0.518-2.346-0.518-3.241 0l-9.531 5.514c-0.763 0.442-0.875 1.117-0.336 1.628l10.578 6.040c0.583 0.146 1.25 0.145 1.832-0.003l10.589-6.060c0.512-0.508 0.392-1.17-0.36-1.605zM16.305 10.417l-0.23-0.129c-0.257-0.144-0.421-0.307-0.492-0.488-0.074-0.183-0.062-0.474 0.037-0.874l0.095-0.359c0.055-0.214 0.061-0.389 0.016-0.525-0.041-0.139-0.133-0.248-0.277-0.329-0.219-0.123-0.482-0.167-0.788-0.133-0.309 0.033-0.628 0.141-0.958 0.326-0.31 0.174-0.592 0.391-0.846 0.653-0.257 0.26-0.477 0.557-0.661 0.892l-1.476-0.827c0.332-0.333 0.658-0.625 0.978-0.875s0.659-0.474 1.015-0.674c0.934-0.524 1.803-0.835 2.607-0.934 0.8-0export const up = function(knex) {
return knex.schema.createTable('debits', function(t) {
t.increments('id').unsigned().primary();
t.enu('type', ['withdrawal', 'order', 'transfer', 'invoice', 'exchange'])
t.int('account_id').notNull();
t.foreign('account_id').references('accounts.id');
t.double('amount');
t.enu('type', ['withdrawal', 'transfer', 'order', 'invoice'])
t.enu('status', ['pending', 'completed', 'reversed', 'cancelled'])
t.timestamps();
})
};
export const down = function(knex) {
return knex.schema.dropTable('debits');
};
// Changes:
//
// Should these be tracked as transactions ?
// SAT -> SAT
// tracking various exchange variations (outside of external networks ?)
//
// Is user / account / amount info redundant ?
// + transaction_type: deposit / withdrawal / transfer / exchange ?
//
// add transfers table ? (for internal transfers only ?)
// add redemptions table ? (for bitcoin transfers only ?)
// add exchanges table ? (for conversion from one currency to another)
//
// network -> scope: internal / bitcoin / liquid / lightning ?
// add bitcoin_transaction ? (with redemption attributes)
// add liquid_transaction ? ()
// add lightning_transaction ? (with LN_invoice_hash)
// add internal_transaction ? ()
//
// context for path, memo, rate, preimage, address, received, fee, tip, confirmed, redeemcode ?
import { DataTypes } from '@sequelize/core';
const attributes = {
id: {
type: DataTypes.INTEGER(11),
allowNull: false,
defaultValue: null,
primaryKey: true,
autoIncrement: true,
comment: null,
field: "id"
},
account_id: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "account_id"
},
user_id: {
type: DataTypes.INTEGER(11),
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "user_id"
},
path: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "path"
},
memo: {
type: DataTypes.TEXT,
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "memo"
},
hash: {
type: DataTypes.TEXT,
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "hash"
},
createdAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "createdAt"
},
updatedAt: {
type: DataTypes.DATE,
allowNull: false,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "updatedAt"
},
rate: {
type: DataTypes.DOUBLE,
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "rate"
},
preimage: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "preimage"
},
network: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "network"
},
currency: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "currency"
},
address: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "address"
},
received: {
type: DataTypes.INTEGER(1),
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "received"
},
amount: {
type: DataTypes.DOUBLE,
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "amount"
},
fee: {
type: DataTypes.DOUBLE,
allowNull: false,
defaultValue: 0,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "fee"
},
tip: {
type: DataTypes.DOUBLE,
allowNull: false,
defaultValue: 0,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "tip"
},
redeemed: {
type: DataTypes.BOOLEAN,
allowNull: false,
defaultValue: false,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "redeemed"
},
redeemcode: {
type: DataTypes.STRING(255),
allowNull: true,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "redeemcode"
},
confirmed: {
type: DataTypes.INTEGER(1),
allowNull: false,
defaultValue: null,
primaryKey: false,
autoIncrement: false,
comment: null,
field: "confirmed"
}
};
const options = {
tableName: "payments",
comment: "",
indexes: []
};
db["Payment"] = db.define("payments_model", attributes, options);
|