Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor structure #3

Merged
merged 150 commits into from
Aug 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
150 commits
Select commit Hold shift + click to select a range
53721ea
nav
devyin7 Feb 7, 2020
0ea173c
add footer and darapp
devyin7 Feb 8, 2020
6af166b
add valdiate store
devyin7 Feb 8, 2020
390fa16
add new UI create wallet and alert private key
devyin7 Feb 10, 2020
ff535d5
add create from private key form
devyin7 Feb 10, 2020
420bc76
add assets
devyin7 Feb 14, 2020
9b2b732
add mixin and store mosaics , namespace
devyin7 Feb 17, 2020
c808b2f
add wallet date
devyin7 Feb 18, 2020
0654976
add validate form
devyin7 Feb 19, 2020
2925cb8
add valdiate filter mosaic
devyin7 Feb 21, 2020
961b83f
new navbar - delete item
devyin7 Feb 21, 2020
f6c6fb9
nav new list item
devyin7 Feb 21, 2020
94a56ff
add valdiate dt
devyin7 Feb 26, 2020
eaf75fa
add config
devyin7 Mar 2, 2020
ec635e9
add stora db
devyin7 Mar 4, 2020
b7c98ba
add remove data
devyin7 Mar 4, 2020
0b45678
add new validate
devyin7 Mar 9, 2020
3a8529d
add loger
devyin7 Mar 9, 2020
8dfc11c
add store
devyin7 Mar 11, 2020
5f441b8
add filtel comp
devyin7 Mar 12, 2020
1d33c69
new filter type
devyin7 Mar 17, 2020
336db8e
add card new offer
devyin7 Mar 18, 2020
fcc05d4
add commit offer
devyin7 Mar 22, 2020
1359def
add newOffer
devyin7 Mar 27, 2020
cdd4bdd
add config db
devyin7 Mar 29, 2020
f63ce6a
add create table and bata base
devyin7 Mar 29, 2020
aac0648
add
devyin7 Apr 8, 2020
683f9ee
add
devyin7 Apr 8, 2020
8c9f0f5
dd use db
devyin7 Apr 8, 2020
f6e4620
buider
devyin7 Apr 9, 2020
27fb726
add filter
devyin7 Apr 13, 2020
243ab5d
add login
devyin7 Apr 14, 2020
d5ea6ca
add
devyin7 Apr 14, 2020
5c56701
add
devyin7 Apr 15, 2020
fce6c4e
add validate amount
devyin7 Apr 15, 2020
afc7da3
src/views/
devyin7 Apr 15, 2020
7420174
Data
Apr 15, 2020
281914a
Merge branch 'feature/refactoring-ui' of https://github.com/proximax-…
Apr 15, 2020
c241269
add all offers
devyin7 Apr 15, 2020
64d0326
GRaphics
Apr 15, 2020
ce1f90b
Merge branch 'feature/refactoring-ui' of https://github.com/proximax-…
Apr 15, 2020
7bd0fc7
Offers
Apr 15, 2020
0ec7768
Type search
Apr 15, 2020
42b49d0
add validate
devyin7 Apr 16, 2020
27b6b84
Type search
Apr 16, 2020
546da59
FIX BUGS
Apr 16, 2020
09c7490
add valdiate
devyin7 Apr 16, 2020
3d933a4
revolver conflict
devyin7 Apr 16, 2020
f596568
add
devyin7 Apr 16, 2020
3d77cad
add console
devyin7 Apr 16, 2020
f05e618
add validate new info wallet
devyin7 Apr 20, 2020
4e935a6
ade validatte
devyin7 Apr 21, 2020
3a6aa5f
Change structure project
Apr 21, 2020
947fcf2
Change structure project
Apr 21, 2020
63aa247
add UI remove offers
devyin7 Apr 21, 2020
f5cb2da
create account
Apr 22, 2020
6d73b45
Merge pull request #2 from proximax-storage/feature/refactoring-ui
joicodev Apr 22, 2020
7fd539e
Fix bugs
Apr 22, 2020
b63b07d
Fix bugs
Apr 22, 2020
a526206
buscar mosaicos
devyin7 Apr 22, 2020
e8ca451
Merge branch 'refactor-structure' of https://github.com/proximax-stor…
devyin7 Apr 22, 2020
38f3037
Fix bugs
Apr 22, 2020
fe51e07
Changes
Apr 22, 2020
e84eb61
Fix bugs
Apr 22, 2020
71822a2
fix bugs
Apr 22, 2020
637b50e
fix bug
Apr 22, 2020
12bac61
fix bug
Apr 22, 2020
6a347f8
agregar nuevo tx exchange
devyin7 Apr 22, 2020
12a331a
Merge branch 'refactor-structure' of https://github.com/proximax-stor…
devyin7 Apr 22, 2020
260754e
Fix bug
Apr 22, 2020
e3740b6
Fix bugs
Apr 22, 2020
6f68e42
Fix bugs
Apr 22, 2020
6b91412
agregado http exchange y propierti
devyin7 Apr 23, 2020
8c87fd9
Merge branch 'refactor-structure' of https://github.com/proximax-stor…
devyin7 Apr 23, 2020
b462ea2
Menu
Apr 23, 2020
eff12af
to active btn
devyin7 Apr 23, 2020
0d4ca0c
Changes
Apr 24, 2020
c71f55d
Changes
Apr 24, 2020
91ac3fc
Monitor hash
Apr 24, 2020
a25dc9d
Execute tx
Apr 24, 2020
eaa6633
unconfirmed added
Apr 24, 2020
06c6e97
Fix bugs
Apr 24, 2020
3103898
Listen to transactions in create new offer
Apr 24, 2020
c81273b
add comment console
devyin7 Apr 24, 2020
f7bbaac
Merge branch 'refactor-structure' of https://github.com/proximax-stor…
devyin7 Apr 24, 2020
a300c67
new change tx
devyin7 Apr 24, 2020
f35bb77
add validate form amount
devyin7 Apr 24, 2020
740141b
Changes
Apr 24, 2020
419a8a1
changes
Apr 24, 2020
48144ef
clear console and new tx
devyin7 Apr 24, 2020
757fb60
Merge branch 'refactor-structure' of https://github.com/proximax-stor…
devyin7 Apr 24, 2020
7a669ae
add
devyin7 Apr 24, 2020
49386a4
add delete offert list
devyin7 Apr 26, 2020
2814935
add delete
devyin7 Apr 26, 2020
8293095
add validate wallet info
devyin7 Apr 28, 2020
cd54546
add export wallet
devyin7 Apr 28, 2020
068ea08
add validatte
devyin7 Apr 29, 2020
e6a7cf1
add validate change ofer
devyin7 Apr 30, 2020
588c122
add validate unic
devyin7 May 1, 2020
a079873
add status nodo
devyin7 May 1, 2020
685d7b2
add validate trunElement
devyin7 May 26, 2020
f5fb97c
add merching
devyin7 Jun 24, 2020
4d63d00
add take ofert
devyin7 Jun 24, 2020
4cabb12
add validare
devyin7 Jun 25, 2020
16def8c
Complete the merching of the offers
devyin7 Jun 25, 2020
2d911f2
add Fix the error of Mosaic as per XPX value
devyin7 Jun 26, 2020
76d10d0
add view merching offert
devyin7 Jul 1, 2020
5f2353c
add validate view
devyin7 Jul 1, 2020
be8d538
add validate expire functions
devyin7 Jul 2, 2020
492f1d9
add validate offer expire
devyin7 Jul 3, 2020
7d100d5
add validate update info and insert info moisac
devyin7 Jul 6, 2020
babdfad
add validate remove
devyin7 Jul 7, 2020
3bdd379
add validate remove offert
devyin7 Jul 7, 2020
1500426
add validate
devyin7 Jul 8, 2020
32c161c
add asset info balance
devyin7 Jul 11, 2020
1727d64
add validate data table
devyin7 Jul 10, 2020
6c62bb5
add
devyin7 Jul 13, 2020
48a56b1
remove console log
devyin7 Jul 13, 2020
bf4fe43
add validate
devyin7 Jul 14, 2020
ff6100d
add list mosaic
devyin7 Jul 15, 2020
50f570d
remove console
devyin7 Jul 15, 2020
b0a30b2
add balance usd
devyin7 Jul 17, 2020
516707f
filter offert for public key
devyin7 Jul 17, 2020
021567e
new router and component add new assets
devyin7 Jul 22, 2020
7d43ef4
add validate hash minitor
devyin7 Jul 22, 2020
b217684
add link to namespace
devyin7 Jul 23, 2020
a9a4b4b
add list namespace
devyin7 Jul 23, 2020
643225f
filter, sord and map of list namespace select
devyin7 Jul 23, 2020
c4e23b0
Integration of "select namespace" component with the component "new …
devyin7 Jul 23, 2020
2594fd1
add validate select
devyin7 Jul 23, 2020
1e16621
add form new asset
devyin7 Jul 23, 2020
1ff3707
add validate name namespace
devyin7 Jul 24, 2020
cdd92d6
add validate mosaic alias
devyin7 Jul 27, 2020
281f779
add link to namespcae 2 level
devyin7 Jul 27, 2020
b9b40d6
add validate
devyin7 Jul 28, 2020
3e5469c
add validate loading
devyin7 Jul 28, 2020
4e3d791
add computer and compoent file
devyin7 Jul 29, 2020
e597dd9
add validate not require file icon
devyin7 Jul 29, 2020
5985fb7
add validate
devyin7 Jul 30, 2020
f762aca
validate
devyin7 Aug 1, 2020
fa8b36d
add GET_ICON_MOSAICS
devyin7 Aug 1, 2020
7e7dd6f
add mosaic basa64 icon
devyin7 Aug 2, 2020
6ba2927
add validate icon get
devyin7 Aug 3, 2020
b481fca
add validate max fee
devyin7 Aug 4, 2020
8337a4c
add validate dex
devyin7 Aug 4, 2020
7237d7d
cal balance and validate
devyin7 Aug 5, 2020
c589900
add validate fee
devyin7 Aug 5, 2020
7560698
add validate nw UI
devyin7 Aug 9, 2020
06fdabf
add validate overline
devyin7 Aug 9, 2020
68af556
UI update
devyin7 Aug 10, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions bridgedb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<p align="center">
<a href="https://www.proximax.io/">
<img src="https://www.proximax.io/user/themes/proximaxvrs1/images/logo.png" alt="Logo" width=280 height=60>
</a>
<h3 align="center">ProximaX Dex bridedb</h3>
</p>
<p>

</p>
<p align="center">
<a href="https://t.me/proximaxhelpdesk">Report bug</a>
</p>
18 changes: 18 additions & 0 deletions bridgedb/lib/blockchain-provider.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
const sdk = require('tsjs-xpx-chain-sdk')

class BlockchainProvider {
constructor (node) {
console.log(node)
}

/**
*
* @param {(string | number[])} id
* @returns {MosaicId}
* @memberof BlockchainProvider
*/
getMosaicId (id) {
return new sdk.MosaicId(id)
}
}
module.exports = BlockchainProvider
83 changes: 83 additions & 0 deletions bridgedb/lib/db.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
const r = require('rethinkdb')
const Log = require('./log')

const DB = {
conn: null,
connStruc: null,
name: 'dexWallet',
host: 'localhost',
port: 32769,
tables: [
{ table: 'executeOffers', options: {} },
{ table: 'mosaicInfo', options: { primaryKey: 'mosaicIdHex' } }
],
// host: '192.168.1.70',
async connect () {
try {
Log.info(' >> Connecting to RethinkDB...')
const host = process.env.db_host || DB.host // 192.168.3.242
const port = process.env.db_port || DB.port //
const db = process.env.db_name || undefined
const user = process.env.db_user || undefined
const password = process.env.db_password || undefined

DB.conn = await r.connect({ host, port, db, user, password })
DB.dbCreateStrusture()
Log.info(' >> RethinkDB connected')
} catch (error) {
console.error(error)
process.exit(-1)
}
},
async close () {
DB.conn
.close({ noreplyWait: true })
.then(function () {
// conn is now closed
Log.info(' >> RethinkDB disconnect!')
})
.error(function (err) {
console.error(err)
// process the error
})
},

async dbCreateStrusture () {
try {
Log.info(' >> Create strusture RethinkDB...')
const bd = process.env.db_user || DB.name
// DB.connStruc = await r.connect({ host, port, db, user, password })
const data = await r.dbCreate(bd).run(DB.conn)
// console.log('data', data)
if (data.config_changes.length > 0) {
Log.info(` >> Created dataBase '${data.config_changes[0]['new_val']['name']}'`)
DB.conn.use(bd)
for (let element of DB.tables) {
await DB.createTable(bd, element.table, element.options, DB.conn)
}
}
} catch (error) {
if (error.msg) {
Log.info(` >> ${error.msg}`)
} else {
console.error(error)
process.exit(-1)
}
}
},
createTable (db, name, options, connect) {
return r
.db(db)
.tableCreate(name, options)
.run(connect)
.then(data => {
if (data.config_changes.length > 0) {
Log.info(` >> Created Table '${data.config_changes[0]['new_val']['name']}'`)
}
})
.catch(error => {
console.log('RETHINKDB: Table', error)
})
}
}
module.exports = DB
38 changes: 38 additions & 0 deletions bridgedb/lib/log.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
const winston = require('winston')
const path = require('path')

const filename = path.join(__dirname, '../log/bridge.log')
const config = {
levels: {
error: 0,
debug: 1,
warn: 2,
data: 3,
info: 4,
verbose: 5,
silly: 6,
custom: 7
},
colors: {
error: 'red',
debug: 'blue',
warn: 'yellow',
data: 'grey',
info: 'green',
verbose: 'cyan',
silly: 'magenta',
custom: 'yellow'
}
}
//
winston.addColors(config.colors)
const Log = winston.createLogger({
levels: config.levels,
format: winston.format.combine(winston.format.colorize({ all: true }), winston.format.simple()),
transports: [
new winston.transports.Console({ handleExceptions: true }),
new winston.transports.File({ filename })
]
})

module.exports = Log
56 changes: 56 additions & 0 deletions bridgedb/lib/queries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
const r = require('rethinkdb')
const DB = require('./db')
//
// const standardValue = { includeInitial: true, includeTypes: true, includeStates: true }
// const standardQuery = {
// includeInitial: true,
// includeTypes: true,
// includeStates: true,
// includeOffsets: true
// }
// const noRangeQuery = { includeInitial: true, includeTypes: true }

const Queries = {}
// A simple value query for a public user record. We do not emit sensitive fields (tx proximax, etc.) here. Note that the
// pluck operation has to come after the changefeed request.
Queries.changesTable = params => {
DB.conn.use(DB.name)
return r
.table('offers')
.changes()
.run(DB.conn)
}

Queries.getAlloffertTx = params => {
DB.conn.use(DB.name)
return r.table('offers').run(DB.conn)
}
Queries.getMosaicInfo = params => {
console.log('DB', DB)
DB.conn.use(DB.name)
return r.table('mosaicInfo').run(DB.conn)
}

Queries.insertMoisaicsInfo = params => {
DB.conn.use(DB.name)
return r
.table('mosaicInfo')
.insert(params, { returnChanges: true, conflict: 'replace' })
.run(DB.conn)
}
Queries.insertOffert = params => {
DB.conn.use(DB.name)
return r
.table('offers')
.insert(params, { returnChanges: true })
.run(DB.conn)
}
Queries.insertExecuteOffers = params => {
DB.conn.use(DB.name)
return r
.table('executeOffers')
.insert(params, { returnChanges: true })
.run(DB.conn)
}

module.exports = Queries
Loading