@privy-io/js-sdk-core
Version:
Vanilla JS client for the Privy Auth API
2 lines (1 loc) • 716 B
JavaScript
import{isCrossAppWalletSmart as s}from"./utils/isCrossAppWalletSmart.mjs";import{sendCrossAppRequest as r}from"./utils/sendCrossAppRequest.mjs";import{throwIfNotLoggedIn as e}from"./utils/throwIfNotLoggedIn.mjs";import"../../../Error.mjs";import"./utils/getCrossAppAccountByWalletAddress.mjs";import"./utils/getProviderAccessTokenOrRelink.mjs";import"../linkWithCrossAppAuth.mjs";const t=({client:t,openAuthSession:o})=>{let i=r({client:t,openAuthSession:o});return async({user:r,address:t,message:o,redirectUrl:m})=>{e(r);let l=s(r,t),{result:p}=await i({user:r,request:{method:l?"privy_signSmartWalletMessage":"personal_sign",params:[o,t]},address:t,redirectUrl:m});return{signature:p}}};export{t as signMessage};