UNPKG

@privy-io/js-sdk-core

Version:

Vanilla JS client for the Privy Auth API

2 lines (1 loc) 449 B
import a from"canonicalize";import{WalletRpc as i}from"@privy-io/public-api";async function e(e,r,{wallet_id:t,...o}){let p={version:1,url:e.getCompiledPath(i,{params:{wallet_id:t}}),method:i.method,headers:{"privy-app-id":e.app.appId},body:{...o}},d=Buffer.from(a(p)).toString("base64"),{signature:l}=await r({message:d});return await e.fetchPrivyRoute(i,{body:o,params:{wallet_id:t},headers:{"privy-authorization-signature":l}})}export{e as rpc};