EOSIO / eosjs

General purpose library for the EOSIO blockchain.
http://eosio.github.io/eosjs
MIT License
1.43k stars 463 forks source link

JsSignatureProvider error when create new JsSignatureProvider #1130

Open midastouch-dev opened 2 years ago

midastouch-dev commented 2 years ago

I got the error when use JsSignatureProvider on React Native app. My code is

import { Api, JsonRpc, RpcError } from 'eosjs';
import { JsSignatureProvider } from 'eosjs/dist/eosjs-jssig';

const defaultPrivateKey = ['5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'];
const signatureProvider = new JsSignatureProvider(defaultPrivateKey);

The issue is

Possible Unhandled Promise Rejection (id: 0):
TypeError: priv.getPublicKey is not a function. (In 'priv.getPublicKey()', 'priv.getPublicKey' is undefined)
JsSignatureProvider@http://10.0.2.2:8081/index.bundle?platform=android&dev=true&minify=false&app=com.picomobilewallet&modulesOnly=false&runModule=true:201683:41
...

Please check this issue