Skip to content

Commit f27de92

Browse files
authored
Merge pull request #166 from hypercerts-org/develop
Develop
2 parents 4c6d4b3 + 5989b63 commit f27de92

File tree

4 files changed

+47
-6
lines changed

4 files changed

+47
-6
lines changed

src/types/supabaseCaching.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,7 @@ export type Database = {
700700
owner_id: string | null;
701701
path_tokens: string[] | null;
702702
updated_at: string | null;
703+
user_metadata: Json | null;
703704
version: string | null;
704705
};
705706
Insert: {
@@ -713,6 +714,7 @@ export type Database = {
713714
owner_id?: string | null;
714715
path_tokens?: string[] | null;
715716
updated_at?: string | null;
717+
user_metadata?: Json | null;
716718
version?: string | null;
717719
};
718720
Update: {
@@ -726,6 +728,7 @@ export type Database = {
726728
owner_id?: string | null;
727729
path_tokens?: string[] | null;
728730
updated_at?: string | null;
731+
user_metadata?: Json | null;
729732
version?: string | null;
730733
};
731734
Relationships: [
@@ -747,6 +750,7 @@ export type Database = {
747750
key: string;
748751
owner_id: string | null;
749752
upload_signature: string;
753+
user_metadata: Json | null;
750754
version: string;
751755
};
752756
Insert: {
@@ -757,6 +761,7 @@ export type Database = {
757761
key: string;
758762
owner_id?: string | null;
759763
upload_signature: string;
764+
user_metadata?: Json | null;
760765
version: string;
761766
};
762767
Update: {
@@ -767,6 +772,7 @@ export type Database = {
767772
key?: string;
768773
owner_id?: string | null;
769774
upload_signature?: string;
775+
user_metadata?: Json | null;
770776
version?: string;
771777
};
772778
Relationships: [

src/types/supabaseData.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,7 @@ export type Database = {
573573
owner_id: string | null;
574574
path_tokens: string[] | null;
575575
updated_at: string | null;
576+
user_metadata: Json | null;
576577
version: string | null;
577578
};
578579
Insert: {
@@ -586,6 +587,7 @@ export type Database = {
586587
owner_id?: string | null;
587588
path_tokens?: string[] | null;
588589
updated_at?: string | null;
590+
user_metadata?: Json | null;
589591
version?: string | null;
590592
};
591593
Update: {
@@ -599,6 +601,7 @@ export type Database = {
599601
owner_id?: string | null;
600602
path_tokens?: string[] | null;
601603
updated_at?: string | null;
604+
user_metadata?: Json | null;
602605
version?: string | null;
603606
};
604607
Relationships: [
@@ -620,6 +623,7 @@ export type Database = {
620623
key: string;
621624
owner_id: string | null;
622625
upload_signature: string;
626+
user_metadata: Json | null;
623627
version: string;
624628
};
625629
Insert: {
@@ -630,6 +634,7 @@ export type Database = {
630634
key: string;
631635
owner_id?: string | null;
632636
upload_signature: string;
637+
user_metadata?: Json | null;
633638
version: string;
634639
};
635640
Update: {
@@ -640,6 +645,7 @@ export type Database = {
640645
key?: string;
641646
owner_id?: string | null;
642647
upload_signature?: string;
648+
user_metadata?: Json | null;
643649
version?: string;
644650
};
645651
Relationships: [
@@ -776,6 +782,10 @@ export type Database = {
776782
updated_at: string;
777783
}[];
778784
};
785+
operation: {
786+
Args: Record<PropertyKey, never>;
787+
Returns: string;
788+
};
779789
search: {
780790
Args: {
781791
prefix: string;

src/utils/getRpcUrl.ts

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,27 @@
11
import { alchemyApiKey, drpcApiPkey, infuraApiKey } from "./constants.js";
22
import { createPublicClient, fallback, http } from "viem";
3-
import { base, baseSepolia, celo, optimism, sepolia } from "viem/chains";
3+
import {
4+
arbitrum,
5+
arbitrumSepolia,
6+
base,
7+
baseSepolia,
8+
celo,
9+
optimism,
10+
sepolia,
11+
} from "viem/chains";
412

5-
export const selectedNetwork = (chainId: number) => {
13+
const selectedNetwork = (chainId: number) => {
614
switch (chainId) {
715
case 10:
816
return optimism;
917
case 8453:
1018
return base;
1119
case 42220:
1220
return celo;
21+
case 42161:
22+
return arbitrum;
23+
case 421614:
24+
return arbitrumSepolia;
1325
case 84532:
1426
return baseSepolia;
1527
case 11155111:
@@ -27,12 +39,16 @@ export const alchemyUrl = (chainId: number) => {
2739
return `https://base-mainnet.g.alchemy.com/v2/${alchemyApiKey}`;
2840
case 42220:
2941
return;
42+
case 42161:
43+
return `https://arb-mainnet.g.alchemy.com/v2/${alchemyApiKey}`;
44+
case 421614:
45+
return `https://arb-sepolia.g.alchemy.com/v2/${alchemyApiKey}`;
3046
case 84532:
3147
return `https://base-sepolia.g.alchemy.com/v2/${alchemyApiKey}`;
3248
case 11155111:
3349
return `https://eth-sepolia.g.alchemy.com/v2/${alchemyApiKey}`;
3450
default:
35-
throw new Error(`Unsupported chain ID for alchemy: ${chainId}`);
51+
throw new Error(`Unsupported chain ID: ${chainId}`);
3652
}
3753
};
3854

@@ -44,12 +60,16 @@ const infuraUrl = (chainId: number) => {
4460
return;
4561
case 42220:
4662
return `https://celo-mainnet.infura.io/v3/${infuraApiKey}`;
63+
case 42161:
64+
return `https://arbitrum-mainnet.infura.io/v3/${infuraApiKey}`;
65+
case 421614:
66+
return `https://arbitrum-sepolia.infura.io/v3/${infuraApiKey}`;
4767
case 84532:
4868
return;
4969
case 11155111:
5070
return `https://sepolia.infura.io/v3/${infuraApiKey}`;
5171
default:
52-
throw new Error(`Unsupported chain ID for infura: ${chainId}`);
72+
throw new Error(`Unsupported chain ID: ${chainId}`);
5373
}
5474
};
5575

@@ -61,12 +81,16 @@ const drpcUrl = (chainId: number) => {
6181
return `https://lb.drpc.org/ogrpc?network=base&dkey=${drpcApiPkey}`;
6282
case 42220:
6383
return `https://lb.drpc.org/ogrpc?network=celo&dkey=${drpcApiPkey}`;
84+
case 42161:
85+
return `https://lb.drpc.org/ogrpc?network=arbitrum&dkey=${drpcApiPkey}`;
86+
case 421614:
87+
return `https://lb.drpc.org/ogrpc?network=arbitrum-sepolia&dkey=${drpcApiPkey}`;
6488
case 84532:
6589
return;
6690
case 11155111:
6791
return;
6892
default:
69-
throw new Error(`Unsupported chain ID for drpc: ${chainId}`);
93+
throw new Error(`Unsupported chain ID: ${chainId}`);
7094
}
7195
};
7296

@@ -95,6 +119,7 @@ const fallBackProvider = (chainId: number) => {
95119
};
96120

97121
/* Returns a PublicClient instance for the configured network. */
122+
// @ts-expect-error viem typings
98123
export const getEvmClient = (chainId: number) =>
99124
createPublicClient({
100125
chain: selectedNetwork(chainId),

0 commit comments

Comments
 (0)