-
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
21 changed files
with
253 additions
and
190 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': minor | ||
--- | ||
|
||
- **feat**: Updated `FrameMetadataType` to support `target` for button `post` and `post_redirect` actions. By @HashWarlock @zizzamia #130 #136 |
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
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
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,72 @@ | ||
--- | ||
title: FrameKit Types | ||
deescription: Glossary of Types in Frame Kit. | ||
--- | ||
|
||
# Types [Glossary of Types in Frame Kit.] | ||
|
||
## `FrameButtonMetadata` | ||
|
||
```ts | ||
type FrameButtonMetadata = | ||
| { | ||
action: 'link' | 'mint'; | ||
label: string; | ||
target: string; | ||
} | ||
| { | ||
action?: 'post' | 'post_redirect'; | ||
label: string; | ||
target?: string; | ||
}; | ||
``` | ||
|
||
## `FrameImageMetadata` | ||
|
||
```ts | ||
type FrameImageMetadata = { | ||
src: string; | ||
aspectRatio?: '1.91:1' | '1:1'; | ||
}; | ||
``` | ||
|
||
## `FrameInputMetadata` | ||
|
||
```ts | ||
type FrameInputMetadata = { | ||
text: string; | ||
}; | ||
``` | ||
|
||
## `FrameMetadataResponse` | ||
|
||
```ts | ||
type FrameMetadataResponse = Record<string, string>; | ||
``` | ||
|
||
## `FrameMetadataReact` | ||
|
||
```ts | ||
type FrameMetadataReact = FrameMetadataType & { | ||
ogDescription?: string; | ||
ogTitle?: string; | ||
wrapper?: React.ComponentType<any>; | ||
}; | ||
``` | ||
|
||
## `FrameMetadataType` | ||
|
||
```ts | ||
type FrameMetadataType = { | ||
// A list of strings which are the label for the buttons in the frame (max 4 buttons). | ||
buttons?: [FrameButtonMetadata, ...FrameButtonMetadata[]]; | ||
// An image which must be smaller than 10MB and should have an aspect ratio of 1.91:1 | ||
image: string | FrameImageMetadata; | ||
// The text input to use for the Frame. | ||
input?: FrameInputMetadata; | ||
// A valid POST URL to send the Signature Packet to. | ||
postUrl?: string; | ||
// A period in seconds at which the app should expect the image to update. | ||
refreshPeriod?: number; | ||
}; | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Avatar | ||
|
||
The `Avatar` component is used to display ENS avatar associated with Ethereum addresses. When an ENS avatar is not available, it defaults to blue color avatar. | ||
|
||
## Usage | ||
|
||
```tsx | ||
import { Avatar } from '@coinbase/onchainkit'; | ||
|
||
<Avatar address="0x1234567890abcdef1234567890abcdef12345678" />; | ||
``` | ||
|
||
## Props | ||
|
||
```ts | ||
type UseAvatar = { | ||
// Ethereum address to be resolved from ENS. | ||
address: Address; | ||
// Optional CSS class for custom styling. | ||
className?: string; | ||
// Additional HTML attributes for the span element. | ||
props?: React.HTMLAttributes<HTMLSpanElement>; | ||
}; | ||
``` |
Oops, something went wrong.