Skip to content

Instantly share code, notes, and snippets.

/**
* Copyright 2025-present Coinbase Global, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
const erc20Abi= [
'function transfer(address to, uint256 amount)',
'function balanceOf(address owner) view returns (uint256)',
'function decimals() view returns (uint8)',
'function symbol() view returns (string)',
'function name() view returns (string)',
]
const provider = new ethers.providers.AlchemyProvider(
'goerli',
@cfluke-cb
cfluke-cb / gist:715ae7cef93f57fe523b17d080046645
Created June 8, 2022 19:46
Mui Button Coinbase Pay Example
import { useRef, useState, useEffect } from 'react';
import { initOnRamp } from '@coinbase/cbpay-js';
import { Button } from '@mui/material';
export const PayWithCoinbaseButton = () => {
const onrampInstance = useRef();
const [isReady, setIsReady] = useState(false);
useEffect(() => {
console.log('initializing');