Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can a simple user consume your API? #58

Open
guldil opened this issue Feb 16, 2021 · 2 comments
Open

Can a simple user consume your API? #58

guldil opened this issue Feb 16, 2021 · 2 comments
Labels
question Further information is requested

Comments

@guldil
Copy link

guldil commented Feb 16, 2021

Hello

I'm an user of Celcius, i just want to consume API to export my balance wallet every day.

Is it possible ?

Thanks

Guldil

@guldil guldil added the question Further information is requested label Feb 16, 2021
@victorbutler
Copy link

Same here, so I will share what I did.

Here is where I went: https://developers.celsius.network/

  1. You need to request a Partner API key. Email link is at the bottom of the page.

After you get a key from the Business Development team

  1. Authenticate in the SDK using API_KEY and follow the calls in the test script - that worked for me.
  Celsius({
    authMethod: AUTH_METHODS.API_KEY,
    partnerKey: partnerKey, // Requested from https://developers.celsius.network/
    environment: ENVIRONMENT.PRODUCTION,
  })
    .then((celsius) => {
      celsius
        .getBalanceSummary(userApiKey)
        .then((balanceSummary) => {
          console.log(balanceSummary);
        })
        .catch((error) => {
          console.log("Error", error);
        });
    })
    .catch((e) => {
      console.error("Error", e);
    });

Example response balanceSummary

{
  balance: {
    eth: '0',
    btc: '0',
    dash: '0',
    bch: '0',
    bsv: '0',
    ltc: '0',
    zec: '0',
    btg: '0',
    xrp: '0',
    xlm: '0',
    omg: '0',
    tusd: '0',
    gusd: '0',
    pax: '0',
    paxg: '0',
    usdc: '0',
    dai: '0',
    mcdai: '0',
    cel: '0',
    zrx: '0',
    orbs: '0',
    'usdt erc20': '0',
    tgbp: '0',
    taud: '0',
    thkd: '0',
    tcad: '0',
    eos: '0',
    sga: '0',
    sgr: '0',
    xaut: '0',
    etc: '0',
    bat: '0',
    busd: '0',
    knc: '0',
    link: '0',
    lpt: '0',
    matic: '0',
    snx: '0',
    uma: '0',
    uni: '0',
    mana: '0',
    comp: '0',
    spark: '0',
    steth: '0',
    aave: '0',
    bnt: '0'
  }
}
  1. Where you see userSecret or apiKey parameters in the documentation/code, that's the Celsius user generated API key (Celsius App, go to Profile > API Key > Generate API Key)

References

Good luck!

@andpi314
Copy link

andpi314 commented Jun 18, 2021

Hi, I have yet to understand why it doesn't work, but in my case after having received a proper partnerKey (a partner one, securely transmitted by Celsius via email) and set the sdk to work with partnerKey (partner) and userSecret (created through the app) I received these errors:

This is shown in a normal browser:


Unhandled Rejection (Error): No signature was provided for verification.

while this appears if I run chrome in dev mode (--disable-web-security)


Unhandled Rejection (Error): wrong public key type

For your reference, my init code is as follows:

const initCelsius = async () => {
    const celsius = await Celsius({
      authMethod: AUTH_METHODS.API_KEY,
      partnerKey: "****",
      environment: ENVIRONMENT.PRODUCTION,
    })
    const rates = celsius.getInterestRates(
      "****"
    )
    console.log(rates)
  }

I also tried the combinations of auth keys in Postman, and I've successfully been able to get a response, so the problems is somewhere else.

Could the problem be due to the fact that I'm using the sdk on the frontend side (react)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants