Use testnet-onboarding-api to generate sumsub access token #3

Merged
nabarun merged 8 commits from sk-replace-query-params-with-state into kyc-integration 2024-07-26 16:49:30 +00:00
5 changed files with 18 additions and 11 deletions
Showing only changes of commit 40212628f5 - Show all commits

View File

@ -6,4 +6,4 @@ REACT_APP_LACONICD_RPC_ENDPOINT=http://localhost:26657
REACT_APP_LACONICD_DENOM=photon REACT_APP_LACONICD_DENOM=photon
REACT_APP_FAUCET_ENDPOINT=http://localhost:4000 REACT_APP_FAUCET_ENDPOINT=http://localhost:4000
REACT_APP_WALLET_META_URL=http://localhost:3000 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 OnboardingSuccess = () => {
const location = useLocation(); const location = useLocation();
const { cosmosAddress } = location.state as { const { cosmosAddress } = location.state as {
cosmosAddress: string cosmosAddress?: string
} }
const [participant, setParticipant] = useState<Participant>(); const [participant, setParticipant] = useState<Participant>();

View File

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

View File

@ -24,7 +24,12 @@ const UserVerification = () => {
const location = useLocation(); const location = useLocation();
const navigate = useNavigate(); 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; const userId = cosmosAddress;
useEffect(() => { useEffect(() => {

View File

@ -1,6 +1,6 @@
export const fetchToken = async (userId: string) => { export const fetchToken = async (userId: string) => {
try { 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', method: 'POST',
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'