Install SDK & Development for Python

Install SDK & Development for Python

  1. Development Environment

Linux/Mac OS

It was developed only for python3.


2. Installation

In the project directory, do the following.


pip install  EdenChain-client-sdk

If there is no error, installation to the relevant library is completed.

3. Provided API

All of the following APIs are methods of the EdenClientApi () class.


  • Network Settings

Set up the network of the EdenChain to connect through the SDK. There are currently three networks, and you have to set up a network to test, which is always the first thing you need to initialize when using the SDK.


(1)  Network constant

EdenChain_MAINNET_NETWORK      : EdenChain MainNet General Release
EdenChain_CANDIDATE_RELEASE    : EdenChain Candidate Release
EdenChain_BETA_RELEASE         : EdenChain Beta Release

(2) Network Settings

It is to initialize API Class, after which all APIs are called using the class.


EdenClientApi(network_id)
parameter  :
             network_id puts the network constants above.

return     :
             A Python class is created. Use this instance to call the API.
  • Authentication

Only sign in to EdenChain is supported. Sign In provides sign-in to the pre-created account.


authenticate_user( email, password)
parameter  :
             email    (String) :  An email address to use for future accounts.
             password (String) : An password to use for future accounts.
return     :
             token    (String) :  Returns the authentication token of the user to be used in the API call.

  • Synchronous apis

Each API has an async version and a default sync version, and async has a _async appended to the function name.


get_user_info(token=’‘)

Returns user information in the EdenChain. Returns the dictionary type, token address or token deposit, and Ethereum address information to be used for withdrawing.


parameter  :
             token        (String) :  This is the token value obtained at the time of authentication.

return:
             {}                    : Returns a Dictionary, with the following information.

                                   email  ( String ) :  User email address

                                   eth_address (String ) : It is the ethereum address of the user added / deleted by api, and may contain multiple addresses as delimiter with '|'.

                                                           It will refuse to withdraw or deposit to unregistered address in API.
                                   tedn_public_key (String) Eden chain User wallet address


get_user_balance(token=’‘)

Returns the user account balance of the Eden chain.


parameter  :
            token      (String) :  This is the token value obtained at the time of authentication.
return:
            int                 : decimal is the Token balance of 18

get_user_transaction(token=’‘, page = 0, countperpage = 0)

It is an API to get the transaction list of the user. Returns information from the transaction of the user corresponding to iamtoken.


parameter  :
            token        (String) :  This is the token value obtained at the time of authentication.
            page  (int)           : Specify whether to return the transaction for some pages.
            countperpage (int)    : By specifying the transaction count of each page and specifying the page, you specify how many transactions are returned.

return:
            [{}]                  :   Returns a list of objects, each of which has the following information in dictionary form.
                                   from_addr  (String):  The address on EdenChain where the amount is withdrawn.
                                   to_addr       (String) : The address on the EdenChain where the amount is deposited.
                                   amount     (int )       :  token amount corresponding to tx, and it is decimal 18.
                                   regdate    (int)         : The time at which tx was performed, in seconds.
get_coin_server_address(token=’‘)

Returns the CoinServer Ethereum Address. It returns the address of Ropsten Ethereum Testnet in Beta Release and Candidate Release, and returns the address of Ethereum MainNet in General Release.


parameter  :
             token    (String) :  This is the token value obtained at the time of authentication.

return:
             String            : Returns the Ethereum address of the Coin Server.

add_eth_address(token=’‘, private_key=’‘)

It is used to add Ethereum address in the user account. In order to prevent the misuse of the address of the other person, the address is signed and sent, and the server processes it only when the signature is correct.


parameter  :
             token       (String)  :  This is the token value obtained in authentication
             private_key (String)  : Ethereum Private Key is used to generate the following address object using the corresponding key and forward it to the server side.
                                     The following is an address Object.
                                     address  (String) : Ethereum Checksum Address
                                     public_key (String) : Ethereum public key. This is used to verify the signature.
                                     signature ( String ) : After the keccak256 hash of address, it is signed with Ethereum private key.

return    :
              Boolean   : It indicates the success or failure of Ethereum address addition.

del_eth_address( token=’‘, private_key=’‘)

It is used to put ethereum address in user account. In order to prevent the misuse of the address of the other person, the address is signed and sent, and the server processes it only when the signature is correct.


parameter  :
            token       (String)  :  This is the token value obtained in authentication
            private_key (String)  : Ethereum Private Key is used to generate the following address object using the corresponding key and forward it to the server side.
                                    The followings are address Objects.
                                    address  (String) : Ethereum Checksum Address
                                    public_key (String) : Ethereum public Key.이며, signature를 verify할  사용한다.
                                    signature ( String ) : address를 keccak256 해시  이를 ethereum private key로 sign한 값이다.

return    :
           Boolean   : It indicates the success or failure of Ethereum address deletion.

deposit_token(token=’‘, txhash=’‘)

It is the API that is called when the Ethereum ERC20 EDN Token is passed for the EdenChain service.


parameter  :
             token      (String) :  This is the token value obtained at the time of authentication.
             txhash     (String) : Transaction hash value after ethereum transfer

return     :
              Boolean   : Indicates the success or failure of the API.

withdraw_token(token=’‘, ethaddress=’‘,amount=‘0’)

This is the API that is called when the token of the Eden Chain service is passed to Ethereum’s ERC20 EDN Token.


parameter  :
             token        (String) :  Authentication시 얻어지는 token 값이다.
             ethaddress   (String) :  The address on the Ethereum you want to receive, which must be registered by addEthAddress () in advance.
             amount       (String) : The amount you want to receive and it is decimal 18.

return     :
             txhash  (String): Txhash value generated after Ethereum transfer in Coin Server. You can use that value to determine if the withdraw was successful.

  • Asynchronous apis

Each API has an async version and a default sync version, and async has a _async appended to the function name.


get_user_info_async(token=’‘)

And returns user information on the EdenChain. Returns the dictionary type, token address or token deposit, and Ethereum address information to be used for withdrawing.


parameter  :
             token        (String) :  This is the token value obtained at the time of authentication.

return:
             {}                    : Returns a Dictionary, with the following information.

                                   email  ( String ) :  User email address
                                   eth_address (String ) : It is the ethereum address of the user added / deleted by api, and may contain multiple addresses as delimiter with '|'.

                                                           withdraw or deposit of api will refuse to withdraw or deposit to unregistered address.
                                   tedn_public_key (String )  EdenChain user wallet address


get_user_balance_async(token=’‘)

Returns the user account Balance on EdenChain.


parameter  :
            token      (String) :  This is the token value obtained in authentication

return:
            int                 : decimal is the Token balance of 18

get_user_transaction_async(token=’‘, page = 0, countperpage = 0)

It is an API to get the transaction list of the user. Returns information from the transaction of the user corresponding to iamtoken.


parameter  :
            token        (String) :  This is the token value obtained in authentication
            page  (int)           : Specifies the next page transaction to return.
            countperpage (int)    : By specifying the transaction count of each page and specifying the page, you can specify how many transactions are returned.

return:
            [{}]                  :   Returns a list of objects, each of which has the following information in dictionary form.
                                   from_addr  (String):  The address on the EdenChain where the amount is withdrawn.
                                   to_addr       (String) : The address on the EdenChain where the amount is deposited.
                                   amount     (int )       :  token amount corresponding to tx, and it is decimal 18.
                                   regdate    (int)         : The time at which tx was performed, in seconds.
get_coin_server_address_async(token=’‘)

Returns to the CoinServer Ethereum Address. It returns the address of Ropsten Ethereum Testnet in Beta Release and Candidate Release, and returns the address of Ethereum MainNet in General Release.


parameter  :
             token       (String) :  AThis is the token value obtained at the time of authentication.

return:
             String            : Returns the Ethereum address of the Coin Server.

add_eth_address_async(token=’‘, private_key=’‘)

It is used to put Ethereum address in the user account. In order to prevent the misuse of the address of the other person, the address is signed and sent, and the server processes it only when the signature is correct.


parameter  :
             token       (String) :  This is the token value obtained at the time of authentication.
             private_key (String)  : Ethereum Private Key is used to generate the following address object using the corresponding key and forward it to the server side.
                                     The followings are address Objects.
                                     address  (String) : Ethereum Checksum Address
                                     public_key (String) : Ethereum public key. This is used to verify the signature.
                                     signature ( String ) : After the keccak256 hash of address, it is signed with Ethereum private key.

return    :
              Boolean   : It indicates the success or failure of Ethereum address addition.

del_eth_address_async( token=’‘, private_key=’‘)

It is used to put Ethereum address in the user account. In order to prevent the misuse of the address of the other person, the address is signed and sent, and the server processes it only when the signature is correct.



parameter  :
            token       (String) :  This is the token value obtained at the time of authentication.
            private_key (String)  : Ethereum Private Key is used to generate the following address object using the corresponding key and forward it to the server side.
                                    The followings are address Objects.
                                    address  (String) : Ethereum Checksum Address
                                    public_key (String) : Ethereum public Key.It is used to verify the signature.
                                    signature ( String ) : After the keccak256 hash of address, it is a value signed with Ethereum private key.

return    :
           Boolean   : It indicates the success or failure of Ethereum address deletion.

deposit_token_async(token=’‘, txhash=’‘)

It is the API that is called when the Ethereum ERC20 EDN Token is passed for the Eden Chain service.


parameter  :
             token      (String) :   This is the token value obtained at the time of authentication.
             txhash     (String) : Transaction hash value after Ethereum transfer

return     :
              Boolean   : Indicates the success or failure of the API.

withdraw_token_async(token=’‘, ethaddress=’‘,amount=‘0’)

This is the API that is called when the token of the Eden Chain service is passed to Ethereum’s ERC20 EDN Token.


parameter  :
             token      (String) :  This is the token value obtained at the time of authentication.
             ethaddress (String) :  The address on the ethereum you want to receive, which must be registered by addEthAddress () in advance.
             amount     (String) : The quantity you want to receive and it is decimal 18..

return     :
             txhash     (String): Txhash value generated after Ethereum transfer in Coin Server. You can use that value to determine if the withdraw was successful.
|