Skip to main content

Utils

Portkey provides a series of public methods to help projects accomplish a variety of user scenarios.

managerApprove

Get info about guardian approval from the approval process, then proceed with the token approval transaction using the returned data guardiansApproved and amount.

Usage

import { managerApprove } from "@portkey/did-ui-react";

const { amount, guardiansApproved, symbol } = await managerApprove({
originChainId: "AELF",
symbol: "ELF",
caHash: "caHash",
amount: "recommendedAmount",
targetChainId: "AELF",
networkType: "MAINNET",
});

checkWalletSecurity

Verify the security status of the current user's wallet. If it is found to be insecure, prompt the user to add guardians to enhance security. If the security condition is not met, the user will be unable to proceed with the transaction.

Usage

import { checkWalletSecurity } from "@portkey/did-ui-react";

const { status, message } = await checkWalletSecurity({
originChainId: "AELF",
targetChainId: "tDVV",
caHash: "caHash",
});