
/* Create PiNetworkClient */
const PiNetworkClient = window.PiNetwork;

/* Authenticate the Current User */
try {
  const user = await PiNetworkClient.Authenticate()
  console.log(`Hello ${user.username}`)
} catch (err) {
  // Not able to fetch the user
}

/* Request a Transfer */
try {
  const transferRequest = await PiNetworkClient.RequestTransfer(3.14, "Demo transfer request")
} catch(err) {
  // Technical problem (eg network failure). Please try again
}

/* - Check Transfer Status using 
     transferRequest.status */