Skip to content

Commit be1aafe

Browse files
committed
fix(app2): whitelist sepolia
1 parent 472a56d commit be1aafe

File tree

5 files changed

+63
-3
lines changed

5 files changed

+63
-3
lines changed

app2/src/lib/components/Transfer/ChainAsset/ChainSelector.svelte

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,13 @@ const filteredChains = $derived(
3636
chains.data.pipe(
3737
Option.map(
3838
Arr.filter(c =>
39-
["corn.21000001", "bob.60808", "bob.808813", "babylon.bbn-test-5"].includes(
40-
c.universal_chain_id
41-
)
39+
[
40+
"corn.21000001",
41+
"bob.60808",
42+
"bob.808813",
43+
"babylon.bbn-test-5",
44+
"ethereum.11155111"
45+
].includes(c.universal_chain_id)
4246
)
4347
)
4448
)

ts-sdk/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@
7474
"babel-plugin-annotate-pure-calls": "^0.5.0",
7575
"biome": "^0.3.3",
7676
"dpdm": "^3.14.0",
77+
"@effect/platform": "^0.77.2",
78+
"gql.tada": "^1.8.10",
79+
"graphql-request": "^7.1.2",
7780
"effect": "^3.13.12",
7881
"viem": "^2.23.12"
7982
},

ts-sdk/src/graphql/unwrapped-quote-token.ts

Whitespace-only changes.

ts-sdk/src/utils/graphql-query.ts

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { Effect, Option, pipe, Schedule, Schema } from "effect"
2+
import { FetchHttpClient, HttpClient } from "@effect/platform"
3+
import type { DurationInput } from "effect/Duration"
4+
import type { HttpClientError } from "@effect/platform/HttpClientError"
5+
import type { ParseError } from "effect/ParseResult"
6+
import type { TadaDocumentNode } from "gql.tada"
7+
import { request } from "graphql-request"
8+
import { URLS } from "$lib/constants"
9+
import type { TimeoutException, UnknownException } from "effect/Cause"
10+
11+
// Deprecated, use the one from ts-sdk
12+
export const fetchDecode = <S>(schema: Schema.Schema<S>, url: string) =>
13+
Effect.gen(function* () {
14+
const client = yield* HttpClient.HttpClient
15+
const response = yield* client.get(url)
16+
const json = yield* response.json
17+
return yield* Schema.decodeUnknown(schema)(json)
18+
})
19+
20+
export type FetchDecodeGraphqlError = UnknownException | ParseError | TimeoutException
21+
22+
// Deprecated, use the one from ts-sdk
23+
export const fetchDecodeGraphql = <S, E, D, V extends object | undefined>(
24+
schema: Schema.Schema<S, E>,
25+
document: TadaDocumentNode<D, V>,
26+
variables?: V
27+
) =>
28+
Effect.gen(function* () {
29+
const data = yield* Effect.tryPromise(() => request(URLS().GRAPHQL, document, variables))
30+
return yield* Schema.decodeUnknown(schema)(data)
31+
})

ts-sdk/ts-sdk.nix

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,23 @@ _: {
22
perSystem =
33
{
44
pkgs,
5+
pkgsUnstable,
56
lib,
67
self',
8+
ensureAtRepositoryRoot,
79
...
810
}:
911
let
1012
buildPnpmPackage = import ../tools/typescript/buildPnpmPackage.nix {
1113
inherit pkgs lib;
1214
};
15+
deps = with pkgsUnstable; [
16+
python3
17+
stdenv.cc
18+
pkg-config
19+
nodePackages_latest.nodejs
20+
pnpm_10
21+
];
1322
pnpm = pkgs.pnpm_10;
1423
in
1524
{
@@ -46,6 +55,19 @@ _: {
4655
'';
4756
};
4857
};
58+
ts-sdk-fetch-schema = {
59+
type = "app";
60+
program = pkgs.writeShellApplication {
61+
name = "ts-sdk-fetch-schema";
62+
runtimeInputs = deps;
63+
text = ''
64+
${ensureAtRepositoryRoot}
65+
cd ts-sdk/
66+
pnpm dlx gql.tada generate-schema --tsconfig ./tsconfig.json --output "./src/generated/schema.graphql" "https://development.graphql.union.build/v1/graphql"
67+
pnpm dlx gql.tada generate-output --disable-preprocessing --tsconfig ./tsconfig.json --output ./src/generated/graphql-env.d.ts
68+
'';
69+
};
70+
};
4971
};
5072
};
5173
}

0 commit comments

Comments
 (0)