0.0.14 • Published 2 years ago

@lollipop-protocol/sdk v0.0.14

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

lollipop-sdk package

TypeScript Docs

What's Lollipop?

Lollipop is a highly efficient multichain nft indexer.

This sdk provides methods for interaction with lollipop api and it’s solana contracts

The SDK allows interacting with lollipop, specifically:

  • getting user's fungible tokens.
  • getting user's nfts
  • preparing verifyQuest transactions to a lollipop contracts

Installation

Yarn

$ yarn add @lollipop-protocol/sdk

NPM

npm install @lollipop-protocol/sdk

Usage

Lollipop API

// Create an instance of LollipopAPI class for interaction with API
import { LollipopAPI } from "@lollipop-protocol/sdk";

const userPublicKey = new PublicKey("YOUR PUBLIC KEY");
const lollipopAPI = new LollipopAPI();

const fetchedUserData = await lollipopApi.getWalletInfo(
  userPublicKey.toString()
);

const userNFTs = await lollipopApi.getUserNFTs(userPublicKey.toString());

const userTokens = await lollipopApi.getUserFungibleTokens(
  userPublicKey.toString()
);

Lollipop Program

// Create an instance of LollipopProgram class for interaction with contracts
import { LollipopProgram } from "@lollipop-protocol/sdk";
import { useConnection, useWallet } from "@solana/wallet-adapter-react";

// use your quest id
const QUEST_ID = "***";
const { connection } = useConnection();
const { wallet, publicKey } = useWallet();

const lollipopProgram = new LollipopProgram({
  connection,
  wallet,
});

const verifyQuestTx = await lollipopProgram.getVerifyQuestTx({
  questId,
  payer: publicKey,
});

const isUserParticipantInQuest = await lollipopProgram.isUserParticipantInQuest(
  publicKey,
  QUEST_ID
);
0.0.14

2 years ago

0.0.10

2 years ago

0.0.11

2 years ago

0.0.12

2 years ago

0.0.13

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.3

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.6

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago