Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@mirrorworld/evm.token-claim
Advanced tools
@usemirrorworld/evm.token-claim
Client SDKThis SDK contains the client side methods for the Token Claim EVM Smart Contract
🚨 Please make sure to add this NPM token in your
.npmrc
file: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
yarn add @usemirrorworld/evm.token-claim
Import the TokenClaimLib
instance into your client for using the Token Claim Smart Contract. It expects
a contractAddress
and provider
instance.
import { TokenClaimLib} from "@mirrorworld/evm.token-claim";
const RPC = "http://localhost:8500";
let provider = new ethers.providers.JsonRpcProvider(RPC);
let tokenClaimLib: TokenClaimLib = new TokenClaimLib(tokenClaim.address, provider);
Example: You can see example project in this is here
For setup up the claim pool call the "initializeClaimConfig" method
let tx = await tokenClaimLib.createInitializeClaimConfigTransactionRequest(caller.address, claimPoolName, ercTokenAddress, poolOwnerAddress, gasPrice, gasLimit);
const sigTx = await caller.signTransaction(tx);
const sentTx = await provider.sendTransaction(sigTx);
const txRe = await sentTx.wait();
For setting the enable or disable the claim pool, airdrop and claim call the "updateClaimConfig" method
let tx = await tokenClaimLib.createUpdateClaimConfigTransactionRequest(caller.address, claimPoolName, isEnable, isClaimEnable, isAirdropEnable, gasPrice, gasLimit);
const sigTx = await caller.signTransaction(tx);
const sentTx = await provider.sendTransaction(sigTx);
For top up the pool supply for claim and airdrop call the "addPoolSupply" method, but before calling this method caller must call of this method must call the ERC20 approve for this Token Claim contract address as spender and amount which need to added in the supply
let tx = await tokenClaimLib.createAddPoolSupplyTransactionRequest(caller.address, claimPoolName, amount, gasPrice, gasLimit);
const sigTx = await caller.signTransaction(tx);
const sentTx = await provider.sendTransaction(sigTx);
For withdraw the pool supply call the "withdrawPoolSupply" method
let tx = await tokenClaimLib.createWithdrawPoolSupplyTransactionRequest(caller.address, claimPoolName, amount, receiver, gasPrice, gasLimit);
const sigTx = await caller.signTransaction(tx);
const sentTx = await provider.sendTransaction(sigTx);
For airdrop the token to the user call the "airdrop" method
let tx = await tokenClaimLib.createAirdropTransactionRequest(caller.address, claimPoolName, amount, user, gasPrice, gasLimit);
const sigTx = await caller.signTransaction(tx);
const sentTx = await provider.sendTransaction(sigTx);
For user to claim the token claim pool owner need to sign the payload with "claim ID (season ID)" and create the transaction which user send to the network
let claimMsg = tokenClaimLib.getClaimMessage(claimPoolName, caller.address, BigNumber.from(amount), claimId)
let claimSig = await tokenClaimLib.signMessage(ownerWallet, claimMsg)
let tx = await tokenClaimLib.createClaimTransactionRequest(caller.address, claimPoolName, amount, claimId, claimSig, gasPrice, gasLimit);
const sigTx = await caller.signTransaction(tx);
const sentTx = await provider.sendTransaction(sigTx);
const txRe = await sentTx.wait();
FAQs
Air Droper Contract SDK
The npm package @mirrorworld/evm.token-claim receives a total of 7 weekly downloads. As such, @mirrorworld/evm.token-claim popularity was classified as not popular.
We found that @mirrorworld/evm.token-claim demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.