npm package: @qiibee/react-native-qb-wallet-sdk
Description: React Native Wrapper of qiibee Wallet SDK
Author: Elvis Dedic
Latest version: 0.1.1

# React Native SDK

## Install SDK

```bash
npm install @qiibee/react-native-qb-wallet-sdk --save
```

## Import qbWalletSDK

```javascript
import QbWalletSdk from '@qiibee/react-native-qb-wallet-sdk';
```

## Get Wallet Address

```javascript
/**
* @address { "address" : "some_address" }
* @error { "error" : "error_description" } 
*/
QbWalletSdk.walletAddress((address, err) => {
    if (err) {
        console.log(err)
    } else {
        console.log(address)
    }
})
```

## Get Private Key

```javascript
/**
* @privateKey { "privateKey" : "some_private_key" }
* @error { "error" : "error_description" } 
*/
QbWalletSdk.privateKey((privateKey, err) => {
    if (err) {
        console.log(err)
    } else {
        console.log(privateKey)
    }
})
```

## Get Mnemonic Phrase

```javascript
/**
* @phrase { "phrase" : "some_phrase" }
* @error { "error" : "error_description" } 
*/
QbWalletSdk.mnemonicPhrase((phrase, err) => {
    if (err) {
        console.log(err)
    } else {
        console.log(phrase)
    }
})
```

## Create new Wallet

```javascript
/**
* @wallet { "wallet" : { 
    "phrase": "...", 
    "address":"...", 
    "privateKey":"..." }
}
* @error { "error" : "error_description" } 
*/
QbWalletSdk.createWallet((wallet, err) => {
    if (err) {
        console.log(err)
    } else {
        console.log(wallet)
    }
})
```

## Remove existing Wallet

```javascript
/**
* @phrase { "success" : true }
* @error { "error" : "error_description" } 
*/
QbWalletSdk.removeWallet((success, err) => {
    if (err) {
        console.log(err)
    } else {
        console.log(success)
    }
})
```

## Restore Wallet

```javascript
/**
* @wallet { "wallet" : { 
    "phrase": "...", 
    "address":"...", 
    "privateKey":"..." }
}
* @error { "error" : "error_description" } 
*/
QbWalletSdk.restoreWallet((wallet, err) => {
    if (err) {
        console.log(err)
    } else {
        console.log(wallet)
    }
})
```

## Get Balances

```javascript
/**
* @balances { 
    "aggValue": { "USD": "agg_value_in_USD" }
    "balances" : { 
        "ethBalance": "value",
        "privateTokens": [
            "balance": "...",
            "address": "...",
            "symbol": "..."
        ],
        "publicTokens": [
            "balance": "...",
            "address": "...",
            "symbol": "..."
        ]
    }
}
* @error { "error" : "error_description" } 
*/
QbWalletSdk.getBalances((balancess, err) => {
      if (err) {
        console.log(err)
      } else {
        console.log(balances)
      }
    })
```

## Get Tokens

```javascript
/**
* @tokens {     
    "privateTokens": [
        "balance": "...",
        "address": "...",
        "symbol": "..."
    ],
    "publicTokens": [
        "balance": "...",
        "address": "...",
        "symbol": "..."
    ]
}
* @error { "error" : "error_description" } 
*/
QbWalletSdk.getTokens((tokens, err) => {
      if (err) {
        console.log(err)
      } else {
        console.log(tokens)
      }
    })
```

## Get Transactions

```javascript
/**
* @transactions {     
    "transactions": [
        {
            "address": "..",
            "from": "...",
            "to": "...",
            "timestamp": "...",
            "token": {
                "balance": "...",
                "cotnractAddress": "...",
                "symbol": "..."
            }
        }
    ]
}
* @error { "error" : "error_description" } 
*/
QbWalletSdk.getTransactions((transactions, err) => {
      if (err) {
        console.log(err)
      } else {
        console.log(transactions)
      }
    })
```

## Send Transaction

```javascript
/**
* @param {String} toAddress
* @param {String} contractAddress
* @param {String} sendValue

* @hash { "hash" : "some_hash" }
* @error { "error" : "error_description" } 
*/
QbWalletSdk.sendTransaction(
      "toAddress", 
      "contractAddress",
      "2.1",
      (hash, err) => {
        if (err) {
          console.log(err)
        } else {
          console.log(hash)
        }
      }
    )
```