Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

WAEXLink

Tech Notes

  • Authentification
Authentification
Preparation
Login and password -> cookie and csrf_token
Access token
​
Authentification tutorial
$WAEXCredentials
WAEX system variable with user authentification
WAEXLogin
Login to the WAEX services
SystemCredential
Built-in function
You can sign-in to the WAEX and get you login/pasword pair and access token here: https://access.ccdb.waexservices.com/profile. And documentation here: https://docs-ccdb.waexservices.com. In this tutorial I try to explain all about authintification methods to WAEX services from Wolfram Language. .
Preparation
Default installation with dependencies:
In[1]:=
PacletInstall[StringTemplate["KirillBelov/`1`"]@#]&/@{​​"CSockets",​​"Objects",​​"LTP",​​"SocketIOLink",​​"WAEXLink"​​};
Import the package:
In[69]:=
Get["KirillBelov`WAEXLink`"];
Access token

Global credentials

If you want to use WAEX Client withot login actions in every sessions just save you access token to system credentials like this:
In[32]:=
SystemCredential["WAEX_ACCESS_TOKEN"]="ajzFBTnXbMkvLSSGBO0mloSBzsbTS7BE_f_KbGPlndsKsx1CD8zukZ1Pw8mWgVbb-btd1O6tSbIxPk6TjSs6eg";
Now your access token saved in special system variable and will be work after restarting of the kernel:
In[33]:=
$WAEXCredentials
Out[33]=
access_tokenajzFBTnXbMkvLSSGBO0mloSBzsbTS7BE_f_KbGPlndsKsx1CD8zukZ1Pw8mWgVbb-btd1O6tSbIxPk6TjSs6eg
And you can get access to waex services without passing login/passord or access token:
In[34]:=
WAEXExchanges["limit"1]
Out[34]=
data{id1,externalExchangeIdbinance,dataSourcebinance,typeCEX,nameBinance,descriptionNull,imageUrlNull,createdAt2024-09-24T12:19:34.614Z,updatedAt2024-09-24T12:19:34.614Z},metafetchCount1,totalCount22,status1

Session credentials

Of course you can use you access token only during the Wolfram Language session lives. Just set system variable one time:
$WAEXCredentials="access_token""ajzFBTnXbMkvLSSGBO0mloSBzsbTS7BE_f_KbGPlndsKsx1CD8zukZ1Pw8mWgVbb-btd1O6tSbIxPk6TjSs6eg"
I assume that OS credentials are not set this time. And after setting creds you can get data from WAEX the same way:
In[35]:=
WAEXExchanges["limit"1,"offset"2]
Out[35]=
data{id12,externalExchangeIdminswap,dataSourceCardano,typeDEX,nameMinswap,descriptionNull,imageUrlNull,createdAt2024-09-24T12:21:13.978Z,updatedAt2024-11-14T09:23:38.570Z},metafetchCount1,totalCount22,status1

One call credentials

And the last way to get access - using Credentials option during call of the API Client method:
In[38]:=
WAEXExchanges["limit"1,"offset"1,​​"Credentials""access_token""ajzFBTnXbMkvLSSGBO0mloSBzsbTS7BE_f_KbGPlndsKsx1CD8zukZ1Pw8mWgVbb-btd1O6tSbIxPk6TjSs6eg"​​]
Out[38]=
data{id5,externalExchangeIdbybit,dataSourcebybit,typeCEX,nameBybit,descriptionNull,imageUrlNull,createdAt2024-09-24T12:20:00.681Z,updatedAt2024-09-24T12:20:00.681Z},metafetchCount1,totalCount22,status1

Advanced method

And one more advanced way to use credentials for several call without passing Creadentials option. Just use Block:
In[39]:=
Block[{$WAEXCredentials="access_token""ajzFBTnXbMkvLSSGBO0mloSBzsbTS7BE_f_KbGPlndsKsx1CD8zukZ1Pw8mWgVbb-btd1O6tSbIxPk6TjSs6eg"},​​{​​WAEXExchanges["limit"1],​​WAEXExchanges["limit"1,"offset"1]​​}​​]
Out[39]=
{data{id1,externalExchangeIdbinance,dataSourcebinance,typeCEX,nameBinance,descriptionNull,imageUrlNull,createdAt2024-09-24T12:19:34.614Z,updatedAt2024-09-24T12:19:34.614Z},metafetchCount1,totalCount22,status1,data{id5,externalExchangeIdbybit,dataSourcebybit,typeCEX,nameBybit,descriptionNull,imageUrlNull,createdAt2024-09-24T12:20:00.681Z,updatedAt2024-09-24T12:20:00.681Z},metafetchCount1,totalCount22,status1}
Login and password -> cookie and csrf_token

Global login and password

You can save global login and password to SystemCredentials:
In[47]:=
SystemCredential["WAEX_LOGIN"]="kirillbelovtest@gmail.com";​​SystemCredential["WAEX_PASSWORD"]="1234asdf";
After let's check that (assuming that WAEX_ACCESS_TOKE not set). the value of the variable are constant during the session but calculated from scratch after kernel reloading:
In[64]:=
$WAEXCredentials
Out[64]=
Cookieccdb.sid=s%3A5XpZilSihqe_DSapW57oSmfoNw0Z8-h5.JSridNAWSH0bKHgR9NS2kBbcyN2Hn3O4ZTKPWU5wW2w; Path=/; Expires=Fri, 21 Mar 2025 18:15:04 GMT; HttpOnly; SameSite=Strict,csrf_tokenpQh0mTm1
Of couse you can manually recalculate cookie and csrf_token:
In[72]:=
WAEXLogin[];​​$WAEXCredentials
Out[73]=
Cookieccdb.sid=s%3AMXTsrCuNFnD9dZCZFJwHNfQZ56sPn6kG.hOUPfdaxcji1ZjMfaSafND1bvrMKiQahtYR%2BFkFyjKs; Path=/; Expires=Fri, 21 Mar 2025 18:19:13 GMT; HttpOnly; SameSite=Strict,csrf_tokenFtq0RX2O

Session login and password

Assuming that acces token, loing and password not saved in system credentials you can login to the system using login and password passing manually lke this:
In[76]:=
WAEXLogin["kirillbelovtest@gmail.com","1234asdf"];
After session credentials is:
In[77]:=
$WAEXCredentials
Out[77]=
Cookieccdb.sid=s%3A2N80n51BC5saDAEm83SWKrWH3sDFxmS6.%2BDAzW0RlfI2V%2BdE0riWw8oTxPMBN59pTloTVpsVjhuc; Path=/; Expires=Fri, 21 Mar 2025 18:21:38 GMT; HttpOnly; SameSite=Strict,csrf_token7DlR6vkT
And try to get some data from WAEX:
In[80]:=
WAEXMarkets["limit"1]
Out[80]=
data{id6,externalMarketIdBTC:CNHT,baseId1,quoteId7,exchangeId2,metaNull,baseMetaNull,quoteMetaNull,descriptionNull,imageUrlNull,activeFalse,historicalFalse,exchangeid2,externalExchangeIdbitfinex,dataSourcebitfinex,typeCEX,nameBitfinex,descriptionNull,imageUrlNull,createdAt2024-09-24T12:19:35.311Z,updatedAt2024-10-18T12:28:26.656Z,baseTokenid1,symbolBTC,nameBitcoin,itinNull,descriptionNull,imageUrlNull,createdAt2024-09-24T12:19:47.676Z,updatedAt2024-09-24T12:19:56.481Z,quoteTokenid7,symbolCNHT,nameNull,itinNull,descriptionNull,imageUrlNull,createdAt2024-09-24T12:19:48.090Z,updatedAt2024-09-24T12:19:48.090Z,createdAt2024-09-24T12:19:48.098Z,updatedAt2024-11-14T09:40:36.910Z},metafetchCount1,totalCount889,status1
Of course you can just save hardcoded cookie and token to the variable:
In[82]:=
$WAEXCredentials="Cookie""ccdb.sid=s%3A2N80n51BC5saDAEm83SWKrWH3sDFxmS6.%2BDAzW0RlfI2V%2BdE0riWw8oTxPMBN59pTloTVpsVjhuc; Path=/; Expires=Fri, 21 Mar 2025 18:21:38 GMT; HttpOnly; SameSite=Strict","csrf_token""7DlR6vkT"
Out[82]=
Cookieccdb.sid=s%3A2N80n51BC5saDAEm83SWKrWH3sDFxmS6.%2BDAzW0RlfI2V%2BdE0riWw8oTxPMBN59pTloTVpsVjhuc; Path=/; Expires=Fri, 21 Mar 2025 18:21:38 GMT; HttpOnly; SameSite=Strict,csrf_token7DlR6vkT

One time cookie and csrf_token

And the last way - passing cookie and csrf_token directly to optionvalue Credentials:
In[81]:=
WAEXExchanges["limit"1,"Credentials""Cookie""ccdb.sid=s%3A2N80n51BC5saDAEm83SWKrWH3sDFxmS6.%2BDAzW0RlfI2V%2BdE0riWw8oTxPMBN59pTloTVpsVjhuc; Path=/; Expires=Fri, 21 Mar 2025 18:21:38 GMT; HttpOnly; SameSite=Strict","csrf_token""7DlR6vkT"]

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com