-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: polish README for
getFrameMessage()
(#38)
- Loading branch information
Showing
8 changed files
with
160 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
--- | ||
'@coinbase/onchainkit': minor | ||
--- | ||
|
||
- **docs**: Polished README for `getFrameMessage()`. By @zizzamia #38 | ||
- **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 | ||
|
||
```ts | ||
import { getFrameValidatedMessage } from '@coinbase/onchainkit'; | ||
|
||
... | ||
|
||
const validatedMessage = await getFrameValidatedMessage(body); | ||
``` | ||
|
||
**@Returns** | ||
|
||
```ts | ||
type Promise<Message | undefined> | ||
``` | ||
|
||
After | ||
|
||
```ts | ||
import { getFrameMessage } from '@coinbase/onchainkit'; | ||
... | ||
const { isValid, message } = await getFrameMessage(body); | ||
``` | ||
|
||
**@Returns** | ||
|
||
```ts | ||
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; | ||
}; | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters