Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/did document #638

Merged
merged 49 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
66e1a37
feat: support multiple did methods
bhavanakarwade Mar 11, 2024
c2c5f35
Merge branch 'develop' of https://github.com/credebl/studio into feat…
pranalidhanavade Mar 12, 2024
50fa053
fix: sonarcloud issues
pranalidhanavade Mar 12, 2024
a914032
fix: sonarlint issues
pranalidhanavade Mar 12, 2024
5e7eede
fix: resolved sonarlint issues
pranalidhanavade Mar 12, 2024
773ba1a
feat: support multiple did methods (#620)
bhavanakarwade Mar 12, 2024
9b0cdda
fix: resolved sonarcloud issues
pranalidhanavade Mar 12, 2024
47ed268
Merge branch 'develop' of https://github.com/credebl/studio into feat…
pranalidhanavade Mar 12, 2024
3f59ecc
Worked on the refresh token implementation
nishad-ayanworks Mar 13, 2024
860394d
Merge branch 'develop' of https://github.com/credebl/studio into auth…
nishad-ayanworks Mar 13, 2024
b73045d
removed unnecessary encryption while storing token in cookies
nishad-ayanworks Mar 14, 2024
deac1cc
cosmetic changes
nishad-ayanworks Mar 14, 2024
90b79fb
Merge pull request #624 from credebl/auth-refresh-token
nishad-ayanworks Mar 15, 2024
eb414b7
feat: did web functionality
bhavanakarwade Mar 18, 2024
41f9e62
Merge branch 'feat/multiple-did-methods' of https://github.com/credeb…
bhavanakarwade Mar 18, 2024
ac6e30f
Handled the error validations in encrypt and decrypt of data
nishad-ayanworks Mar 18, 2024
03b517a
refactored auth.ts for encrypt and decrypt data
nishad-ayanworks Mar 18, 2024
665bfc4
Merge pull request #626 from credebl/fix-utf8-data-issue
nishad-ayanworks Mar 18, 2024
1a285d7
feat: implemented did document screen
bhavanakarwade Mar 18, 2024
817a4a4
Merge branch 'develop' of https://github.com/credebl/studio into feat…
bhavanakarwade Mar 18, 2024
a8ebd1b
Merge pull request #623 from credebl/feat/multiple-did-methods
bhavanakarwade Mar 19, 2024
366ca13
Merge branch 'develop' of https://github.com/credebl/studio into deve…
bhavanakarwade Mar 19, 2024
d230ab7
Merge branch 'develop' of https://github.com/credebl/studio into feat…
bhavanakarwade Mar 19, 2024
69e12c5
Merge branch 'develop' of https://github.com/credebl/studio into deve…
nishad-ayanworks Mar 20, 2024
ed11f5b
Merge branch 'develop-to-qa' of https://github.com/credebl/studio int…
nishad-ayanworks Mar 20, 2024
da7e9aa
refactoring in wallet spinup
nishad-ayanworks Mar 20, 2024
c1d1ee4
cosmetic changes in wallet spinup
nishad-ayanworks Mar 20, 2024
c44413b
cosmetic changesin Field
nishad-ayanworks Mar 20, 2024
e8675f7
fix: bugs fixes
bhavanakarwade Mar 20, 2024
b309f49
Merge branch 'develop' of https://github.com/credebl/studio into fix/…
bhavanakarwade Mar 20, 2024
a721d61
Merge branch 'develop' of https://github.com/credebl/studio into feat…
bhavanakarwade Mar 21, 2024
36af40d
wip: domain validations
bhavanakarwade Mar 21, 2024
4ce9a01
fix: schema list search
bhavanakarwade Mar 21, 2024
f78671d
fix: input field validations
bhavanakarwade Mar 26, 2024
920680b
fix: applied validations for private key
bhavanakarwade Mar 26, 2024
49a3da5
fix: unexpected authorization error
pranalidhanavade Mar 27, 2024
552396d
fix: defalut values
bhavanakarwade Mar 27, 2024
688f55c
Merge pull request #633 from credebl/fix/bug-fixes
bhavanakarwade Mar 27, 2024
1b01b70
fix: parse error
pranalidhanavade Mar 27, 2024
d7d4d7a
Merge branch 'develop' of https://github.com/credebl/studio into comp…
pranalidhanavade Mar 27, 2024
ca2a762
Merge branch 'develop' of https://github.com/credebl/studio into feat…
bhavanakarwade Mar 27, 2024
13d93fb
fix: parse error
sanjay-k1910 Mar 27, 2024
c3fa405
Merge pull request #627 from credebl/feat/support-did-methods
bhavanakarwade Mar 27, 2024
e36f4f4
Merge pull request #636 from credebl/componenets-dependency-issues
vivekayanworks Mar 27, 2024
e4ca9bd
resolved conflicts
bhavanakarwade Mar 27, 2024
f682ab2
fix: encrypt and decrypt data
sanjay-k1910 Mar 27, 2024
64dc717
fix: decryption error
sanjay-k1910 Mar 27, 2024
1f76a48
Merge pull request #640 from credebl/fix/encryption-decryption
bhavanakarwade Mar 27, 2024
6996ece
Merge branch 'develop' of https://github.com/credebl/studio into feat…
sanjay-k1910 Mar 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 7 additions & 13 deletions src/api/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,10 +229,10 @@ export const encryptData = (value: any): string => {
const CRYPTO_PRIVATE_KEY: string = `${envConfig.PUBLIC_CRYPTO_PRIVATE_KEY}`

try {
const encJson: string = CryptoJS.AES.encrypt(JSON.stringify(value), CRYPTO_PRIVATE_KEY).toString();
let encData = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(encJson))

return encData;
if (typeof (value) !== 'string') {
value = JSON.stringify(value)
}
return CryptoJS.AES.encrypt(value, CRYPTO_PRIVATE_KEY).toString();
} catch (error) {
// Handle encryption error
console.error('Encryption error:', error);
Expand All @@ -244,14 +244,8 @@ export const decryptData = (value: any): string => {
const CRYPTO_PRIVATE_KEY: string = `${envConfig.PUBLIC_CRYPTO_PRIVATE_KEY}`

try {

let decData = CryptoJS.enc.Base64.parse(value).toString(CryptoJS.enc.Utf8)
let bytes = CryptoJS.AES.decrypt(decData, CRYPTO_PRIVATE_KEY).toString(CryptoJS.enc.Utf8)
const parsedData = JSON.parse(bytes);
if (typeof parsedData !== 'string') {
return JSON.stringify(parsedData);
}
return parsedData;
let bytes = CryptoJS.AES.decrypt(value, CRYPTO_PRIVATE_KEY);
return bytes.toString(CryptoJS.enc.Utf8);
} catch (error) {
// Handle decryption error or invalid input
console.error('Decryption error:', error);
Expand Down Expand Up @@ -312,4 +306,4 @@ export const getFromCookies = (cookies: AstroCookies, key: string) =>{
export const removeFromLocalStorage = async (key: string) => {
await localStorage.removeItem(key);
return true;
};
};
6 changes: 3 additions & 3 deletions src/api/ecosystem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ export const updateEcosystem = async (dataPayload: CreateEcosystemPayload) => {

export const getEcosystems = async (
orgId: string,
pageNumber?: number,
pageSize?: number,
pageNumber: number = 1,
pageSize: number = 10,
search = '',
) => {
const url = `${apiRoutes.Ecosystem.root}/${orgId}`;
const url = `${apiRoutes.Ecosystem.root}/${orgId}?pageNumber=${pageNumber}&pageSize=${pageSize}&search=${search}`;
const axiosPayload = {
url,
config: await getHeaderConfigs(),
Expand Down
4 changes: 2 additions & 2 deletions src/commonComponents/EcosystemProfileCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ const EcosystemProfileCard = ({getEndorsementListData}:IEndorsement) => {
setLoading(false)
const { data } = response as AxiosResponse;
if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
setEcosystemList(data?.data.ecosystemDetails
setEcosystemList(data?.data.ecosystemList
)
const ecosystemData = data?.data?.ecosystemDetails?.find((item: { id: string }) => item.id === ecosystemId);
const ecosystemData = data?.data?.ecosystemList?.find((item: { id: string }) => item.id === ecosystemId);
if (ecosystemData) {
setEcosystemId(ecosystemData?.id)
const ecosystemOrg =
Expand Down
12 changes: 5 additions & 7 deletions src/components/Authentication/SignInUser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,11 @@ const SignInUser = () => {

const saveEmail = async (values: emailValue) => {
setEmail(values);
await removeFromLocalStorage(storageKeys.TOKEN)
await removeFromLocalStorage(storageKeys.USER_EMAIL)
await removeFromLocalStorage(storageKeys.ORG_ID)
await removeFromLocalStorage(storageKeys.ORG_ROLES)
await removeFromLocalStorage(storageKeys.ECOSYSTEM_ID)
await removeFromLocalStorage(storageKeys.ECOSYSTEM_ROLE)
await removeFromLocalStorage(storageKeys.USER_PROFILE)

for await (const value of Object.values(storageKeys)){
await removeFromLocalStorage(value)
}

setCurrentComponent('password');
await setToLocalStorage(storageKeys.LOGIN_USER_EMAIL, values.email);
setIsPasskeySuccess(true);
Expand Down
3 changes: 1 addition & 2 deletions src/components/Ecosystem/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ const Dashboard = () => {
const response = await getEcosystems(id);
const { data } = response as AxiosResponse;
if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
const ecosystemData = data?.data?.ecosystemDetails?.find(
const ecosystemData = data?.data?.ecosystemList?.find(
(item: { id: string }) => item.id === ecosystemId,
);
if (ecosystemData) {
Expand Down Expand Up @@ -165,7 +165,6 @@ const Dashboard = () => {

if (ecosystemId && orgId) {
const response = await getEcosystemDashboard(ecosystemId, orgId);

const { data } = response as AxiosResponse;

if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Ecosystem/EcosystemList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ const EcosystemList = () => {
const { data } = response as AxiosResponse;

if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
const ecosystemData = data?.data.ecosystemDetails;
const ecosystemData = data?.data.ecosystemList;
if (ecosystemData) {

setEcosystemList(ecosystemData);
Expand Down
8 changes: 4 additions & 4 deletions src/components/Ecosystem/Endorsement/EndorsementPopup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,11 @@ const EndorsementPopup = (props: {
>
<path
d="M20.4848 3.51515C18.2172 1.24747 15.2071 0 12 0C8.79293 0 5.78283 1.24747 3.51515 3.51515C1.24747 5.78283 0 8.79293 0 12C0 15.2071 1.24747 18.2172 3.51515 20.4848C5.78283 22.7525 8.79293 24 12 24C15.2071 24 18.2172 22.7525 20.4848 20.4848C22.7525 18.2172 24 15.2071 24 12C24 8.79293 22.7525 5.78283 20.4848 3.51515ZM19.5202 19.5202C17.5101 21.5303 14.8384 22.6364 12 22.6364C9.16162 22.6364 6.4899 21.5303 4.4798 19.5202C0.333333 15.3737 0.333333 8.62626 4.4798 4.4798C6.4899 2.4697 9.16162 1.36364 12 1.36364C14.8384 1.36364 17.5101 2.4697 19.5202 4.4798C23.6667 8.62626 23.6667 15.3737 19.5202 19.5202Z"
fill="#1F4EAD"
fill="currentColor"
/>
<path
d="M17.2882 6.71248C17.0206 6.4448 16.5913 6.4448 16.3236 6.71248L12.0004 11.0357L7.67712 6.71248C7.40945 6.4448 6.98015 6.4448 6.71248 6.71248C6.4448 6.98015 6.4448 7.40945 6.71248 7.67712L11.0357 12.0004L6.71248 16.3236C6.4448 16.5913 6.4448 17.0206 6.71248 17.2882C6.84379 17.4195 7.02056 17.4903 7.19227 17.4903C7.36399 17.4903 7.54076 17.4246 7.67207 17.2882L11.9953 12.965L16.3185 17.2882C16.4499 17.4195 16.6266 17.4903 16.7983 17.4903C16.9751 17.4903 17.1468 17.4246 17.2781 17.2882C17.5458 17.0206 17.5458 16.5913 17.2781 16.3236L12.965 12.0004L17.2882 7.67712C17.5559 7.40945 17.5559 6.98015 17.2882 6.71248Z"
fill="#1F4EAD"
fill="currentColor"
/>
</svg>
<span className="ml-2 mr-2">Decline</span>
Expand All @@ -202,13 +202,13 @@ const EndorsementPopup = (props: {
isProcessing={loading}
color="bg-primary-800"
disabled={loading || !isAccess || loadingReject}
className={`${isAccess ? "hover:bg-primary-800 dark:hover:text-primary-700 dark:hover:bg-primary-700" : ""} text-base font-medium text-center text-white bg-primary-700 rounded-lg focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:focus:ring-primary-800 mr-3`}
className={`${isAccess ? "hover:bg-secondary-700 hover:!bg-secondary-700 dark:hover:text-primary-700 dark:hover:bg-secondary-700" : ""} text-base font-medium text-center text-white bg-primary-700 rounded-lg focus:ring-4 focus:ring-primary-300 sm:w-auto dark:bg-primary-600 dark:focus:ring-primary-800 mr-3`}
onClick={() => {
SignEndorsement(props.endorsementData.id);
}}
>
<svg
className="h-8 w-8 text-white"
className="h-8 w-8"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
Expand Down
12 changes: 9 additions & 3 deletions src/components/Resources/Schema/SchemasList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ const SchemaList = (props: {
const [walletStatus, setWalletStatus] = useState(false);
const [totalItem, setTotalItem] = useState(0);
const [isEcosystemData, setIsEcosystemData] = useState<ICheckEcosystem>();
const [searchValue, setSearchValue] = useState('');

const getSchemaList = async (
schemaListAPIParameter: GetAllSchemaListParameter,
Expand Down Expand Up @@ -97,14 +98,18 @@ const SchemaList = (props: {
getSchemaList(schemaListAPIParameter, false);
}, [schemaListAPIParameter, allSchemaFlag]);


const onSearch = async (
event: ChangeEvent<HTMLInputElement>,
): Promise<void> => {
event.preventDefault();
const inputValue = event.target.value;
setSearchValue(inputValue);

getSchemaList(
{
...schemaListAPIParameter,
search: event.target.value,
search: inputValue,
},
false,
);
Expand All @@ -113,7 +118,7 @@ const SchemaList = (props: {
getSchemaList(
{
...schemaListAPIParameter,
allSearch: event.target.value,
allSearch: inputValue,
},
false,
);
Expand Down Expand Up @@ -169,6 +174,7 @@ const SchemaList = (props: {
console.log(error);
}
})();
setSearchValue('');
}, []);

const createSchemaTitle = isEcosystemData?.isEcosystemMember
Expand All @@ -191,7 +197,7 @@ const SchemaList = (props: {
<h1 className="ml-1 text-xl font-semibold text-gray-900 sm:text-2xl dark:text-white mr-auto">
Schemas
</h1>
<SearchInput onInputChange={onSearch} />
<SearchInput onInputChange={onSearch} value={searchValue}/>

<select
onChange={handleFilter}
Expand Down
3 changes: 2 additions & 1 deletion src/components/SearchInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const SearchInput = ({ onInputChange }: any) => {
const SearchInput = ({ onInputChange, value }: any) => {
return (
<div>
<label className="sr-only">Search</label>
Expand All @@ -22,6 +22,7 @@ const SearchInput = ({ onInputChange }: any) => {
name="email"
id="topbar-search"
onChange={onInputChange}
value={value}
className="bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm rounded-lg focus:ring-primary-500 focus:border-primary-500 block w-full pl-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
placeholder="Search"
/>
Expand Down
14 changes: 7 additions & 7 deletions src/components/User/UserDashBoard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const UserDashBoard = () => {
allSearch: '',
});
const [ecoCount, setEcoCount] = useState(0);
const [ecosystemList, setEcosystemList] = useState([]);
const [ecosystemListDetails, setEcosystemListDetails] = useState([]);
const [credDefList, setCredDefList] = useState([]);
const [credDefCount, setCredDefCount] = useState(0);
const [walletData, setWalletData] = useState([]);
Expand Down Expand Up @@ -245,12 +245,12 @@ const UserDashBoard = () => {
);
const { data } = response as AxiosResponse;
if (data?.statusCode === apiStatusCodes.API_STATUS_SUCCESS) {
setEcoCount(data?.data?.totalCount);
const ecosystemData = data?.data?.ecosystemDetails.filter(
setEcoCount(data?.data?.totalItems);
const ecosystemData = data?.data?.ecosystemList.filter(
(ecosystem: Organisation, index: number) => index < 3,
);
if (ecosystemData) {
setEcosystemList(ecosystemData);
setEcosystemListDetails(ecosystemData);
} else {
setError(response as string);
}
Expand Down Expand Up @@ -1092,9 +1092,9 @@ const UserDashBoard = () => {

{!ecoLoading ? (
<>
{ecosystemList && ecosystemList.length > 0 ? (
{ecosystemListDetails && ecosystemListDetails.length > 0 ? (
<>
{ecosystemList?.map((ecosystem: any) => {
{ecosystemListDetails?.map((ecosystem: any) => {
return (
<button
className="flex justify-between w-full mt-2 items-center"
Expand Down Expand Up @@ -1212,7 +1212,7 @@ const UserDashBoard = () => {
);
})}

{ecosystemList && ecosystemList?.length > 0 && (
{ecosystemListDetails && ecosystemListDetails?.length > 0 && (
<a
href="/ecosystems"
className="absolute bottom-0 sm:bottom-[-13px] right-0 float-right inline-flex items-center text-sm font-medium rounded-lg text-primary-700 hover:bg-gray-100 dark:text-primary-500 dark:hover:bg-gray-700"
Expand Down
20 changes: 10 additions & 10 deletions src/components/organization/OrganizationDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { dateConversion } from '../../utils/DateConversion';
import DateTooltip from '../Tooltip';
import CopyDid from '../../commonComponents/CopyDid';
import { setToLocalStorage } from '../../api/Auth';
import Tooltip from '../Tooltip';
import { Tooltip } from 'flowbite-react';

const OrganizationDetails = ({ orgData }: { orgData: Organisation | null }) => {
const { org_agents } = orgData as Organisation;
Expand Down Expand Up @@ -180,8 +180,7 @@ const OrganizationDetails = ({ orgData }: { orgData: Organisation | null }) => {
<div className="flex justify-between w-full">
<div className="relative flex w-full">
<div
className="mb-4 sm:mb-0 px-0 sm:px-4 py-4"
style={{ width: '100%' }}
className="mb-4 sm:mb-0 px-0 sm:px-4 py-4 w-full"
>
<h3 className="mb-1 mt-1 text-2xl font-bold text-gray-900 dark:text-white">
DID Document
Expand Down Expand Up @@ -210,16 +209,17 @@ const OrganizationDetails = ({ orgData }: { orgData: Organisation | null }) => {
</pre>
</div>
<div className="flex items-start mt-4 mr-4">
<CopyDid
className="block text-sm truncate"
value={JSON.stringify(agentData?.didDocument)}
hideValue={true}
/>
<Tooltip
content={'Copy DID Document'}
placement="bottom"
className="items-center text-center dark:text-white"
></Tooltip>
>
<CopyDid
className="block text-sm truncate"
value={JSON.stringify(agentData?.didDocument)}
hideValue={true}
/>
</Tooltip>
</div>
</div>
</div>
Expand All @@ -231,4 +231,4 @@ const OrganizationDetails = ({ orgData }: { orgData: Organisation | null }) => {
);
};

export default OrganizationDetails;
export default OrganizationDetails;
22 changes: 13 additions & 9 deletions src/components/organization/WalletSpinup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ import { AlertComponent } from '../AlertComponent';
import CopyDid from '../../commonComponents/CopyDid';
import { DidMethod } from '../../common/enums';
import GenerateBtnPolygon from './walletCommonComponents/GenerateBtnPolygon';
import SetPrivateKeyValue from './walletCommonComponents/SetPrivateKeyValue';
import SetDomainValueInput from './walletCommonComponents/SetDomainValueInput';
import TokenWarningMessage from './walletCommonComponents/TokenWarningMessage';
import LedgerLessMethodsComponents from './walletCommonComponents/LegderLessMethods'
import SetPrivateKeyValueInput from './walletCommonComponents/SetPrivateKeyValue';


interface Values {
Expand Down Expand Up @@ -74,7 +74,7 @@ interface ISharedAgentForm {
loading: boolean;
submitSharedWallet: (
values: ValuesShared,
privateKey: string,
privatekey: string,
domain: string,
endPoint: string,
) => void;
Expand Down Expand Up @@ -244,6 +244,8 @@ const SharedAgentForm = ({
method: yup.string().required('Method is required'),
...(DidMethod.INDY === selectedLedger || DidMethod.POLYGON === selectedLedger) && { network: yup.string().required('Network is required') },
...(DidMethod.INDY === selectedLedger) && { ledger: yup.string().required('Ledger is required') },
...(DidMethod.WEB === selectedLedger) && { domain: yup.string().required('Domain is required for web method') },
...(DidMethod.POLYGON === selectedLedger) && { privatekey: yup.string().required('Private key is required') },
}

return (
Expand Down Expand Up @@ -278,6 +280,8 @@ const SharedAgentForm = ({
network: '',
did: '',
ledger: '',
domain: '',
privatekey: '',
label: orgName || '',
}}
validationSchema={yup.object().shape(validations)}
Expand Down Expand Up @@ -313,8 +317,8 @@ const SharedAgentForm = ({
id="method" name="method" className="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500 h-11"
>
<option value="">Select Method</option>
{mappedData && Object.keys(mappedData)?.map((ledger) => (
<option key={ledger} value={ledger}>{ledger}</option>
{mappedData && Object.keys(mappedData)?.map((method) => (
<option key={method} value={method}>{method.charAt(0).toUpperCase() + method.slice(1)}</option>
))}
</select>
{formikHandlers?.errors?.method && formikHandlers?.touched?.method && (
Expand Down Expand Up @@ -357,9 +361,9 @@ const SharedAgentForm = ({

{generatedKeys && formikHandlers.values.method === DidMethod.POLYGON && (<TokenWarningMessage />)}

{formikHandlers.values.method === DidMethod.POLYGON && (<SetPrivateKeyValue setPrivateKeyValue={(val:string)=>setPrivateKeyValue(val)} privateKeyValue={privateKeyValue}/>)}
{formikHandlers.values.method === DidMethod.POLYGON && (<SetPrivateKeyValueInput setPrivateKeyValue={(val:string)=>setPrivateKeyValue(val)} privateKeyValue={privateKeyValue} formikHandlers={formikHandlers}/>)}

{formikHandlers.values.method === DidMethod.WEB && (<SetDomainValueInput setDomainValue={(val:string)=>setDomainValue(val)} domainValue={domainValue}/>)}
{formikHandlers.values.method === DidMethod.WEB && (<SetDomainValueInput setDomainValue={(val:string)=>setDomainValue(val)} domainValue={domainValue} formikHandlers={formikHandlers}/>)}

{formikHandlers.values.method !== DidMethod.POLYGON && formikHandlers.values.method !== DidMethod.KEY && formikHandlers.values.method !== DidMethod.WEB && (
<div className="my-3 relative">
Expand All @@ -383,7 +387,7 @@ const SharedAgentForm = ({
{mappedData && selectedLedger && mappedData[selectedLedger] &&
Object.keys(mappedData[selectedLedger])?.map(
(ledger) => (
<option key={ledger} value={ledger}>{ledger}</option>
<option key={ledger} value={ledger}>{ledger.charAt(0).toUpperCase() + ledger.slice(1)}</option>
),
)}
</select>
Expand Down Expand Up @@ -912,11 +916,11 @@ const WalletSpinup = (props: {

const submitSharedWallet = async (
values: ValuesShared,
privateKey: string,
privatekey: string,
domain: string,
endPoint: string,
) => {
const polygonPrivateKey = privateKey.slice(2);
const polygonPrivateKey = privatekey.slice(2);
setLoading(true);
const payload = {
keyType: values.keyType || 'ed25519',
Expand Down
Loading
Loading