Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
beem
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
beem
Commits
5e6f5849
Commit
5e6f5849
authored
7 years ago
by
Fabian Schuh
Browse files
Options
Downloads
Patches
Plain Diff
[expiration] allow order expiration to be defined from storage
parent
e29f27c5
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Makefile
+1
-1
1 addition, 1 deletion
Makefile
bitshares/market.py
+6
-3
6 additions, 3 deletions
bitshares/market.py
bitshares/storage.py
+1
-0
1 addition, 0 deletions
bitshares/storage.py
with
8 additions
and
4 deletions
Makefile
+
1
−
1
View file @
5e6f5849
...
@@ -10,7 +10,7 @@ clean-build:
...
@@ -10,7 +10,7 @@ clean-build:
rm
-fr
build/
rm
-fr
build/
rm
-fr
dist/
rm
-fr
dist/
rm
-fr
*
.egg-info
rm
-fr
*
.egg-info
rm
-fr
__pycache__/ .eggs/ .cache/
rm
-fr
__pycache__/ .eggs/ .cache/
.tox/
clean-pyc
:
clean-pyc
:
find
.
-name
'*.pyc'
-exec
rm
-f
{}
+
find
.
-name
'*.pyc'
-exec
rm
-f
{}
+
...
...
This diff is collapsed.
Click to expand it.
bitshares/market.py
+
6
−
3
View file @
5e6f5849
...
@@ -356,7 +356,7 @@ class Market(dict):
...
@@ -356,7 +356,7 @@ class Market(dict):
self
,
self
,
price
,
price
,
amount
,
amount
,
expiration
=
7
*
24
*
60
*
60
,
expiration
=
None
,
killfill
=
False
,
killfill
=
False
,
account
=
None
,
account
=
None
,
returnOrderId
=
False
returnOrderId
=
False
...
@@ -395,6 +395,8 @@ class Market(dict):
...
@@ -395,6 +395,8 @@ class Market(dict):
* This means that you actually place a sell order for 1000 BTS in order to obtain **at least** 10 USD
* This means that you actually place a sell order for 1000 BTS in order to obtain **at least** 10 USD
* If an order on the market exists that sells USD for cheaper, you will end up with more than 10 USD
* If an order on the market exists that sells USD for cheaper, you will end up with more than 10 USD
"""
"""
if
not
expiration
:
expiration
=
self
.
bitshares
.
config
[
"
order-expiration
"
]
if
not
account
:
if
not
account
:
if
"
default_account
"
in
self
.
bitshares
.
config
:
if
"
default_account
"
in
self
.
bitshares
.
config
:
account
=
self
.
bitshares
.
config
[
"
default_account
"
]
account
=
self
.
bitshares
.
config
[
"
default_account
"
]
...
@@ -453,7 +455,7 @@ class Market(dict):
...
@@ -453,7 +455,7 @@ class Market(dict):
self
,
self
,
price
,
price
,
amount
,
amount
,
expiration
=
7
*
24
*
60
*
60
,
expiration
=
None
,
killfill
=
False
,
killfill
=
False
,
account
=
None
,
account
=
None
,
returnOrderId
=
False
returnOrderId
=
False
...
@@ -480,6 +482,8 @@ class Market(dict):
...
@@ -480,6 +482,8 @@ class Market(dict):
market. I.e. in the BTC/BTS market, prices are BTS per BTC.
market. I.e. in the BTC/BTS market, prices are BTS per BTC.
That way you can multiply prices with `1.05` to get a +5%.
That way you can multiply prices with `1.05` to get a +5%.
"""
"""
if
not
expiration
:
expiration
=
self
.
bitshares
.
config
[
"
order-expiration
"
]
if
not
account
:
if
not
account
:
if
"
default_account
"
in
self
.
bitshares
.
config
:
if
"
default_account
"
in
self
.
bitshares
.
config
:
account
=
self
.
bitshares
.
config
[
"
default_account
"
]
account
=
self
.
bitshares
.
config
[
"
default_account
"
]
...
@@ -531,7 +535,6 @@ class Market(dict):
...
@@ -531,7 +535,6 @@ class Market(dict):
tx
[
"
orderid
"
]
=
tx
[
"
operation_results
"
][
0
][
1
]
tx
[
"
orderid
"
]
=
tx
[
"
operation_results
"
][
0
][
1
]
self
.
bitshares
.
blocking
=
prevblocking
self
.
bitshares
.
blocking
=
prevblocking
def
cancel
(
self
,
orderNumber
,
account
=
None
):
def
cancel
(
self
,
orderNumber
,
account
=
None
):
"""
Cancels an order you have placed in a given market. Requires
"""
Cancels an order you have placed in a given market. Requires
only the
"
orderNumber
"
. An order number takes the form
only the
"
orderNumber
"
. An order number takes the form
...
...
This diff is collapsed.
Click to expand it.
bitshares/storage.py
+
1
−
0
View file @
5e6f5849
...
@@ -221,6 +221,7 @@ class Configuration(DataDir):
...
@@ -221,6 +221,7 @@ class Configuration(DataDir):
"
node
"
:
"
wss://node.bitshares.eu
"
,
"
node
"
:
"
wss://node.bitshares.eu
"
,
"
rpcpassword
"
:
""
,
"
rpcpassword
"
:
""
,
"
rpcuser
"
:
""
,
"
rpcuser
"
:
""
,
"
order-expiration
"
:
7
*
24
*
60
*
60
,
}
}
def
__init__
(
self
):
def
__init__
(
self
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment