diff --git a/package.json b/package.json
index 7fbc2c45..148ab7e1 100644
--- a/package.json
+++ b/package.json
@@ -10,7 +10,7 @@
"license": "Apache-2.0",
"dependencies": {
"@creativecommons/cc-assets": "^0.1.0",
- "@logion/client": "^0.43.0-3",
+ "@logion/client": "^0.43.0-4",
"@logion/client-browser": "^0.3.4",
"@logion/crossmint": "^0.1.32",
"@logion/extension": "^0.8.0-1",
diff --git a/src/components/identity/PersonalInfo.tsx b/src/components/identity/PersonalInfo.tsx
index 6ec8439e..0f70f171 100644
--- a/src/components/identity/PersonalInfo.tsx
+++ b/src/components/identity/PersonalInfo.tsx
@@ -1,23 +1,18 @@
-import { Row } from "../../common/Grid";
+import { LocData } from "@logion/client";
import { Col } from "react-bootstrap";
+
+import { Row } from "../../common/Grid";
import Detail from "../../common/Detail";
-import { PersonalInfoProps } from "./type";
-import { LocRequestStatus } from "@logion/client/dist/LocClient.js";
import "./PersonalInfo.css";
import LegalEntity from "./LegalEntity";
-interface PersonalAndStatusInfoProps extends PersonalInfoProps {
- status: LocRequestStatus,
- seal?: string
-}
-
-export function PersonalInfo(props: { personalAndStatusInfo: PersonalAndStatusInfoProps }) {
- const { requesterAddress, userIdentity, userPostalAddress, status, seal, company } = props.personalAndStatusInfo;
+export function PersonalInfo(props: { personalAndStatusInfo: LocData }) {
+ const { requesterAccountId, userIdentity, userPostalAddress, status, seal, company } = props.personalAndStatusInfo;
const padding = "/";
return (
-
Identity data (not publicly available) submitted by the following account address: { requesterAddress?.address || padding }
+
Identity data (not publicly available) submitted by the following account address: { requesterAccountId?.address || padding }
Import all
diff --git a/src/vault/VaultOutRequest.tsx b/src/vault/VaultOutRequest.tsx
index 529b25a8..8a235a26 100644
--- a/src/vault/VaultOutRequest.tsx
+++ b/src/vault/VaultOutRequest.tsx
@@ -18,18 +18,19 @@ import { useUserContext } from "../wallet-user/UserContext";
import ExtrinsicSubmissionStateView from "src/ExtrinsicSubmissionStateView";
interface FormValues {
- legalOfficer: ValidAccountId | null;
amount: Amount;
destination: string;
}
export default function VaultOutRequest() {
- const { api, accounts, getOfficer, signer, client, submitCall, clearSubmissionState, extrinsicSubmissionState } = useLogionChain();
+ const { accounts, getOfficer, signer, client, submitCall, clearSubmissionState, extrinsicSubmissionState } = useLogionChain();
const { availableLegalOfficers, colorTheme } = useCommonContext();
const { protectionState, mutateVaultState } = useUserContext();
const [ showDialog, setShowDialog ] = useState(false);
const [ legalOfficersOptions, setLegalOfficersOptions ] = useState[]>([]);
+ const [ legalOfficer, setLegalOfficer ] = useState(null);
+ const [ legalOfficerError, setLegalOfficerError ] = useState();
useEffect(() => {
if (legalOfficersOptions.length === 0 && protectionState && availableLegalOfficers) {
@@ -38,11 +39,10 @@ export default function VaultOutRequest() {
buildOptions(candidates)
.then(options => setLegalOfficersOptions(options));
}
- }, [ accounts, api, availableLegalOfficers, legalOfficersOptions, setLegalOfficersOptions, protectionState ]);
+ }, [ availableLegalOfficers, legalOfficersOptions, protectionState ]);
const { control, handleSubmit, formState: { errors }, reset } = useForm({
defaultValues: {
- legalOfficer: null,
amount: {
value: "",
unit: Numbers.NONE
@@ -57,10 +57,15 @@ export default function VaultOutRequest() {
}, [ reset ]);
const transferCallback = useCallback(async (formValues: FormValues) => {
+ if(!legalOfficer) {
+ setLegalOfficerError("You must select a Legal Officer");
+ return;
+ }
+
const call = async (callback: CallCallback) => {
await mutateVaultState(async (state: VaultState) => {
return await state.createVaultTransferRequest({
- legalOfficer: getOfficer!(formValues!.legalOfficer!)!,
+ legalOfficer: getOfficer!(legalOfficer!)!,
amount: Lgnt.fromPrefixedNumber(new Numbers.PrefixedNumber(formValues.amount.value, formValues.amount.unit)),
destination: ValidAccountId.polkadot(formValues.destination),
signer: signer!,
@@ -74,7 +79,7 @@ export default function VaultOutRequest() {
} finally {
clearSubmissionState();
}
- }, [ getOfficer, mutateVaultState, signer, submitCall, clearSubmissionState, close ]);
+ }, [ getOfficer, mutateVaultState, signer, submitCall, clearSubmissionState, close, legalOfficer ]);
if(availableLegalOfficers === undefined || !client) {
return null;
@@ -170,28 +175,14 @@ export default function VaultOutRequest() {
id="legalOfficer"
label="Legal officer"
control={
- (
-
- )}
+