Tweed Docs
  • Welcome to Tweed
    • What Can Tweed Do?
  • Getting Started
    • Embedded Wallets | WaaS
    • Token Checkout | Payments
      • Flow of Funds: Purchase to Settlement
      • Token Checkout
      • Legacy Token Checkout
        • Basic Checkout Integration
        • Checkout + WaaS + Auth
        • Features
          • Payment links
          • Whitelist
          • Flow of Funds
          • Apple & Google Pay
          • AML & KYC Policy Overview
  • Developer Tools
    • Tweed SDKs
      • core-react
        • useAuth
        • useWallet
        • useTweed
        • usePayments
        • useWeb3
      • core-js
      • core-vue
      • Payments SDKs (v1)
        • Frontend SDKs (Payments)
        • Backend SDK (Payments)
        • How to set up your smart contract for Tweed
        • Tezos chain considerations
    • Management Dashboard
      • Create platform
      • Create application
        • UI Customization
    • Webhooks
      • Checkout Webhooks
    • API
      • API (V1)
      • API (V2)
        • Authorization
        • API reference
          • Contracts
            • Add
            • Add contract function
            • Contract
          • Payouts
            • Add
            • Payout
          • Items
            • Add
            • All
              • Contract
                • Count
              • Payout
                • Count
          • Assets
            • Blockchain
            • All
              • Blockchains
          • Blockchains
            • Multiple
            • Native asset
          • Audit event mappings
          • Platform webhooks
            • Set active
          • Tickets
        • Specification
    • External Integrations
      • Wagmi connector
      • Onramp to Crypto
    • Example Projects
    • Supported Blockchains
    • Pricing
  • Products
    • WaaS
    • Payments
Powered by GitBook
On this page
  1. Developer Tools
  2. Tweed SDKs
  3. core-react

useWeb3

This hook is your gateway to the Web3 world. Use it to obtain the ethereumProvider and begin interacting with the blockchain, such as signing transactions.

PrevioususePaymentsNextcore-js

Last updated 11 months ago

Ethereum Provider |

The Ethereum Provider acts as a bridge for Web3 libraries designed for EVM chains, such as and . For example, integrating Tweed with a dApp built using EthersJS is straightforward and requires only three lines of code. implements the chainChanged functionality to support the EVMs that are supported by the tweed infrastructure.

getEthereumProvider()
import { useWeb3 } from "@paytweed/core-react";

const { getEthereumProvider } = useWeb3();

const provider = getEthereumProvider(Network.ETHEREUM_SEPOLIA)

Method parameters

REQUIRED string

EIP-1193
EthersJS
Web3JS