UNPKG

@privy-io/js-sdk-core

Version:

Vanilla JS client for the Privy Auth API

2 lines (1 loc) 587 B
"use strict";var e=require("canonicalize"),a=require("@privy-io/public-api");function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var i=/*#__PURE__*/t(e);exports.updateWallet=async function(e,{wallet_id:t},r,l){let p={version:1,url:e.getCompiledPath(a.WalletUpdate,{params:{wallet_id:t}}),method:a.WalletUpdate.method,headers:{"privy-app-id":e.app.appId},body:l},d=Buffer.from(i.default(p)).toString("base64"),{signature:o}=await r({message:d});return await e.fetchPrivyRoute(a.WalletUpdate,{params:{wallet_id:t},body:l,headers:{"privy-authorization-signature":o}})};