Skip to content

Commit

Permalink
v0.5.0 (#64)
Browse files Browse the repository at this point in the history
* docs: 📝 updated contribution doc

* fix: csv macro protection

* chore: bump versions

* chore: bump electorn version

* chore: bump zod version

* chore: bump graphql version

* chore: bump cosmjs/stargate version

* refactor(@fireblocks/recovery-shared): ♻️ changed variable names

* refactor(@fireblocks/asset-config): ♻️ change utxo asset configuration

* fix(@fireblocks/recovery-shared): 🐛 fixed address validation for testnet and btc assets

* refactor(@fireblocks/recovery-utility): ♻️ refactor derivation and signing code for btc-like

* refactor(@fireblocks/recovery-relay): ♻️ refactored btc-like information query code on relay

* feat(@fireblocks/recovery-utility): ✨ added DASH signing support

* fix(@fireblocks/recovery-relay): 🐛 fetched UTXOs are now only confirmed ones

* chore: bump nextron version for `yarn dev`

* fix(@fireblocks/recovery-utility): 🐛 consecutive withdrawals don't work

* fix(@fireblocks/recovery-relay): 💄 withdrawal dialog reflected errors in broadcast

* fix(@fireblocks/recovery-relay): 🐛 fixed relay failure due to bigint in logger.info call

* fix(@fireblocks/recovery-shared): 🐛 fixed explorer URL for avax testnet

* test(@fireblocks/e2e-tests): ✅ fixed test detection of failed tx broadcast

* fix(@fireblocks/recovery-relay): 🐛 consecutive EVM withdrawals fail due to provider caching

* refactor(@fireblocks/e2e-tests): ♻️ allow e2e tests to send to alternative address

* fix(@fireblocks/recovery-relay): 🐛 xrp don't wait on tx to be confirmed

* Update xrp relay broadcast

* chore(@fireblocks/recovery-relay): 🧵 web request goes through main instead of renderer

* fix(@fireblocks/recovery-relay): 🐛 added bsv broadcast function and cleanup

* fix(@fireblocks/recovery-relay): 🐛 fixed broadcast override for btc relay wallet

* chore(@fireblocks/recovery-relay): ✨ allow btc relay wallet to route reqs through main proc

* feat(@fireblocks/recovery-utility): ✨ implemented BSV tx creation and signing

* chore: ⬆️ update yarn.lock

* fix(@fireblocks/asset-config): 🐛 updated doge explorer link

* fix(@fireblocks/recovery-relay): 🐛 show broadcast error in case one happened

* chore(@fireblocks/recovery-relay): ♻️ refactored doge relay wallet

* fix(@fireblocks/recovery-relay): 🐛 fixed broadcast failure due to missing baseurl

* feat(@fireblocks/recovery-utility): ✨ implemented doge coin tx signing

* feat(@fireblocks/recovery-relay): ✨ added update alert

* fix: correct LTC wallet derivation and tx signing

* feat(@fireblocks/recovery-utility): ✨ added ability to provide xprv/fprv

* chore(@fireblocks/recovery-utility): 🔇 removed log flooding print

* chore: update beta warning

* fix(@fireblocks/recovery-shared): 🐛 do not load csv if asset is missing derivation path

* WIP: implement ZEC (#55)

WIP: implement ZEC

* fix(@fireblocks/recovery-utility): 🐛 fixed linux relaunch failure

* chore(@fireblocks/recovery-utility): ♻️ export ncw master key as part of recovery

* feat(@fireblocks/recovery-utility): ✨ added NCW recovery functionality

* test(@fireblocks/recovery-utility): ✅ added NCW tests

* feat(@fireblocks/recovery-utility): ✨ allow to only recover NCW keys

* refactor(@fireblocks/recovery-utility): ♻️ refactor ncw naming and fix chaincode

* fix(@fireblocks/recovery-relay): 🐛 added zec tx generation code but disabled zec transfer

* chore: 🔖 bump versions

---------

Co-authored-by: agoltzman <106151463+agoltzman@users.noreply.github.com>
Co-authored-by: Ariel <arielsirota@fireblocks.com>
Co-authored-by: Dain Kang <dainkang1@gmail.com>
  • Loading branch information
4 people authored Jan 25, 2024
1 parent c1b9f08 commit c2bb413
Show file tree
Hide file tree
Showing 112 changed files with 3,357 additions and 2,006 deletions.
6 changes: 6 additions & 0 deletions .changeset/breezy-buckets-explode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@fireblocks/extended-key-recovery': minor
'@fireblocks/recovery-shared': minor
---

allow manual input of xprv and fprv
5 changes: 5 additions & 0 deletions .changeset/clever-donuts-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

fixed btc relay wallet broadcast failure
5 changes: 5 additions & 0 deletions .changeset/fair-actors-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

added alert for new version availability
5 changes: 5 additions & 0 deletions .changeset/few-squids-mate.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-utility': minor
---

Implemented BSV transaction creation, serialization and signing
5 changes: 5 additions & 0 deletions .changeset/fifty-actors-behave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

reflect broadcast error in case occurred
5 changes: 5 additions & 0 deletions .changeset/forty-walls-sin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-shared': minor
---

prevent loading csv if asset is missing derivation path
5 changes: 5 additions & 0 deletions .changeset/friendly-lobsters-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/e2e-tests': minor
---

tests now take into account broadcast errors
5 changes: 5 additions & 0 deletions .changeset/friendly-rings-turn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/asset-config': minor
---

fixed AVAX testnet explorer URL
5 changes: 5 additions & 0 deletions .changeset/gold-fishes-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-shared': minor
---

fixed address validation for testnet assets
5 changes: 5 additions & 0 deletions .changeset/gold-spies-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-shared': minor
---

changed variable names
5 changes: 5 additions & 0 deletions .changeset/hip-keys-deny.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

refactored btc-like information query code on relay
5 changes: 5 additions & 0 deletions .changeset/hot-dolls-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-utility': minor
---

implemented doge tx signing
7 changes: 7 additions & 0 deletions .changeset/kind-pigs-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@fireblocks/recovery-utility': minor
'@fireblocks/recovery-relay': minor
'@fireblocks/recovery-shared': minor
---

fix: consecutive withdrawals don't work
5 changes: 5 additions & 0 deletions .changeset/light-adults-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

allowed btc relay utils to pipe web req through main proc
5 changes: 5 additions & 0 deletions .changeset/long-crabs-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-utility': minor
---

implemented DASH signing
5 changes: 5 additions & 0 deletions .changeset/many-days-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

fixed fetching UTXO to only confirmed ones
5 changes: 5 additions & 0 deletions .changeset/many-falcons-wash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/asset-config': minor
---

updated doge explorer link
5 changes: 5 additions & 0 deletions .changeset/new-cooks-hang.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/wallet-derivation': minor
---

added NCW tests
5 changes: 5 additions & 0 deletions .changeset/nine-pans-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-utility': minor
---

fix linux appimage relaunch failure
5 changes: 5 additions & 0 deletions .changeset/ninety-teachers-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

refactored doge relay wallet
5 changes: 5 additions & 0 deletions .changeset/old-months-sniff.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

added bsv broadcast function and cleanup
7 changes: 7 additions & 0 deletions .changeset/plenty-numbers-argue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@fireblocks/wallet-derivation': minor
'@fireblocks/recovery-utility': minor
'@fireblocks/recovery-shared': minor
---

added ncw recovery functionality
5 changes: 5 additions & 0 deletions .changeset/proud-coins-hope.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

ripple tx broadcast and result without waiting for confirmation
6 changes: 6 additions & 0 deletions .changeset/quiet-candles-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@fireblocks/recovery-relay': minor
'@fireblocks/recovery-shared': minor
---

fixed EVM provider caching and funds broadcast error
7 changes: 7 additions & 0 deletions .changeset/rare-snakes-lick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@fireblocks/extended-key-recovery': minor
'@fireblocks/recovery-utility': minor
'@fireblocks/recovery-shared': minor
---

added functionality to only recover NCW keys
6 changes: 6 additions & 0 deletions .changeset/red-flies-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@fireblocks/wallet-derivation': minor
'@fireblocks/recovery-utility': minor
---

refactor derivation and signing code
8 changes: 8 additions & 0 deletions .changeset/rotten-islands-impress.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@fireblocks/extended-key-recovery': minor
'@fireblocks/wallet-derivation': minor
'@fireblocks/recovery-utility': minor
'@fireblocks/recovery-shared': minor
---

update type naming
5 changes: 5 additions & 0 deletions .changeset/seven-impalas-double.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/asset-config': minor
---

Disabled transfer for testnet assets and re-enabled transfer for UTXO assets
5 changes: 5 additions & 0 deletions .changeset/strange-clouds-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

updated withdrawal modal to reflect errors
6 changes: 6 additions & 0 deletions .changeset/strange-kangaroos-deliver.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@fireblocks/recovery-utility': minor
'@fireblocks/recovery-relay': minor
---

execute web requests through main process instead of renderer for SOL and BSV
6 changes: 6 additions & 0 deletions .changeset/stupid-forks-draw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@fireblocks/recovery-utility': minor
'@fireblocks/recovery-shared': minor
---

export NCW master wallet from recovery to workspace
5 changes: 5 additions & 0 deletions .changeset/tame-icons-pretend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-utility': minor
---

remove log flooding print
5 changes: 5 additions & 0 deletions .changeset/unlucky-horses-reply.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

fix error due to bigint in info call
5 changes: 5 additions & 0 deletions .changeset/violet-comics-applaud.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/recovery-relay': minor
---

fixed btc relay wallet to use overwritten broadcast function in case available
5 changes: 5 additions & 0 deletions .changeset/weak-paws-hear.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@fireblocks/e2e-tests': minor
---

allowed for alternative to address in tests
29 changes: 27 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,33 @@ No member of Fireblocks will ask for such information of you, and in the event w
We have setup issue templates for your convenience, please use them so that we can better understand what the issue is and how to best assist you.
Feature requests are welcome however we can't commit to any features.

## How to open pull requests
## Versions, Pull requests & Commits

We have setup pull request templates for your convenience, please use them for bug fixese. Note that version pull requests are only done by Fireblocks members and any pull request from a non-fireblocks member will be closed without review.
### Versions

We work in a versioned branch approach, so each new version has it's own dedicated branch, which will be deleted some time after the version has been released.

### Pull requests

We have setup pull request templates for your convenience, please use them for bug fixes. Note that version pull requests are only done by Fireblocks members and any pull request from a non-fireblocks member will be closed without review.

To open a bugfix pull request, use the following URL template:
https://github.com/fireblocks/recovery/compare/<base-branch>...<username>:recovery:<branch>?template=bug_fix_pull_request.md

Where:

- `base-branch` is some open version branch (_vX.Y.Z_)
- `username` is your username
- `branch` is the branch name in your fork. We recommend creating a branch in the following format: _vX.Y.Z-<FIX>_ where `FIX` is some short word aobut the bug fix (for example btc-sign-tx, evm-derivation, etc...)

### Commits

When creating a fix to be pulled, before actually committing the changes to your branch, make sure to always run `yarn changeset`.
Once ran you will be presented with several prompts, just follow the on screen instructions.
For more information about this please see the [changesets repo](https://github.com/changesets/changesets/blob/main/docs/intro-to-using-changesets.md).

Lastly, we try to enforce [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/) - please try to use it.
For VSCode we suggest the extension [Conventional Commits](https://marketplace.visualstudio.com/items?itemName=vivaxy.vscode-conventional-commits).

## Styling

Expand All @@ -24,6 +48,7 @@ We provide a quick summary of styling we want code to use as part of the repo, p
1. File names:
1. For assets - name the containing folder as the asset's ID / symbol (Ethereum = ETH, Bitcoin = BTC, etc...), the main file will be `index.ts`
2. For files that contain TSX - file name must be `<NAME>.tsx`
3. For library functions - file name must be `<EXPALANTION>.ts`, so if the file handles CSV operations - `csv.ts`, if it gets logs, `getLogs.ts`, etc...
2. Function and variable names should use camelCase
3. Arrow functions of one line should not use brackets:

Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@
</a>
</p>

## Beta Warning
## Early Access

⚠️⚠️⚠️ WARNING ⚠️⚠️⚠️<br/>
This tool is currently in beta stage, it is subject to change and might contain bugs. Please use it for testing purposes only, and not for mainnet workspaces.
For the current recommended production tool please visit the [python key recovery tool](https://github.com/fireblocks/fireblocks-key-recovery-tool).
For beta access please contact your Customer Success Manager.
This tool is currently in early access state, it is subject to change and might contain bugs.

---

Expand Down
30 changes: 30 additions & 0 deletions apps/recovery-relay/components/Layout/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
import { ReactNode } from 'react';
import { Alert, AlertTitle } from '@mui/material';
import { LeakAdd, ImportExport, Settings } from '@mui/icons-material';
import semver from 'semver';
import {
Layout as BaseLayout,
LayoutProps as BaseLayoutProps,
AccountsIcon,
RelayRequestParams,
useOfflineQuery,
} from '@fireblocks/recovery-shared';
import packageJson from '../../package.json';
import { useWorkspace } from '../../context/Workspace';
import { WithdrawModal } from '../WithdrawModal';

Expand All @@ -29,6 +33,25 @@ export const Layout = ({ children }: Props) => {

const hasExtendedPublicKeys = !!xpub || !!fpub;

const versionQuery = useOfflineQuery({
enabled: true,
queryKey: ['utilityReleasesUrl'],
refetchOnWindowFocus: false,
refetchInterval: false,
queryFn: async () => {
const latestPackageJson = (await (
await fetch(
packageJson.repository
.replace('recovery-relay', 'recovery-utility/package.json')
.replace('github.com', 'raw.githubusercontent.com')
.replace('tree', ''),
)
).json()) as typeof packageJson;

return latestPackageJson.version;
},
});

const navLinks: BaseLayoutProps['navLinks'] = [
{
label: 'Accounts',
Expand Down Expand Up @@ -60,6 +83,13 @@ export const Layout = ({ children }: Props) => {
description='Query balances and send transactions from your recovered Fireblocks wallets'
navLinks={navLinks}
>
{!!versionQuery.data && semver.gt(versionQuery.data, packageJson.version) && (
<Alert severity='error'>
<AlertTitle style={{ lineHeight: undefined, marginBottom: 0, marginTop: 0 }}>
Version {versionQuery.data} is available, please update
</AlertTitle>
</Alert>
)}
{children}
<WithdrawModal key={getWithdrawModalKey(inboundRelayParams)} />;
</BaseLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export const CreateTransaction = ({ asset, inboundRelayParams, setSignTxResponse
enabled: !!derivation,
queryFn: async () => {
logger.debug(`Querying prepare transaction ${toAddress}`);
return derivation!.prepare?.(toAddress, values.memo);
return await derivation!.prepare?.(toAddress, values.memo);
},
onSuccess: (prepare: AccountData) => {
logger.info('UTXOs', prepare.utxos);
Expand Down Expand Up @@ -175,7 +175,11 @@ export const CreateTransaction = ({ asset, inboundRelayParams, setSignTxResponse
values,
asset,
derivation: sanatize(derivation),
prepare: prepareQuery.data,
prepare: JSON.stringify(
prepareQuery.data,
(_, v) => (typeof v === 'bigint' ? v.toString() : typeof v === 'function' ? 'function' : v),
2,
),
});

return (
Expand Down
Loading

0 comments on commit c2bb413

Please sign in to comment.