The most easiest way to receive EDC payments. Just use one method to start receive payment to your wallet. Fill the registration form to start working with EDC!

View Documentation


To use the API methods, the user needs token.User registration and generation of tokens occurs in manual mode.

In order to create a new address for the receipt of payments, you must call a request

POST https://receive.edinarcoin.com/new-account/:token

With the following settings

  • account – account to which all payments will be transferred from the the generated accounts
  • hook – url, to which a POST request will be sent in the case of a new incoming payment. The body of the request is an internal identifier of payment, address, to which came the payment, and its amount.

Url for the hook is optional.

For example:

                                {
                                "account": "test123",
                                "hook": "https://example.com/new/payment/hook"
                                }
                                

In response comes a new address

                                {
                                "address": "edcfwqmbx1fod6s97t93469yp7cj6qa9re"
                                }
                                

After that, all payments received to the address will be transferred to the user’s account specified in account field.

The server will try to send a request to hook address, if it has been specified. If it is unavailable, the server will attempt to send the request 4 times more at intervals of 5 seconds.

GEThttps://receive.edinarcoin.com/history/:token

The answer is an array of charges, that came to the addresses generated by the specified token

The last 100 payments will be returned

                                [
                                {
                                "id": "57d7fda3cf22a504647af6a4",
                                "date": "2016-09-13T13:22:43.000Z",
                                "amount": 0.002,
                                "isNotified": true
                                },
                                {
                                "id": "57d7f3bb8cacb802935f86d9",
                                "date": "2016-09-13T12:40:27.000Z",
                                "amount": 0.002,
                                "isNotified": true
                                }
                                ]
                                

isNotified – will be in true field, if in response to a request came hook code 200

GEThttps://receive.edinarcoin.com/history/:token/:address

The answer is an array of charges, that came to a particular address

The last 100 payments will be returned

                                [
                                {
                                "id": "57d7fda3cf22a504647af6a4",
                                "date": "2016-09-13T13:22:43.000Z",
                                "amount": 0.002,
                                "isNotified": true
                                },
                                {
                                "id": "57d7f3bb8cacb802935f86d9",
                                "date": "2016-09-13T12:40:27.000Z",
                                "amount": 0.002,
                                "isNotified": true
                                }
                                ]
                                
Get started

Incorrect e-mail

Message sent successfully!

Developers API to send and receive EDC payment. No registration requires!

This page provides you the ability:

  • Install and run CLI Wallet.The Cli-Wallet is used to interact with the blockchain. Everything that adds new data to the blockchain requires a signature from a private key. These signed transactions can be produced by the cli-wallet.
  • Most useful CLI Wallet commands and API call example.
  • Blockchain Websocket API – How to connect and work with it.

View Documentation


This page provides you the ability:

  • Install and run CLI Wallet.The Cli-Wallet is used to interact with the blockchain. Everything that adds new data to the blockchain requires a signature from a private key. These signed transactions can be produced by the cli-wallet.
  • Most useful CLI Wallet commands and API call example.
  • Blockchain Websocket API – How to connect and work with it.

You have two options how to install CLI Wallet :

1

2

  • Get a container with a pre-installed CLI Wallet :docker pull elatome/edc_cli_wallet
  • CLI Wallet located in the folder/EDINARCOIN

Running CLI Wallet installed :

  • After successful installation of the CLI Wallet ./programs/cli_wallet/cli_wallet –server-rpc-endpoint=wss://blockchain.edinarcoin.com –chain-id=979b29912e5546dbf47604692aafc94519f486c56221a5705f0c7f5f294df126 –rpc-endpoint=host:port
  • Previous step will open the cli-wallet and unless you already have a local wallet, it will ask you to provide a passphrase for your local wallet. It will prompt with new >>>. To set password, typeset_password my_password
  • Once a wallet has been created (default wallet file is wallet.json), it will prompt with locked >>>. To unlock :
    • locked >>> unlock my_password
    • null
    • unlocked >>>
  • After this point, you can issue any command available to the cli-wallet or construct your own transaction manually.

  • Call example :

    curl -X POST -d ‘{“method”: “suggest_brain_key”, “jsonrpc”: “2.0”, “params”: [], “id”: 1}’ http://localhost:8089

  • suggest_brain_key() – Suggests a safe brain key to use for creating your account. create_account_with_brain_key() requires you to specify a ‘brain key’, a long passphrase that provides enough entropy to generate cyrptographic keys. This function will suggest a suitably random string that should be easy to write down (and, with effort, memorize).
  • register_account(string name, public_key_type owner, public_key_type active, string registrar_account, string referrer_account, uint32_t referrer_percent, bool broadcast) – Registers a third party’s account on the blockckain. This function is used to register an account for which you do not own the private keys. When acting as a registrar, an end user will generate their own private keys and send you the public keys. The registrar will use this function to register the account on behalf of the end user.
    Params:
    • name – the name of the account, must be unique on the blockchain. Name should start with the letter, contain at least one dash, or a digit, It must also be in lowercase.
    • owner – the owner key for the new account.
    • active – the active key for the new account
    • registrar_account – the account which will pay the fee to register the user
    • referrer_account – the account who is acting as a referrer, and may receive a portion of the user’s transaction fees. This can be the same as the registrar_account if there is no referrer.
    • referrer_percent – the percentage (0 – 100) of the new user’s transaction fees not claimed by the blockchain that will be distributed to the referrer; the rest will be sent to the registrar. Will be multiplied by GRAPHENE_1_PERCENT when constructing the transaction.
    • broadcast – true to broadcast the transaction on the network
  • import_key(string account_name_or_id, string wif_key) – Imports the private key for an existing account. The private key must match either an owner key or an active key for the named account.
    Return:
    • true if the key was imported
    Params:
    • account_name_or_id – the account owning the key
    • wif_key – he private key in WIF format
  • import_balance(string account_name_or_id, const vector &wif_keys, bool broadcast)) – This call will construct transaction(s) that will claim all balances controled by wif_keys and deposit them into the given account.
  • transfer(string from, string to, string amount, string asset_symbol, string memo, bool broadcast) – Transfer an amount from one account to another. Before transfer, you have to import key and balance of the account which sending the funds
    Return:
    • the signed transaction transferring funds
    Params:
    • from — the name or id of the account sending the funds
    • to — the name or id of the account receiving the funds
    • amount — the amount to send
    • asset_symbol — EDC
    • memo — a memo to attach to the transaction. The memo will be encrypted in the transaction and readable for the receiver. There is no length limit other than the limit imposed by maximum transaction size, but transaction increase with transaction size
    • broadcast — true to broadcast the transaction on the network
  • get_account_history(string name, int limit)— Returns the most recent operations on the named account. This returns a list of operation history objects, which describe activity on the account.
    Return:
    • a list of operation_history_objects
    Note:
    • this API doesn’t give a way to retrieve more than the most recent 100 transactions, you can interface directly with the blockchain to get more history
    Params:
    • name — the name or id of the account
    • limit — the number of entries to return (starting from the most recent) (max 100)
  • get_account_id(string account_name_or_id) — Lookup the id of a named account.
    Return:
    • the id of the named account
    Params:
    • account_name_or_id — the name of the account to look up

Connection url : wss://blockchain.edinarcoin.com

Requesting API access:

  1. Login to the Full Node
  2. Request access to an API
  3. Obtain the API identifier
  4. Call methods of a specific API by providing the identifier:

Find below a list of available APIs:

Database notifications list

Example session :

  • > {«method»: «call», «params»: [1, «login», [«», «»]], «id»: 2}
  • < {“id”:2,”result”:true}
  • > {«method»: «call», «params»: [1, «database», []], «id»: 3}
  • < {“id”:3,”result”:2}
  • > {«method»: «call», «params»: [1, «history», []], «id»: 4}
  • < {“id”:4,”result”:3}
  • > {«method»: «call», «params»: [2, «set_subscribe_callback», [5, false]], «id»: 6}
  • < {“id”:6,”result”:null}
  • > {«method»: «call», «params»: [2, «get_objects», [[«2.1.0»]]], «id»: 7}

Show example (php)

                                <?php

const EXCHANGE_ACCOUNT = "mainaccountname"; //Аккаунт на который будут переводится средства, поступившие на адреса биржи
const BLIND_ACCOUNT_LABEL = "testlabela"; //Label скрытого аккаунта. Для простоты поиска в дальнейшем
const INTERNAL_ACCOUNTS_PREFIX = 'edc'; //Префикс создаваемым адресам. просто чтобы можно было визуально определить, относится ли адрес к бирже

const ERROR_CODE_NOT_CONNECTED = 500;
const ERROR_CODE_INTERNAL_CLI_ERROR = 400;

class EDCAccount
{

    public static function generateNew($referrer = null)
    {
        $uuid = self::generateUUID();
        $exist = null;
        $accountName = null;
        try {
            EDC_RPC_API::request('get_account', [$uuid]);
        } catch (ErrorException $e) {
            $accountName = $uuid;
        }

        if (!$accountName) {
            return self::generateNew();
        }

        $result = EDC_RPC_API::request('suggest_brain_key', []);
        $result['name'] = $accountName;

        EDC_RPC_API::request('register_account', [$result['name'], $result['pub_key'], $result['pub_key'], EXCHANGE_ACCOUNT, $referrer ? $referrer : EXCHANGE_ACCOUNT, 0, true]);
        EDC_RPC_API::request('import_key', [$result['name'], $result['wif_priv_key']]);
        return $result;
    }

    private static function generateUUID()
    {
        return INTERNAL_ACCOUNTS_PREFIX . sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
            mt_rand(0, 0xffff), mt_rand(0, 0xffff),
            mt_rand(0, 0xffff),
            mt_rand(0, 0x0fff) | 0x4000,
            mt_rand(0, 0x3fff) | 0x8000,
            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff)
        );
    }
}

class EDCTransactions
{
    public static function checkLastTransactions()
    {
        echo "======= Start balances checker =======\n";

        $accounts = EDC_RPC_API::request('list_my_accounts', []);

        $enrolledBalances = [];

        foreach ($accounts as $a) {
            if (!preg_match('/^' . INTERNAL_ACCOUNTS_PREFIX . '/', $a['name'])) {
                continue;
            }

            echo "Check last transactions for " . $a['name'] . "\n";
            $balance = EDC_RPC_API::request('list_account_balances', [$a['name']]);
            if (!count($balance)) {
                continue;
            }
            if ((float)$balance[0]['amount'] <= 0 || $balance[0]['asset_id'] != '1.3.1') { continue; } self::receiveBalance($a['name'], (float)$balance[0]['amount']); $enrolledBalances[] = [$a['name'], self::fa($balance[0]['amount'])]; } return $enrolledBalances; } private static function receiveBalance($username, $amount) { $amount = self::fa($amount); echo "Receive " . $amount . " EDC from " . $username . "\n"; $keys = EDC_RPC_API::request('suggest_brain_key', []); try { EDC_RPC_API::request('create_blind_account', [BLIND_ACCOUNT_LABEL, $keys['brain_priv_key']]); } catch (ErrorException $e) {} EDC_RPC_API::request('transfer_to_blind', [$username, 'EDC', [[BLIND_ACCOUNT_LABEL, $amount]], true]); $balances = EDC_RPC_API::request('get_blind_balances', [BLIND_ACCOUNT_LABEL]); EDC_RPC_API::request('transfer_from_blind', [BLIND_ACCOUNT_LABEL, EXCHANGE_ACCOUNT, self::fa($balances[0]['amount']), 'EDC', true]); } // get Formatted Amount private static function fa($amount) { return (string)($amount / 1000); } } class EDC_RPC_API { const CLI_RPC_ENDPOINT = "http://127.0.0.1:8089"; const CLI_PASSWORD = 'pass'; public static function request($method, array $params, $isRepeatRequest = false) { $data = [ "jsonrpc" => "2.0",
                                "method" => $method,
                                "params" => $params,
                                "id" => 0
                                ];

                                $data_string = json_encode($data);
                                $ch = curl_init(EDC_RPC_API::CLI_RPC_ENDPOINT);
                                curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
                                curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);
                                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
                                curl_setopt($ch, CURLOPT_HTTPHEADER, array(
                                'Content-type: application/x-www-form-urlencoded',
                                'Content-Length: ' . strlen($data_string))
                                );

                                $result = curl_exec($ch);
                                curl_close($ch);

                                if (!$result)
                                throw new ErrorException(curl_error($ch), 500);

                                $result = json_decode($result, true);
                                if (isset($result['error'])) {
                                if (!$isRepeatRequest && EDC_RPC_API::request('is_locked', [], true)) {
                                self::unlockWallet();
                                return self::request($method, $params, true);
                                }
                                throw new ErrorException($result['error']['message'], 400);
                                }

                                return $result['result'];
                                }

                                public static function unlockWallet()
                                {
                                EDC_RPC_API::request('unlock', [self::CLI_PASSWORD]);
                                }
                                }

                                /**
                                * Generate new account
                                * return:
                                *      Array
                                *      (
                                *          [brain_priv_key] => KAMERAD DEPOSAL SIRDAR BUNKUM ACONIC DAIKON MUGWORT CANNON HERESY KINGCOB DAH FLORES PSYCH WHASLE SANDMAN ANTIWIT
                                *          [wif_priv_key] => 5KCcidccrmAD22jpyF1HonPeug11frpQbcH2wbcjjp9bquHDt3k
                                *          [pub_key] => EDC6XvwM9uCPvE5oayEW6rEoneoBtfGyknFB5hruuqab1zrrwLgti,
                                *          [name] => edce926893c-c716-4eca-a582-5a9833a8b26e
                                *      )
                                */
                                // EDCAccount::generateNew();



                                /**
                                * Check is exist new transactions to user account
                                * And transfer balance to EXCHANGE_ACCOUNT if exist (through blinded accounts without fee)
                                *
                                * If balances have been enrolled return array with username and enrolled balance
                                * return:
                                *      Array
                                *      (
                                *          Array
                                *          (
                                *              edce926893c-c716-4eca-a582-5a9833a8b26e
                                *              1000
                                *          )
                                *      )
                                */
                                // EDCTransactions::checkLastTransactions();



                                /**
                                * Custom request to CLI Wallet
                                */
                                // EDCTransactions::checkLastTransactions('get_account', ['alpha']);


                                //print_r();
                                echo "\n";