Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • IRewardsResponse

Index

Methods

  • claimRewards(provider: Provider, owner: PublicKey, info: IRewardsInfo): Promise<TransactionEnvelope>
  • claim distributor rewards

    example
    import { useRewards } from '@pngfi/react-hooks';
    const { claimRewards } = useRewards();
    const claimTx = await claimRewards(provider, publicKey, {
    distributor: data.distributor,
    amount: data.amount.toString(),
    claimAddress: data.claimAddress || '',
    proof: data.proof,
    mint: data.mint,
    index: data.index,
    });

    Parameters

    Returns Promise<TransactionEnvelope>

  • Confirm insert distributor

    example
    await confirmInsertDistributor({
    distributor: newDistributor,
    status: 'SUCCESS', // 'CANCEL', 'ERROR'
    }, {
    'X-PNG-SIGNATURE': await signAuth(signMessage, 'Create Distributor'),
    'X-PNG-ADDRESS': publicKey.toString()
    });

    Parameters

    Returns Promise<any>

  • Confirm update distributor

    example
    await confirmUpdateDistributor({
    distributor: distributorAddress,
    previousEpochID: distributor.epochID,
    status: 'SUCCESS', // 'CANCEL', 'ERROR'
    }, {
    'X-PNG-SIGNATURE': await signAuth(signMessage, 'Update Distributor'),
    'X-PNG-ADDRESS': publicKey.toString()
    });

    Parameters

    Returns Promise<any>

  • deleteDistributor(address: string, headers: IConfirmHeader): Promise<any>
  • Delete distributor

    example
    const result = await deleteDistributor((
    address,
    {
    'X-PNG-SIGNATURE': await signAuth(signMessage, 'Delete Distributor'),
    'X-PNG-ADDRESS': publicKey.toString()
    }
    ));

    Parameters

    Returns Promise<any>

  • get distributor

    example
    const distributor = await getDistributors(address);
    

    Parameters

    • address: string

    Returns Promise<IDistributorResponse>

  • get distributors

    example
    const distributors = await getDistributors(account);
    

    Parameters

    • account: string

    Returns Promise<IDistributorResponse[]>

  • Insert distributor

    example
    const  = insertDistributor({
    provider,
    adminAuth,
    data: {
    "title": "coinId-Airdrop-22-05-21",
    "token": {
    symbol: '',
    mint: '',
    decimals: 9
    },
    "rewards": [{
    "dest": "x39AvmSeyFFbxuKWJhSG53rTK9bQ69Sv9nZ8e6zCCPw1",
    "amount": "10000000000000"
    }]
    }
    });

    Parameters

    Returns Promise<{ distributor: IMerkleRewardsInsertResponse; txe: TransactionEnvelope }>

  • only insert distributor data

    example
    const  = insertDistributorMerkleRewards({
    "title": "coinId-Airdrop-22-05-21",
    "base": "xxAfjgadh9yWRogsXJ1wXQBMKj36ostXMn8LpS1zQp1W",
    "projectID": "coinId",
    "epochID": 134662756,
    "adminAuth": "x39AvmSeyFFbxuKWJhSG53rTK9bQ69Sv9nZ8e6zCCPw1",
    "mint": "x6VYF5jXq6rfq4QRgGMG6co7b1Ev1Lj7KSbHBxfQ9e1L",
    "rewards": [{
    "dest": "x39AvmSeyFFbxuKWJhSG53rTK9bQ69Sv9nZ8e6zCCPw1",
    "amount": "10000000"
    }]
    });

    Parameters

    Returns Promise<IMerkleRewardsInsertResponse>

  • update distributor

    example
    const  = updateDistributor({
    provider,
    distributor,
    adminAuth,
    data: {
    "title": "coinId-Airdrop-22-05-21",
    "token": {
    symbol: '',
    mint: '',
    decimals: 9
    },
    "rewards": [{
    "dest": "x39AvmSeyFFbxuKWJhSG53rTK9bQ69Sv9nZ8e6zCCPw1",
    "amount": "10000000000000"
    }]
    }
    });

    Parameters

    Returns Promise<{ distributor: IMerkleRewardsInsertResponse; txe: TransactionEnvelope }>

Generated using TypeDoc