The Airstack Frames SDK empowers developers to seamlessly integrate onchain data, including token balances, token mints, Farcaster followers and followings, POAPs, and more, into their Frames using just a few lines of code.
Additionally, developers can leverage the SDK to create an allow list feature, enabling checks for token ownership, token mints, following status, and more.
Designed with TypeScript, the SDK offers full type support for those building Frames with TypeScript.
Get trending mints in a given time frame by simply specifying the audience, criteria, and time frame that you prefer. All analysis and sorting will be done for you and you simply just need to receive the response from this function.
Input
Field
Type
Required
Description
audience
Audience
true
The audience to get trending mints for
criteria
Criteria
true
The criteria to analyze and sort trending mints
timeFrame
TimeFrame
true
The time frame to analyze the trending mints, e.g. the last 1 hour
limit
number
false
Number of results per pages. Maximum value is 200. For more results, use paginations.
[{"address":"0x9d70ccd59b3124e5227a9148413892f947697afd","erc1155TokenID":"","criteriaCount":1880,"timeFrom":"2024-03-07T15:17:00Z","timeTo":"2024-03-08T14:52:00Z","name":"Base's 2024 Mission, Strategy and Roadmap","symbol":"BASES2024MISSIONSTRATEGYANDROADMAP","type":"ERC721"}]
getTrendingTokens
Get trending tokens in a given time frame by simply specifying the audience, criteria, time frame, and transfer type that you prefer. All analysis and sorting will be done for you and you simply just need to receive the response from this function.
Input
Field
Type
Required
Description
audience
Audience
true
The audience to get trending mints for
criteria
TrendingTokensCriteria
true
The criteria to analyze and sort trending mints
timeFrame
TimeFrame
true
The time frame to analyze the trending mints, e.g. the last 1 hour
transferType
TransferType
true
The type of transfer to get trending tokens for, either all or self_initiated
limit
number
false
Number of results per pages. Maximum value is 200. For more results, use paginations.
Fetch Farcaster user details, including profile name, fnames, profile images (resized), user-associated addresses (connected addresses), follower count and following count.
[{"eventName":"ETHGlobal New York 2023 Speaker","eventId":"151055","eventURL":"https://ethglobal.com/events/newyork2023","isVirtualEvent":false,"startDate":"2023-09-22T00:00:00Z","endDate":"2023-09-25T00:00:00Z","city":"New York City"}]
getFarcasterUserERC20Balances
Fetch ERC20 tokens owned by a Farcaster user of a given FID across Ethereum, Polygon, Base, and Zora.
List of blockchains to fetch user's ERC20 balance. Currently, supports Ethereum, Polygon, Base, and Zora. Defaults to include all supported blockchains.
limit
number
false
Number of results per pages. Maximum value is 200. For more results, use paginations.
[{"blockchain":"zora","tokenAddress":"0xe03ef4b9db1a47464de84fb476f9baf493b3e886","tokenId":"110","amount":1,"amountInWei":"1","name":"Farcaster OG","symbol":"$FCOG","image":{"extraSmall":"https://assets.airstack.xyz/image/nft/7777777/PtYr9f5cHxXadiklS+Xzp805o/lFKCmd1jvpLmU58tO5UgOEdm56cjqIt1Gf/UK052NE4yYf2xmpwwrzjcDl+w==/extra_small.png","small":"https://assets.airstack.xyz/image/nft/7777777/PtYr9f5cHxXadiklS+Xzp805o/lFKCmd1jvpLmU58tO5UgOEdm56cjqIt1Gf/UK052NE4yYf2xmpwwrzjcDl+w==/small.png","medium":"https://assets.airstack.xyz/image/nft/7777777/PtYr9f5cHxXadiklS+Xzp805o/lFKCmd1jvpLmU58tO5UgOEdm56cjqIt1Gf/UK052NE4yYf2xmpwwrzjcDl+w==/medium.png","large":"https://assets.airstack.xyz/image/nft/7777777/PtYr9f5cHxXadiklS+Xzp805o/lFKCmd1jvpLmU58tO5UgOEdm56cjqIt1Gf/UK052NE4yYf2xmpwwrzjcDl+w==/large.png","original":"https://assets.airstack.xyz/image/nft/7777777/PtYr9f5cHxXadiklS+Xzp805o/lFKCmd1jvpLmU58tO5UgOEdm56cjqIt1Gf/UK052NE4yYf2xmpwwrzjcDl+w==/original_image.png"},"metaData":{"name":"Farcaster OG 43","description":"Celebrating Farcaster at permissionless.","image":"ipfs://bafybeihbx6nx4h2wblf6nlsy6nkotzqynzsrgimgqzwqgw6gf7d27ewfqu","imageData":"","externalUrl":"","animationUrl":"","youtubeUrl":"","backgroundColor":"","attributes":null},"tokenType":"ERC721"}]
getFarcasterUserERC20Mints
Fetch ERC20 tokens minted by a Farcaster user of a given FID across Ethereum, Polygon, Base, and Zora.
[{"blockchain":"base","tokenAddress":"0x7d5861cfe1c74aaa0999b7e2651bf2ebd2a62d89","tokenId":"94613","tokenType":"ERC721","amount":1,"amountInWei":"1","name":"Base Day One","symbol":"$BASEDAYONE","blockTimestamp":"2023-08-11T08:23:43Z","blockNumber":2476438,"image":{"extraSmall":"https://assets.airstack.xyz/image/nft/8453/VsImj/jHMngFqJSF7KWaDce4NeMMkjjE6vKrM78PzD+4gKMh74NjmrMUXl9+slIronvYbTNTE8aDkB1TuYwHPA==/extra_small.gif","small":"https://assets.airstack.xyz/image/nft/8453/VsImj/jHMngFqJSF7KWaDce4NeMMkjjE6vKrM78PzD+4gKMh74NjmrMUXl9+slIronvYbTNTE8aDkB1TuYwHPA==/small.gif","medium":"https://assets.airstack.xyz/image/nft/8453/VsImj/jHMngFqJSF7KWaDce4NeMMkjjE6vKrM78PzD+4gKMh74NjmrMUXl9+slIronvYbTNTE8aDkB1TuYwHPA==/medium.gif","large":"https://assets.airstack.xyz/image/nft/8453/VsImj/jHMngFqJSF7KWaDce4NeMMkjjE6vKrM78PzD+4gKMh74NjmrMUXl9+slIronvYbTNTE8aDkB1TuYwHPA==/large.gif","original":"https://assets.airstack.xyz/image/nft/8453/VsImj/jHMngFqJSF7KWaDce4NeMMkjjE6vKrM78PzD+4gKMh74NjmrMUXl9+slIronvYbTNTE8aDkB1TuYwHPA==/original_image.gif"},"metaData":{"name":"Base Day One 94613","description":"Base Day One commemorates the first day of Base. Watch it evolve as more people come onchain and collectively create our story. All proceeds will support the next generation of builders on Base; this does not confer any other rights. GET ONCHAIN at onchainsummer.xyz and mint to join us.","image":"ipfs://bafybeidkxtd2qck3omiccqhi2iebklr5yfsm33vivmgyfarlh62l462zka","imageData":"","externalUrl":"","animationUrl":"","youtubeUrl":"","backgroundColor":"","attributes":null}}]
getFarcasterUserTokenSentFrom
Fetch all token transfers sent from a Farcaster user of a given FID across Ethereum, Polygon, Base, and Zora.
List of blockchains to fetch user's token transfers. Currently, supports Ethereum, Polygon, Base, and Zora. Defaults to include all supported blockchains.
List of blockchains to fetch user's token transfers. Currently, supports Ethereum, Polygon, Base, and Zora. Defaults to include all supported blockchains.
[{"blockchain":"zora","tokenAddress":"0xe03ef4b9db1a47464de84fb476f9baf493b3e886","amount":1,"amountInWei":"1","name":"Farcaster OG","symbol":"$FCOG","blockTimestamp":"2023-10-11T21:02:39Z","blockNumber":5182160,"tokenType":"ERC721","txHash":"0x116d7d7d2f6e8adb7b6991348ff1869742dae538f0b68f36624ed2496bc2091e","sender":{"addresses":["0x3a23f943181408eac424116af7b7790c94cb97a5"],"socials":null},"metaData":{"name":"Farcaster OG 43","description":"Celebrating Farcaster at permissionless.","image":"ipfs://bafybeihbx6nx4h2wblf6nlsy6nkotzqynzsrgimgqzwqgw6gf7d27ewfqu","imageData":"","externalUrl":"","animationUrl":"","youtubeUrl":"","backgroundColor":"","attributes":null},"image":{"extraSmall":"https://assets.airstack.xyz/image/nft/7777777/PtYr9f5cHxXadiklS+Xzp805o/lFKCmd1jvpLmU58tO5UgOEdm56cjqIt1Gf/UK052NE4yYf2xmpwwrzjcDl+w==/extra_small.png","small":"https://assets.airstack.xyz/image/nft/7777777/PtYr9f5cHxXadiklS+Xzp805o/lFKCmd1jvpLmU58tO5UgOEdm56cjqIt1Gf/UK052NE4yYf2xmpwwrzjcDl+w==/small.png","medium":"https://assets.airstack.xyz/image/nft/7777777/PtYr9f5cHxXadiklS+Xzp805o/lFKCmd1jvpLmU58tO5UgOEdm56cjqIt1Gf/UK052NE4yYf2xmpwwrzjcDl+w==/medium.png","large":"https://assets.airstack.xyz/image/nft/7777777/PtYr9f5cHxXadiklS+Xzp805o/lFKCmd1jvpLmU58tO5UgOEdm56cjqIt1Gf/UK052NE4yYf2xmpwwrzjcDl+w==/large.png","original":"https://assets.airstack.xyz/image/nft/7777777/PtYr9f5cHxXadiklS+Xzp805o/lFKCmd1jvpLmU58tO5UgOEdm56cjqIt1Gf/UK052NE4yYf2xmpwwrzjcDl+w==/original_image.png"},"tokenId":"110"}]
getFarcasterChannelDetails
Fetch all details of a given Farcaster channel, including name, description, warpcast URL, image URL, creation time, hosts, etc.
Input
Field
Type
Required
Description
channel
string
true
Farcaster channel ID, e.g. /airstack channel ID is "airstack"
{"name":"Farcaster","description":"Discussions about Farcaster on Farcaster (meta!)","imageUrl":"https://ipfs.decentralized-content.com/ipfs/bafkreialf5usxssf2eu3e5ct37zzdd553d7lg7oywvdszmrg5p2zpkta7u","createdAtTimestamp":"2023-08-02T22:33:26Z","hosts":[{"profileName":"v","fnames":["v","varunsrin.eth"],"fid":"2","profileImage":{"extraSmall":"https://assets.airstack.xyz/image/social/XCPJH5EP49qftYc7+wAFfv5jzo3ddBWc9FMEERWezG8=/extra_small.png","small":"https://assets.airstack.xyz/image/social/XCPJH5EP49qftYc7+wAFfv5jzo3ddBWc9FMEERWezG8=/small.png","medium":"https://assets.airstack.xyz/image/social/XCPJH5EP49qftYc7+wAFfv5jzo3ddBWc9FMEERWezG8=/medium.png","large":"https://assets.airstack.xyz/image/social/XCPJH5EP49qftYc7+wAFfv5jzo3ddBWc9FMEERWezG8=/large.png","original":"https://assets.airstack.xyz/image/social/XCPJH5EP49qftYc7+wAFfv5jzo3ddBWc9FMEERWezG8=/original_image.png"},"userAssociatedAddresses":["0x4114e33eb831858649ea3702e1c9a2db3f626446","0x91031dcfdea024b4d51e775486111d2b2a715871","0x182327170fc284caaa5b1bc3e3878233f529d741","0xf86a7a5b7c703b1fd8d93c500ac4cc75b67477f0"],"followerCount":142424,"followingCount":1127}],"warpcastUrl":"https://warpcast.com/~/channel/farcaster"}
getFarcasterChannelParticipants
Fetch the list of all participants of a Farcaster channel that has either casted or replied to a cast in the specified channel. You can also use the lastActionTimestamp to only fetch users that have last participated during the specified time range.
Input
Field
Type
Required
Description
channel
string
true
Farcaster channel ID, e.g. /airstack channel ID is "airstack"
actionType
FarcasterChannelActionType
false
Farcaster channel action type, either cast or reply. Defaults to include both type.
lastActionTimestamp.before
string
false
get participants that participate before the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
lastActionTimestamp.after
string
false
get participants that participate after the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
limit
number
false
Number of results per pages. Defaults to 200. Maximum value is 200. For more results, use paginations.
Fetch all the channels where a Farcaster user has participated in, either by casting or replying to a cast. You can also use the lastActionTimestamp to only fetch channels where users have last participated during the specified time range.
Input
Field
Type
Required
Description
fid
number
true
Farcaster channel participant's FID
actionType
FarcasterChannelActionType
false
Farcaster channel action type, either cast or reply. Defaults to include both type.
lastActionTimestamp.before
string
false
get participants that participate before the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
lastActionTimestamp.after
string
false
get participants that participate after the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
limit
number
false
Number of results per pages. Defaults to 200. Maximum value is 200. For more results, use paginations.
Fetch all the channels where a Farcaster user is the host. You can also use the createdAtTimestamp to only fetch channels that are created in the specified timestamp.
Input
Field
Type
Required
Description
fid
number
true
Farcaster channel host's FID
createdAtTimestamp.before
string
false
get participants that participate before the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
createdAtTimestamp.after
string
false
get participants that participate after the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
limit
number
false
Number of results per pages. Defaults to 200. Maximum value is 200. For more results, use paginations.
[{"name":"airstack","description":"a place for updates about new airstack functionality, user requests, questions, and more!","imageUrl":"https://i.imgur.com/13jY9D4.png","createdAtTimestamp":"2023-12-21T17:30:38Z","warpcastUrl":"https://warpcast.com/~/channel/airstack"}]
searchFarcasterChannels
Fetch all the Farcaster channels that contain the specified input words in their names. You can also use the createdAtTimestamp to only fetch channels that are created in the specified timestamp.
Input
Field
Type
Required
Description
channel
string
true
Farcaster channel's name
createdAtTimestamp.before
string
false
get participants that participate before the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
createdAtTimestamp.after
string
false
get participants that participate after the specified input. ISO 8601 date string, e.g. "2024-02-28T00:00:00Z".
limit
number
false
Number of results per pages. Defaults to 200. Maximum value is 200. For more results, use paginations.
[{"name":"airstack","description":"a place for updates about new airstack functionality, user requests, questions, and more!","imageUrl":"https://i.imgur.com/13jY9D4.png","createdAtTimestamp":"2023-12-21T17:30:38Z","hosts":[{"profileName":"betashop.eth","fnames":["betashop","betashop.eth","jasongoldberg.eth"],"fid":"602","profileImage":{"extraSmall":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/extra_small.png","small":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/small.png","medium":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/medium.png","large":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/large.png","original":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/original_image.png"},"userAssociatedAddresses":["0x66bd69c7064d35d146ca78e6b186e57679fba249","0xeaf55242a90bb3289db8184772b0b98562053559"],"followerCount":59421,"followingCount":2290}],"warpcastUrl":"https://warpcast.com/~/channel/airstack"}]
searchFarcasterUsers
Search Farcaster users that contain a given string input, e.g. all Farcaster users that contain "a" in their profile name.
Input
Field
Type
Required
Description
profileName
string
true
string to match with the profile name. Only profile name that contains this inputted string will be returned in the response.
limit
number
false
Number of results per pages. Defaults to 200. Maximum value is 200. For more results, use paginations.
{"Poaps":{"Poap":[{"poapEvent":{"poaps":[{"poapEvent":{"poaps":[{"eventName":"You have met Patricio in September of 2023 (IRL)"}]}}]}}]}}
Frog Middlewares
Onchain Data Middleware
The Onchain Data middleware injects onchain data of the user, including Farcaster user details, token balances, token mints, POAPs, Farcaster channels, etc.
Input
Parameters
Type
Required
Description
apiKey
string
false
Configure API key, if no API key has been provided with init function.
features
Object
true
An object that contains variables used for fetching onchain data of the user.
{"userDetails":{"profileName":"betashop.eth","fnames":["betashop","betashop.eth","jasongoldberg.eth"],"profileImage":{"extraSmall":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/extra_small.jpg","small":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/small.jpg","medium":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/medium.jpg","large":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/large.jpg","original":"https://assets.airstack.xyz/image/social/TQjjhuaajVkwqgzZVvgFQYU1qxNfVHQgSmZjTcXRrzQ=/original_image.jpg"},"userAssociatedAddresses":["0x66bd69c7064d35d146ca78e6b186e57679fba249","0xeaf55242a90bb3289db8184772b0b98562053559"],"followerCount":65820,"followingCount":2303},"erc20Balances":[{"blockchain":"polygon","tokenAddress":"0x10503dbed34e291655100a3c204528425abe3235","amount":740,"amountInWei":"740000000000000000000","name":"am00r","symbol":"AM00R"}],"nftBalances":[{"blockchain":"base","tokenAddress":"0xbd2019982628d26786d75e4477daf15489260d66","tokenId":"1","amount":1,"amountInWei":"1","name":"Doom scrolling","symbol":"","image":{},"metaData":{},"tokenType":"ERC1155"}],"erc20Mints":[{"blockchain":"polygon","tokenAddress":"0x058d96baa6f9d16853970b333ed993acc0c35add","amount":50,"amountInWei":"50000000000000000000","name":"Staked SPORK","symbol":"sSPORK","blockTimestamp":"2024-01-03T18:43:02Z","blockNumber":51901326}],"nftMints":[{"blockchain":"base","tokenAddress":"0xb3da098a7251a647892203e0c256b4398d131a54","tokenId":"4442","tokenType":"ERC721","amount":1,"amountInWei":"1","name":"Mint A Penny","symbol":"PENNY","blockTimestamp":"2024-02-12T22:43:35Z","blockNumber":10494234,"image":{},"metaData":{}}],"poaps":[{"eventName":"You have met Patricio in February of 2024 (IRL)","eventId":"167539","eventURL":"https://POAP.xyz","isVirtualEvent":false,"startDate":"2024-02-01T00:00:00Z","endDate":"2024-03-01T00:00:00Z","city":""}]}
Allow List Middleware
The Allow List middleware injects allow list logic to check if a user is allowed to access a frame or not, based on various criterias, such as token holdings, Farcaster follower counts, following certain Farcaster users, or attended certain POAPs.
Input
Parameters
Type
Required
Description
apiKey
string
false
Configure API key, if no API key has been provided with init function.
allowListCriteria
object
true
Criteria to check if the user is allowed
isAllowedFunction
function
false
Custom function to determine if the user is allowed. It will use AND logic by default.
The npm package @airstack/frames receives a total of 524 weekly downloads. As such, @airstack/frames popularity was classified as not popular.
We found that @airstack/frames demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 0 open source maintainers collaborating on the project.
Package last updated on 18 Mar 2024
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.
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."