This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

@hubbleprotocol/distributor
TypeScript icon, indicating that this package has built-in type declarations

0.1.4 • Public • Published

Distributor SDK

Distributor SDK is a TypeScript client SDK used to interact with the distributor contract

How to install the SDK

npm

yarn add @hubbleprotocol/distributor-sdk
yarn update @hubbleprotocol/distributor-sdk

How to use the SDK

// Initialize the client and then you can use it to fetch data by calling it
const distributorClient = new Distributor(env.provider.connection);

// To check wether tokens are claimable 
// merkleDistributorPublicKey - should be taken from the api
const isClaimable = await distributorClient.isClaimable(merkleDistributorPublicKey);

// To check wether tokens have been already claimed or not for a specific user
// merkleDistributorPublicKey - should be taken from the api
// userAddress - the address that is claiming
const userClaimed = await distributorClient.userClaimed(merkleDistributorPublicKey, userAddress);

// To get a new claim ixn - this includes the ATA creation ixn if it's needed
// merkleDistributorPublicKey - should be taken from the api
// userAddress - the address that is claiming
// amountLamports - should be taken from the api (it has to match the value from the api - can't do partial claim)
// proof - should be taken from the api
const newClaimIxn = await distributorClient.getNewClaimIx(merkleDistributorPublicKey, userAddress, amountLamports, proof);

/@hubbleprotocol/distributor/

    Package Sidebar

    Install

    npm i @hubbleprotocol/distributor

    Weekly Downloads

    0

    Version

    0.1.4

    License

    Apache-2.0

    Unpacked Size

    354 kB

    Total Files

    100

    Last publish

    Collaborators

    • andreihrs
    • elliotkennedy
    • hubbleadmin
    • mihalex
    • peroxy
    • siltros971
    • valqrtis