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

Unable to use Wallet in thetajs #180

Open
the-xperimentalist opened this issue Apr 11, 2022 · 1 comment
Open

Unable to use Wallet in thetajs #180

the-xperimentalist opened this issue Apr 11, 2022 · 1 comment

Comments

@the-xperimentalist
Copy link

the-xperimentalist commented Apr 11, 2022

Hello, posting here since couldn't find theta js repository.
I am following the Get Started tutorials of theta js. And am unable to import all the objects, as required. The following is the initial code:

import './style.css'
import * as THETA from "@thetalabs/theta-js";

console.log(THETA)

const provider = new THETA.providers.HttpProvider()

const privateKey = "0x0000000000000000000000000000000000000000000000000000000000000000"
const wallet = new THETA.Wallet(privateKey)

console.log(wallet)

Here, I am getting the following error in the line where the wallet is created:

Uncaught TypeError: can't access property "fromRed", this.x is null
    getX thetajs.umd.js:37573
    _encode thetajs.umd.js:37078
    encode thetajs.umd.js:37087
    getPublic thetajs.umd.js:38496
    SigningKey thetajs.umd.js:39004
    Wallet thetajs.umd.js:56009
    <anonymous> script.js:9
    <anonymous> bundle.bc5303e438ec3245.js:70102
    <anonymous> bundle.bc5303e438ec3245.js:70104
thetajs.umd.js:37573
    getX thetajs.umd.js:37573
    _encode thetajs.umd.js:37078
    encode thetajs.umd.js:37087
    getPublic thetajs.umd.js:38496
    SigningKey thetajs.umd.js:39004
    Wallet thetajs.umd.js:56009
    <anonymous> script.js:9
    <anonymous> bundle.bc5303e438ec3245.js:70102
    <anonymous> bundle.bc5303e438ec3245.js:70104

My package json dependencies are:

    "dependencies": {
        "@babel/core": "^7.15.8",
        "@babel/preset-env": "^7.15.8",
        "@thetalabs/theta-js": "^0.0.67",
        "babel-loader": "^8.2.3",
        "clean-webpack-plugin": "^4.0.0",
        "copy-webpack-plugin": "^9.0.1",
        "css-loader": "^6.5.0",
        "file-loader": "^6.2.0",
        "html-loader": "^3.0.0",
        "html-webpack-plugin": "^5.5.0",
        "mini-css-extract-plugin": "^2.4.3",
        "portfinder-sync": "0.0.2",
        "raw-loader": "^4.0.2",
        "style-loader": "^3.3.1",
        "webpack": "^5.60.0",
        "webpack-cli": "^4.9.1",
        "webpack-dev-server": "^4.4.0",
        "webpack-merge": "^5.8.0"
    }

I am using webpack for working on the page right now. Don't think that should cause an issue. Please let me know

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

No branches or pull requests

5 participants
@the-xperimentalist and others