💸Tips

Tip Users and Groups / Spaces with MATIC or any ERC-20 token on Polygon

Table of Contents


Events

logAddTip

This event is emitted when a tip is added to a post.

logClaimTips

This event is emitted when tips are claimed by a user or group.

logTaggedTip

This event is emitted when a tagged tip is made.

logTaggedTipERC20

This event is emitted when a tagged ERC20 tip is made.


Public Functions

getTippersFromMsgID

Returns a list of addresses that tipped a post and how much they tipped in MATIC.

Parameter
Type
Description

msgID

uint256

the message ID to get tips from

startFrom

uint256

the number to start getting records from

let msgID = 123;
let startFrom = 0;

const tippers = await contract.getTippersFromMsgID(msgID, startFrom);
console.log(tippers);

checkTips

Checks to see how much in tips are owed to an address of a user or group.

Parameter
Type
Description

addr

address

the address to check for tips owed to

let addr = "0x...";
const tips = await contract.checkTips(addr);
console.log(tips);

claimTips

Claims tips owed to an address (user or group). If you pass a group ID, then you must be the owner of the group to claim the tips.

Parameter
Type
Description

groupID

uint256

the group ID to claim tips for

let groupID = 123;

await contract.claimTips(groupID);

addTipFromPost

Adds tips to a post. Tips are calculated from the value sent to this function.

Parameter
Type
Description

msgID

uint256

the message ID you want to add the tips to

let msgID = 123;
let value = ethers.utils.parseEther('0.1'); // 0.1 ether

await contract.addTipFromPost(msgID, {value: value});

Last updated