Giter Club home page Giter Club logo

Comments (2)

victorbutler avatar victorbutler commented on June 11, 2024 1

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!

from celsius-js-sdk.

andpi314 avatar andpi314 commented on June 11, 2024

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)?

from celsius-js-sdk.

Related Issues (5)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.