Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@nuvosphere.io/react-native-nuvo-sdk

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nuvosphere.io/react-native-nuvo-sdk

## 1 install package

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

This is a Nuvo SDK react native

Getting Started

1 install package


# OR using Yarn
yarn add  @nuvosphere.io/react-native-nuvo-sdk
# beta
yarn add  @nuvosphere.io/react-native-nuvo-sdk@beta

yarn add  "react-native-webview@12.1.0"

yarn add "@react-native-async-storage/async-storage@1.19.3"

yarn add  "react-native-modal-layer@1.0.8",

2 package.json

js package adapted to react-native

{
  "script": {
    "postinstall": "rn-nodeify --install buffer,crypto,stream,util,process,vm,assert,bn --hack --yarn"
  }
}

3 APP.tsx

Use ModalLayers to wrap the outermost layer of the application

import {ModalLayers} from 'react-native-modal-layer';

function App(): JSX.Element {
    return (
        <>
            <ModalLayers>
                xxxxx
            </ModalLayers>
        </>
    );
}

Use Example

For Android

  function handleToLogin() {
        rnNuvoSdkRef.current.Login({
            appId: APP_ID,
            appKey: APP_KEY,
            switchAccount:false
        }).then((res: any) => {
            console.log("login success:", res);setToken
            setToken(res);
        }).catch((err: any) => {
            console.log("exec err:", err)``
            setToken(JSON.stringify(err));
        });
    }

    function getUserInfo() {
        rnNuvoSdkRef.current.getUserInfo().then((res: any) => {
            console.log("getUserInfo success:", res);
            setUserInfo(JSON.stringify(res));
        });
    }

    function handleToTransfer() {
        rnNuvoSdkRef.current.transfer({
            "from": "0xf1181bd15E8780B69a121A8D8946cC1C23972Bd4",
            "to": "0xf1181bd15E8780B69a121A8D8946cC1C23972Bd4",
            "value": "1000000000000",
            "data": "0x",
            "chainId": 599
        }).then((res: any) => {
            console.log("transfer success:", res);
            setInfo(JSON.stringify(res));
        })
            .catch((err: any) => {
                console.log("exec err:", err)
                setInfo(JSON.stringify(err));
            });
        ;
    }

    function handleToContractTransfer() {
        rnNuvoSdkRef.current.contractTransfer({
            "contractAddress": "0x70E45aD1d427532d8E7A86bC2037be0fd00e4829",
            "ABI": "function transfer(address to,uint256 amount)",
            "method": "transfer",
            "args": ['0xf1181bd15E8780B69a121A8D8946cC1C23972Bd4', '100000000000'],
            "chainId": 599
        }).then((res: any) => {
            console.log("handleToContractTransfer success:", res);
            setInfo(JSON.stringify(res));
        })
            .catch((err: any) => {
                console.log("exec err:", err)
                setInfo(JSON.stringify(err));
            });
    }

    return (
        <>
            <ModalLayers>
                <View>
                    <Button title="to Login" onPress={() => handleToLogin()}/>
                    <Text>token: {token}</Text>
                    {token && (
                        <>
                            <Button
                                onPress={() => handleToContractTransfer()}
                                title=" contract Payable Method"
                            />
                            <Text>result: {info}</Text>
                            <Button
                                onPress={() => handleToTransfer()}
                                title=" transfer Method"
                            />
                            <Text>result: {info}</Text>
                        </>

                    )}
                    <Button title="Get User Info" onPress={() => getUserInfo()}/>
                    <Text>user info:{userInfo}</Text>
                    <RNNuvoSDK
                        ref={rnNuvoSdkRef}
                        appId={APP_ID}
                        apiHost={API_HOST}
                        oauthHost={OAUTH_URL}
                    >
                    </RNNuvoSDK>
                </View>
            </ModalLayers>
        </>
    );

FAQs

Package last updated on 02 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc