-
Notifications
You must be signed in to change notification settings - Fork 5
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
How to use eosjs-rn in react-native project? #10
Comments
I try to reproduce this issue according your I think there is some problems with |
eosjsTest.zip |
|
hey, this projects uses |
|
still ok with Android Simulator |
can you speak chinese? use wechat? haha~ @JadeTao |
you can send me ur wechat via email |
ok, thanks |
i have sent email to you but not respond, did you received the email? |
no...and I test my google mail. it works. |
I have figured out this problem.
related issue: —— |
core-js helps out. |
it also helps me out. tks |
react-native version
0.57.8
package.json content
{
"name": "eosjsTest",
"version": "0.0.1",
"private": true,
"scripts": {
"start": "node node_modules/react-native/local-cli/cli.js start",
"test": "jest"
},
"dependencies": {
"react": "16.6.3",
"react-native": "0.57.8",
"eosjs-rn": "^20.0.0-beta3"
},
"devDependencies": {
"babel-jest": "23.6.0",
"jest": "23.6.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3"
},
"jest": {
"preset": "react-native"
}
}
Version of EOSJS
20.0.0-beta3
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
1.
import { Api, JsonRpc, RpcError } from 'eosjs-rn';
import JsSignatureProvider from 'eosjs-rn/dist/eosjs-jssig';
import { TextEncoder, TextDecoder } from 'text-encoding';
2.
const defaultPrivateKey = "5JtUScZK2XEp3g9gh7F8bwtPTRAkASmNrrftmx4AxDKD5K4zDnr";
const signatureProvider = new JsSignatureProvider([defaultPrivateKey]);
const rpc = new JsonRpc('http://127.0.0.1:8888', { fetch });
const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() });
(async () => {
const result = await api.transact({
actions: [{
account: 'eosio.token',
name: 'transfer',
authorization: [{
actor: 'useraaaaaaaa',
permission: 'active',
}],
data: {
from: 'useraaaaaaaa',
to: 'useraaaaaaab',
quantity: '0.0001 SYS',
memo: '',
},
}]
}, {
blocksBehind: 3,
expireSeconds: 30,
});
console.dir(result);
})();
Expected behavior
can not run correctly
Screenshots
The text was updated successfully, but these errors were encountered: