Closed toffzz closed 2 years ago
It works if I copy dist/node.js
and reference it directly as a utils function.
Also, while I'm here and exploring StarkEx. This is using v2 Gateway which has a bunch of deprecated functions, correct? Like deposit referenced in https://starkware.co/StarkExRESTAPI/gateway.html?
Is there a JS library for v4 planned? Thanks for all the help! Excited about this.
I think I am confused as the readme says this is version2, but https://docs.starkware.co/starkex-v4/ links to that gateway reference as v4 rest API. If anyone can clear up what I am using please, thanks!
Can confirm const StarkExAPI = require('@starkware-industries/starkex-js/node');
does not work in a node environment
It also does not work for me
I use "@starkware-industries/starkex-js/dist/node"
to make it work
Hi @toffzz and thank you for reporting this issue!
After checking, we had an issue in our packing process. We will fix it in the next release.
In the meanwhile, keep using .../dist/node
of course.
Regarding your first question, I will start from the end and then explain - this JS library does support StarkEx v4.
The gateway is indeed still in its version2, the StarkEx itself as a package is in v4. The difference is not in the API but only in the way it is used. For example, in v4 in order to make a withdrawal, you must first make a transfer and only then a withdrawal.
The deprecated functions you see are indeed such, but in this SDK we use internally the non-deprecated API add_transaction
, so the external gateway functions of the SDK such as transfer
/withdrawal
/deposit
are just a matter of ease of use for those who use the SDK.
Thanks @dan-ziv !
And for module in nodeJS :
import StarkExAPI from '@starkware-industries/starkex-js/dist/node.js';
Describe the bug
Using:
const StarkExAPI = require('@starkware-industries/starkex-js/node');
I get the error:
Cannot find module '@starkware-industries/starkex-js/node'
To Reproduce Steps to reproduce the behavior:
npm install @starkware-industries/starkex-js
const StarkExAPI = require('@starkware-industries/starkex-js/node');
Error: Cannot find module '@starkware-industries/starkex-js/node'
Expected behavior
require('@starkware-industries/starkex-js/node')
should return package.var StarkExAPI = require('@starkware-industries/starkex-js
seems to work.Screenshots
Desktop (please complete the following information):
Additional context I just want to build with StarkEx!