Skip to content

Commit

Permalink
Merge pull request #184 from palladians/chore/move-away-from-berkeley
Browse files Browse the repository at this point in the history
chore(wallet): ditch berkeley and add devnet as default network
  • Loading branch information
mrcnk authored Jun 12, 2024
2 parents 0f6bc03 + c35445b commit e5d68de
Show file tree
Hide file tree
Showing 72 changed files with 131 additions and 1,151 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/apps-extension-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ on:
- packages/web-provider/**
jobs:
test_and_build:
name: 'Build and test'
name: "Build and test"
env:
VITE_APP_MODE: web
VITE_APP_DEFAULT_NETWORK: Berkeley
NODE_OPTIONS: '--max_old_space_size=4096'
VITE_APP_DEFAULT_NETWORK: Devnet
NODE_OPTIONS: "--max_old_space_size=4096"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -49,7 +49,7 @@ jobs:
run: pnpm lint
- name: Build extension
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_API: "http://127.0.0.1:9080"
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: pallad
run: VITE_APP_MODE=$VITE_APP_MODE pnpm build:extension
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/apps-extension-e2e.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Extension E2E
on:
workflow_run:
workflows: ['Extension CI']
workflows: ["Extension CI"]
branches: [main]
types: [completed]
workflow_dispatch:
Expand All @@ -10,8 +10,8 @@ jobs:
name: Run E2E tests
env:
VITE_APP_MODE: web
VITE_APP_DEFAULT_NETWORK: Berkeley
NODE_OPTIONS: '--max_old_space_size=4096'
VITE_APP_DEFAULT_NETWORK: Devnet
NODE_OPTIONS: "--max_old_space_size=4096"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -24,7 +24,7 @@ jobs:
TURBO_SERVER_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }}
- name: Build extension
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_API: "http://127.0.0.1:9080"
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: pallad
run: VITE_APP_MODE=$VITE_APP_MODE pnpm build:extension
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/packages-ui-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
id-token: write
env:
VITE_APP_MODE: web
VITE_APP_DEFAULT_NETWORK: Berkeley
VITE_APP_DEFAULT_NETWORK: Devnet
steps:
- uses: actions/checkout@v3
- name: Setup Pages
Expand All @@ -33,7 +33,7 @@ jobs:
TURBO_SERVER_TOKEN: ${{ secrets.TURBO_SERVER_TOKEN }}
- name: Build features
env:
TURBO_API: 'http://127.0.0.1:9080'
TURBO_API: "http://127.0.0.1:9080"
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: pallad
run: VITE_APP_MODE=$VITE_APP_MODE pnpm build:features
Expand Down
11 changes: 3 additions & 8 deletions apps/extension/.env.example
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
VITE_APP_MODE=web
VITE_APP_DEFAULT_NETWORK=Berkeley
VITE_APP_DEFAULT_NETWORK=Devnet

VITE_APP_MINA_PROXY_MAINNET_URL=https://proxy.minaexplorer.com/
VITE_APP_MINA_EXPLORER_MAINNET_URL=https://graphql.minaexplorer.com/graphql
VITE_APP_MINA_PROXY_MAINNET_URL=https://api.minascan.io/node/mainnet/v1/graphql

VITE_APP_MINA_PROXY_BERKELEY_URL=https://proxy.berkeley.minaexplorer.com/
VITE_APP_MINA_EXPLORER_BERKELEY_URL=https://berkeley.graphql.minaexplorer.com

VITE_APP_MINA_PROXY_TESTWORLD_URL=https://proxy.devnet.minaexplorer.com/
VITE_APP_MINA_EXPLORER_TESTWORLD_URL=https://devnet.graphql.minaexplorer.com
VITE_APP_MINA_PROXY_DEVNET_URL=https://api.minascan.io/node/devnet/v1/graphql
2 changes: 1 addition & 1 deletion apps/extension/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@palladxyz/extension",
"version": "0.5.1",
"version": "0.5.2",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
7 changes: 5 additions & 2 deletions apps/extension/src/background/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { onMessage, sendMessage } from "webext-bridge/background"
// options should be defined by user
const opts = {
projectId: "test",
chains: ["Mina - Berkeley"],
chains: ["Mina - Devnet"],
}

const provider = await MinaProvider.init(opts, [])
Expand Down Expand Up @@ -91,7 +91,10 @@ onMessage("mina_addChain", async (data) => {
})

onMessage("mina_requestNetwork", async (data) => {
return await provider.request({ method: "mina_requestNetwork", params: data })
return await provider.request({
method: "mina_requestNetwork",
params: data,
})
})

onMessage("mina_switchChain", async (data) => {
Expand Down
4 changes: 0 additions & 4 deletions apps/extension/src/typings.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
declare module "mina-signer"

interface ImportMetaEnv {
readonly VITE_APP_MINA_PROXY_MAINNET_URL: string
readonly VITE_APP_MINA_EXPLORER_MAINNET_URL: string
readonly VITE_APP_MINA_PROXY_DEVNET_URL: string
readonly VITE_APP_MINA_EXPLORER_DEVNET_URL: string
readonly VITE_APP_MINA_PROXY_BERKELEY_URL: string
readonly VITE_APP_MINA_EXPLORER_BERKELEY_URL: string
}

interface ImportMeta {
Expand Down
2 changes: 1 addition & 1 deletion packages/features/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@palladxyz/features",
"version": "0.5.1",
"version": "0.5.2",
"description": "",
"type": "module",
"module": "dist/index.js",
Expand Down
9 changes: 0 additions & 9 deletions packages/features/src/common/hooks/use-blockchain-summary.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/features/src/common/lib/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,4 @@ export const TransactionFee = {
export const MinaChainId = {
Mainnet: "5f704cc0c82e0ed70e873f0893d7e06f148524e3f0bdae2afb02e7819a0c24d1",
Devnet: "b6ee40d336f4cc3f33c1cc04dee7618eb8e556664c2b2d82ad4676b512a82418",
Berkeley: "667b328bfc09ced12191d099f234575b006b6b193f5441a6fa744feacd9744db",
} as Record<string, string>
2 changes: 1 addition & 1 deletion packages/features/src/components/address-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const AddressDropdown = ({
toast.success("Address Copied")
}
const openInExplorer = () => {
const url = `https://minascan.io/berkeley/account/${publicKey}`
const url = `https://minascan.io/devnet/account/${publicKey}`
window.open(url, "_blank")?.focus()
}
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/features/src/components/hash-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const HashDropdown = ({ hash, className }: HashDropdownProps) => {
toast.success("Hash Copied")
}
const openInExplorer = () => {
const url = `https://minascan.io/berkeley/tx/${hash}/txInfo`
const url = `https://minascan.io/devnet/tx/${hash}/txInfo`
window.open(url, "_blank")?.focus()
}
return (
Expand Down
2 changes: 1 addition & 1 deletion packages/features/src/send/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const Send: Story<{ advanced: boolean }> = ({ advanced }) => (
fiatPrice={1.5}
advanced={advanced}
setAdvanced={action("Set Advanced")}
currentNetwork="Berkeley"
currentNetwork="Devnet"
/>
)

Expand Down
3 changes: 0 additions & 3 deletions packages/features/src/staking/routes/staking-overview.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import { useAccount } from "@/common/hooks/use-account"
import { useBlockchainSummary } from "@/common/hooks/use-blockchain-summary"

import { useTransactions } from "@/common/hooks/use-transactions"
import { mean, sum } from "rambda"
import { StakingOverviewView } from "../views/staking-overview"

export const StakingOverviewRoute = () => {
const blockchainSummary = useBlockchainSummary()
const account = useAccount()
const { data: transactions } = useTransactions()
const rewardsTransactions = transactions?.filter(
Expand All @@ -21,7 +19,6 @@ export const StakingOverviewRoute = () => {
<StakingOverviewView
account={account}
rewards={rewards}
blockchainSummary={blockchainSummary}
stakeDelegated={account.stakeDelegated}
stats={{
lastReward: rewardsTransactions[0]?.amount ?? 0,
Expand Down
2 changes: 0 additions & 2 deletions packages/features/src/staking/views/staking-overview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { useAccount } from "@/common/hooks/use-account"
import type { useBlockchainSummary } from "@/common/hooks/use-blockchain-summary"
import { AddressDropdown } from "@/components/address-dropdown"
import { AppLayout } from "@/components/app-layout"
import { MenuBar } from "@/components/menu-bar"
Expand Down Expand Up @@ -33,7 +32,6 @@ const EmptyState = ({ heading, button }: EmptyStateProps) => {

type StakingOverviewViewProps = {
stakeDelegated: boolean
blockchainSummary: ReturnType<typeof useBlockchainSummary>
account: ReturnType<typeof useAccount>
rewards: { amount: number }[]
stats: { lastReward: number; avgReward: number; totalReward: number }
Expand Down
4 changes: 0 additions & 4 deletions packages/features/src/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ interface ImportMetaEnv {
readonly VITE_APP_DEFAULT_NETWORK: string
readonly VITE_APP_MINA_PROXY_MAINNET_URL: string
readonly VITE_APP_MINA_PROXY_DEVNET_URL: string
readonly VITE_APP_MINA_PROXY_BERKELEY_URL: string
readonly VITE_APP_MINA_EXPLORER_MAINNET_URL: string
readonly VITE_APP_MINA_EXPLORER_DEVNET_URL: string
readonly VITE_APP_MINA_EXPLORER_BERKELEY_URL: string
}

interface ImportMeta {
Expand Down
2 changes: 1 addition & 1 deletion packages/features/src/wallet/components/info-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const InfoBar = ({ onClose }: InfoBarProps) => {
<div className="flex flex-col">
<h2>Open Beta version</h2>
<p className="text-gray-400 text-sm">
Only works for Berkeley before Mainnet launch
Only works for Devnet before Mainnet launch
</p>
</div>
<button type="button" onClick={onClose}>
Expand Down
2 changes: 1 addition & 1 deletion packages/features/src/wallet/index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const Dashboard = () => {
}

export const Networks = () => {
return <NetworksView currentNetwork="Berkeley" />
return <NetworksView currentNetwork="Devnet" />
}

export default {
Expand Down
4 changes: 2 additions & 2 deletions packages/features/src/wallet/views/networks.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { MenuBar } from "@/components/menu-bar"
const NETWORKS = [
{
icon: MinaIcon,
value: "Berkeley",
value: "Devnet",
blockchain: "Mina",
network: "Berkeley",
network: "Devnet",
},
{
icon: ZekoIcon,
Expand Down
2 changes: 0 additions & 2 deletions packages/mina-core/src/Mina/Networks.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
export enum Networks {
MAINNET = "mainnet",
DEVNET = "devnet",
BERKELEY = "berkeley",
TESTWORLD = "testworld",
}
2 changes: 1 addition & 1 deletion packages/pallad-core/src/Pallad/providers/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export enum Network {
Ethereum = "Ethereum",
}
export enum PalladNetworkNames {
MINA_BERKELEY = "berkeley",
MINA_DEVNET = "devnet",
MINA_MAINNET = "mainnet",
OPTIMISM_SEPOLIA = "optimismSepolia",
}
1 change: 0 additions & 1 deletion packages/providers/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
export * as Blockberry from "./blockberry-provider"
export * as MinaExplorer from "./mina-explorer"
export * as MinaNode from "./mina-node"
export * as Obscura from "./obscura-provider"
export * as Optimism from "./optimism"
Expand Down

This file was deleted.

1 change: 0 additions & 1 deletion packages/providers/src/mina-explorer/account-info/index.ts

This file was deleted.

36 changes: 0 additions & 36 deletions packages/providers/src/mina-explorer/account-info/queries.ts

This file was deleted.

Loading

0 comments on commit e5d68de

Please sign in to comment.