-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Onboarding: Faucet for remark signing (#1335)
* Add payment info check before signing remark * Add endpoint to get native currency from and hook up to frontend * Fix bug in endpoint and more toasts * Improve toasts and error handling * Fix bug where wss closed before remark signing was complete * Comment out proxy for now * Check country codes for manual review on server and send verify email * Fix bug in document signing if no agreement available * Fix bugs in manual flow * Fix proxies
- Loading branch information
1 parent
6542786
commit e4ef5fb
Showing
16 changed files
with
370 additions
and
82 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
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
21 changes: 21 additions & 0 deletions
21
onboarding-api/src/controllers/agreement/getBalanceForSigning.ts
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,21 @@ | ||
import { Request, Response } from 'express' | ||
import { checkBalanceBeforeSigningRemark } from '../../utils/centrifuge' | ||
import { fetchUser } from '../../utils/fetchUser' | ||
import { HttpError, reportHttpError } from '../../utils/httpError' | ||
|
||
export const getBalanceForSigningController = async (req: Request, res: Response) => { | ||
try { | ||
const { wallet } = req | ||
const user = await fetchUser(wallet) | ||
if (!user.globalSteps.verifyIdentity.completed) { | ||
throw new HttpError(401, 'Unauthorized') | ||
} | ||
|
||
await checkBalanceBeforeSigningRemark(wallet) | ||
|
||
return res.status(201).end() | ||
} catch (e) { | ||
const error = reportHttpError(e) | ||
return res.status(error.code).send({ error: error.message }) | ||
} | ||
} |
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.