Skip to content

Commit a67a105

Browse files
Add LIT protocol support for PGN (#2071)
* feat: add lit support for pgn in explorer * feat: add lit support for pgn in builder * chore: update Fantom * fix: build issue * feat: add pgn type
1 parent 3000574 commit a67a105

File tree

5 files changed

+21
-5
lines changed

5 files changed

+21
-5
lines changed

packages/builder/src/actions/roundApplication.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,13 +220,23 @@ export const submitApplication =
220220
let application: RoundApplication;
221221
let deterministicApplication: string;
222222

223+
let chain: string = "";
224+
225+
if (chainName === "mainnet") {
226+
chain = "ethereum";
227+
} else if (chainName === "pgn") {
228+
chain = "publicGoodsNetwork";
229+
} else {
230+
chain = chainName;
231+
}
232+
223233
try {
224234
const builder = new RoundApplicationBuilder(
225235
true,
226236
project,
227237
roundApplicationMetadata,
228238
roundAddress,
229-
chainName === "mainnet" ? "ethereum" : chainName // lit wants "ethereum" for mainnet
239+
chain
230240
);
231241

232242
application = await builder.build(roundAddress, formInputs);

packages/grant-explorer/src/features/api/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { VerifiableCredential } from "@gitcoinco/passport-sdk-types";
44
import { ChainId } from "common";
55
import { BigNumber } from "ethers";
66

7-
export type Network = "goerli" | "optimism" | "Fantom";
7+
export type Network = "goerli" | "optimism" | "fantom" | "pgn";
88

99
export interface Web3Instance {
1010
/**

packages/round-manager/src/features/api/exports.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,10 @@ export async function roundApplicationsToCSV(
5050
}
5151

5252
const lit = new Lit({
53-
chain: chainName.toLowerCase(),
53+
chain:
54+
chainName.toLowerCase() === "pgn"
55+
? "publicGoodsNetwork"
56+
: chainName.toLowerCase(),
5457
contract: roundId,
5558
});
5659

packages/round-manager/src/features/api/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { VerifiableCredential } from "@gitcoinco/passport-sdk-types";
77
import { BigNumber } from "ethers";
88
import { SchemaQuestion } from "./utils";
99

10-
export type Network = "goerli" | "optimism";
10+
export type Network = "goerli" | "optimism" | "fantom" | "pgn";
1111

1212
export interface Web3Instance {
1313
/**

packages/round-manager/src/features/round/ViewApplicationPage.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,10 @@ export default function ViewApplicationPage() {
263263
const encryptedString: Blob = await response.blob();
264264

265265
const lit = new Lit({
266-
chain: chain.name.toLowerCase(),
266+
chain:
267+
chain.name.toLowerCase() === "pgn"
268+
? "publicGoodsNetwork"
269+
: chain.name.toLowerCase(),
267270
contract: utils.getAddress(roundId),
268271
});
269272

0 commit comments

Comments
 (0)