Skip to content

Commit

Permalink
Merge branch 'michael-0921' of https://github.com/mastercoin-msc/mast…
Browse files Browse the repository at this point in the history
…ercore into michael-0921
  • Loading branch information
m21 committed Aug 2, 2014
2 parents 2349291 + 05d8d15 commit 6765f10
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
41 changes: 41 additions & 0 deletions doc/apidocumentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,44 @@ $src/mastercored sendtoowners_MP "1MCHESTxYkPSLoJ57WBQot7vz3xkNahkcb" 2147483668
```
*Please note, the private key for the requested sender address must be available in the wallet.*

###Listing currently active DeX sell offers
The **getactivedexsells_MP** call allows for listing all currently active Master Protocol DeX sell offers.

**Required Parameters**
- There are no required parameters for this call.

**Additional Optional Parameters**
- You may pass in (1) parameter, which is the address to filter by/on.

**Examples**
```
$src/mastercored getactivedexsells_MP
[
{
"txid" : "9133dc9f042a4edd92a8bc1f1764a9cc5e0b1f04061ccb74e5fce34981f664a1",
"propertyid" : 1,
"seller" : "1Ji1E3r4paY8ZqtudraKYvc7cfN1fyEfNo",
"amountavailable" : 0.01000000,
"bitcoindesired" : 0.00200000,
"unitprice" : 0.20000000,
"timelimit" : 6,
"minimumfee" : 0.00010000,
"amountaccepted" : 0.00000000,
"accepts" : [
]
},
{
"txid" : "28d951ac4b48c31706561dac62fd0ea065a7873faede5316ff04817e1057315f",
"propertyid" : 1,
"seller" : "1K5Tofy7UTfcrpWBnXcJhHZzvLTksDdasQ",
"amountavailable" : 0.00000001,
"bitcoindesired" : 0.00000000,
"unitprice" : 0.12000000,
"timelimit" : 100,
"minimumfee" : 0.00010000,
"amountaccepted" : 0.00000000,
"accepts" : [
]
}
]
```
12 changes: 12 additions & 0 deletions src/mastercore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1867,6 +1867,18 @@ class CMPTransaction
//get txid
string sp_txid = sp.txid.GetHex().c_str();

//Units going into the calculateFundraiser function must
//match the unit of the fundraiser's property_type.
//By default this means Satoshis in and satoshis out.
//In the condition that your fundraiser is Divisible,
//but you are accepting indivisible tokens, you must
//account for 1.0 Div != 1 Indiv but actually 1.0 Div == 100000000 Indiv.
//The unit must be shifted or your values will be incorrect,
//that is what we check for below.
if ( !(isPropertyDivisible(currency)) && (sp.isDivisible()) ) {
nValue = nValue * 1e8;
}

//fprintf(mp_fp, "\nValues going into calculateFundraiser(): hexid %s nValue %lu earlyBird %d deadline %lu blockTime %ld numProps %lu issuerPerc %d \n", txid.GetHex().c_str(), nValue, sp.early_bird, sp.deadline, (uint64_t) blockTime, sp.num_tokens, sp.percentage);

// calc tokens per this fundraise
Expand Down

0 comments on commit 6765f10

Please sign in to comment.