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

Subgraph integration with dApp #397

Merged
merged 11 commits into from
May 9, 2024
Merged

Conversation

kkosiorowska
Copy link
Contributor

@kkosiorowska kkosiorowska commented May 7, 2024

Closes #347

This PR integrates a subgraph with dApp. Subgraph can be run locally or use a production/development URL. To select the right endpoint, set the URL for the following environmental variable:

VITE_ACRE_SUBGRAPH_URL=<SUBGRAPH_URL>

By default, the development URL is set to subgraph.

  • If you want to use a local subgraph you need to follow the steps here. Then set the subgraph URL to localhost.
  • To find the production URL you need to connect to the Subgraph Studio with Acre Wallet and open the dedicated page for the selected subgraph. Copy the URL and use the API key from the "API Keys" tab.

Subgraph API

  • fetchActivityDatas - Returns activities for the Ethereum account

Subgraph can be run locally or use a production URL. DApp can select the right data source environment variables. The available functions for the Acre subgraph were exported in the `subgraphAPI` object. Currently, only the method that fetches activities has been implemented.
@kkosiorowska kkosiorowska self-assigned this May 7, 2024
Copy link

netlify bot commented May 7, 2024

Deploy Preview for acre-dapp-testnet ready!

Name Link
🔨 Latest commit 76d525b
🔍 Latest deploy log https://app.netlify.com/sites/acre-dapp-testnet/deploys/663c7f3f5fb4ed0008af32c6
😎 Deploy Preview https://deploy-preview-397--acre-dapp-testnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kkosiorowska kkosiorowska marked this pull request as ready for review May 7, 2024 08:18
dapp/src/utils/subgraphAPI.ts Outdated Show resolved Hide resolved
dapp/src/utils/subgraphAPI.ts Outdated Show resolved Hide resolved
dapp/src/utils/subgraphAPI.ts Outdated Show resolved Hide resolved
dapp/src/utils/subgraphAPI.ts Outdated Show resolved Hide resolved
dapp/src/utils/subgraphAPI.ts Outdated Show resolved Hide resolved
dapp/src/vite-env.d.ts Outdated Show resolved Hide resolved
dapp/src/hooks/useRequestBitcoinAccount.ts Outdated Show resolved Hide resolved
dapp/.env Outdated Show resolved Hide resolved
dapp/.env Outdated Show resolved Hide resolved
dapp/src/hooks/useRequestBitcoinAccount.ts Outdated Show resolved Hide resolved
dapp/src/utils/subgraphAPI.ts Outdated Show resolved Hide resolved
@kkosiorowska kkosiorowska force-pushed the subgraph-dapp-integration branch from f09020c to 6b6e730 Compare May 9, 2024 05:39
@kkosiorowska kkosiorowska requested a review from r-czajkowski May 9, 2024 05:44
@r-czajkowski r-czajkowski enabled auto-merge May 9, 2024 07:43
@r-czajkowski r-czajkowski merged commit f4e29b1 into main May 9, 2024
25 checks passed
@r-czajkowski r-czajkowski deleted the subgraph-dapp-integration branch May 9, 2024 07:49
@nkuba nkuba mentioned this pull request May 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Subgraph: Integrate with dApp
2 participants