mirror of
https://github.com/neynarxyz/create-farcaster-mini-app.git
synced 2025-12-11 03:42:32 -05:00
Compare commits
5 Commits
760d2f28ec
...
c73b955cf9
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c73b955cf9 | ||
|
|
76396153a1 | ||
|
|
36b4540e47 | ||
|
|
c5fef388b2 | ||
|
|
91658503ff |
@@ -496,6 +496,7 @@ export async function init(
|
|||||||
'@farcaster/mini-app-solana': '>=0.0.17 <1.0.0',
|
'@farcaster/mini-app-solana': '>=0.0.17 <1.0.0',
|
||||||
'@farcaster/quick-auth': '>=0.0.7 <1.0.0',
|
'@farcaster/quick-auth': '>=0.0.7 <1.0.0',
|
||||||
'@neynar/react': '^1.2.15',
|
'@neynar/react': '^1.2.15',
|
||||||
|
'@pigment-css/react': '^0.0.30',
|
||||||
'@radix-ui/react-label': '^2.1.1',
|
'@radix-ui/react-label': '^2.1.1',
|
||||||
'@solana/wallet-adapter-react': '^0.15.38',
|
'@solana/wallet-adapter-react': '^0.15.38',
|
||||||
'@tanstack/react-query': '^5.61.0',
|
'@tanstack/react-query': '^5.61.0',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@neynar/create-farcaster-mini-app",
|
"name": "@neynar/create-farcaster-mini-app",
|
||||||
"version": "1.9.0",
|
"version": "1.9.1",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"private": false,
|
"private": false,
|
||||||
"access": "public",
|
"access": "public",
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
import { useCallback, useMemo } from "react";
|
import { useCallback, useMemo } from "react";
|
||||||
import { useAccount, useSendTransaction, useWaitForTransactionReceipt } from "wagmi";
|
import { useAccount, useSendTransaction, useWaitForTransactionReceipt } from "wagmi";
|
||||||
import { base } from "wagmi/chains";
|
import { arbitrum, base, mainnet, optimism, polygon, scroll, shape, zkSync, zora } from "wagmi/chains";
|
||||||
import { Button } from "../Button";
|
import { Button } from "../Button";
|
||||||
import { truncateAddress } from "../../../lib/truncateAddress";
|
import { truncateAddress } from "../../../lib/truncateAddress";
|
||||||
import { renderError } from "../../../lib/errorUtils";
|
import { renderError } from "../../../lib/errorUtils";
|
||||||
@@ -44,18 +44,37 @@ export function SendEth() {
|
|||||||
// --- Computed Values ---
|
// --- Computed Values ---
|
||||||
/**
|
/**
|
||||||
* Determines the recipient address based on the current chain.
|
* Determines the recipient address based on the current chain.
|
||||||
*
|
*
|
||||||
* Uses different protocol guild addresses for different chains:
|
* Uses different protocol guild addresses for different chains.
|
||||||
* - Base: 0x32e3C7fD24e175701A35c224f2238d18439C7dBC
|
* Defaults to Ethereum mainnet address if chain is not recognized.
|
||||||
* - Other chains: 0xB3d8d7887693a9852734b4D25e9C0Bb35Ba8a830
|
* Addresses are taken from the protocol guilds documentation: https://protocol-guild.readthedocs.io/en/latest/
|
||||||
*
|
*
|
||||||
* @returns string - The recipient address for the current chain
|
* @returns string - The recipient address for the current chain
|
||||||
*/
|
*/
|
||||||
const protocolGuildRecipientAddress = useMemo(() => {
|
const protocolGuildRecipientAddress = useMemo(() => {
|
||||||
// Protocol guild address
|
switch (chainId) {
|
||||||
return chainId === base.id
|
case mainnet.id:
|
||||||
? "0x32e3C7fD24e175701A35c224f2238d18439C7dBC"
|
return "0x25941dC771bB64514Fc8abBce970307Fb9d477e9";
|
||||||
: "0xB3d8d7887693a9852734b4D25e9C0Bb35Ba8a830";
|
case arbitrum.id:
|
||||||
|
return "0x7F8DCFd764bA8e9B3BA577dC641D5c664B74c47b";
|
||||||
|
case base.id:
|
||||||
|
return "0xd16713A5D4Eb7E3aAc9D2228eB72f6f7328FADBD";
|
||||||
|
case optimism.id:
|
||||||
|
return "0x58ae0925077527a87D3B785aDecA018F9977Ec34";
|
||||||
|
case polygon.id:
|
||||||
|
return "0xccccEbdBdA2D68bABA6da99449b9CA41Dba9d4FF";
|
||||||
|
case scroll.id:
|
||||||
|
return "0xccccEbdBdA2D68bABA6da99449b9CA41Dba9d4FF";
|
||||||
|
case shape.id:
|
||||||
|
return "0x700fccD433E878F1AF9B64A433Cb2E09f5226CE8";
|
||||||
|
case zkSync.id:
|
||||||
|
return "0x9fb5F754f5222449F98b904a34494cB21AADFdf8";
|
||||||
|
case zora.id:
|
||||||
|
return "0x32e3C7fD24e175701A35c224f2238d18439C7dBC";
|
||||||
|
default:
|
||||||
|
// Default to Ethereum mainnet address
|
||||||
|
return "0x25941dC771bB64514Fc8abBce970307Fb9d477e9";
|
||||||
|
}
|
||||||
}, [chainId]);
|
}, [chainId]);
|
||||||
|
|
||||||
// --- Handlers ---
|
// --- Handlers ---
|
||||||
|
|||||||
Reference in New Issue
Block a user