File tree Expand file tree Collapse file tree 3 files changed +15
-17
lines changed Expand file tree Collapse file tree 3 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -21,12 +21,6 @@ import type {
2121 PendingAny ,
2222} from "./utils/types.ts" ;
2323
24- declare global {
25- interface Window {
26- __PORTO__ ?: unknown ;
27- }
28- }
29-
3024export function App ( ) {
3125 useEffect ( ( ) => {
3226 if ( ! window . __PORTO__ ) {
Original file line number Diff line number Diff line change @@ -45,10 +45,7 @@ export const api = async <T = unknown>(
4545 "Content-Type" : "application/json" ,
4646 } ;
4747
48- const token =
49- typeof window !== "undefined" && ( window as any ) . __SESSION_TOKEN__
50- ? String ( ( window as any ) . __SESSION_TOKEN__ )
51- : null ;
48+ const token = typeof window !== "undefined" ? window . __SESSION_TOKEN__ : undefined ;
5249
5350 if ( token ) {
5451 headers [ "X-Session-Token" ] = token ;
Original file line number Diff line number Diff line change 11import type { TransactionRequest } from "viem" ;
22
3+ declare global {
4+ interface Window {
5+ __PORTO__ ?: unknown ;
6+ __SESSION_TOKEN__ ?: string ;
7+ }
8+
9+ interface WindowEventMap {
10+ "eip6963:announceProvider" : EIP6963AnnounceProviderEvent ;
11+ "eip6963:requestProvider" : Event ;
12+ }
13+ }
14+
315export type EIP6963ProviderInfo = {
416 uuid : string ;
517 name : string ;
@@ -33,13 +45,8 @@ export interface EIP6963AnnounceProviderEvent extends CustomEvent<EIP6963Provide
3345 type : "eip6963:announceProvider" ;
3446}
3547
36- declare global {
37- interface WindowEventMap {
38- "eip6963:announceProvider" : EIP6963AnnounceProviderEvent ;
39- "eip6963:requestProvider" : Event ;
40- }
41- }
42-
4348export type ApiOk < T > = { status : "ok" ; data : T } ;
49+
4450export type ApiErr = { status : string ; message ?: string } ;
51+
4552export type PendingAny = Record < string , unknown > & { id : string ; request : TransactionRequest } ;
You can’t perform that action at this time.
0 commit comments