Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions apps/connect/.env.development
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="http://localhost:3030"
VITE_HYPERGRAPH_CHAIN="geo-testnet"
VITE_HYPERGRAPH_API_URL="https://v2-postgraphile.up.railway.app/graphql"
VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-test-zc16z3tcvf.t.conduit.xyz"
VITE_PRIVY_APP_ID="cmbhnmo1x000bla0mxudtd8z9"
VITE_PRIVY_PROVIDERS="development"
# VITE_HYPERGRAPH_CHAIN="geogenesis"
# VITE_HYPERGRAPH_API_URL="https://hypergraph-v2.up.railway.app/graphql"
# VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-genesis-h0q2s21xx8.t.conduit.xyz"
1 change: 0 additions & 1 deletion apps/connect/.env.production
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="https://syncserver.hypergraph.thegraph.com"
VITE_HYPERGRAPH_SYNC_SERVER_ORIGIN="https://hypergraph.fly.dev"
VITE_HYPERGRAPH_CHAIN="geo-testnet"
VITE_HYPERGRAPH_API_URL="https://v2-postgraphile.up.railway.app/graphql"
VITE_HYPERGRAPH_RPC_URL="https://rpc-geo-test-zc16z3tcvf.t.conduit.xyz"
VITE_PRIVY_APP_ID="cmcccikza007bjy0niawgutl0"
VITE_PRIVY_PROVIDERS="production"
2 changes: 1 addition & 1 deletion apps/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"dependencies": {
"@base-ui-components/react": "1.0.0-beta.0",
"@graphprotocol/grc-20": "^0.21.2",
"@graphprotocol/grc-20": "^0.21.6",
"@graphprotocol/hypergraph": "workspace:*",
"@graphprotocol/hypergraph-react": "workspace:*",
"@privy-io/react-auth": "^2.13.0",
Expand Down
3 changes: 2 additions & 1 deletion apps/connect/src/routes/authenticate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SpacesCard } from '@/components/SpacesCard';
import { Loading } from '@/components/ui/Loading';
import { usePrivateSpaces } from '@/hooks/use-private-spaces';
import { usePublicSpaces } from '@/hooks/use-public-spaces';
import { Graph } from '@graphprotocol/grc-20';
import { Connect, Identity, Key, type Messages, StoreConnect, Utils } from '@graphprotocol/hypergraph';
import { useIdentityToken, usePrivy, useWallets } from '@privy-io/react-auth';
import { createFileRoute } from '@tanstack/react-router';
Expand Down Expand Up @@ -145,7 +146,7 @@ function AuthenticateComponent() {
isPending: publicSpacesPending,
error: publicSpacesError,
data: publicSpacesData,
} = usePublicSpaces(import.meta.env.VITE_HYPERGRAPH_API_URL);
} = usePublicSpaces(`${Graph.TESTNET_API_ORIGIN}/graphql`);

const selectedPrivateSpaces = new Set<string>();
const selectedPublicSpaces = new Set<string>();
Expand Down
3 changes: 2 additions & 1 deletion apps/connect/src/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SpacesCard } from '@/components/SpacesCard';
import { Loading } from '@/components/ui/Loading';
import { usePrivateSpaces } from '@/hooks/use-private-spaces';
import { usePublicSpaces } from '@/hooks/use-public-spaces';
import { Graph } from '@graphprotocol/grc-20';
import { useIdentityToken } from '@privy-io/react-auth';
import { createFileRoute } from '@tanstack/react-router';

Expand Down Expand Up @@ -32,7 +33,7 @@ function Authorized() {
isPending: publicSpacesPending,
error: publicSpacesError,
data: publicSpacesData,
} = usePublicSpaces(import.meta.env.VITE_HYPERGRAPH_API_URL);
} = usePublicSpaces(`${Graph.TESTNET_API_ORIGIN}/graphql`);

return (
<div className="flex grow flex-col items-center justify-center">
Expand Down
2 changes: 1 addition & 1 deletion apps/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"preview": "vite preview"
},
"dependencies": {
"@graphprotocol/grc-20": "^0.21.2",
"@graphprotocol/grc-20": "^0.21.6",
"@graphprotocol/hypergraph": "workspace:*",
"@graphprotocol/hypergraph-react": "workspace:*",
"@noble/hashes": "^1.8.0",
Expand Down
2 changes: 1 addition & 1 deletion apps/next-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
},
"type": "module",
"dependencies": {
"@graphprotocol/grc-20": "^0.21.2",
"@graphprotocol/grc-20": "^0.21.6",
"@graphprotocol/hypergraph": "workspace:*",
"@graphprotocol/hypergraph-react": "workspace:*",
"next": "15.3.2",
Expand Down
2 changes: 1 addition & 1 deletion apps/typesync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@effect/sql": "^0.40.1",
"@effect/sql-sqlite-node": "^0.41.1",
"@effect/vitest": "^0.23.10",
"@graphprotocol/grc-20": "^0.21.3",
"@graphprotocol/grc-20": "^0.21.6",
"@graphql-codegen/cli": "^5.0.7",
"@graphql-codegen/client-preset": "^4.8.3",
"@graphql-codegen/typescript": "^4.1.6",
Expand Down
2 changes: 1 addition & 1 deletion apps/typesync/src/Database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const SqlLive = SqliteClient.layer({

const MigratorLive = Migrator.layer({
loader: fromFileSystem(fileURLToPath(new URL('migrations', import.meta.url))),
}).pipe(Layer.provide(SqlLive))
}).pipe(Layer.provide(SqlLive));

const DatabaseLive = Layer.mergeAll(SqlLive, MigratorLive).pipe(Layer.provide(NodeContext.layer));

Expand Down
57 changes: 25 additions & 32 deletions apps/typesync/src/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ export class InvalidInputError extends Data.TaggedError('/typesync/errors/Invali
/* Windows-safe migration loader */
/* ------------------------------------------------------------------ */

import { pathToFileURL } from "node:url"
import { FileSystem } from "@effect/platform/FileSystem"
import * as Effect from "effect/Effect"
import type { Loader, ResolvedMigration } from "@effect/sql/Migrator"
import { MigrationError } from "@effect/sql/Migrator"
import { pathToFileURL } from 'node:url';
import { FileSystem } from '@effect/platform/FileSystem';
import type { Loader, ResolvedMigration } from '@effect/sql/Migrator';
import { MigrationError } from '@effect/sql/Migrator';
import * as Effect from 'effect/Effect';

/**
* Patched version of
Expand All @@ -143,36 +143,29 @@ import { MigrationError } from "@effect/sql/Migrator"
* The only difference is that the dynamic `import()` receives a proper
* `file://` URL, so it works on Windows as well as on Linux / macOS.
*/
export const fromFileSystem = (
dir: string,
): Loader<FileSystem> =>
export const fromFileSystem = (dir: string): Loader<FileSystem> =>
FileSystem.pipe(
/* read directory ----------------------------------------------------- */
Effect.flatMap((FS) => FS.readDirectory(dir)),
Effect.mapError(
(e) => new MigrationError({ reason: "failed", message: e.message }),
),
Effect.mapError((e) => new MigrationError({ reason: 'failed', message: e.message })),
/* build migration list ---------------------------------------------- */
Effect.map((files): ReadonlyArray<ResolvedMigration> =>
files
.flatMap((file) => {
const m =
file.match(/^(?:.*[\\/])?(\d+)_([^.]+)\.(js|ts)$/) // win/posix
if (!m) return []
const [basename, id, name] = m
return [
[
Number(id),
name,
Effect.promise(() =>
import(
/* @vite-ignore */ /* webpackIgnore: true */
pathToFileURL(`${dir}/${basename}`).href,
Effect.map(
(files): ReadonlyArray<ResolvedMigration> =>
files
.flatMap((file) => {
const m = file.match(/^(?:.*[\\/])?(\d+)_([^.]+)\.(js|ts)$/); // win/posix
if (!m) return [];
const [basename, id, name] = m;
return [
[
Number(id),
name,
Effect.promise(
() => import(/* @vite-ignore */ /* webpackIgnore: true */ pathToFileURL(`${dir}/${basename}`).href),
),
),
],
] as const
})
.sort(([a], [b]) => a - b),
],
] as const;
})
.sort(([a], [b]) => a - b),
),
)
);
2 changes: 1 addition & 1 deletion docs/docs/spaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Public spaces are spaces that are open to the public. They are visible to anyone

Indexer API that indexes all the public spaces and the content in it!

[Railway Graphql API](https://v2-postgraphile.up.railway.app/graphql)
[Railway Graphql API](https://api-testnet.geobrowser.io/graphql)

## Private Spaces

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"@babel/core": "^7.27.1",
"@biomejs/biome": "1.9.4",
"@changesets/cli": "^2.29.3",
"@graphprotocol/grc-20": "^0.21.3",
"@graphprotocol/grc-20": "^0.21.6",
"babel-plugin-annotate-pure-calls": "^0.5.0",
"glob": "^11.0.2",
"pkg-pr-new": "^0.0.43",
Expand Down
2 changes: 1 addition & 1 deletion packages/hypergraph-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@automerge/automerge": "^2.2.9",
"@automerge/automerge-repo": "^2.0.6",
"@automerge/automerge-repo-react-hooks": "^2.0.6",
"@graphprotocol/grc-20": "^0.21.2",
"@graphprotocol/grc-20": "^0.21.6",
"@noble/hashes": "^1.8.0",
"@tanstack/react-query": "^5.75.5",
"effect": "^3.16.10",
Expand Down
4 changes: 2 additions & 2 deletions packages/hypergraph-react/src/hooks/use-spaces.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Graph } from '@graphprotocol/grc-20';
import { store } from '@graphprotocol/hypergraph';
import { useQuery } from '@tanstack/react-query';
import { useSelector } from '@xstate/store/react';
import { gql, request } from 'graphql-request';
import { useEffect } from 'react';
import { useHypergraphApp } from '../HypergraphAppContext.js';
import { GEO_API_TESTNET_ENDPOINT } from '../internal/constants.js';

const publicSpacesQueryDocument = gql`
query Spaces($accountAddress: String!) {
Expand Down Expand Up @@ -33,7 +33,7 @@ export const useSpaces = (params: { mode: 'public' | 'private' }) => {
const publicResult = useQuery({
queryKey: ['hypergraph-spaces', params.mode],
queryFn: async () => {
const result = await request<PublicSpacesQueryResult>(GEO_API_TESTNET_ENDPOINT, publicSpacesQueryDocument, {
const result = await request<PublicSpacesQueryResult>(Graph.TESTNET_API_ORIGIN, publicSpacesQueryDocument, {
accountAddress,
});
return result?.spaces
Expand Down
2 changes: 0 additions & 2 deletions packages/hypergraph-react/src/internal/constants.ts

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Op } from '@graphprotocol/grc-20';
import { Graph, type Op } from '@graphprotocol/grc-20';
import { gql, request } from 'graphql-request';
import { GEO_API_TESTNET_ENDPOINT } from './constants.js';

const deleteEntityQueryDocument = gql`
query entity($entityId: String!) {
Expand Down Expand Up @@ -45,7 +44,7 @@ type DeleteEntityResult = {
};

export const generateDeleteOps = async ({ id, space }: { id: string; space: string }) => {
const result = await request<DeleteEntityResult>(GEO_API_TESTNET_ENDPOINT, deleteEntityQueryDocument, {
const result = await request<DeleteEntityResult>(Graph.TESTNET_API_ORIGIN, deleteEntityQueryDocument, {
entityId: id,
});
if (result.entity === null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import type { Connect, Entity } from '@graphprotocol/hypergraph';
import { useQueryClient } from '@tanstack/react-query';
import request, { gql } from 'graphql-request';
import { publishOps } from '../publish-ops.js';
import { GEO_API_TESTNET_ENDPOINT } from './constants.js';

type DeleteEntityPublicParams = {
space: string;
Expand Down Expand Up @@ -38,7 +37,7 @@ export const useDeleteEntityPublic = <S extends Entity.AnyNoContext>(type: S, {

return async ({ id, walletClient }: { id: string; walletClient: Connect.SmartSessionClient }) => {
try {
const result = await request<EntityToDeleteQueryResult>(GEO_API_TESTNET_ENDPOINT, deleteEntityQueryDocument, {
const result = await request<EntityToDeleteQueryResult>(Graph.TESTNET_API_ORIGIN, deleteEntityQueryDocument, {
spaceId: space,
entityId: id,
});
Expand Down
4 changes: 2 additions & 2 deletions packages/hypergraph-react/src/internal/use-public-space.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Graph } from '@graphprotocol/grc-20';
import { useQuery } from '@tanstack/react-query';
import { gql, request } from 'graphql-request';
import { GEO_API_TESTNET_ENDPOINT } from '../internal/constants.js';

const spaceQueryDocument = gql`
query Space($spaceId: UUID!) {
Expand All @@ -24,7 +24,7 @@ export const usePublicSpace = ({ spaceId, enabled }: { spaceId: string; enabled:
const result = useQuery({
queryKey: ['hypergraph-public-space', spaceId],
queryFn: async () => {
const result = await request<SpaceQueryResult>(GEO_API_TESTNET_ENDPOINT, spaceQueryDocument, {
const result = await request<SpaceQueryResult>(Graph.TESTNET_API_ORIGIN, spaceQueryDocument, {
spaceId,
});
return result?.space?.page
Expand Down
4 changes: 2 additions & 2 deletions packages/hypergraph-react/src/internal/use-query-public.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Graph } from '@graphprotocol/grc-20';
import { type Entity, type Mapping, type MappingEntry, Type, store } from '@graphprotocol/hypergraph';
import { useQuery as useQueryTanstack } from '@tanstack/react-query';
import { useSelector } from '@xstate/store/react';
Expand All @@ -6,7 +7,6 @@ import * as Schema from 'effect/Schema';
import { gql, request } from 'graphql-request';
import { useMemo } from 'react';
import { useHypergraphSpaceInternal } from '../HypergraphSpaceContext.js';
import { GEO_API_TESTNET_ENDPOINT } from './constants.js';
import type { QueryPublicParams } from './types.js';

const entitiesQueryDocumentLevel0 = gql`
Expand Down Expand Up @@ -344,7 +344,7 @@ export const useQueryPublic = <S extends Entity.AnyNoContext>(type: S, params?:
queryDocument = entitiesQueryDocumentLevel2;
}

const result = await request<EntityQueryResult>(GEO_API_TESTNET_ENDPOINT, queryDocument, {
const result = await request<EntityQueryResult>(Graph.TESTNET_API_ORIGIN, queryDocument, {
spaceId: space,
typeIds: mappingEntry?.typeIds || [],
relationTypeIdsLevel1,
Expand Down
3 changes: 1 addition & 2 deletions packages/hypergraph-react/src/prepare-publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {
import type { Entity } from '@graphprotocol/hypergraph';
import { Type, store } from '@graphprotocol/hypergraph';
import request, { gql } from 'graphql-request';
import { GEO_API_TESTNET_ENDPOINT } from './internal/constants.js';

export type PreparePublishParams<S extends Entity.AnyNoContext> = {
entity: Entity.Entity<S>;
Expand Down Expand Up @@ -46,7 +45,7 @@ export const preparePublish = async <S extends Entity.AnyNoContext>({
entity,
publicSpace,
}: PreparePublishParams<S>) => {
const data = await request<EntityToPublishQueryResult>(GEO_API_TESTNET_ENDPOINT, entityToPublishQueryDocument, {
const data = await request<EntityToPublishQueryResult>(Graph.TESTNET_API_ORIGIN, entityToPublishQueryDocument, {
entityId: entity.id,
spaceId: publicSpace,
});
Expand Down
2 changes: 1 addition & 1 deletion packages/hypergraph-react/src/publish-ops.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const publishOps = async ({ name, ops, walletClient, space }: PublishPara
const cid = publishResult.cid;

// This returns the correct contract address and calldata depending on the space id
const result = await fetch(`https://v2-postgraphile.up.railway.app/space/${space}/edit/calldata`, {
const result = await fetch(`https://api-testnet.geobrowser.io/space/${space}/edit/calldata`, {
method: 'POST',
body: JSON.stringify({ cid }),
});
Expand Down
2 changes: 1 addition & 1 deletion packages/hypergraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"@automerge/automerge": "^2.2.9",
"@automerge/automerge-repo": "^2.0.6",
"@effect/experimental": "^0.51.1",
"@graphprotocol/grc-20": "^0.21.2",
"@graphprotocol/grc-20": "^0.21.6",
"@noble/ciphers": "^1.3.0",
"@noble/curves": "^1.9.0",
"@noble/hashes": "^1.8.0",
Expand Down
Loading
Loading