Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mersui

Package Overview
Dependencies
Maintainers
0
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mersui

Simple "Buy Me a Coffee" React button with payments in SUI.

  • 0.1.1
  • npm
  • Socket score

Version published
Weekly downloads
13
increased by62.5%
Maintainers
0
Weekly downloads
 
Created
Source

MerSui

Simple "Buy Me a Coffee" React button with payments in SUI.

Demo

mersui.xyz

Installation

pnpm add mersui || yarn add mersui || npm install mersui

Usage

First of all, wrap your main app component into the MerSuiProvider component.

import { MerSuiProvider } from "mersui";

function App() {
  return (
    <MerSuiProvider>
      <YourApp />
    </MerSuiProvider>
  );
}

Then, use the MerSuiWidget component to render the button.

import { MerSuiWidget } from "mersui";

function App() {
  return (
    <div>
      <MerSuiWidget recipientAddress="0x..." />
    </div>
  );
}

Enjoy!

Props

PropTypeDefaultDescription
buttonLabelstring-Button label
recipientAddressstring-Sui address of the recipient
containerClassNamestring-Optional class name for the button container
buttonClassNamestring-Optional class name for the button
statusClassNamestring-Optional class name for the status message. The status-success and status-error classes are automatically added for your convenience.

Pyth integration

MerSui uses Pyth's Sponsored Feed for SUI/USD to properly calculate the transaction amount in SUI. See lib/MerSuiWidget.tsx/fetchSuiPrice.

Development

The lib folder contains the source code of the library.

The src folder contains a demo app that you can use to play with the library locally.

But before that, you need to set up the environment variables:

# .env.local
VITE_RECIPIENT_ADDRESS=0x...

Then, run the development server:

pnpm dev

Build the library

pnpm build

Copyright (c) 2024 Konstantin Komelin

Licensed under the MIT License.

Keywords

FAQs

Package last updated on 14 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc