Coin Manager React App (api-address-verifier-apollo)
Demo
Branches
Master
![Maintainability](https://api.codeclimate.com/v1/badges/fb3d2115a8ee406da3f5/maintainability)
Develop
![BCH compliance](https://bettercodehub.com/edge/badge/xylabs/api-address-verifier-apollo?branch=develop)
Description
Apollo api with react codegen components for ethereum address verification
Getting Started
- Via terminal,
cd
into the api-address-verifier-apollo
directory. - Make sure you have Node.js Version 10.x or later installed: Latest Node.js Versions
- Make sure you have npm installed. How to Install npm
- In your terminal run
yarn
- In your terminal run
yarn dev
React component usage
Example
- In react codebase
yarn add @xyo-network/api-address-verifier-apollo @xyo-network/tool-storybook-react
import {
VerifyType,
withVerifyAddress,
VerifyAddressProvider,
withMyVerifiedAddresses,
VerifiedAddress,
} from '@xyo-network/api-address-verifier-apollo'
import {
SignButton,
ISigningValues,
} from '@xyo-network/tool-storybook-react/dist/lib/Signing'
const SIGNING_DATA = 'I <3 XYO'
export const VerifyAddresses = withVerifyAddress()(({ mutate }) => {
const onSuccess = async ({ address, signature, error }: ISigningValues) => {
try {
if (error) throw error
await mutate({
variables: {
type: VerifyType.Sign,
data: SIGNING_DATA,
address,
signature,
},
})
} catch (e) {
}
}
return <SignButton data={SIGNING_DATA} onSuccess={onSuccess} />
})
export const MyVerifiedAddresses = withMyVerifiedAddresses()(({ data }) => {
return <YourAddressListComponent verifiedAddresses={data.verifiedAddresses} />
})
export default () => {
return (
<VerifyAddressProvider
getRequestContext={async () => ({ headers: {
'X-Auth-Token': `${usertoken}`
...headers
} })}
>
<>
<VerifyAddresses />
<MyVerifiedAddresses />
</>
</VerifyAddressProvider>
)
}
License
Only for internal XY - The Persistent Company use at this time.
Credits
Made with ❄️ and 🔥 by XY - The Persistent Company