GithubHelp home page GithubHelp logo

daria-github / onchainkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from coinbase/onchainkit

0.0 0.0 0.0 33.14 MB

React components and TypeScript utilities to help you build top-tier onchain apps.

Home Page: https://onchainkit.xyz

License: MIT License

JavaScript 0.36% TypeScript 76.91% CSS 0.39% MDX 22.34%

onchainkit's Introduction

OnchainKit logo vibes

OnchainKit

React components and TypeScript utilities to help you build top-tier onchain apps.

Version MIT License Downloads per month Minified + gzip package size for @coinbase/onchainkit in KB


Documentation

For documentation and guides, visit onchainkit.xyz.

Quickstart

To integrate OnchainKit into your project, begin by installing the necessary packages.

# Yarn: Add library
yarn add @coinbase/onchainkit [email protected]

# or

# Use NPM
npm install @coinbase/onchainkit [email protected]

# Use PNPM
pnpm add @coinbase/onchainkit [email protected]

Components

Display ENS avatars, Attestation badges, and ENS names.

const EAS_SCHEMA_ID = '0xf8b05c79f090979bf4a80270aba232dff11a10d9ca55c4f88de95317970f0de9';
const ACCOUNT_ADDRESS = '0x838aD0EAE54F99F1926dA7C3b6bFbF617389B4D9';

<OnchainKitProvider chain={base} schemaId={EAS_SCHEMA_ID}>
  <div className="flex h-10 items-center space-x-4">
    <Avatar address={ACCOUNT_ADDRESS} showAttestation />
    <div className="flex flex-col text-sm">
      <b>
        <Name address={ACCOUNT_ADDRESS} />
      </b>
      <Name address={ACCOUNT_ADDRESS} showAddress />
    </div>
  </div>
</OnchainKitProvider>;
OnchainKit Identity components

Convert your web page into a Frame

import { FrameMetadata } from '@coinbase/onchainkit/frame';

export default function HomePage() {
  return (
    ...
    <FrameMetadata
      buttons={[
        {
          label: 'Tell me the story',
        },
        {
          action: 'link',
          label: 'Link to Google',
          target: 'https://www.google.com'
        },
        {
          action: 'post_redirect',
          label: 'Redirect to cute pictures',
        },
      ]}
      image={{
       src: 'https://zizzamia.xyz/park-3.png',
       aspectRatio: '1:1'
      }}
      input={{
        text: 'Tell me a boat story',
      }}
      postUrl="https://zizzamia.xyz/api/frame"
    />
    ...
  );
}

Create or connect your wallet with Connect Account, powered by Smart Wallet.

<div className="flex flex-grow">
  {(() => {
    if (status === 'disconnected') {
      return <ConnectAccount />; // [!code focus]
    }
    return (
      <div className="flex h-8 w-8 items-center justify-center">
        <button type="button" onClick={() => disconnect()}>
          <Avatar address={address} />
        </button>
      </div>
    );
  })()}
</div>
OnchainKit Wallet components OnchainKit Wallet components

Utilities

If you're seeking basic TypeScript utilities, we have plenty of ready-to-use options available.

Frames
Identity
Swap

Coming soon

Token
Wallet

Coming soon

Farcaster
XMTP

Design

All our component designs are open-sourced. You can access the Figma file to use them for your onchain project.

Figma - How to use

OnchainKit logo vibes

Figma - Components

OnchainKit logo vibes

Community โ˜๏ธ ๐ŸŒ โ˜๏ธ

Check out the following places for more OnchainKit-related content:

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details

onchainkit's People

Contributors

zizzamia avatar github-actions[bot] avatar cnasc avatar alvaroraminelli avatar kyhyco avatar eragon512 avatar taycaldwell avatar robpolak avatar dongambas avatar neekolas avatar 0xalec avatar alvaroraminelli-cb avatar sneh1999 avatar cpcramer avatar michachan avatar sinasab avatar nicovalencia avatar dannydns avatar yuripetusko avatar wespickett avatar syntag avatar maurelian avatar manan19 avatar hashwarlock avatar jarrensj avatar bansalgautam avatar n3ps avatar flickque avatar federerkk avatar fabriguespe avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.