# This document describes the types of transactions and accounts that can occur in CoinOS ## Receive bitcoin There are four ways a user can receive bitcoin - Bitcoin - Liquid - Lightning - Internal In every case, a payment record is added to the `payments` table The payment `type` will be one of BTC, LBTC, LNBTC, or COINOS The `amount` will be a positive integer representing the number of satoshis received In the case of Bitcoin and Liquid payments, the `confirmed` column will be set to `false` initially until the transaction is mined into a block on the blockchain. Also, the payment amount will be reflected in users' active account record in the `accounts` table under the `pending` column. The `balance` column will be updated when confirmations are received and the `pending` amount will be debited. ## Send bitcoin Users can also send bitcoin over any of the four networks by pasting in or scanning a QR code of a bitcoin or liquid address, lightning invoice, or username. In the case of lightning, it's also possible to paste an [LNURL](https://github.com/fiatjaf/lnurl-rfc) which is a way of getting a lightning invoice from a remote server or other wallet over HTTP. If scanning or pasting an address or invoice that happens to belong to another coinos user, coinos will detect that and automatically change the payment type to an internal COINOS transfer as if you had typed in the recipient's username. ## Creating Liquid Assets Users can issue new assets on the Liquid network at https://coinos.io/asset This will create an on-chain transaction that will issue a specified amount of new tokens. A new account record will be created in the `accounts` table for the user to track their balance of the new asset. As with receiving bitcoin over the Liquid network, the balance will be `pending` until one block confirmation has been received and then it will be updated. A separate payment record will be created to cover the fee for the issuance transaction, which is paid in L-BTC. ## Receiving Liquid Assets If the user has not received a particular asset before, a new account will be generated for them at the time the payment is detected. ## Sending Liquid Assets Users can choose from a drop down menu to pick which account they want to be the active one. In the case of Liquid assets, they will only be able to an internal transfer to another coinos user, or send to a Liquid address. Users will receive an error if they paste in an LN invoice or on-chain BTC address while they have a Liquid asset accounted selected as their active account. ## Depositing Fiat After having their account verified, users can fill out the deposit form at https://coinos.io/funding to indicate that they intend to send an interac or wire transfer. If the user is added to the list of accounts enabled for auto-deposit (under the `imap` config in config/index.js) then coinos will parse the Interac email it receives and automatically generate a new payment record and update the users Bitcoin account balance to credit them with an amount of bitcoin calculated equivalent to the fiat amount received, based on the current exchange rate less 2%. ## Withdrawing Fiat Fiat withdrawals are currently processed manually. When a user requests to withdraw, we manually calculate how much bitcoin to remove from their account and do that with a database query before sending them an interac or wire transfer. eUpdate'>stats
path: root/lib/devrates.js
blob: 817db79d3bb78bd6b53c2550d4e88b25f6f8ef39 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
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
module.exports = {
  AED: 3.673197203659543,
  AFN: 76.6256149863538,
  ALL: 110.8416522346242,
  AMD: 478.2176049761077,
  ANG: 1.6440976724364613,
  AOA: 495.7980659551896,
  ARS: 60.16250872722986,
  AUD: 1.488616065356751,
  AWG: 1.8,
  AZN: 1.6962307434239756,
  BAM: 1.773328678810739,
  BBD: 2.0179975881110193,
  BDT: 84.84807728925439,
  BGN: 1.7733658545431463,
  BHD: 0.37701451667014246,
  BIF: 1882.026875334355,
  BMD: 1,
  BND: 1.3617924143371387,
  BOB: 6.910922411526291,
  BRL: 4.243896379446354,
  BSD: 0.9994332967620843,
  BTC: 0.00010608684613780408,
  BTN: 71.33797455729143,
  BWP: 10.86375819452882,
  BYN: 2.1386963105352397,
  BYR: 19600.003905265352,
  BZD: 2.014552939149673,
  CAD: 1.3204203577937563,
  CDF: 1685.0003536228205,
  CHF: 0.9699348064595101,
  CLF: 0.028905492034419285,
  CLP: 797.5984676344447,
  CNY: 6.936699701687416,
  COP: 3415.0006800438855,
  CRC: 565.1944327073908,
  CUC: 1,
  CUP: 26.500005440351085,
  CVE: 99.97282272615992,
  CZK: 22.890403220687844,
  DJF: 177.71966414899308,
  DKK: 6.775711552585527,
  DOP: 53.16095188009466,
  DZD: 120.05533381087527,
  EGP: 15.806803159030528,
  ERN: 15.000079791815898,
  ETB: 31.792392575734223,
  EUR: 0.9067251806649922,
  FJD: 2.190200114247373,
  FKP: 0.7634417474407681,
  GBP: 0.7633973179069156,
  GEL: 2.8950320527351363,
  GGP: 0.7634417474407681,
  GHS: 5.506778677450651,
  GIP: 0.7634417474407681,
  GMD: 51.09502026530779,
  GNF: 9521.397871009276,
  GTQ: 7.660548387389266,
  GYD: 208.25970150607054,
  HKD: 7.769651001477962,
  HNL: 24.612961636457605,
  HRK: 6.748502543364132,
  HTG: 99.227949803694,
  HUF: 305.64013800357253,
  IDR: 13667.802722895718,
  ILS: 3.451430358972499,
  IMP: 0.7634417474407681,
  INR: 71.46499950130115,
  IQD: 1193.147438048002,
  IRR: 42105.008235784815,
  ISK: 123.38744004279744,
  JEP: 0.7634417474407681,
  JMD: 139.41456744675256,
  JOD: 0.708966605311596,
  JPY: 109.06551724137931,
  KES: 100.60072265996898,
  KGS: 69.85026612384053,
  KHR: 4089.819789277068,
  KMF: 446.5001795315858,
  KPW: 900.0134594285818,
  KRW: 1186.498037846709,
  KWD: 0.30397598991721597,
  KYD: 0.8328842021271773,
  KZT: 379.16800529527507,
  LAK: 8877.657789222665,
  LBP: 1511.1774996146419,
  LKR: 181.3996862730875,
  LRD: 195.25017907822317,
  LSL: 14.779750106540206,
  LTL: 2.95274057685856,
  LVL: 0.6048899688993263,
  LYD: 1.4029060542040312,
  MAD: 9.626910696636957,
  MDL: 17.477868651790327,
  MGA: 3684.7089348699296,
  MKD: 55.9018714807729,
  MMK: 1463.177394434521,
  MNT: 2748.7517513396865,
  MOP: 7.997262596679572,
  MRO: 356.9999410628633,
  MUR: 36.903554362708206,
  MVR: 15.4603733894294,
  MWK: 736.1130459618994,
  MXN: 18.75570103457343,
  MYR: 4.086504302410982,
  MZN: 63.850077525002945,
  NAD: 14.780262406267283,
  NGN: 361.5008196795633,
  NIO: 33.71733567872913,
  NOK: 9.173537225602292,
  NPR: 114.14688222546629,
  NZD: 1.5415452410528891,
  OMR: 0.3850118327636077,
  PAB: 0.999442364013891,
  PEN: 3.344138475069591,
  PGK: 3.4082131166864635,
  PHP: 50.85751085803403,
  PKR: 154.4431709993018,
  PLN: 3.892450606145783,
  PYG: 6525.286300289245,
  QAR: 3.6409975790437676,
  RON: 4.3302030157679505,
  RSD: 106.58501999329023,
  RUB: 63.17741166229928,
  RWF: 949.3656895191637,
  SAR: 3.75192180402042,
  SBD: 8.247527813794916,
  SCR: 13.70055763598611,
  SDG: 45.2856737421455,
  SEK: 9.638936592708117,
  SGD: 1.3617198763226854,
  SHP: 0.7634417474407681,
  SLL: 9715.00196215329,
  SOS: 585.0003091932866,
  SRD: 7.458006836707863,
  STD: 21560.79429579189,
  SVC: 8.74500893124303,
  SYP: 514.9989228104854,
  SZL: 14.688762048110842,
  THB: 31.129969080671337,
  TJS: 9.689288855440804,
  TMT: 3.5100002720175545,
  TND: 2.822251035933519,
  TOP: 2.3116505118463646,
  TRY: 5.979699329930091,
  TTD: 6.752923735345054,
  TWD: 30.212996092014468,
  TZS: 2310.202055545985,
  UAH: 24.83074886432671,
  UGX: 3677.8646377179543,
  USD: 1,
  UYU: 37.3734148177029,
  UZS: 9534.72592599309,
  VEF: 7330111621.478939,
  VND: 23171.26161650965,
  VUV: 117.62686717382827,
  WST: 2.6770380915248397,
  XAF: 594.7539682827532,
  XAG: 0.0560981802025624,
  XAU: 0.0006365210768268246,
  XCD: 2.7025506179332104,
  XDR: 0.7268916554081624,
  XOF: 594.7431882270803,
  XPF: 108.13165196260665,
  YER: 250.35016729079578,
  ZAR: 14.75420131112461,
  ZMK: 9001.213295311323,
  ZMW: 14.841628659769507,
  ZWL: 322.000065284213,
  VES: 73301.11621478939,
  KVES: 73.30111621478939,
}