V2 + Frame Chain is now live!
The following documentation is for the V2 of the Frame API, it provides a more flexible and easier way to work with calling contract functions from a Farcaster Frame.
We've also launched our Frame Chain alongside V2 to enable free mints using our Frame API. Read more here!
The Syndicate Frame API allows you to easily perform an action on Syndicate's Frame Chain or Base mainnet from a Farcaster Frame action triggered by a user. For an example, see Wordchain, a Farcaster Frame powered by Syndicate Frame API. If you need a ERC-721 contract to get started with the API, check out WillPapper/syndicate-farcaster-frame-starter.
There are a few steps and pre-requisites needed to get started, you can see them below:
WillPapper/syndicate-farcaster-frame-starter
on Githubhttps://frame.syndicate.io/api/v2/createApiKey
with the chain ID of the network you want to broadcast transactions on. Available options are Syndicate's Frame Chain (5101), Base (8453) and Degen (666666666). Note: You will need to save this API key somewhere safe as it will not be displayed again.https://frame.syndicate.io/api/v2/getWallets
. All transactions will be broadcast from this address.https://frame.syndicate.io/api/v2/sendTransaction
with the frame trusted data signature that you get from the Farcaster Frame POST request, the function signature, the arguments for that function signature, and your contract address.Its important to note you will need to add "{frame-user}"
in place of the address you want to mint the NFT to. See the example below for code.
Requests require Bearer Authentication using an API key generated from /createApiKey
. The API key should be included in the header of your request.
POST https://frame.syndicate.io/api/v2/createApiKey
chainId: 5101 | 8453 | 666666666
(required) the chain ID on which your contract is deployed. Available options are (5101 Syndicate's Frame Chain, 8453 Base and 666666666 Degen)
email: string
(optional) the email address you want to associate with the API key, used for receiving notifications and updates
200
Note: You will need to save this API key somewhere safe as it will not be displayed again.
4XX
&5XX
GET https://frame.syndicate.io/api/v2/getWallets
Authorization: Bearer Auth
200
4XX
&5XX
POST https://frame.syndicate.io/api/v2/sendTransaction
Authorization: Bearer Auth
frameTrustedData: string
(required) the signature you receive from the Farcaster frame POST request
contractAddress: string
(required) the function signature on the contract you are calling
functionSignature: string
(required) the function signature on the contract you are calling
args: object
(required) the arguments for the function you are calling, if using named parameters in your function signature, each key is the parameter name, if not each key is the index of the parameter
shouldLike: boolean
(optional) if true the user who interacted with the frame is required to have liked the frames cast
shouldRecast: boolean
(optional) if true the user who interacted with the frame is required to have recasted the frames cast
shouldFollow: boolean
(optional) if true the user who interacted with the frame is required to be following the frame caster
args: object
"{frame-user}"
(optional) can be used as a variable within the args parameter and is replaced before calling the contract with the ethereum address of the user who interacted with the frame
200
4XX
&5XX
GET https://frame.syndicate.io/api/v2/transaction/{transactionId}/hash
Authorization: Bearer Auth
200
4XX
&5XX
Create an API key
Send a transaction
One thing to note in the example below is that the first argument of the function signature mint(address to, uint256 amount)
is the desired address that the NFT should be minted to.
As we dont know the address ahead of time when passing in the args you need to pass "{frame-user}"
at the index of the address argument.
The Syndicate Frame API uses Syndicate's Transaction Cloud API to send onchain transactions using a simple fetch request.
Using our API gives you access to our underlying broadcasting infrastructure that allows you to scale your app to thousands of transactions without having to worry about gas, activity spikes or re-orgs. Syndicate Transaction Cloud handles all of that for you seamlessly!
Base have kindly sponsored gas for this API when using Base and gas is free when using the API on Syndicate Frame Chain.
Having trouble? Please contact us on Warpcast with your Syndicate Project ID that can be retreived from GET https://frame.syndicate.io/api/v2/getProjectId
.