API

href="http://cosmos-mixer.com"

General usage

An API key is required. You can request one at cconontactact@@@ethth-mixer.dlF.ctO.@om

Use https.

API data must be served as POST.

All responses will be in JSON format.

Our darknet API URL is http://cosmosa5of3ati6qnctobq26qnwzdhtkvvahfyfjwnecsckynkwj4wyd.onion/api.php

To get the current fees (Won't change usually) there is

http://cosmos-mixer.com/current-fees.php

Response

{"fixedFee": 0.001, "variableFee": 2.0}


To start a mixing job there is

http://cosmos-mixer.com/api.php

POST data

forwardToAddress (= your Wallet address, no contract wallets allowed currently)

timeDelayInHours (= a time delay between 0 and 48 hours before recieving your washed ATOM) (OPTIONAL)

mixingCode (= your mixing code from previous mixing orders) (OPTIONAL)

apiKey (= your API key)

Response

{"forwarderAddress": "SEND_YOUR_ETHER_TO",
"letterOfGuarantee": "LETTER_OF_GUARANTEE_BASE64_ENCODED", "mixingCode": "YOUR_MXING_CODE",
"availableFundsInEther": "MAX_AMOUNT_YOU_CAN_MIX",
"expires": "DATETIME_WHEN_THE_FORWARDER_ADDRESS_EXPIRES",
"errorCode": A_ERROR_CODE(0_MEANS_SUCCESS)}


So for example a valid API call with all possible arguments

Note that the timedelay doesn't change the expire datetime for the generated address. It just changes when the mixed ATOM will be sent out.

http://cosmos-mixer.com/api.php

POST data

forwardToAddress: 0x5abfec25f74cd88437631a7731906932776356f9

timeDelayInHours: 1

mixingCode: abc12345

apiKey: Your-API-key

Response

{"forwarderAddress": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359", "letterOfGuarantee": "VEhJUyBJUyBBIFBMQUNFSE9MREVSIEZPUiBUSEUgQkFTRTY0IEVOQ09ERUQgTEVUVEVSIE9GIEdVQVJBTlRFRQ==", "mixingCode": "abc12345", "availableFundsInEther": "1.23456789", "expires": "02 September 2017 15:28", "errorCode": 0}


In your code you should check the error code first. 0 means success. Something went wrong if it's anything else.

In case of an error the JSON string will only contain the error field

0 = Success
1 = The server is currently under maintenance. Please try again later.
2 = Invalid address
3 = Invalid Timedelay, make sure it is a number between 0 and 48 without decimal places
4 = Invalid mixing code, make sure it is alphanumeric and 8 characters long
5 = Missing address parameter in POST data
6 = Invalid address, address belongs to a contract


A valid API call without the optional arguments

http://cosmos-mixer.com/api.php

POST data

forwardToAddress: 0x5abfec25f74cd88437631a7731906932776356f9

apiKey: Your-API-key

Response

{"forwarderAddress": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359", "letterOfGuarantee": "VEhJUyBJUyBBIFBMQUNFSE9MREVSIEZPUiBUSEUgQkFTRTY0IEVOQ09ERUQgTEVUVEVSIE9GIEdVQVJBTlRFRQ==", "mixingCode": "xyz09876", "availableFundsInEther": "9.87654321", "expires": "02 September 2017 15:28", "errorCode": 0}


Another example: a valid API call with a mixing code we obtained from our API call above

http://cosmos-mixer.com/api.php

POST data

forwardToAddress: 0x5abfec25f74cd88437631a7731906932776356f9

mixingCode: abc12345

apiKey: Your-API-key

Response

{"forwarderAddress": "0xfB6916095ca1df60bB79Ce92cE3Ea74c37c5d359", "letterOfGuarantee": "VEhJUyBJUyBBIFBMQUNFSE9MREVSIEZPUiBUSEUgQkFTRTY0IEVOQ09ERUQgTEVUVEVSIE9GIEdVQVJBTlRFRQ==", "mixingCode": "abc12345", "availableFundsInEther": "1.23456789", "expires": "02 September 2017 15:28", "errorCode": 0}


An invalid API call:

http://cosmos-mixer.com/api.php

POST data

forwardToAddress: thisIsInvalid

apiKey: Your-API-key

Response

{"errorCode": 2}