Security News
Research
Supply Chain Attack on Rspack npm Packages Injects Cryptojacking Malware
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
@connext/nxtp-adapters-subgraph
Advanced tools
The subgraph adapter has been built on top of the graphclient. This basically works in cross-chain mode right now and uses highestValue
strategy, but we will integrate the most-synced
strategy once they get it released here.
There are several use cases graphclient can support for cross chain mode. See more details here.
union
the responsesCross chain mode has been implemented in the adapter using use-case 1. So in this scenario, developers need to prefix each schema types while being compose, at the level of each source:
sources:
- name: Connext_Kovan
handler:
graphql:
endpoint: https://api.thegraph.com/subgraphs/name/connext/nxtp-amarok-runtime-v0-kovan
transforms:
- prefix:
value: kovan_
includeRootOperations: true
ignore:
- _SubgraphErrorPolicy_
- name: Connext_Rinkeby
handler:
graphql:
endpoint: https://api.thegraph.com/subgraphs/name/connext/nxtp-amarok-runtime-v0-rinkeby
transforms:
- prefix:
value: rinkeby_
includeRootOperations: true
ignore:
- _SubgraphErrorPolicy_
The merged schema allows users to execute a cross-chain query through multiple chains at the same time and parse responses.
query something($t: String) { # you can even pass the same GraphQL variable, into multiple GraphQL field arguments
kovan_something(t: $t) {
id
}
rinkeby_something(t: $t) {
id
}
}
To add a new subgraph, you need to determine source name, endpoint and prefix first. After that, you can add a new source to .graphclientrc.yml and need to regenerate typescript types for schemas to be updated.
Whenever you add a new source in .graphclientrc.yml or there is an update in subgraph schema, you need to rebuild graphclient. Before building a graphclient, you must create .env
file and set the following variables properly. To generate schemas for local subgraphs without running the graph nodes locally, we can use live endpoints like the following.
GRAPH_1337_ENDPOINT=https://api.thegraph.com/subgraphs/name/connext/nxtp-amarok-runtime-v0-rinkeby
GRAPH_1338_ENDPOINT=https://api.thegraph.com/subgraphs/name/connext/nxtp-amarok-runtime-v0-rinkeby
yarn workspace @connext/nxtp-adapters-subgraph build-client
This basically fetches the schemas from endpoints and creates typescript-based entities which are prefixed.
FAQs
adapter for subgraph interaction of nxtp protocol
The npm package @connext/nxtp-adapters-subgraph receives a total of 9 weekly downloads. As such, @connext/nxtp-adapters-subgraph popularity was classified as not popular.
We found that @connext/nxtp-adapters-subgraph demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.
Security News
Sonar’s acquisition of Tidelift highlights a growing industry shift toward sustainable open source funding, addressing maintainer burnout and critical software dependencies.