🔐

[Async] POST /tokens/:tokenId/communityAdminAirdrop

Asynchronously airdrop a token to a wallet as an admin
This endpoint allows a community admin to airdrop an allowlisted Kudos token to a particular wallet. This is the recommended path if you need to airdrop allowlisted Kudos tokens, as it obtains consent from the receiver (user) in the form of a signature. Note that you cannot airdrop tokens that are not associated with your community.

Caveat

  • This endpoint requires an API key. Refer to the Authentication doc for more info.
  • This endpoint also is an asynchronous endpoint, which means the initial call does not return the response immediately. Please refer to the Async Endpoint doc for more information about how to use these APIs.

Body

Field
Type
Description
receivingAddress
string
The ETH address that the admin will airdrop the token to.
adminAddress
string
The ETH address of the admin that is trying to airdrop a token. The signature generated should be signed by this admin address.
adminSignature
string
Signature that proves that the admin address signed the relevant information to airdrop the Kudos token. More info on how to generate the signature below.
receiverSignature
string
Signature that proves that the receiving address consents to receipt of the Kudos token. More info on how to generate the signature below.

How to generate the admin airdrop Kudos signature

What am I signing?

Using your Ethereum account’s private key, you are signing that you are trying to airdrop token of tokenId. You can only do this as an admin of the particular Kudos token’s associated community.
In addition, you must provide a signature from the receiving address for the airdrop token of tokenId . This receiving address is not required to be a member of the community, or allowlisted for the token.

Signing with Ethers.js

const adminTypes = {
CommunityAdminAirdrop: [
{ name: "tokenId", type: "uint256" },
],
};
const receiverTypes = {
CommunityAdminAirdropReceiverConsent: [
{ name: "tokenId", type: "uint256" },
],
};
// The data to sign
const value = {
tokenId: tokenId, // mandatory
};
// Domain info (if you're using the sandbox environment)
const domainInfo = {
name: 'Kudos',
// Mumbai
chainId: 80001,
verifyingContract: "0xB876baF8F69cD35fb96A17a599b070FBdD18A6a1"
};
// Domain info (if you're using the production environment)
const domainInfo = {
name: 'Kudos',
// Polygon - comment this out if you're on Mumbai
chainId: 137,
verifyingContract: "0x60576A64851C5B42e8c57E3E4A5cF3CF4eEb2ED6"
};
// Get signer
const provider = new ethers.providers.JsonRpcProvider(/* constructor params */);
const adminSigner = provider.getSigner(/* address */);
// Obtain signatures
const adminSignature: string = await adminSigner._signTypedData(domainInfo, adminTypes, value);
const receiverSignature: string = await receiverSigner._signTypedData(domainInfo, receiverTypes, value);

Example Response

// status
202 Created
// header
Location: /v1/operations/dc3a7730-53e2-4af6-acc9-d13b2fcf10e2
// body
{}