Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@broxus/airdrop-ui

Package Overview
Dependencies
Maintainers
0
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@broxus/airdrop-ui

Ton aidrop ui utils

  • 1.0.6
  • latest
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

The library provides the AirdropUI utility for implementing an airdrop form, examples of usage.

To implement your own logic:

  1. checkQueue -- checks if the user has an airdrop and their position in the queue

    import { checkQueue } from '@broxus/airdrop-ui'
    const checkResult = await checkQueue(apiBaseUrl, workspaceId, userAddress)
    

    checkResult will have one of the following values:

    1. noReward -- no reward for the user.
    2. inQueue -- a reward is available, and the user is in the queue. checkResult.place contains the user's current position in the queue. In this case, you need to repeat the checkQueue operation every 30 seconds.
    3. signed -- the user's turn has come, and you can proceed to the next step.
  2. buildTransaction -- prepares the data for calling a transaction

    import { buildTransaction } from '@broxus/airdrop-ui'
    import { Clock, EverscaleStandaloneClient } from 'everscale-standalone-client'
    import { CHAIN } from '@tonconnect/ui'
    
    const clock = new Clock()
    const providerRpcClient = new ProviderRpcClient({
        fallback: () =>
            EverscaleStandaloneClient.create({
                clock,
                connection: {
                    data: {
                        endpoint: 'https://jrpc-ton.broxus.com/rpc',
                    },
                    id: Number(CHAIN.MAINNET),
                    type: 'jrpc',
                },
            }),
        forceUseFallback: true,
    })
    const trxData = await buildTransaction(claimData, providerRpcClient, clock)
    
  3. Execute the transaction

    import { TonConnectUI } from '@tonconnect/ui'
    const tonConnectUI = new TonConnectUI()
    tonConnectUI.sendTransaction(trxData)
    

FAQs

Package last updated on 22 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc