0.10.2 • Published 11 months ago
@elrond-giants/erdjs-auth v0.10.2
MultiversX Auth Providers
Overview
This library aims to make it easy to authenticate and sign transactions on MultiversX network. It offers a common interface for all auth providers.
Install
npm install @elrond-giants/erdjs-auth
Usage
The library comes with simple provider factories for all providers. You can customize them by extending them, or you can choose not to use them at all.
import {ExtensionProviderFactory} from "@elrond-giants/erdjs-auth";
const provider = new ExtensionProviderFactory().createProvider();
await provider.init();
// you can pass a token to be included in auth signature
const token = "some-token";
await provider.login(token);
const address = provider.getAddress();
const authSignature = provider.getSignature();
Event listeners can be set for login/logout events.
import {WalletConnectProviderFactory} from "@elrond-giants/erdjs-auth";
const provider = new WalletConnectProviderFactory({
chainId: "D",
projectId: "yourProjectId"
}).createProvider();
provider.on(
"login",
() => {
const {address} = provider.toJson();
console.log(address);
}
);
const initialized = await provider.init();
If you are using a react-based framework we recommend using the @elrond-giants/erd-react-hooks
package as it makes the
authentication process even easier.
0.10.2
11 months ago
0.10.2-beta.0
2 years ago
0.10.1-beta.0
2 years ago
0.10.0
2 years ago
0.9.0
2 years ago
0.10.1-beta.1
2 years ago
0.8.0
2 years ago
0.6.0-beta.2
2 years ago
0.6.0-beta.1
2 years ago
0.5.0
2 years ago
0.7.0-alpha.0
2 years ago
0.4.3
3 years ago
0.4.2
3 years ago
0.4.1
3 years ago
0.4.0
3 years ago
0.3.0
3 years ago