@fivewest/web3
v0.0.2-beta.1
Published
A Typescript-based React package providing web3 utilities for seamlessly interacting with the Ethereum blockchain and integrating with the FiveWest payment gateway
Downloads
4
Readme
Introduction
This package contains the functionality for connecting wallets and initiating payments when integrating with the FiveWest payment gateway.
Built With
Getting Started
Installation
- 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 [email protected] for more information on how to integrate with the FiveWest payment gateway.