{"id":28471251,"url":"https://github.com/requestnetwork/payments-subgraph","last_synced_at":"2026-02-12T01:33:18.423Z","repository":{"id":37372654,"uuid":"375151677","full_name":"RequestNetwork/payments-subgraph","owner":"RequestNetwork","description":null,"archived":false,"fork":false,"pushed_at":"2025-03-25T07:37:16.000Z","size":547,"stargazers_count":6,"open_issues_count":4,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-06-07T10:48:46.406Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RequestNetwork.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-06-08T21:38:02.000Z","updated_at":"2025-03-25T07:37:19.000Z","dependencies_parsed_at":"2023-12-07T16:46:10.044Z","dependency_job_id":"5d727806-4710-4a32-af0d-13993eb4c081","html_url":"https://github.com/RequestNetwork/payments-subgraph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RequestNetwork/payments-subgraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RequestNetwork%2Fpayments-subgraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RequestNetwork%2Fpayments-subgraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RequestNetwork%2Fpayments-subgraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RequestNetwork%2Fpayments-subgraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RequestNetwork","download_url":"https://codeload.github.com/RequestNetwork/payments-subgraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RequestNetwork%2Fpayments-subgraph/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263039387,"owners_count":23404171,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-07T10:39:58.309Z","updated_at":"2026-02-12T01:33:13.392Z","avatar_url":"https://github.com/RequestNetwork.png","language":"TypeScript","readme":"# Request Payments subgraph\n\nThis repo contains the code and configuration for Request Payment subgraphs:\n\nMainnets:\n- [Arbitrum One](https://thegraph.com/explorer/subgraphs/3MtDdHbzvBVNBpzUTYXGuDDLgTd1b8bPYwoH1Hdssgp9?view=Overview\u0026chain=arbitrum-one)\n- [Avalanche](https://thegraph.com/explorer/subgraphs/A27V4PeZdKHeyuBkehdBJN8cxNtzVpXvYoqkjHUHRCFp?view=Overview\u0026chain=arbitrum-one)\n- [Base](https://thegraph.com/explorer/subgraphs/A5AqE5jBRrHYfgqYihwJw9EBZU5MqL6JyN4vLg7sx5jU?view=Overview\u0026chain=arbitrum-one)\n- [BSC](https://thegraph.com/explorer/subgraphs/4PScFUi3CFDbop9XzT6gCDtD4RR8kRzyrzSjrHoXHZBt?view=Overview\u0026chain=arbitrum-one)\n- [Celo](https://thegraph.com/explorer/subgraphs/5ts3PHjMcH2skCgKtvLLNE64WLjbhE5ipruvEcgqyZqC?view=Overview\u0026chain=arbitrum-one)\n- [Core - Hosted by CoreDAO](https://thegraph.coredao.org/subgraphs/name/requestnetwork/request-payments-core)\n- [Ethereum Mainnet](https://thegraph.com/explorer/subgraphs/5mXPGZRC2Caynh4NyVrTK72DAGB9dfcKmLsnxYWHQ9nd?view=Overview\u0026chain=arbitrum-one)\n- [Fuse](https://thegraph.com/explorer/subgraphs/EHSpUBa7PAewX7WsaU2jbCKowF5it56yStr6Zgf8aDtx?view=Overview\u0026chain=arbitrum-one)\n- [Fantom](https://thegraph.com/explorer/subgraphs/6AwmiYo5eY36W526ZDQeAkNBjXjXKYcMLYyYHeM67xAb?view=Overview\u0026chain=arbitrum-one)\n- [Gnosis Chain (xDai)](https://thegraph.com/explorer/subgraphs/2UAW7B94eeeqaL5qUM5FDzTWJcmgA6ta1RcWMo3XuLmU?view=Overview\u0026chain=arbitrum-one)\n- [Mantle - Hosted by FusionX](https://graph.fusionx.finance/subgraphs/name/request-payments-mantle)\n- [Moonbeam](https://thegraph.com/explorer/subgraphs/4Jo3DwA25zyVLeDhyi7cks52dNrkVCWWhQJzm1hKnCfj?view=Overview\u0026chain=arbitrum-one)\n- [Near](https://thegraph.com/explorer/subgraphs/9yEg3h46CZiv4VuSqo1erMMBx5sHxRuW5Ai2V8goSpQL?view=Overview\u0026chain=arbitrum-one)\n- [Optimism](https://thegraph.com/explorer/subgraphs/525fra79nG3Z1w8aPZh3nHsH5zCVetrVmceB1hKcTrTX?view=Overview\u0026chain=arbitrum-one)\n- [Polygon (Matic)](https://thegraph.com/explorer/subgraphs/DPpU1WMxk2Z4H2TAqgwGbVBGpabjbC1972Mynak5jSuR?view=Overview\u0026chain=arbitrum-one)\n- [zkSync Era](https://thegraph.com/explorer/subgraphs/HJNZW9vRSGXrcCVyQMdNKxxuLKeZcV6yMjTCyY6T2oon?view=Overview\u0026chain=arbitrum-one)\n\nTestnets:\n- [Mantle Testnet - Hosted by Mantle](https://graph.testnet.mantle.xyz/subgraphs/name/request-payments-mantle-testnet)\n- [Near Testnet](https://thegraph.com/explorer/subgraphs/AusVyfndonsMVFrVzckuENLqx8t6kcXuxn6C6VbSGd7M?view=Overview\u0026chain=arbitrum-one)\n- [Sepolia](https://thegraph.com/explorer/subgraphs/6e8Dcwt3cvsgNU3JYBtRQQ9Sj4P9VVVnXaPjJ3jUpYpY?view=Overview\u0026chain=arbitrum-one)\n\nIt indexes Request's proxy smart-contracts for easy querying of payment data.\n\nSmart-contract addresses can be found here:\n\n- [ERC20 Proxy](https://github.com/RequestNetwork/requestNetwork/blob/master/packages/smart-contracts/src/lib/artifacts/ERC20Proxy/index.ts)\n- [ERC20 Fee Proxy](https://github.com/RequestNetwork/requestNetwork/blob/master/packages/smart-contracts/src/lib/artifacts/ERC20FeeProxy/index.ts)\n- [ERC20 Conversion Proxy](https://github.com/RequestNetwork/requestNetwork/blob/master/packages/smart-contracts/src/lib/artifacts/Erc20ConversionProxy/index.ts)\n- [requestnetwork.near](https://github.com/RequestNetwork/requestNetwork/blob/master/packages/payment-detection/src/near-detector.ts)\n\n[Learn more about TheGraph](https://thegraph.com/)\n\n## Contributing\n\n```\n# setup variables\ncp .env.sample .env # don't forget to edit the WEB3_URL and, if required, the NETWORK variable\n\n# install dependencies\nyarn\n# generate ABIs \u0026 subgraph manifests, and generate types\nyarn prepare\n\n# Run a local Graph Node\ndocker-compose up -d\n# Run\n```\n\n### Adding a new chain\n\n\u003e This requires the `@requestnetwork/smart-contracts` package to be deployed.\n\n```\nexport NETWORK=my-network\n\n# update to latest version\nyarn add --exact @requestnetwork/smart-contracts@next\n\n# add new network\ncat \u003c\u003c\u003c $(jq '. + [env.NETWORK] | unique' cli/networks.json) \u003e cli/networks.json\n\n# update CI (update deployment targets with cli/networks.json)\nNETWORKS=$(cat ./cli/networks.json) yq e -i '.jobs.deploy.strategy.matrix.chain |= env(NETWORKS)' .github/workflows/deploy.yaml\n\n# create Github Environment (for CI) based on mainnet\nyarn subgraph configure-ci $NETWORK\n```\n\n## Manifests\n\nThe subgraphs manifests are automatically generated using the [prepare script](./scripts/prepare.ts), which uses `@requestnetwork/smart-contracts` NPM package to get the smart-contracts addresses.\n\nOne manifest can refer to many different versions of proxies dealing with the same payment network. The first version found is not explicitely mentionned in generated files and data sources naming. Example; `EthProxy` implicitely refers to the version `0.1.0`. Further versions are referenced in this format: `EthProxy_0_2_0` for the contract `EthProxy` of abi version `0.2.0`.\n\n\u003e Note: The `TransferWithReferenceAndFee` event is configured twice. That is because the Conversion proxy makes an internal call to the ERC20 Fee proxy. Both `TransferWithReferenceAndFee` and `TransferWithConversionAndReference` need to be parsed for the Conversion smart-contract.\n\n### Build\n\n```\nexport NETWORK=sepolia\nyarn build\n```\n\n## Deployment\n\n### Local\n\n```\nexport NETWORK=sepolia\nyarn create-local\nyarn deploy-local\n```\n\n### Hosted\n\nAll deployments are semi-automated through GitHub action.\nThe first time a subgraph is deployed, it needs to be created on the Graph Node or on Subgraph Studio.\n\nGraph Node locations:\n* `core` uses the [Graph Node hosted by CoreDAO](https://thegraph.coredao.org)\n* `mantle` uses the [Graph Node hosted by FusionX](https://graph.fusionx.finance)\n* `mantle-testnet` uses the [Graph Node hosted by Mantle](https://docs.mantle.xyz/network/for-devs/resources-and-tooling/graph-endpoints)\n* all other chains use Subgraph Studio.\n\nWhen a PR is merged on `main`:\n* test chains are deployed immediately, without approval\n* mainnet chains require a manual approval in [GitHub actions](https://github.com/RequestNetwork/payments-subgraph/actions).\n\n\u003e **Important**: Once a subgraph is deployed on Subgraph Studio,\n\u003e a manual action is required to publish it to the decentralized network.\n\u003e See [the documentation](https://thegraph.com/docs/en/publishing/publishing-a-subgraph/) for more information.\n\n### Check the deployed version\n\nYou can compare the code to the deployed version using one of these commands\n\n```\n# all\nyarn subgraph compare\n# one network\nyarn subgraph compare NETWORK_NAME\n# several networks\nyarn subgraph compare NETWORK_NAME_1 NETWORK_NAME_2\n```\n\n## Example query\n\n```graphql\n{\n  payments {\n    txHash\n    gasPrice\n    contractAddress\n    block\n    amount\n    amountInCrypto\n    feeAmount\n    feeAmountInCrypto\n    feeAddress\n    tokenAddress\n    maxRateTimespan\n    reference\n    id\n    to\n    from\n    currency\n  }\n}\n```\n\n## Troubleshooting\n\n### Delays\n\nRun one of these commands to check for indexing delays.\n\n```\n# all\nyarn subgraph monitor\n# one network\nyarn subgraph monitor --network NETWORK_NAME\n# several networks\nyarn subgraph monitor --network NETWORK_NAME_1 NETWORK_NAME_2\n```\n\nSome networks will require you to set env vars:\n\n```\nexport ALCHEMY_API_KEY=...\nexport INFURA_API_KEY=...\n```\n\n### Hosting service API\n\nURL: https://api.thegraph.com/index-node/graphql\nSchema: https://github.com/graphprotocol/graph-node/blob/master/server/index-node/src/schema.graphql\n\n### Sync failed with no logs\n\n```\nhttp POST 'https://api.thegraph.com/index-node/graphql'  query=\"{ indexingStatusForPendingVersion(subgraphName: \\\"requestnetwork/request-payments-sepolia\\\") { subgraph fatalError { message } nonFatalErrors {message } } }\" | jq .data\n```\n\n### Build issue `TS6054: File '~lib/allocator/arena.ts' not found.`\n\nYou probably have an issue in the package resolution of `assemblyscript`.\n\nSee next issue for resolution.\n\n### Install issue `Couldn't find match for ...`\n\nThis is related to the fact TheGraph uses a very old version of assemblyscript (see [This PR](https://github.com/graphprotocol/graph-ts/pull/185/files) for migration to the latest version).\n\nIn the meantime, `yarn cache clean` should resolve it.\n\n### Failed to fetch status for mainnet: could not detect network (event=\"noNetwork\", code=NETWORK_ERROR, version=providers/5.7.2)\n\nNeed to set env var ALCHEMY_API_KEY or INFURA_API_KEY.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frequestnetwork%2Fpayments-subgraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frequestnetwork%2Fpayments-subgraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frequestnetwork%2Fpayments-subgraph/lists"}