This authenticator is meant to be used with Anchor and Universal Authenticator Library. When used in combination with them, it gives developers the ability to request transaction signatures through Anchor using the common UAL API.
- The Anchor Authenticator only supports both Desktop and Mobile environments
yarn add ual-anchor
You must use one of the UAL renderers below.
React - ual-reactjs-renderer
PlainJS - ual-plainjs-renderer
import { Anchor } from 'ual-anchor'
import { UALProvider, withUAL } from 'ual-reactjs-renderer'
const exampleNet = {
chainId: '',
rpcEndpoints: [{
protocol: '',
host: '',
port: '',
}]
}
const App = (props) => <div>{JSON.stringify(props.ual)}</div>
const AppWithUAL = withUAL(App)
const anchor = new Anchor([exampleNet], {
// Required: The app name, required by anchor-link. Short string identifying the app
appName: 'Example App',
// Optional: a JsonRpc instance from eosjs to use internally
rpc: new JsonRpc(),
// Optional: The callback service URL to use, defaults to https://cb.anchor.link
service: 'https://cb.anchor.link',
// Optional: A flag to disable the Greymass Fuel integration, defaults to false (enabled)
disableGreymassFuel: false,
// Optional: A flag to enable the Anchor Link UI request status, defaults to false (disabled)
requestStatus: false,
})
<UALProvider chains={[exampleNet]} authenticators={[anchor]}>
<AppWithUAL />
</UALProvider>