Syndicate Frame API & Chain

Powered by

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!

View docs for the V1 API (will sunset May 1st 2024)

Overview

API

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.

Frame Chain

To get started using Frame Chain with the Frame API refer to the documentation below. Here are the Frame Chain details:
Network Name:Syndicate Frame ChainRPC Endpoint:https://rpc-frame.syndicate.ioChain ID:5101Currency Symbol:ETHBlock Explorer:https://explorer-frame.syndicate.ioBridge:https://bridge-frame.syndicate.io

Getting Started

There are a few steps and pre-requisites needed to get started, you can see them below:

Endpoints

Authorization

Requests require Bearer Authentication using an API key generated from /createApiKey. The API key should be included in the header of your request.

{
Authentication: Bearer YOUR_API_KEY
}

Endpoint

POST https://frame.syndicate.io/api/v2/createApiKey

Parameters

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

Responses

200
{
success: true,
data: {
apiKey: string
}
}

Note: You will need to save this API key somewhere safe as it will not be displayed again.

4XX&5XX
{
success: false,
error: string
}

Endpoint

GET https://frame.syndicate.io/api/v2/getWallets

Authorization: Bearer Auth

Responses

200
{
success: true,
data: {
walletAddresses: string[]
}
}
4XX&5XX
{
success: false,
error: string
}

Endpoint

POST https://frame.syndicate.io/api/v2/sendTransaction

Authorization: Bearer Auth

Parameters

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

Variables

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

Responses

200
{
success: true,
data: {
transactionId: string,
userAddress: string
}
}
4XX&5XX
{
success: false,
error: string
}

Endpoint

GET https://frame.syndicate.io/api/v2/transaction/{transactionId}/hash

Authorization: Bearer Auth

Responses

200
{
success: true,
data: {
transactionHash: string | null
}
}
4XX&5XX
{
success: false,
error: string
}

Example

Create an API key

curl -X POST https://frame.syndicate.io/api/v2/createApiKey \
-H "Content-Type: application/json" \
-d '{ "chainId": 5101 }'
const res = await fetch('https://frame.syndicate.io/api/v2/createApiKey', {
method: "POST",
headers: {
"content-type": "application/json"
},
body: JSON.stringify({
chainId: 5101
})
})

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.

curl -X POST https://frame.syndicate.io/api/v2/sendTransaction \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_KEY" \
-d '{
"frameTrustedData": "0a49080d1085940118f6b...",
"contractAddress": "0x18F...",
"functionSignature": "mint(address to, uint256 amount)",
"args": { "to": "{frame-user}", "amount": 1 }

// optional
"shouldLike": false,
"shouldRecast": false,
"shouldFollow": false
}
}'

const res = await fetch('https://frame.syndicate.io/api/v2/sendTransaction', {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_KEY"
},
body: JSON.stringify({
frameTrustedData: "0a49080d1085940118f6b...",
contractAddress: "0x18F...",
functionSignature: "mint(address to, uint256 amount)",
args: { to: "{frame-user}", amount: 1 },
shouldLike: false,
shouldRecast: false,
shouldFollow: false
})
})

More details

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.

Support

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.