Skip to content

Commit

Permalink
Cleanup env
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura committed Aug 12, 2024
1 parent 5767223 commit 9fee542
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 371 deletions.
3 changes: 1 addition & 2 deletions examples/starknet-react-next/.env.development
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
NEXT_PUBLIC_RPC_MAINNET="http://localhost:8001/x/starknet/mainnet"
NEXT_PUBLIC_RPC_SEPOLIA="http://localhost:8001/x/starknet/sepolia"
NEXT_PUBLIC_API_URL="http://localhost:8001"
XFRAME_URL="http://localhost:3001"
3 changes: 1 addition & 2 deletions examples/starknet-react-next/.env.production
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
NEXT_PUBLIC_RPC_MAINNET="https://api.cartridge.gg/x/starknet/mainnet"
NEXT_PUBLIC_RPC_SEPOLIA="https://api.cartridge.gg/x/starknet/sepolia"
NEXT_PUBLIC_API_URL="https://api.cartridge.gg"
XFRAME_URL="https://x.cartridge.gg/"
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ export const DelegateAccount = () => {
setDelegateAddress(delegate?.toString() || "");
setIsDelegateSupported(true);
} catch (e: any) {
console.log(e)
console.log(e);
// controller doesnt support delegateAccount, ignore
}
}, [account, chainId, cartridgeConnector]);
}, [account, cartridgeConnector]);

const execute = useCallback(async () => {
if (!account) {
Expand Down Expand Up @@ -76,7 +76,7 @@ export const DelegateAccount = () => {
type="text"
min-width="420px"
value={delegateAddressInput}
onChange={(e:any ) => setDelegateAddressInput(e.target.value)}
onChange={(e: any) => setDelegateAddressInput(e.target.value)}
/>
<Button onClick={() => execute()} disabled={submitted}>
Set Delegate
Expand Down
2 changes: 1 addition & 1 deletion examples/starknet-react-next/src/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function Menu() {
if (!account) return;
const isConnected = await cartridgeConnector.openMenu();
if (!isConnected) {
disconnect()
disconnect();
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ function provider(chain: Chain) {
switch (chain) {
case mainnet:
return new RpcProvider({
nodeUrl: process.env.NEXT_PUBLIC_RPC_MAINNET,
nodeUrl: `${process.env.NEXT_PUBLIC_API_URL}/x/starknet/mainnet`,
});
case sepolia:
default:
return new RpcProvider({
nodeUrl: process.env.NEXT_PUBLIC_RPC_SEPOLIA,
nodeUrl: `${process.env.NEXT_PUBLIC_API_URL}/x/starknet/sepolia`,
});
}
}
Expand Down Expand Up @@ -78,7 +78,7 @@ const connectors = [
],
{
url,
rpc: process.env.NEXT_PUBLIC_RPC_SEPOLIA,
rpc: `${process.env.NEXT_PUBLIC_API_URL}/x/starknet/sepolia`,
paymaster: {
caller: shortString.encodeShortString("ANY_CALLER"),
},
Expand Down
12 changes: 1 addition & 11 deletions packages/keychain/.env.development
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
# NEXT_PUBLIC_RP_ID="cartridge.gg"
# NEXT_PUBLIC_RP_ID="localhost"
# NEXT_PUBLIC_ADMIN_URL="https://cartridge.gg"
# NEXT_PUBLIC_API_BASE_URL="https://api.cartridge.gg"
# NEXT_PUBLIC_API_URL="https://api.cartridge.gg/query"
# NEXT_PUBLIC_RPC_MAINNET="https://api.cartridge.gg/rpc/starknet"
# NEXT_PUBLIC_RPC_SEPOLIA="https://api.cartridge.gg/rpc/starknet-sepolia"
NEXT_PUBLIC_ETH_RPC_MAINNET="https://eth-mainnet.g.alchemy.com/v2/OGPRMquXP3K7oTkLrmVZpjCd1DswtYz3"
NEXT_PUBLIC_ETH_RPC_SEPOLIA="https://eth-sepolia.g.alchemy.com/v2/mURnclB5pn5elDfyzgTN4W2GR-rOYevI"

NEXT_PUBLIC_ORIGIN="http://localhost:3001"
NEXT_PUBLIC_RP_ID="localhost"
NEXT_PUBLIC_ADMIN_URL="http://localhost:3002"
NEXT_PUBLIC_API_BASE_URL="http://localhost:8000"
NEXT_PUBLIC_API_URL="http://localhost:8000/query"
NEXT_PUBLIC_RPC_MAINNET="http://localhost:8001/x/starknet/mainnet"
NEXT_PUBLIC_RPC_SEPOLIA="http://localhost:8001/x/starknet/sepolia"
NEXT_PUBLIC_API_URL="http://localhost:8000"
5 changes: 1 addition & 4 deletions packages/keychain/.env.production
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
NEXT_PUBLIC_ORIGIN="https://x.cartridge.gg"
NEXT_PUBLIC_RP_ID="cartridge.gg"
NEXT_PUBLIC_ADMIN_URL="https://cartridge.gg"
NEXT_PUBLIC_API_BASE_URL="https://api.cartridge.gg"
NEXT_PUBLIC_API_URL="https://api.cartridge.gg/query"
NEXT_PUBLIC_RPC_MAINNET="https://api.cartridge.gg/x/starknet/mainnet"
NEXT_PUBLIC_RPC_SEPOLIA="https://api.cartridge.gg/x/starknet/sepolia"
NEXT_PUBLIC_API_URL="https://api.cartridge.gg"
NEXT_PUBLIC_ETH_RPC_MAINNET="https://eth-mainnet.g.alchemy.com/v2/OGPRMquXP3K7oTkLrmVZpjCd1DswtYz3"
NEXT_PUBLIC_ETH_RPC_SEPOLIA="https://eth-sepolia.g.alchemy.com/v2/mURnclB5pn5elDfyzgTN4W2GR-rOYevI"
2 changes: 1 addition & 1 deletion packages/keychain/codegen.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
overwrite: true
schema: ${NEXT_PUBLIC_API_URL:https://api.cartridge.gg/query}
schema: ${NEXT_PUBLIC_API_URL:https://api.cartridge.gg}/query
documents: "src/**/*.graphql"
generates:
src/generated/graphql.ts:
Expand Down
2 changes: 1 addition & 1 deletion packages/keychain/src/components/bridge/BridgeEth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ const ethereumConfig = createConfig({
});

async function fetchEthPrice() {
const res = await fetch(process.env.NEXT_PUBLIC_API_URL, {
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/query`, {
method: "POST",
headers: {
"content-type": "application/json",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ type LayoutContextValue = {
};
};

type LayoutVariant = "default" | "connect" | "menu"| "error";
type LayoutVariant = "default" | "connect" | "menu" | "error";

export function useLayout() {
return useContext(LayoutContext);
Expand Down
Loading

0 comments on commit 9fee542

Please sign in to comment.