Skip to content

Commit 1620b1b

Browse files
shaneauerbachcursoragentshane
authored
Refactor: Exclude chains with known subscription issues (#139)
Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: shane <shane@dune.com>
1 parent 01aa048 commit 1620b1b

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

evm/subscriptions.mdx

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ description: "Get realtime onchain data pushed directly to your app with webhook
66

77
import { SupportedChains } from "/snippets/supported-chains.mdx";
88

9+
{/*
10+
NOTE: The SupportedChains components below exclude "abstract", "zero_network", and "zksync"
11+
because subscriptions are not currently working for these chains due to ingestion issues.
12+
This is a temporary frontend workaround until the backend API properly reflects subscription
13+
chain support separately from general API endpoint support.
14+
See: https://duneanalytics.slack.com/archives/C04AD72E0FL/p1766158048815119
15+
*/}
16+
917
The Subscriptions API allows you to receive realtime onchain data through webhooks. Instead of repeatedly polling endpoints to check for new data, the Subscriptions API pushes data directly to your app as soon as events occur. This makes it a great way to build reactive apps that respond instantly to onchain activity.
1018

1119
Essentially, the Subscriptions API provides a webhook-based version of our existing [Balances](/evm/balances), [Activity](/evm/activity), and [Transactions](/evm/transactions) endpoints. Supported chains vary by subscription type.
@@ -77,7 +85,7 @@ Below are examples of the webhook payloads for each subscription type, along wit
7785

7886
Get notified when a wallet's ERC20 token balance changes. The payload contains details about the asset, the balance change, and the transaction that caused it. This data is similar to the response from our [Balances API](/evm/balances).
7987

80-
<SupportedChains endpoint="balances" title="Balances Event Supported Chains" />
88+
<SupportedChains endpoint="balances" title="Balances Event Supported Chains" excludeChains={["abstract", "zero_network", "zksync"]} />
8189

8290
<CodeGroup>
8391
```json [expandable] Balance Change Payload
@@ -116,7 +124,7 @@ Get notified when a wallet's ERC20 token balance changes. The payload contains d
116124

117125
Receive a notification when a new activity is associated with a subscribed address. The payload contains an array of activity objects, which is similar to the response from our [Activity API](/evm/activity).
118126

119-
<SupportedChains endpoint="activity" title="Activities Event Supported Chains" />
127+
<SupportedChains endpoint="activity" title="Activities Event Supported Chains" excludeChains={["abstract", "zero_network", "zksync"]} />
120128

121129
<CodeGroup>
122130
```json [expandable] Activity Payload
@@ -159,7 +167,7 @@ Receive a notification when a new activity is associated with a subscribed addre
159167

160168
Get notified when a subscribed address is the sender or receiver of a transaction. The payload contains an array of transaction objects, which is similar to the response from our [Transactions API](/evm/transactions).
161169

162-
<SupportedChains endpoint="transactions" title="Transactions Event Supported Chains" />
170+
<SupportedChains endpoint="transactions" title="Transactions Event Supported Chains" excludeChains={["abstract", "zero_network", "zksync"]} />
163171

164172
<CodeGroup>
165173
```json [expandable] Transaction Payload

snippets/supported-chains.mdx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export const SupportedChains = ({ endpoint, title }) => {
1+
export const SupportedChains = ({ endpoint, title, excludeChains }) => {
22
const dataState = useState(null);
33
const data = dataState[0];
44
const setData = dataState[1];
@@ -30,16 +30,22 @@ export const SupportedChains = ({ endpoint, title }) => {
3030

3131
var supportedChains = [];
3232
var totalChains = data.chains.length;
33+
var excludedChainNames = excludeChains || [];
3334

3435
if (endpoint !== undefined && endpoint !== 'defi_positions') {
3536
for (var i = 0; i < data.chains.length; i++) {
3637
var chain = data.chains[i];
37-
if (chain[endpoint] && chain[endpoint].supported) {
38+
if (chain[endpoint] && chain[endpoint].supported && excludedChainNames.indexOf(chain.name) === -1) {
3839
supportedChains.push(chain);
3940
}
4041
}
4142
} else {
42-
supportedChains = data.chains;
43+
for (var i = 0; i < data.chains.length; i++) {
44+
var chain = data.chains[i];
45+
if (excludedChainNames.indexOf(chain.name) === -1) {
46+
supportedChains.push(chain);
47+
}
48+
}
4349
}
4450

4551
var count = supportedChains.length;

0 commit comments

Comments
 (0)