Giter Site home page Giter Site logo

yunbi private api not work about ccxt HOT 16 CLOSED

86chenjie avatar 86chenjie commented on May 8, 2024
yunbi private api not work

from ccxt.

Comments (16)

86chenjie avatar 86chenjie commented on May 8, 2024 1

const yunbi = new ccxt.yunbi ({
// apiKey: '8NnHFhLaXt42CqnquZCfCtdkQUq1bfeu89bhj3jm',
// secret: '2rDJ7K7him971O83J7OvJUM2FsxB5Tgz7yzZ0NJy',
apiKey: 'jroBF8uJmFgHi3YKrYeRxSCeL3qtbLabaxcXxzoa',
secret: '7LjTck795Axt1lzLxxbz5qAnbkDxVEVm5wGt8rgp',
verbose: true
})
those 2 pairs are both valid. you can use them as you wish. 👍

from ccxt.

86chenjie avatar 86chenjie commented on May 8, 2024 1

New version work great for me. Thanks very much! :)

from ccxt.

kroitor avatar kroitor commented on May 8, 2024

Did you use the keys elsewhere before (in other software maybe)?

from ccxt.

kroitor avatar kroitor commented on May 8, 2024

Also, have you read and tried the steps from the Troubleshooting section of the manual?

from ccxt.

86chenjie avatar 86chenjie commented on May 8, 2024

i just generate a new pair key/secret. still 401. can you run the same code, i just posted. if it worked in your side, then it must be my problem.

from ccxt.

kroitor avatar kroitor commented on May 8, 2024

For yunbi.privateGetOrders () you need to specify a 'market' param like so:

// ...

// orders by product symbol
await yunbi.privateGetOrders ({ market: yunbi.products['BTC/CNY']['id'] })

// or

// orders by product id
await yunbi.privateGetOrders ({ market: 'btccny' })

// ...

This method is not a part of the unified ccxt API, it is a method of the custom Yunbi API, therefore it may need some uncommon params. Please, test it and report, standing by for updates from you.

upd: minor edits.

from ccxt.

86chenjie avatar 86chenjie commented on May 8, 2024

var info2 = await yunbi.privateGetMembersMe()
this api don't need any params, right?
can you run this line in your localhost? if it works, then it must be my problem.

from ccxt.

kroitor avatar kroitor commented on May 8, 2024

I'm not able to test their private API from where I am now, so we will have to test and return back to it a little later. It may be a bug in the library. Meanwhile, do not use their private API until we fix it. We're still waiting for them to resolve our verification, because we're not residents of China.

It would be very helpful, if you could send us a pair of keys for testing (if you can, remove all permissions, we only need to test the authentication with Yunbi, we don't need your balance, or anything else whatsoever). This way we could then test and help quicker (a fix would be ready in a couple of hours then).

from ccxt.

kroitor avatar kroitor commented on May 8, 2024

Thanks! We will get back to you shortly, will fix it asap.

from ccxt.

kroitor avatar kroitor commented on May 8, 2024

We're still debugging this, had to contact Yunbi support for their comment. No matter what we do with it, it still does not want to authenticate. Yet I'm sure it's a very basic problem and we will solve it as quickly as possible. Digging deeper now. Will update you on the progress.

from ccxt.

86chenjie avatar 86chenjie commented on May 8, 2024

👍

from ccxt.

kroitor avatar kroitor commented on May 8, 2024

Ok, we found the problem at last. Get ready for an update. Yunbi will be working since version 1.1.84+. It will be available within 30-40 minutes. Thank you very much for your help!

For those who might encounter the same problem: it is related to the request path, the signature should include the '.json' path format, without it it doesn't want to authenticate (this contradicts their own example, but still).

from ccxt.

kroitor avatar kroitor commented on May 8, 2024

I will post code for testing in several minutes here.

from ccxt.

86chenjie avatar 86chenjie commented on May 8, 2024

Great! 💯

from ccxt.

kroitor avatar kroitor commented on May 8, 2024

Ok, Yunbi is now available again with version 1.1.84+.
We tested it with both of your keypairs (thanks again for that!) :

"use strict";

let ccxt = require ('./ccxt')
let yunbi = ccxt.yunbi ({
	"apiKey": "8NnHFhLaXt42CqnquZCfCtdkQUq1bfeu89bhj3jm",
	"secret": "2rDJ7K7him971O83J7OvJUM2FsxB5Tgz7yzZ0NJy",

	// your keys need this
	// if you don't want to redefine nonce, then
	// just generate a new keypair and you should be fine now
	nonce: function () { return this.milliseconds (); }
})

let yunbi2 = ccxt.yunbi ({
	"apiKey": "jroBF8uJmFgHi3YKrYeRxSCeL3qtbLabaxcXxzoa",
	"secret": "7LjTck795Axt1lzLxxbz5qAnbkDxVEVm5wGt8rgp",

	// an alternative way to have milliseconds nonce
	nonce: Date.now,
})


async function test () {
	await yunbi.loadProducts ()
	console.log (await yunbi.fetchBalance ())
	await yunbi2.loadProducts ()
	console.log (await yunbi2.fetchBalance ())
}

test ()

We fixed an internal problem in the library, and you also need to override the nonce, if you want to continue using these keys. Please report after you test it, if everything is ok on your side now. Thanks!

from ccxt.

kroitor avatar kroitor commented on May 8, 2024

Thank you! Respect!

from ccxt.

Related Issues (20)

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.