UNPKG

@privy-io/js-sdk-core

Version:

Vanilla JS client for the Privy Auth API

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