Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge Main into develop #4660

Merged
merged 12 commits into from
Sep 1, 2024
11 changes: 8 additions & 3 deletions lang/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,7 @@
"label.look_for_the_share_and_get_rewarded": "Busca el botó 'Comparteix i guanya recompenses' per generar enllaços a pàgines específiques a tot el lloc de Giveth.",
"label.make_a_recurring_donation_with": "Fes una donació recurrent amb ",
"label.make_it_anonymous": "Fes-ho anònim",
"label.qr_code_error": "S'ha produït un error en generar el codi QR. Torneu-ho a provar.",
"label.make_it_easier_for_donors_to_find_your_project": "Fes més fàcil que els donants trobin el teu projecte proporcionant una ubicació.",
"label.make_it_unique_and_memorable_to_stand_out_from_other_projects": "Fes-ho únic i memorable per destacar entre altres projectes.",
"label.make_sure_your_description_aligns_with_our": "Assegura't que la teva descripció s'aligna amb el nostre ",
Expand Down Expand Up @@ -1275,7 +1276,7 @@
"label.you_havent_boosted_any_projects_yet": "Encara no has boostejat ningun projecte!",
"label.you_havent_created_any_projects_yet": "Encara no has creat cap projecte!",
"label.you_havent_donated_to_any_projects_yet": "Encara no has donat a cap projecte!",
"label.you_havent_liked_any_projects_yet": "Encara no has donat like a cap projecte!",
"label.you_havent_liked_any_projects_yet": "Encara no has desat cap projecte als marcadors!",
"label.you_have_already_boosted_20_projects": "Ja has impulsat el màxim de 20 projectes!",
"label.you_have_no_notifications": "No tens notificacions",
"label.you_have_successfuly_claimed": "Has reclamat amb èxit",
Expand Down Expand Up @@ -1687,5 +1688,9 @@
"label.sanctioned_wallet_message_part1": "Aquesta adreça ha estat trobada a la llista de sancions dels EUA",
"label.sanctioned_wallet_message_part2": "Malauradament, Endaoment no permet que les adreces a la llista de sancions de l'OFAC donin a projectes realitzats per Endaoment. Consulta un altre projecte per fer una donació.",
"label.project_card_endaoment_title": "Aquest projecte és gestionat per",
"label.project_card_endaoment_subtext": "Aquest projecte és gestionat per Endaoment, que s'encarrega de la conversió i lliurament dels fons fiat al projecte. Endaoment cobra una comissió del 1,5% en les donacions, que es processa fora de l'aplicació de Giveth."
}
"label.project_card_endaoment_subtext": "Aquest projecte és gestionat per Endaoment, que s'encarrega de la conversió i lliurament dels fons fiat al projecte. Endaoment cobra una comissió del 1,5% en les donacions, que es processa fora de l'aplicació de Giveth.",
"label.devouch.view_this_project": "Veure aquest projecte a DeVouch",
"label.devouch.if_you_are_eligible": "Si ets un verificador elegible de Giveth, pots avalar la legitimitat d'aquest projecte, potencialment augmentant els beneficis que rep a Giveth.",
"label.devouch.learn_more_about_devouch": "Més informació sobre DeVouch i la verificació descentralitzada",
"label.devouch.attest_on_devouch": "Certifica a DeVouch"
}
8 changes: 6 additions & 2 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -1280,7 +1280,7 @@
"label.you_havent_boosted_any_projects_yet": "You haven't boosted any projects yet!",
"label.you_havent_created_any_projects_yet": "You haven’t created any project yet!",
"label.you_havent_donated_to_any_projects_yet": "You haven’t donated to any project yet!",
"label.you_havent_liked_any_projects_yet": "You haven’t liked any project yet!",
"label.you_havent_liked_any_projects_yet": "You haven’t bookmarked any project yet!",
"label.you_have_already_boosted_20_projects": "You have already boosted the maximum 20 projects!",
"label.you_have_no_notifications": "You have no notifications",
"label.you_have_successfuly_claimed": "You have successfully claimed",
Expand Down Expand Up @@ -1695,5 +1695,9 @@
"label.sign_a_message_with_your_safe_signer": "Sign a message with your Safe signer address to continue the log in process",
"label.this_is_necessary_to_create_projects": "This is necessary to be able to create projects, manage your profile or use GIVpower.",
"label.project_card_endaoment_title": "This project is delivered by",
"label.project_card_endaoment_subtext": "This project is delivered by Endaoment, which handles the conversion and delivery of fiat funding to this project. Endaoment charges a 1.5% fee on donations which is processed outside of the Giveth Dapp."
"label.project_card_endaoment_subtext": "This project is delivered by Endaoment, which handles the conversion and delivery of fiat funding to this project. Endaoment charges a 1.5% fee on donations which is processed outside of the Giveth Dapp.",
"label.devouch.view_this_project": "View this Project on DeVouch",
"label.devouch.if_you_are_eligible": "If you are an eligible Giveth Verifier you can vouch for this project's legitimacy, potentially increasing the benefits it receives on Giveth.",
"label.devouch.learn_more_about_devouch": "Learn more about DeVouch & Decentralized Verification",
"label.devouch.attest_on_devouch": "Attest on Devouch"
}
9 changes: 7 additions & 2 deletions lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
"label.donate_to_verified_projects_on_giveth": "Dona a proyectos verificados en Giveth. Obtenga GIV y aumente su GIVstream con el programa GIVbacks.",
"label.donate_without_matching": "Donar sin igualar",
"label.donate_with_dollars": "Dona con Dólares",
"label.qr_code_error": "Se ha producido un error al generar el código QR. Por favor, inténtalo de nuevo.",
"label.donating": "Donando",
"label.donating_camelcase": "Donando",
"label.donating_percentage_to": "Donando el {percentage} a ",
Expand Down Expand Up @@ -1275,7 +1276,7 @@
"label.you_havent_boosted_any_projects_yet": "¡Todavía no has boosteado ningún proyecto!",
"label.you_havent_created_any_projects_yet": "¡No has creado ningún proyecto todavía!",
"label.you_havent_donated_to_any_projects_yet": "¡Todavía no has donado a ningún proyecto!",
"label.you_havent_liked_any_projects_yet": "¡Todavía no has dado like a ningún proyecto!",
"label.you_havent_liked_any_projects_yet": "¡Aún no has marcado ningún proyecto como favorito!",
"label.you_have_already_boosted_20_projects": "Ya has boosteado el máximo de 20 proyectos!",
"label.you_have_no_notifications": "No tienes notificaciones",
"label.you_have_successfuly_claimed": "Has reclamado con éxito",
Expand Down Expand Up @@ -1692,5 +1693,9 @@
"label.sanctioned_wallet_message_part1": "Esta dirección ha sido encontrada en la lista de sanciones de EE.UU.",
"label.sanctioned_wallet_message_part2": "Lamentablemente, Endaoment no permite que las direcciones en la lista de sanciones de OFAC donen a proyectos entregados por Endaoment. Consulta otro proyecto para donar.",
"label.project_card_endaoment_title": "Este proyecto es gestionado por",
"label.project_card_endaoment_subtext": "Este proyecto es gestionado por Endaoment, que se encarga de la conversión y entrega de fondos fiat a este proyecto. Endaoment cobra una comisión del 1,5% en las donaciones, que se procesa fuera de la aplicación de Giveth."
"label.project_card_endaoment_subtext": "Este proyecto es gestionado por Endaoment, que se encarga de la conversión y entrega de fondos fiat a este proyecto. Endaoment cobra una comisión del 1,5% en las donaciones, que se procesa fuera de la aplicación de Giveth.",
"label.devouch.view_this_project": "Ver este proyecto en DeVouch",
"label.devouch.if_you_are_eligible": "Si eres un verificador elegible de Giveth, puedes avalar la legitimidad de este proyecto, potencialmente aumentando los beneficios que recibe en Giveth.",
"label.devouch.learn_more_about_devouch": "Más información sobre DeVouch y la verificación descentralizada",
"label.devouch.attest_on_devouch": "Certificar en DeVouch"
}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "givethdapp",
"version": "2.29.7",
"version": "2.30.0",
"private": true,
"scripts": {
"build": "next build",
Expand Down Expand Up @@ -30,6 +30,7 @@
"@solana/wallet-adapter-react-ui": "^0.9.35",
"@solana/wallet-adapter-wallets": "^0.19.26",
"@solana/web3.js": "^1.90.0",
"@stellar/stellar-sdk": "^12.2.0",
"@superfluid-finance/sdk-core": "^0.7.0",
"@tanstack/react-query": "^5.45.1",
"@vercel/speed-insights": "^1.0.9",
Expand All @@ -47,6 +48,7 @@
"next": "^14.2.3",
"nprogress": "^0.2.0",
"posthog-js": "^1.147.0",
"qrcode": "^1.5.3",
"quill": "^1.3.7",
"quill-emoji": "^0.2.0",
"quill-image-resize-module": "^3.0.0",
Expand Down Expand Up @@ -85,6 +87,7 @@
"@types/lodash.isequal": "^4.5.8",
"@types/node": "^20.11.20",
"@types/nprogress": "^0.2.3",
"@types/qrcode": "^1.5.5",
"@types/react": "^18.3.2",
"@types/react-custom-scrollbars": "^4.0.13",
"@types/react-datepicker": "^6.0.1",
Expand Down
4 changes: 0 additions & 4 deletions pages/qf/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,12 @@ import { GeneralMetatags } from '@/components/Metatag';
import ProjectsIndex from '@/components/views/projects/ProjectsIndex';
import { projectsMetatags } from '@/content/metatags';
import { ProjectsProvider } from '@/context/projects.context';
import { useReferral } from '@/hooks/useReferral';
import { IProjectsRouteProps } from 'pages/projects/[slug]';
import { getMainCategorySlug } from '@/helpers/projects';
import { EProjectsSortBy } from '@/apollo/types/gqlEnums';

const QFProjectsCategoriesRoute = (props: IProjectsRouteProps) => {
const { projects, totalCount } = props;

useReferral();

return (
<ProjectsProvider isQF>
<GeneralMetatags info={projectsMetatags} />
Expand Down
84 changes: 84 additions & 0 deletions pages/test2.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import { useState } from 'react';
import { useQueries } from '@tanstack/react-query';
import { useAccount } from 'wagmi';
import {
PublicKey,
LAMPORTS_PER_SOL,
Transaction,
SystemProgram,
} from '@solana/web3.js';
import BigNumber from 'bignumber.js';
import { useConnection, useWallet } from '@solana/wallet-adapter-react';
import FailedDonation, {
EDonationFailedType,
} from '@/components/modals/FailedDonation';
Expand All @@ -25,8 +33,84 @@

console.log('subgraphValues', subgraphValues);

// Solana wallet hooks
const {
publicKey,
disconnect: solanaWalletDisconnect,

Check warning on line 39 in pages/test2.tsx

View workflow job for this annotation

GitHub Actions / build

'solanaWalletDisconnect' is assigned a value but never used. Allowed unused vars must match /^_/u
signMessage: solanaSignMessage,

Check warning on line 40 in pages/test2.tsx

View workflow job for this annotation

GitHub Actions / build

'solanaSignMessage' is assigned a value but never used. Allowed unused vars must match /^_/u
sendTransaction: solanaSendTransaction,
connecting: solanaIsConnecting,
connected: solanaIsConnected,
} = useWallet();

const { connection: solanaConnection } = useConnection();

const donateToSolana = async () => {
if (!publicKey) {
console.error('Wallet is not connected');
return;
}

console.log('Connection endpoint:', solanaConnection.rpcEndpoint);

const to = 'B6bfJUMPnpL2ddngPPe3M7QNpvrv7hiYYiGtg9iCJDMS';
const donationValue = 0.001;

console.log('publicKey', publicKey);
console.log('Public Key string:', publicKey.toString());

// Ensure the wallet has enough funds by requesting an airdrop if necessary
let balance = await solanaConnection.getBalance(publicKey);
console.log('Initial balance:', balance);
if (balance < LAMPORTS_PER_SOL) {
console.log('Airdropping 1 SOL for testing...');
const airdropSignature = await solanaConnection.requestAirdrop(
publicKey,
LAMPORTS_PER_SOL,
);
await solanaConnection.confirmTransaction(airdropSignature);
balance = await solanaConnection.getBalance(publicKey);
console.log('New balance:', balance);
}

const lamports = new BigNumber(donationValue)
.times(LAMPORTS_PER_SOL)
.toFixed();

const transaction = new Transaction().add(
SystemProgram.transfer({
fromPubkey: publicKey!,
toPubkey: new PublicKey(to),
lamports: BigInt(lamports),
}),
);

console.log('Transaction', transaction);

console.log(
'Fee Payer:',
transaction.feePayer ? transaction.feePayer.toBase58() : 'None',
);

transaction.feePayer = publicKey;

const simulationResult =
await solanaConnection.simulateTransaction(transaction);
console.log('Simulation Result:', simulationResult);

if (simulationResult.value.err) {
console.error('Simulation error:', simulationResult.value.err);
return;
}

const hash = await solanaSendTransaction(transaction, solanaConnection);

console.log('hash', hash);
};

return (
<div>
<button onClick={donateToSolana}>DONATE ON SOLANA</button>
<w3m-button />
<div>
<button
Expand Down
4 changes: 4 additions & 0 deletions public/images/devouch.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions public/images/tokens/XLM.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
75 changes: 75 additions & 0 deletions src/apollo/gql/gqlDonations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ export const CREATE_DRAFT_DONATION = gql`
$safeTransactionId: String
$useDonationBox: Boolean
$relevantDonationTxHash: String
$toWalletMemo: String
$qrCodeDataUrl: String
$isQRDonation: Boolean
) {
createDraftDonation(
networkId: $networkId
Expand All @@ -201,6 +204,78 @@ export const CREATE_DRAFT_DONATION = gql`
safeTransactionId: $safeTransactionId
useDonationBox: $useDonationBox
relevantDonationTxHash: $relevantDonationTxHash
toWalletMemo: $toWalletMemo
qrCodeDataUrl: $qrCodeDataUrl
isQRDonation: $isQRDonation
)
}
`;

export const FETCH_DRAFT_DONATION = gql`
query GetDraftDonationById($id: Int!) {
getDraftDonationById(id: $id) {
id
networkId
chainType
status
toWalletAddress
fromWalletAddress
tokenAddress
currency
amount
createdAt
matchedDonationId
qrCodeDataUrl
toWalletMemo
projectId
expiresAt
}
}
`;

export const MARK_DRAFT_DONATION_AS_FAILED = gql`
mutation ($id: Int!) {
markDraftDonationAsFailed(id: $id)
}
`;

export const FETCH_DONATION_BY_ID = gql`
${DONATION_CORE_FIELDS}
query GetDonationById($id: Int!) {
getDonationById(id: $id) {
...DonationCoreFields
isTokenEligibleForGivback
fromWalletAddress
}
}
`;

export const VERIFY_QR_DONATION_TRANSACTION = gql`
query VerifyQRDonationTransaction($id: Int!) {
verifyQRDonationTransaction(id: $id) {
id
networkId
chainType
status
toWalletAddress
fromWalletAddress
tokenAddress
currency
amount
createdAt
matchedDonationId
qrCodeDataUrl
toWalletMemo
projectId
expiresAt
}
}
`;

export const RENEW_DRAFT_DONATION_EXPIRATION = gql`
mutation ($id: Int!) {
renewDraftDonationExpirationDate(id: $id) {
expiresAt
}
}
`;
Loading
Loading