-
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.
- Loading branch information
Showing
12 changed files
with
156 additions
and
67 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,5 @@ | ||
--- | ||
'@coinbase/onchainkit': patch | ||
--- | ||
|
||
- **fix**: make sure imports from `core`, `farcaster` and `xmtp` work. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,17 +4,37 @@ Add OnchainKit to your project, install the required packages. | |
|
||
## Installation | ||
|
||
```sh | ||
# Use Yarn | ||
yarn add @coinbase/onchainkit | ||
:::code-group | ||
|
||
# Use NPM | ||
```bash [npm] | ||
npm install @coinbase/onchainkit | ||
|
||
# Use PNPM | ||
# Depending on the components or utilities you use, | ||
# you may end up utilizing any of those libraries. | ||
npm install [email protected] react@18 react-dom@18 | ||
npm install graphql@14 graphql-request@6 | ||
``` | ||
|
||
```bash [yarn] | ||
yarn add @coinbase/onchainkit | ||
|
||
# Depending on the components or utilities you use, | ||
# you may end up utilizing any of those libraries. | ||
yarn add [email protected] react@18 react-dom@18 | ||
yarn add graphql@14 graphql-request@6 | ||
``` | ||
|
||
```bash [pnpm] | ||
pnpm add @coinbase/onchainkit | ||
|
||
# Depending on the components or utilities you use, | ||
# you may end up utilizing any of those libraries. | ||
pnpm install [email protected] react@18 react-dom@18 | ||
pnpm install graphql@14 graphql-request@6 | ||
``` | ||
|
||
::: | ||
|
||
OnchainKit is divided into various theme utilities and components that are available for your use: | ||
|
||
- [Farcaster Kit](/farcasterkit/introduction) | ||
|
@@ -33,6 +53,12 @@ OnchainKit is divided into various theme utilities and components that are avail | |
- [Framegear](/framekit/framegear) | ||
|
||
- [Identity Kit](/identitykit/introduction) | ||
|
||
- Components: | ||
- [`<Avatar />`](/identitykit/avatar) | ||
- [`<Name />`](/identitykit/name) | ||
|
||
- [XMTP Kit](/xmtpkit/introduction) | ||
- Utilities: | ||
- [`getXmtpFrameMessage`](/xmtpkit/get-xmtp-frame-message) | ||
- [`isXmtpFrameRequest`](/xmtpkit/is-xmtp-frame-request) |
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
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 |
---|---|---|
@@ -1,3 +1,24 @@ | ||
# isXmtpFrameRequest | ||
|
||
isXmtpFrameRequest | ||
```ts | ||
import { FrameRequest } from '@coinbase/onchainkit'; | ||
import { isXmtpFrameRequest } from '@coinbase/onchainkit/xmtp'; // [!code focus] | ||
import { NextResponse } from 'next/server'; | ||
|
||
async function getResponse(req: any): Promise<NextResponse> { | ||
const body: FrameRequest = await req.json(); | ||
if (isXmtpFrameRequest(body)) { | ||
// [!code focus] | ||
// [!code focus] | ||
// ... | ||
} | ||
} | ||
``` | ||
|
||
## Returns | ||
|
||
- **Type:** `boolean` | ||
|
||
## Parameters | ||
|
||
[`XmtpFramesRequest`](/xmtpkit/types#xmtpframesrequest) |
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,36 @@ | ||
--- | ||
title: XmtpKit Types | ||
deescription: Glossary of Types in XmtpKit Kit. | ||
--- | ||
|
||
# Types [Glossary of Types in XmtpKit Kit.] | ||
|
||
## `XmtpFramesRequest` | ||
|
||
```ts | ||
export type UntrustedData = { | ||
url: string; | ||
timestamp: number; | ||
buttonIndex: number; | ||
inputText?: string; | ||
opaqueConversationIdentifier: string; | ||
walletAddress: string; | ||
}; | ||
|
||
// The Frame Signature Packet body | ||
export type XmtpFramesRequest = { | ||
clientProtocol: `xmtp@${string}`; | ||
untrustedData: UntrustedData; | ||
trustedData: { | ||
messageBytes: string; | ||
}; | ||
}; | ||
``` | ||
|
||
## `XmtpFrameValidationResponse` | ||
|
||
```ts | ||
type XmtpFrameValidationResponse = | ||
| { isValid: true; message: XmtpFrameValidationData } | ||
| { isValid: false; message: undefined }; | ||
``` |
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 |
---|---|---|
@@ -1 +1 @@ | ||
export const version = '0.8.0'; | ||
export const version = '0.8.2'; |
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
Empty file.