0.0.1 • Published 1 year ago

@fivewest/web3 v0.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Introduction

This package contains the functionality for connecting wallets and initiating payments when integrating with the FiveWest payment gateway.

Demo

Built With

Getting Started

Installation

  1. Install the required packages.
    npm i @fivewest/web3 --save --legacy-peer-deps

Usage

Available button props:

  • balance?: 'show' | 'hide'
  • size?: 'md' | 'sm'
  • label?: string
  • loadingLabel?: string

Available context provider props:

  • themeMode?: 'dark' | 'light'
  • themeVariables?: Record<string, any>
  • children: ReactNode
  • transaction?: Transaction | null

Example

import { Web3Button, Web3Provider } from '@fivewest/web3'

export default function ConnectWallet() {
  return (
    <Web3Provider
      transaction={{
        updated_at: '2024-02-14T13:02:50.684606Z',
        id: '2b4d155b-a13d-4474-8ad0-858d127c3a0e',
        payment_amount: '0.78840229',
        status: 'pending',
        charge_id: 'b8e470b1-b915-439c-b3b1-05be42127a42',
        created_at: '2024-02-20T11:07:52.357687Z',
        currency: {
          expiry_delta: 900,
          fiat: false,
          id: '06916c78-370d-4914-8d93-8d732283a432',
          meta: {
            chain_id: 1,
            coin_full_name: 'TetherUS',
            contract_address: '0xdAC17F958D2ee523a2206206994597C13D831ec7'
          },
          network: 'ETH',
          scale: 6,
          symbol: 'USDT',
          updated_at: '2023-11-15T10:09:13.935374Z'
        },
        hash: null,
        late: false,
        pay_instructions: {
          destination: {
            address: '0x15cb4f556a4d5ac831fa5388946280d3717c0e2b',
            memo: ''
          }
        }
      }}
      themeMode={'dark'}
    >
      <Web3Button />
    </Web3Provider>
  )
}

Roadmap

  • Improve extensibility
  • Improve documentation

Contact

Contact payments@fivewest.co.za for more information on how to integrate with the FiveWest payment gateway.