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

mersui

Package Overview
Dependencies
Maintainers
1
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. No intermediaries, you receive donations directly to your Sui address.

  • 0.3.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
9
decreased by-89.89%
Maintainers
1
Weekly downloads
 
Created
Source

MerSui

Simple "Buy Me a Coffee" React button with payments in SUI.
No intermediaries, you receive donations directly to your Sui address.

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
recipientAddressstring-Sui address of the recipient
amountnumber3Optional amount in USD
buttonLabelstringMerSuiOptional button label
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.

Known issues

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 11 Dec 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