Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/blue-gorillas-rush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-shared': patch
---

updated x-key types for import and vault shared pages
5 changes: 5 additions & 0 deletions .changeset/dry-paws-thank.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-utility': minor
---

Display each keyset with their enabled keys
5 changes: 5 additions & 0 deletions .changeset/eleven-cheetahs-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-utility': minor
---

get specific keyset when x-keys are required
6 changes: 6 additions & 0 deletions .changeset/giant-cups-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@fireblocks/recovery-utility': minor
'@fireblocks/recovery-shared': minor
---

allow to map keyset when no keyset threshold mapping is defined in drs kit
5 changes: 5 additions & 0 deletions .changeset/old-drinks-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-shared': minor
---

Added type distinction for relay and utility in workspace definition and support for keyset account mapping
5 changes: 5 additions & 0 deletions .changeset/orange-bobcats-taste.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/extended-key-recovery': patch
---

Updated tests for multiple keysets
6 changes: 6 additions & 0 deletions .changeset/tender-turtles-destroy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@fireblocks/recovery-utility': minor
'@fireblocks/recovery-shared': minor
---

Moved x-key page to utility only
5 changes: 5 additions & 0 deletions .changeset/violet-ducks-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/extended-key-recovery': minor
---

Added recovery for multiple keysets
6 changes: 6 additions & 0 deletions .changeset/wild-timers-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@fireblocks/wallet-derivation': minor
'@fireblocks/recovery-shared': minor
---

Make derivation and base wallet to use correct keyset for account created or used
168 changes: 168 additions & 0 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
stages:
- detect
- version
- build
- sync

variables:
EXCLUDE_TAG:
description: "Git tag to exclude from syncing commits"
value: "" # Required manual input when triggering the pipeline

GIT_DEPTH: 2
NODE_ENV: development
CHECKPOINT:
description: "Checkpoint from which to start mirroring to github from main branch"
value: ""
EXECUTABLES_DIR: "apps/recovery-utility/dist"
GITHUB_REPO: "https://oauth2:${GITHUB_TOKEN}@github.com/fireblocks/mirror-test.git"

default:
image: node:lts-gallium
before_script:
- apt-get update && apt-get install -y curl jq git
- corepack enable
- |
if [ -z "$EXCLUDE_TAG" ]; then
echo "❌ ERROR: EXCLUDE_TAG must be provided when triggering the pipeline.";
exit 1;
fi
if [ -z "$CHECKPOINT" ]; then
echo "❌ ERROR: CHECKPOINT must be provided when triggering the pipeline.";
exit 1;
fi

fetch_label_state:
stage: detect
rules:
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "hidden"'
when: always
- when: never
script: |
HEAD_SHA=$(git rev-parse HEAD)
echo "Waiting for MR with commit $HEAD_SHA to be merged..."

timeout=300
interval=10
elapsed=0

while true; do
MR_JSON=$(curl -s --header "PRIVATE-TOKEN: $GITLAB_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/commits/$HEAD_SHA/merge_requests")
MR_STATE=$(echo "$MR_JSON" | jq -r '.[0].state')
MR_LABELS=$(echo "$MR_JSON" | jq -r '.[0].labels | join(",")')
echo "MR State: $MR_STATE"

if [ "$MR_STATE" = "merged" ]; then
echo "$MR_LABELS" | grep -q "new-version" && echo "TRIGGER=true" >> flags.env || echo "TRIGGER=false" >> flags.env
break
fi

if [ $elapsed -ge $timeout ]; then
echo "Timeout waiting for MR to be merged."
exit 1
fi

echo "Still waiting... ($elapsed seconds)"
sleep $interval
elapsed=$((elapsed + interval))
done
artifacts:
reports:
dotenv: flags.env

version_packages:
stage: version
needs: [fetch_label_state]
rules:
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "hidden"'
when: always
- when: never
script:
- if [ "$TRIGGER" = "true" ]; then
yarn install;
npx changeset status;
npx changeset version;
npx changeset publish;
else
echo "Skipping changeset — TRIGGER=$TRIGGER";
fi

build_linux:
stage: build
needs: [version_packages]
rules:
- if: '$CI_COMMIT_BRANCH == "main" || $CI_COMMIT_BRANCH == "hidden"'
when: always
- when: never
script:
- if [ "$TRIGGER" = "true" ]; then
yarn install --frozen-lockfile --network-timeout 100000;
export NODE_OPTIONS="--max_old_space_size=4096";
yarn forcebuild;
else
echo "Skipping build — TRIGGER=$TRIGGER";
fi
artifacts:
name: "Recovery-Build-Linux"
paths:
- apps/recovery-utility/dist/*.AppImage
- apps/recovery-utility/dist/*.exe
- apps/recovery-utility/dist/*.zip
- apps/recovery-relay/out/
expire_in: 7 days

sync_to_github:
stage: sync
image: alpine:latest
needs: [build_linux]
rules:
- if: '$CI_COMMIT_BRANCH == "main"'
when: always
- when: never
before_script:
- apk add --no-cache git bash
- |
if [ -z "$EXCLUDE_TAG" ]; then
echo "❌ ERROR: EXCLUDE_TAG must be provided.";
exit 1;
fi
script:
- if [ "$TRIGGER" != "true" ]; then
echo "Skipping GitHub sync — TRIGGER=$TRIGGER";
exit 0;
fi

- git config --global user.email "ci@gitlab.com"
- git config --global user.name "GitLab CI"
- git fetch --unshallow || true

- COMMITS=$(git log ${CHECKPOINT}..HEAD --oneline --no-merges | awk '{print $1}')

- echo "Filtering commits..."
- for COMMIT in $COMMITS; do
TAGS=$(git tag --contains $COMMIT);
if [[ "$TAGS" != *"${EXCLUDE_TAG}"* ]]; then
echo $COMMIT >> selected_commits.txt;
fi;
done

- echo "Selected commits:"
- cat selected_commits.txt || echo "No commits to sync"

- git clone "$GITHUB_REPO" github-mirror
- cd github-mirror

- |
while read COMMIT; do
git cherry-pick $COMMIT || echo "Cherry-pick failed or already applied: $COMMIT";
done < ../selected_commits.txt

- cd ..
- mkdir -p github-mirror/${EXECUTABLES_DIR}
- cp -r ${EXECUTABLES_DIR}/* github-mirror/${EXECUTABLES_DIR}/ || echo "No executables found."

- cd github-mirror
- git add .
- |
git commit -m "Sync from GitLab CI: commits + executables" || echo "Nothing to commit"
- git push origin main
9 changes: 8 additions & 1 deletion apps/recovery-relay/components/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { ReactNode } from 'react';
import { Alert, AlertTitle } from '@mui/material';
import { LeakAdd, ImportExport, Settings } from '@mui/icons-material';
import DrawIcon from '@mui/icons-material/Draw';
import semver from 'semver';
import {
Layout as BaseLayout,
Expand Down Expand Up @@ -70,6 +71,12 @@ export const Layout = ({ children }: Props) => {
icon: ImportExport,
disabled: !hasExtendedPublicKeys,
},
{
label: 'Raw Signing',
path: '/raw-signing',
icon: DrawIcon,
disabled: !hasExtendedPublicKeys,
},
{
label: 'Settings',
path: '/settings',
Expand All @@ -96,7 +103,7 @@ export const Layout = ({ children }: Props) => {
</Alert>
)}
{children}
<WithdrawModal key={getWithdrawModalKey(inboundRelayParams)} />;
<WithdrawModal key={getWithdrawModalKey(inboundRelayParams)} />
</BaseLayout>
);
};
Loading