@hypha-dao/ual-hypha
v1.1.0
Published
UAL implementation for Hypha Wallet
Downloads
67
Readme
UAL Hypha Authenticator 🔐
UAL implementation of Hypha Authenticator for Hypha Wallet.
Overview
The Universal Authenticator Library creates a single universal API which allows app developers to integrate multiple signature providers with just a few lines of code. This is done through custom Authenticators
.
An Authenticator
represents the bridge between UAL and a custom signing method.
A developer that wishes to add support for their signature provider to UAL must create an Authenticator
by implementing 2 classes. An Authenticator
and a User
.
The Authenticator
class represents the business logic behind the renderer, handles login/logout functionality and initializes the User
class.
Logging in returns 1 or more User objects. A User
object provides the ability for an app developer to request the app User
sign a transaction using whichever authenticator they selected when logging in.
Installation
npm i ual-hypha
( or yarn add ual-hypha
)
Usage
In your main app js file
const telosChain = {
chainId: "4667b205c6838ef70ff7988f6e8257e8be0e1284a2f59699054a018f743b1d11",
rpcEndpoints: [
{
protocol: "https",
host: "api.telosfoundation.io",
port: "443",
},
],
};
const hypha = new HyphaAuthenticator([telosChain], { appName: "Hypha App" });