Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ai
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
ai
Commits
7cea5122
Commit
7cea5122
authored
Aug 03, 2022
by
Ahmad Nemati
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
git pull
parent
aa04dd56
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
285 additions
and
192 deletions
+285
-192
db.js
db.js
+54
-0
package.json
package.json
+2
-0
test_db.js
test_db.js
+8
-0
trade.js
trade.js
+221
-192
No files found.
db.js
0 → 100644
View file @
7cea5122
const
Sequelize
=
require
(
'
sequelize
'
);
const
sequelize
=
new
Sequelize
(
'
ai
'
,
'
root
'
,
'
mahan7797
'
,
{
define
:
{
charset
:
'
utf8
'
,
collate
:
'
utf8_general_ci
'
},
host
:
'
db.zignaly.xyz
'
,
dialect
:
'
mysql
'
,
logging
:
false
,
operatorsAliases
:
false
});
const
Account
=
sequelize
.
define
(
'
account
'
,
{
name
:
Sequelize
.
STRING
,
equity
:
{
type
:
Sequelize
.
DOUBLE
,
allowNull
:
false
,
defaultValue
:
0
},
qty
:
{
type
:
Sequelize
.
DOUBLE
,
allowNull
:
false
,
defaultValue
:
0.001
},
active
:
{
type
:
Sequelize
.
BOOLEAN
,
allowNull
:
false
,
defaultValue
:
false
},
testnet
:
{
type
:
Sequelize
.
BOOLEAN
,
allowNull
:
false
,
defaultValue
:
false
},
key
:
Sequelize
.
STRING
,
secret
:
Sequelize
.
STRING
,
});
async
function
getAllAccounts
()
{
return
await
Account
.
findAll
({
raw
:
true
})
}
sequelize
.
sync
()
module
.
exports
=
{
getAllAccounts
:
getAllAccounts
};
package.json
View file @
7cea5122
...
...
@@ -32,6 +32,8 @@
"
npm
"
:
"
^8.10.0
"
,
"
redis
"
:
"
^4.1.0
"
,
"
request
"
:
"
^2.88.2
"
,
"
sequelize
"
:
"
^6.21.3
"
,
"
mysql2
"
:
"
^1.6.1
"
,
"
shelljs
"
:
"
^0.8.4
"
,
"
stringify-object
"
:
"
^4.0.1
"
,
"
uniqid
"
:
"
^5.4.0
"
,
...
...
test_db.js
0 → 100644
View file @
7cea5122
let
db
=
require
(
'
./db
'
)
test
()
async
function
test
()
{
let
d
=
await
db
.
getAllAccounts
()
console
.
log
(
d
)
}
\ No newline at end of file
trade.js
View file @
7cea5122
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment