Releases: coinbase/onchainkit
v0.3.0
Minor Changes
-
feat have
getFrameAccountAddress
reading from the message instead of the body. By @Zizzamia #46 0695eb9 -
feat update
getFrameMetadata
to the latest Frame APIs By @Zizzamia #43
BREAKING CHANGES
getFrameAccountAddress
We have enhanced the getFrameAccountAddress
method by making it more composable with getFrameMessage
. Now, instead of directly retrieving the accountAddress
from the body
, you will utilize the validated message
to do so.
Before
import { getFrameAccountAddress } from '@coinbase/onchainkit';
...
const accountAddress = await getFrameAccountAddress(body);
After
import { getFrameAccountAddress } from '@coinbase/onchainkit';
...
const { isValid, message } = await getFrameMessage(body);
const accountAddress = await getFrameAccountAddress(message);
getFrameMetadata
We have improved the getFrameMetadata
method by making the buttons
extensible for new actions.
Before
import { getFrameMetadata } from '@coinbase/onchainkit';
...
const frameMetadata = getFrameMetadata({
buttons: ['boat'],
image: 'https://build-onchain-apps.vercel.app/release/v-0-17.png',
post_url: 'https://build-onchain-apps.vercel.app/api/frame',
});
type FrameMetadata = {
buttons: string[];
image: string;
post_url: string;
};
After
import { frameMetadata } from '@coinbase/onchainkit';
...
const frameMetadata = getFrameMetadata({
buttons: [
{
label: 'We love BOAT',
},
],
image: 'https://build-onchain-apps.vercel.app/release/v-0-17.png',
post_url: 'https://build-onchain-apps.vercel.app/api/frame',
});
type Button = {
label: string;
action?: 'post' | 'post_redirect';
};
type FrameMetadata = {
// A list of strings which are the label for the buttons in the frame (max 4 buttons).
buttons: [Button, ...Button[]];
// An image which must be smaller than 10MB and should have an aspect ratio of 1.91:1
image: string;
// A valid POST URL to send the Signature Packet to.
post_url: string;
// A period in seconds at which the app should expect the image to update.
refresh_period?: number;
};
v0.2.1
Patch Changes
- feat: exported
FrameRequest
andFrameData
types. - docs: Polished README for
getFrameMessage()
. By @Zizzamia #38 218b65e - fix: Refactor Farcaster typing to be explicit, and added a Farcaster message verification integration test. By @robpolak @cnasc @Zizzamia #37
- feat: Added a concept of integration tests where we can assert the actual values coming back from
neynar
. We decoupled these from unit tests as we should not commingle. By @robpolak #35 - feat: Refactored
neynar
client out of the./src/core
code-path, for better composability and testability. By @robpolak #35
BREAKING CHANGES
We made the getFrameValidatedMessage
method more type-safe and renamed it to getFrameMessage
.
Before
import { getFrameValidatedMessage } from '@coinbase/onchainkit';
...
const validatedMessage = await getFrameValidatedMessage(body);
type Promise<Message | undefined>
After
import { getFrameMessage } from '@coinbase/onchainkit';
...
const { isValid, message } = await getFrameMessage(body);
type Promise<FrameValidationResponse>;
type FrameValidationResponse =
| { isValid: true; message: FrameData }
| { isValid: false; message: undefined };
interface FrameData {
fid: number;
url: string;
messageHash: string;
timestamp: number;
network: number;
buttonIndex: number;
castId: {
fid: number;
hash: string;
};
}
v0.2.0
Minor Changes
- docs: Polished README for
getFrameMessage()
. By @Zizzamia #38 218b65e - fix: Refactor Farcaster typing to be explicit, and added a Farcaster message verification integration test. By @robpolak @cnasc @Zizzamia #37
- feat: Added a concept of integration tests where we can assert the actual values coming back from
neynar
. We decoupled these from unit tests as we should not commingle. By @robpolak #35 - feat: Refactored
neynar
client out of the./src/core
code-path, for better composability and testability. By @robpolak #35
BREAKING CHANGES
We made the getFrameValidatedMessage
method more type-safe and renamed it to getFrameMessage
.
Before
import { getFrameValidatedMessage } from '@coinbase/onchainkit';
...
const validatedMessage = await getFrameValidatedMessage(body);
type Promise<Message | undefined>
After
import { getFrameMessage } from '@coinbase/onchainkit';
...
const { isValid, message } = await getFrameMessage(body);
type Promise<FrameValidationResponse>;
type FrameValidationResponse =
| { isValid: true; message: FrameData }
| { isValid: false; message: undefined };
interface FrameData {
fid: number;
url: string;
messageHash: string;
timestamp: number;
network: number;
buttonIndex: number;
castId: {
fid: number;
hash: string;
};
}