npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

glip-wallet-sdk

v1.0.119

Published

Guide for installation and usage of Glip's Web3 Wallet.\ Glip Wallet through its SDK provides a signer using which a user's transaction can be signed.\ It also contains a iframe based UI element which can be embedded into any webpage.\ The UI contains

Downloads

71

Readme

Glip Wallet JS Docs

Guide for installation and usage of Glip's Web3 Wallet.
Glip Wallet through its SDK provides a signer using which a user's transaction can be signed.
It also contains a iframe based UI element which can be embedded into any webpage.
The UI contains features to check balance, change currency, transfer and swap tokens.\

Demo app link:

Demo App

Demo app code link:

Demo App Code

Installation

NPM

npm i glip-wallet-sdk

Yarn

yarn add glip-wallet-sdk

Add to HTML

You can only directly add to HTML page.

This will add the variable glipWalletSDK to window. You can access it using window.glipWalletSDK

<script src='https://cdn.jsdelivr.net/npm/[email protected]/dist/bundle.js'></script>

Usage

Initialization

First we need to ensure a div with id glip-wallet in the html body.

<div id="glip-wallet"></div>


It is best to keep the initilization code in a seprate file.

```js
import { getGlipWallet } from 'glip-wallet-sdk/wallet';
let initializedGlipWallet = false;

const getInitializedGlipWallet = async () => {
    return await getGlipWallet({
        chainId: 80001,
        authNetwork: 'cyan',
        clientIdentifier: '63020e1ef81e3742a278846a'
    });
    return glipWalletSDK;
};

export default getInitializedGlipWallet;

Now you can import glip wallet anywhere you need in your app and no need to re re-initialize it.

  let glipWallet = await getInitializedGlipWallet()

Login/Logout

To login or logout a user, you can use croak's prebuilt UI or build your own and call SDK methods. To use prebuilt UI

showConnectModal

glipWallet.showConnectModal(['google'])

This will show a modal with a login with google button. If you are building your own UI you can directly call the login methods

login

  glipWallet.login('google')

isConnected

let isConnected = await glipWallet.isConnected();
console.log(isConnected); // will be a boolean.

logout

await glipWallet.logout()

User Details

Methods to fetch user details

getUserInfo

Get details about the logged in user.

let userInfo = await glipWallet.getUserInfo();
console.log(userInfo.email);
console.log(userInfo.name);
console.log(userInfo.profileImage);
console.log(userInfo.publicAddress);

getUserBalance

Get details about the logged in user.

let balance = await glipWallet.getBalance();
console.log(balance);