aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/LoadingSplash.svelte
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2023-12-01 19:52:37 -0800
committerAdam Soltys <[email protected]>2023-12-01 19:52:37 -0800
commitf0351d072288d603b1a469014d498aaaa5a0911c (patch)
tree3a68b17a62e03668a8fce5844dcb265d5d25aa7e /src/components/LoadingSplash.svelte
parented4d4eee2b81d5e516f2fdb001f29f22280b29b6 (diff)
downloadcoinos-ui-f0351d072288d603b1a469014d498aaaa5a0911c.tar.gz
coinos-ui-f0351d072288d603b1a469014d498aaaa5a0911c.zip
use bun adapter
Diffstat (limited to 'src/components/LoadingSplash.svelte')
0 files changed, 0 insertions, 0 deletions
href='#n137'>137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243
export const up = function(knex) {
  return knex.schema.createTable('transfers', function(t) {
      t.increments('id').unsigned().primary();

      t.int('transaction_id').notNull();
      t.foreign('transaction_id').references('accounts.id');

      t.int('debit_id').notNull();
      t.foreign('debit_id').references('debits.id');

      t.int('credit_id').notNull();
      t.foreign('credit_id').references('credits.id');

      // t.int('liquid_asset_id').notNull();
      // t.foreign('liquid_asset_id').references('liquid_assets.id');
  
      // t.double('amount');
      t.double('transfer_fee').notNull().defaultTo(0)

      t.enu('status', ['pending', 'completed', 'reversed', 'cancelled'])

      t.timestamps();
  })
};

export const down = function(knex) {
return knex.schema.dropTable('transfers');
};

// 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);