-
Notifications
You must be signed in to change notification settings - Fork 10
Nik/switch to geo sdk #586
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { Graph } from '@graphprotocol/grc-20'; | ||
| import { Graph } from '@geoprotocol/geo-sdk'; | ||
| import { useIdentityToken } from '@privy-io/react-auth'; | ||
| import { createFileRoute } from '@tanstack/react-router'; | ||
| import { CreateSpaceCard } from '@/components/CreateSpaceCard'; | ||
|
Comment on lines
+1
to
4
|
||
|
|
@@ -33,7 +33,7 @@ function Authorized() { | |
| isPending: publicSpacesPending, | ||
| error: publicSpacesError, | ||
| data: publicSpacesData, | ||
| } = usePublicSpaces(`${Graph.TESTNET_API_ORIGIN}/v2/graphql`); | ||
| } = usePublicSpaces(`${Graph.TESTNET_API_ORIGIN}/graphql`); | ||
|
|
||
| return ( | ||
| <div className="flex grow flex-col items-center justify-center"> | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -5,7 +5,7 @@ import * as automerge from '@automerge/automerge/slim'; | |||||
| import type { DocHandle } from '@automerge/automerge-repo'; | ||||||
| import { Repo } from '@automerge/automerge-repo/slim'; | ||||||
| import { RepoContext } from '@automerge/automerge-repo-react-hooks'; | ||||||
| import { Graph } from '@graphprotocol/grc-20'; | ||||||
| import { Graph } from '@geoprotocol/geo-sdk'; | ||||||
| import { | ||||||
| Config, | ||||||
| Connect, | ||||||
|
|
@@ -968,7 +968,7 @@ export function HypergraphAppProvider({ | |||||
| const result = await Graph.createSpace({ | ||||||
| editorAddress: smartSessionClient.account.address, | ||||||
| name, | ||||||
| network: smartSessionClient.chain.id === Connect.GEO_TESTNET.id ? 'TESTNET' : 'MAINNET', | ||||||
| network: smartSessionClient.chain.id === Connect.GEO_TESTNET.id ? 'TESTNET' : 'TESTNET', // TODO: switch to mainnet | ||||||
|
||||||
| network: smartSessionClient.chain.id === Connect.GEO_TESTNET.id ? 'TESTNET' : 'TESTNET', // TODO: switch to mainnet | |
| network: smartSessionClient.chain.id === Connect.GEO_TESTNET.id ? 'TESTNET' : 'MAINNET', |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||
| import type { Op } from '@graphprotocol/grc-20'; | ||||||
| import { Ipfs } from '@graphprotocol/grc-20'; | ||||||
| import type { Op } from '@geoprotocol/geo-sdk'; | ||||||
| import { Ipfs } from '@geoprotocol/geo-sdk'; | ||||||
| import { Config, Connect } from '@graphprotocol/hypergraph'; | ||||||
| import type { Hash } from 'viem'; | ||||||
|
|
||||||
|
|
@@ -23,7 +23,7 @@ export const publishOps = async ({ name, ops, walletClient, space }: PublishPara | |||||
| throw new Error('No address found'); | ||||||
| } | ||||||
|
|
||||||
| const network = walletClient.chain.id === Connect.GEO_TESTNET.id ? 'TESTNET' : 'MAINNET'; | ||||||
| const network = walletClient.chain.id === Connect.GEO_TESTNET.id ? 'TESTNET' : 'TESTNET'; // TODO: switch to mainnet | ||||||
|
||||||
| const network = walletClient.chain.id === Connect.GEO_TESTNET.id ? 'TESTNET' : 'TESTNET'; // TODO: switch to mainnet | |
| const network = walletClient.chain.id === Connect.GEO_TESTNET.id ? 'TESTNET' : 'MAINNET'; |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||
| import { Repo } from '@automerge/automerge-repo'; | ||||||
| import { Id } from '@graphprotocol/grc-20'; | ||||||
| import { Id } from '@geoprotocol/geo-sdk'; | ||||||
| import { Config, Entity, store, Type } from '@graphprotocol/hypergraph'; | ||||||
| import '@testing-library/jest-dom/vitest'; | ||||||
| import request from 'graphql-request'; | ||||||
|
|
@@ -133,7 +133,7 @@ describe('preparePublish', () => { | |||||
|
|
||||||
| const result = await preparePublish(params); | ||||||
|
|
||||||
| expect(mockRequest).toHaveBeenCalledWith(`${Config.getApiOrigin()}/v2/graphql`, expect.any(String), { | ||||||
| expect(mockRequest).toHaveBeenCalledWith(`${Config.getApiOrigin()}/graphql`, expect.any(String), { | ||||||
|
||||||
| expect(mockRequest).toHaveBeenCalledWith(`${Config.getApiOrigin()}/graphql`, expect.any(String), { | |
| expect(mockRequest).toHaveBeenCalledWith(`${Config.getApiOrigin()}/v2/graphql`, expect.any(String), { |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| import { MAINNET, TESTNET } from '@graphprotocol/grc-20/contracts'; | ||
| import { TESTNET } from '@geoprotocol/geo-sdk/contracts'; | ||
| import { randomBytes } from '@noble/hashes/utils'; | ||
| import { | ||
| encodeSmartSessionSignature, | ||
|
|
@@ -78,7 +78,7 @@ const SAFE_4337_MODULE_ADDRESS = '0x75cf11467937ce3F2f357CE24ffc3DBF8fD5c226'; | |
| const ERC7579_LAUNCHPAD_ADDRESS = '0x7579011aB74c46090561ea277Ba79D510c6C00ff'; | ||
|
|
||
| const SPACE_FACTORY_ADDRESS: Record<string, Hex> = { | ||
| '80451': MAINNET.DAO_FACTORY_ADDRESS, | ||
| '80451': TESTNET.DAO_FACTORY_ADDRESS, // TODO: switch to mainnet | ||
| '19411': TESTNET.DAO_FACTORY_ADDRESS, | ||
| }; | ||
|
Comment on lines
80
to
83
|
||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API_URLnow always usesGraph.TESTNET_API_ORIGIN, even whenVITE_HYPERGRAPH_CHAIN === 'geogenesis', which means the app will talk to the testnet GraphQL API whileCHAINis set to the geogenesis (mainnet) chain. This desynchronizes chain and API target compared to the previous behavior that usedGraph.MAINNET_API_ORIGINfor geogenesis, and will cause geogenesis deployments to hit the wrong backend; please restore a mainnet-specific origin for the geogenesis branch or otherwise alignAPI_URLwithCHAIN.