Openocean APIs
  • Developer
    • ⚙️APIs
      • Swap API
        • Guide
        • API V4
        • API V3
        • GMX Exclusive API
        • SDK
      • Limit Order API
        • Guide
        • API
        • SDK
        • Node SDK
      • Sweep Swap API
        • Guide
        • API
      • DCA API
        • Guide
        • API
        • SDK
      • Meme API
        • Data API
        • Transaction API
        • Websocket API
      • Ticket API
        • API
      • 🤖Swagger
    • 👾Widget
      • Getting Started
      • Customize Theme
      • Other Reference
      • Widget V2
        • Getting Started
    • ℹ️Developer Resources
      • 🔗Supported Chains
      • 📋Contracts of Chains
      • 🚩Common Error Code
      • 📖Developer references & glossary
Powered by GitBook
On this page
  • Install the widget
  • Basic example
  1. Developer
  2. Widget
  3. Widget V2

Getting Started

PreviousWidget V2NextDeveloper Resources

Last updated 9 days ago

Install the widget

To get started, install the latest version of OpenOcean Widget and required packages.

npm install @openocean.finance/widget wagmi @bigmi/react @solana/wallet-adapter-react @tanstack/react-query

yarn add @openocean.finance/widget wagmi @bigmi/react @solana/wallet-adapter-react @tanstack/react-query

pnpm add @openocean.finance/widget wagmi @bigmi/react @solana/wallet-adapter-react @tanstack/react-query

  • is type safe, extensible, and modular library for building Ethereum apps.

  • is modular TypeScript library that provides reactive primitives for building Bitcoin applications.

  • is modular TypeScript wallet adapters and components for Solana applications.

  • is an async state manager that handles requests, caching, and more.

Basic example

Below is a basic example using OpenOcean Widget with container customization.

// import { OpenOceanWidget, WidgetConfig } from '@openocean.finance/widget';
const widgetConfig: WidgetConfig = {
  theme: {
    container: {
      border: '1px solid rgb(234, 234, 234)',
      borderRadius: '16px',
    },
  },
};
export const WidgetPage = () => {
  return (
    <OpenOceanWidget integrator="Your dApp/company name" config={widgetConfig} />
  );
};
👾
Wagmi
Bigmi
@solana/wallet-adapter-react
TanStack Query