Javascript SDK for MathWallet5
Install
npm install mathwallet5-js-sdk
Require module
var mathwallet = require('mathwallet5-js-sdk);
Drop the dist/mathwallet.min.js
bundle into your html project
<script src="path/to/mathwallet.min.js"></script>
Get instance
var mathwallet = window.mathwallet;
注意: 此SDK需要在麦子钱包的DAPP浏览器中使用
Note: The SDK needs to be used in the MathWallet DAPP Browser.
适用于麦子钱包DAPP浏览器的通用方法
Common method for MathWallet DAPP Browser
mathwallet.isMathWallet();
Return
true
获取用户麦子钱包信息
Get user MathWallet info
mathwallet.getAppInfo().then(console.log);
Return
{
"name": "MathWallet5",
"client": "iOS",
"version": "1.0.0",
"deviceId": "2FB1AD00-20C7-45FF-AE94-A2F30A02F8F6"
"language": "en",
}
获取用户当前钱包信息
Get user current wallet info
mathwallet.getCurrentWallet().then(console.log);
Return
{
"chainType":"EVM",
"chainId":"1",
"name":"ETH-01",
"address":"0x000000000000000000000000000000"
}
从当前链所有钱包中,选出要授权的钱包
Get user wallet info
mathwallet.walletPicker().then(console.log);
Return
{
"chainType":"EVM",
"chainId":"1",
"name":"ETH-01",
"address":"0x000000000000000000000000000000"
}
如果您希望将您开发的DAPP加入麦子钱包,请通过邮箱联系我们 [email protected]
If you would like to list your DAPP in Math Wallet, please send your DAPP information to [email protected]