0.1.0-no-web3j • Published 10 months ago

walletsdk-ethos v0.1.0-no-web3j

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

WalletSDK for React Native

Important

If you are using expo, you need to use this SDK: expo-walletsdk. This SDK won't work with expo.

Installation

npm install ethos-walletsdk

Also make sure to change the minSdkVersion to 27 in android/build.gradle in your react native project.

Usage

How to import SDK

import { isEthOS, getAddress, SignMessageParams, signMessage, TransactionParams, sendTransaction } from 'walletsdk-ethos';

How to know if you're on ethOS

isEthOS().then((isEthOS) => {
    if (isEthOS) {
        setResult("It's EthOS");
    } else {
        setResult("It's not EthOS");
    }
});

How to sign a message

// How to sign Message
var params: SignMessageParams = {
    message: 'Hello World',
};
signMessage(params).then((signature) => {
    console.log("signature: " + signature)
});

How to send a Transaction

// How to send send Transactions
var params: TransactionParams = {
    to: "",
    value: "1000000000000000000", // 1 eth in wei
    data: ""
}
sendTransaction(params).then((txHash) => {
    console.log("txHash: " + txHash)
});

License

MIT


Made with create-react-native-library

0.2.1

10 months ago

0.2.0

10 months ago

0.1.0-no-web3j

10 months ago

0.2.3

10 months ago

0.2.2

10 months ago

0.1.0

1 year ago