Skip to content

Commit 1fd3526

Browse files
committed
chore: shutter env variables
1 parent 7bbe6df commit 1fd3526

File tree

9 files changed

+14
-5
lines changed

9 files changed

+14
-5
lines changed

contracts/.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ LOGTAIL_TOKEN_RELAYER_BOT=41h8q5Z4gnz5yDx215eqcQ4r
1919
LOGTAIL_TOKEN_DISPUTOR_BOT=mSryyvYubviaMqKDWfBKAGsi
2020
HEARTBEAT_URL_KEEPER_BOT=https://uptime.betterstack.com/api/v1/heartbeat/jc23S8ZZzpf8KbzwxL1hoBp9
2121
HEARTBEAT_URL_RELAYER_BOT=https://uptime.betterstack.com/api/v1/heartbeat/eT6Trk6CddJV6fFBbqZNzyqC
22+
SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api"
2223
DISPUTES_TO_SKIP=
2324

2425
# Optionally for debugging

contracts/scripts/shutter.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1+
import env from "./utils/env";
12
import { encryptData, decrypt as shutterDecrypt } from "@shutter-network/shutter-sdk";
23
import { Hex, stringToHex, hexToString } from "viem";
34
import crypto from "crypto";
45
import "isomorphic-fetch";
56

7+
const SHUTTER_API = env.optionalNoDefault("SHUTTER_API");
68
// Time in seconds to wait before the message can be decrypted
79
export const DECRYPTION_DELAY = 5;
810

@@ -38,7 +40,7 @@ async function fetchShutterData(decryptionTimestamp: number): Promise<ShutterApi
3840
const identityPrefix = generateRandomBytes32();
3941
console.log(`Generated identity prefix: ${identityPrefix}`);
4042

41-
const response = await fetch("https://shutter-api.shutter.network/api/register_identity", {
43+
const response = await fetch(`${SHUTTER_API}/register_identity`, {
4244
method: "POST",
4345
headers: {
4446
accept: "application/json",
@@ -88,7 +90,7 @@ async function fetchShutterData(decryptionTimestamp: number): Promise<ShutterApi
8890
async function fetchDecryptionKey(identity: string): Promise<ShutterDecryptionKeyData> {
8991
console.log(`Fetching decryption key for identity: ${identity}`);
9092

91-
const response = await fetch(`https://shutter-api.shutter.network/api/get_decryption_key?identity=${identity}`, {
93+
const response = await fetch(`${SHUTTER_API}/get_decryption_key?identity=${identity}`, {
9294
method: "GET",
9395
headers: {
9496
accept: "application/json",

web/.env.devnet-neo.public

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ export REACT_APP_ATLAS_URI=http://localhost:3000
99
export WALLETCONNECT_PROJECT_ID=
1010
export ALCHEMY_API_KEY=
1111
export NODE_OPTIONS='--max-old-space-size=7680'
12+
export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api"

web/.env.devnet-university.public

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export REACT_APP_ATLAS_URI=http://localhost:3000
88
export WALLETCONNECT_PROJECT_ID=
99
export ALCHEMY_API_KEY=
1010
export NODE_OPTIONS='--max-old-space-size=7680'
11+
export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api"
1112

1213
# devtools
1314
export REACT_APP_GRAPH_API_KEY=

web/.env.devnet.public

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ export REACT_APP_ATLAS_URI=http://localhost:3000
77
export REACT_APP_DEVTOOLS_URL=https://dev--kleros-v2-testnet-devtools.netlify.app
88
export NODE_OPTIONS='--max-old-space-size=7680'
99
export REACT_APP_SPAM_EVIDENCES_IDS="0-2,3-1"
10+
export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api"
1011
# devtools
1112
export REACT_APP_GRAPH_API_KEY=

web/.env.local.public

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export REACT_APP_ATLAS_URI=http://localhost:3000
66
export WALLETCONNECT_PROJECT_ID=
77
export ALCHEMY_API_KEY=
88
export NODE_OPTIONS='--max-old-space-size=7680'
9+
export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api"
910

1011
# devtools
1112
export REACT_APP_GRAPH_API_KEY=

web/.env.mainnet-neo.public

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ export REACT_APP_ARBITRATOR_TYPE=neo
88
export REACT_APP_ATLAS_URI=http://localhost:3000
99
export WALLETCONNECT_PROJECT_ID=
1010
export ALCHEMY_API_KEY=
11-
export NODE_OPTIONS='--max-old-space-size=7680'
11+
export NODE_OPTIONS='--max-old-space-size=7680'
12+
export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api"

web/.env.testnet.public

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ export REACT_APP_DEVTOOLS_URL=https://devtools.v2-testnet.kleros.builders
88
export WALLETCONNECT_PROJECT_ID=
99
export ALCHEMY_API_KEY=
1010
export NODE_OPTIONS='--max-old-space-size=7680'
11+
export REACT_APP_SHUTTER_API="https://shutter-api.chiado.staging.shutter.network/api"
1112
# devtools
1213
export REACT_APP_GRAPH_API_KEY=

web/src/utils/shutter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function fetchShutterData(decryptionTimestamp: number): Promise<ShutterApi
3030
// Generate a random identity prefix
3131
const identityPrefix = generateRandomBytes32();
3232

33-
const response = await fetch("https://shutter-api.shutter.network/api/register_identity", {
33+
const response = await fetch(`${import.meta.env.REACT_APP_SHUTTER_API}/register_identity`, {
3434
method: "POST",
3535
headers: {
3636
accept: "application/json",
@@ -77,7 +77,7 @@ async function fetchShutterData(decryptionTimestamp: number): Promise<ShutterApi
7777
* @returns Promise with the decryption key data
7878
*/
7979
async function fetchDecryptionKey(identity: string): Promise<ShutterDecryptionKeyData> {
80-
const response = await fetch(`https://shutter-api.shutter.network/api/get_decryption_key?identity=${identity}`, {
80+
const response = await fetch(`${import.meta.env.REACT_APP_SHUTTER_API}/get_decryption_key?identity=${identity}`, {
8181
method: "GET",
8282
headers: {
8383
accept: "application/json",

0 commit comments

Comments
 (0)