Add sum sub API endpoint

This commit is contained in:
Shreerang Kale 2024-07-26 19:57:21 +05:30
parent 702fb3ebaa
commit 40212628f5
5 changed files with 18 additions and 11 deletions

View File

@ -6,4 +6,4 @@ REACT_APP_LACONICD_RPC_ENDPOINT=http://localhost:26657
REACT_APP_LACONICD_DENOM=photon
REACT_APP_FAUCET_ENDPOINT=http://localhost:4000
REACT_APP_WALLET_META_URL=http://localhost:3000
REACT_APP_SUMSUB_TOKEN=
REACT_APP_SUMSUB_API_ENDPOINT=

View File

@ -17,7 +17,7 @@ const registry = new Registry(
const OnboardingSuccess = () => {
const location = useLocation();
const { cosmosAddress } = location.state as {
cosmosAddress: string
cosmosAddress?: string
}
const [participant, setParticipant] = useState<Participant>();

View File

@ -24,16 +24,18 @@ const SignWithCosmos = () => {
const [role, setRole] = useState(Role.Participant);
const navigate = useNavigate();
const {message: innerMessage, cosmosAddress, ethSignature, kycId} = location.state as {
message: {
const {message: innerMessage, cosmosAddress, receivedEthSig: ethSignature, kycId} = location.state as {
message?: {
msg: string;
address: string;
};
cosmosAddress: string;
ethSignature: string;
kycId: string;
cosmosAddress?: string;
receivedEthSig?: string;
kycId?: string;
};
const ethAddress = innerMessage.address;
const ethAddress = innerMessage!.address;
const createCosmosClient = useCallback(async (endpoint: string) => {
return await StargateClient.connect(endpoint);

View File

@ -24,7 +24,12 @@ const UserVerification = () => {
const location = useLocation();
const navigate = useNavigate();
const {message, cosmosAddress, receivedEthSig} = location.state;
const {message, cosmosAddress, receivedEthSig} = location.state as {
message?: string;
cosmosAddress?: string;
receivedEthSig?: string;
};
const userId = cosmosAddress;
useEffect(() => {

View File

@ -1,6 +1,6 @@
export const fetchToken = async (userId: string) => {
try {
const response = await fetch('http://localhost:3000/generate-token', {
const response = await fetch(`${process.env.REACT_APP_SUMSUB_API_ENDPOINT}/generate-token`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'