2.1.4 • Published 2 years ago

@hnipps/connect-wallet v2.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Connect Wallet

Usage

Connect Wallet

import { connectWallet } from "@hnipps/connect-wallet";

const result = await connectWallet();

console.log(result); // { success: true, address: "0x1234"}

Get $ALPHA Balance

import { getAlphaBalance } from "@hnipps/connect-wallet";

const result = await getAlphaBalance();

console.log(result); // 1000

Subscribe to AlphaSquare

import {
  connectWallet,
  approveAlpha,
  subscribe,
  isSubscriptionValid,
} from "@hnipps/connect-wallet";

await connectWallet();

await approveAlpha(10);

await subscribe(USER_ID); // USER_ID should be the AlphaSquare user ID not the wallet address

const result = await isSubscriptionValid(USER_ID);
console.log(result); // true

Verify Wallet Ownership

To be used when you need to confirm if the current users owns the wallet they say they do, e.g. before creating an Alpha NFT.

This function is already built into the connect wallet flow.

import { verifyOwnership } from "@hnipps/connect-wallet";

const result = await verifyOwnership("Some string to display in wallet");

console.log(result); // true
2.1.4

2 years ago

2.1.2

2 years ago

2.0.3

2 years ago

2.1.1

2 years ago

2.0.2

2 years ago

2.1.3

2 years ago

2.1.0

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago