-
Notifications
You must be signed in to change notification settings - Fork 144
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 6df0869
Showing
52 changed files
with
350 additions
and
122 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
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
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
Oops, something went wrong.