UNPKG

@dynamic-labs/sdk-react-core

Version:

A React SDK for implementing wallet web3 authentication and authorization to your website.

31 lines (29 loc) 2.54 kB
'use client' const createUserProfileFromSdkUser = (user) => { var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x; const kyc = { alias: (_a = user.alias) !== null && _a !== void 0 ? _a : undefined, btcWallet: (_b = user.btcWallet) !== null && _b !== void 0 ? _b : undefined, ckbWallet: (_c = user.ckbWallet) !== null && _c !== void 0 ? _c : undefined, country: (_d = user.country) !== null && _d !== void 0 ? _d : undefined, discordNotification: (_e = user.discordNotification) !== null && _e !== void 0 ? _e : undefined, dogeWallet: (_f = user.dogeWallet) !== null && _f !== void 0 ? _f : undefined, email: (_g = user.email) !== null && _g !== void 0 ? _g : undefined, emailNotification: (_h = user.emailNotification) !== null && _h !== void 0 ? _h : undefined, firstName: (_j = user.firstName) !== null && _j !== void 0 ? _j : undefined, jobTitle: (_k = user.jobTitle) !== null && _k !== void 0 ? _k : undefined, kasWallet: (_l = user.kasWallet) !== null && _l !== void 0 ? _l : undefined, kdaWallet: (_m = user.kdaWallet) !== null && _m !== void 0 ? _m : undefined, lastName: (_o = user.lastName) !== null && _o !== void 0 ? _o : undefined, ltcWallet: (_p = user.ltcWallet) !== null && _p !== void 0 ? _p : undefined, newsletterNotification: (_q = user.newsletterNotification) !== null && _q !== void 0 ? _q : undefined, phoneNumber: (_r = user.phoneNumber) !== null && _r !== void 0 ? _r : undefined, policiesConsent: (_s = user.policiesConsent) !== null && _s !== void 0 ? _s : undefined, tShirtSize: (_t = user.tShirtSize) !== null && _t !== void 0 ? _t : undefined, team: (_u = user.team) !== null && _u !== void 0 ? _u : undefined, username: (_v = user.username) !== null && _v !== void 0 ? _v : undefined, }; const userProfile = Object.assign({ environmentId: user.projectEnvironmentId, lastVerifiedCredentialId: (_w = user.lastVerifiedCredentialId) !== null && _w !== void 0 ? _w : undefined, lists: user.lists, metadata: user.metadata, mfaBackupCodeAcknowledgement: user.mfaBackupCodeAcknowledgement, missingFields: user.missingFields, newUser: user.newUser, scope: user.scope, sessionId: (_x = user.sessionId) !== null && _x !== void 0 ? _x : 'missing-sessionId', userId: user.id, verifiedCredentials: user.verifiedCredentials || [] }, kyc); return userProfile; }; export { createUserProfileFromSdkUser };