This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); |