钱包 RN App 钱包开发组件封装,需要的收藏

hule0305 · May 13, 2018 · Last by gk5 replied at September 06, 2018 · 2410 hits

RN App钱包开发组件封装,需要的收藏

官方的eosjs库在RN里遇到很多问题,自己整理一个很容易用的组件,有需要的可以收藏下

git:https://github.com/smartblock18/react-native-eos.git

Eos服务部署可以参考下面链接

see https://github.com/smartblock18/eos.git

安装

npm install react-native-eosjs --save

使用

App.js 添加 EosProvider

import {EosProvider} from "react-native-eosjs";

<EosProvider server="http://127.0.0.1:8888" />

通过种子生成密钥对

import {Eos} from "react-native-eosjs";

Eos.seedPrivateKey("onwer help world","active help world",(r)=>{

})

创建账户(生产环境中,创建需放到后台)

Eos.createAccount("eosio","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3","aaa",onwerPublic,activePublic,(r)=>{

});

余额查询

Eos.balance("eosio","aaa",(r)=>{

});

转账(可以直接前端转账,也可以生成转账信息发给后台,后台再广播)

Eos.transfer("eosio","aaa","1000.0000 ABC","","5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3",true,(r)=>{

});

共收到 1 条回复

你好,我下载了eosjs组建,安装错误,求指导,谢 谢!

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up