@@ -41,6 +41,9 @@ const decodeResponseMessage = Schema.decodeUnknownEither(Messages.ResponseMessag
4141
4242const queryClient = new QueryClient ( ) ;
4343
44+ const CHAIN = Connect . GEO_TESTNET ;
45+ const RPC_URL = Connect . TESTNET_RPC_URL ;
46+
4447export type HypergraphAppCtx = {
4548 // auth related
4649 logout ( ) : void ;
@@ -359,7 +362,12 @@ export function HypergraphAppProvider({
359362 signature : update . signature ,
360363 accountAddress : update . accountAddress ,
361364 } ) ;
362- const authorIdentity = await Identity . getVerifiedIdentity ( update . accountAddress , syncServerUri ) ;
365+ const authorIdentity = await Identity . getVerifiedIdentity (
366+ update . accountAddress ,
367+ syncServerUri ,
368+ CHAIN ,
369+ RPC_URL ,
370+ ) ;
363371 if ( authorIdentity . signaturePublicKey !== signer ) {
364372 // console.error(
365373 // `Received invalid signature, recovered signer is ${signer},
@@ -394,7 +402,7 @@ export function HypergraphAppProvider({
394402 const getVerifiedIdentity = ( accountAddress : string ) => {
395403 return Effect . gen ( function * ( ) {
396404 const identity = yield * Effect . tryPromise ( {
397- try : ( ) => Identity . getVerifiedIdentity ( accountAddress , syncServerUri ) ,
405+ try : ( ) => Identity . getVerifiedIdentity ( accountAddress , syncServerUri , CHAIN , RPC_URL ) ,
398406 catch : ( ) => new Identity . InvalidIdentityError ( ) ,
399407 } ) ;
400408 return identity ;
@@ -638,6 +646,8 @@ export function HypergraphAppProvider({
638646 inbox ,
639647 response . spaceId ,
640648 syncServerUri ,
649+ CHAIN ,
650+ RPC_URL ,
641651 ) ;
642652 if ( ! isValid ) {
643653 console . error ( 'Invalid message' , response . message , inbox . inboxId ) ;
@@ -684,6 +694,8 @@ export function HypergraphAppProvider({
684694 inbox ,
685695 identity . address ,
686696 syncServerUri ,
697+ CHAIN ,
698+ RPC_URL ,
687699 ) ;
688700 if ( ! isValid ) {
689701 console . error ( 'Invalid message' , response . message , inbox . inboxId ) ;
@@ -747,7 +759,14 @@ export function HypergraphAppProvider({
747759 response . messages . map (
748760 // If the message has a signature, check that the signature is valid for the authorAccountAddress
749761 async ( message ) => {
750- return Inboxes . validateAccountInboxMessage ( message , inbox , identity . address , syncServerUri ) ;
762+ return Inboxes . validateAccountInboxMessage (
763+ message ,
764+ inbox ,
765+ identity . address ,
766+ syncServerUri ,
767+ CHAIN ,
768+ RPC_URL ,
769+ ) ;
751770 } ,
752771 ) ,
753772 ) ;
@@ -807,7 +826,7 @@ export function HypergraphAppProvider({
807826 response . messages . map (
808827 // If the message has a signature, check that the signature is valid for the authorAccountAddress
809828 async ( message ) => {
810- return Inboxes . validateSpaceInboxMessage ( message , inbox , space . id , syncServerUri ) ;
829+ return Inboxes . validateSpaceInboxMessage ( message , inbox , space . id , syncServerUri , CHAIN , RPC_URL ) ;
811830 } ,
812831 ) ,
813832 ) ;
@@ -1259,7 +1278,7 @@ export function HypergraphAppProvider({
12591278 console . error ( 'No state found for space' ) ;
12601279 return ;
12611280 }
1262- const inviteeWithKeys = await Identity . getVerifiedIdentity ( invitee . accountAddress , syncServerUri ) ;
1281+ const inviteeWithKeys = await Identity . getVerifiedIdentity ( invitee . accountAddress , syncServerUri , CHAIN , RPC_URL ) ;
12631282 const spaceEvent = await Effect . runPromiseExit (
12641283 SpaceEvents . createInvitation ( {
12651284 author : {
@@ -1305,7 +1324,7 @@ export function HypergraphAppProvider({
13051324
13061325 const getVerifiedIdentity = useCallback (
13071326 ( accountAddress : string ) => {
1308- return Identity . getVerifiedIdentity ( accountAddress , syncServerUri ) ;
1327+ return Identity . getVerifiedIdentity ( accountAddress , syncServerUri , CHAIN , RPC_URL ) ;
13091328 } ,
13101329 [ syncServerUri ] ,
13111330 ) ;
0 commit comments