-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6262267
commit 208a386
Showing
49 changed files
with
344 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,20 +2,17 @@ name: PR extension build | |
|
||
on: [pull_request, workflow_dispatch] | ||
|
||
jobs: | ||
pre-run: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Cancel previous runs | ||
uses: styfle/cancel-workflow-action@main | ||
with: | ||
access_token: ${{ github.token }} | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
sha-hash: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
SHORT_SHA: ${{ steps.short-sha.outputs.SHORT_SHA }} | ||
steps: | ||
- run: echo "${{ github.workflow }}-${{ github.ref }}" | ||
- name: Make short commit SHA | ||
id: short-sha | ||
run: echo "SHORT_SHA=`echo ${{ github.event.pull_request.head.sha }} | cut -c1-7`" >> $GITHUB_OUTPUT | ||
|
@@ -24,7 +21,6 @@ jobs: | |
if: github.repository == 'leather-wallet/extension' && github.actor != 'dependabot[bot]' | ||
runs-on: ubuntu-latest | ||
needs: | ||
- pre-run | ||
- sha-hash | ||
steps: | ||
- uses: kyranjamie/[email protected] | ||
|
@@ -36,7 +32,6 @@ jobs: | |
name: build-${{ matrix.target }}-extension | ||
runs-on: ubuntu-latest | ||
needs: | ||
- pre-run | ||
- sha-hash | ||
strategy: | ||
matrix: | ||
|
@@ -73,7 +68,6 @@ jobs: | |
if: github.repository == 'leather-wallet/extension' && github.actor != 'dependabot[bot]' | ||
runs-on: ubuntu-latest | ||
needs: | ||
- pre-run | ||
- sha-hash | ||
- build | ||
steps: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { isString } from 'formik'; | ||
import * as yup from 'yup'; | ||
|
||
import type { NetworkModes } from '@shared/constants'; | ||
|
||
import { checkEntityAddressIsCompliant } from '@app/query/common/compliance-checker/compliance-checker.query'; | ||
|
||
export function complianceValidator( | ||
shouldCheckCompliance: yup.StringSchema<string, yup.AnyObject>, | ||
network: NetworkModes | ||
) { | ||
return yup.string().test({ | ||
message: 'Compliance check failed', | ||
async test(value) { | ||
if (!isString(value)) return false; | ||
|
||
if (network !== 'mainnet') return true; | ||
|
||
if (!shouldCheckCompliance.isValidSync(value)) return true; | ||
|
||
try { | ||
const resp = await checkEntityAddressIsCompliant(value); | ||
return !resp.isOnSanctionsList; | ||
} catch (e) { | ||
return true; | ||
} | ||
}, | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
import { BitcoinAccount } from '@shared/crypto/bitcoin/bitcoin.utils'; | ||
import type { P2Ret, P2TROut } from '@scure/btc-signer'; | ||
|
||
import { useCurrentNativeSegwitAccount } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks'; | ||
import { useCurrentTaprootAccount } from '@app/store/accounts/blockchain/bitcoin/taproot-account.hooks'; | ||
import { ZERO_INDEX } from '@shared/constants'; | ||
|
||
interface CurrentBitcoinAccountLoaderProps { | ||
children(data: { nativeSegwit: BitcoinAccount; taproot: BitcoinAccount }): React.ReactNode; | ||
import type { Signer } from '@app/store/accounts/blockchain/bitcoin/bitcoin-signer'; | ||
import { useCurrentAccountNativeSegwitSigner } from '@app/store/accounts/blockchain/bitcoin/native-segwit-account.hooks'; | ||
import { useCurrentAccountTaprootSigner } from '@app/store/accounts/blockchain/bitcoin/taproot-account.hooks'; | ||
|
||
interface CurrentBitcoinSignerLoaderProps { | ||
children(data: { nativeSegwit: Signer<P2Ret>; taproot: Signer<P2TROut> }): React.ReactNode; | ||
} | ||
export function CurrentBitcoinAccountLoader({ children }: CurrentBitcoinAccountLoaderProps) { | ||
const nativeSegwit = useCurrentNativeSegwitAccount(); | ||
const taproot = useCurrentTaprootAccount(); | ||
export function CurrentBitcoinSignerLoader({ children }: CurrentBitcoinSignerLoaderProps) { | ||
const nativeSegwit = useCurrentAccountNativeSegwitSigner()?.(ZERO_INDEX); | ||
const taproot = useCurrentAccountTaprootSigner()?.(ZERO_INDEX); | ||
if (!taproot || !nativeSegwit) return null; | ||
return children({ nativeSegwit, taproot }); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
src/app/features/dialogs/leather-intro-dialog/leather-intro-dialog.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.