executive-pi
v0.1.2
Published
JavaScript SDK wrapper for Pi Platform API (A2U/U2A backend flow)
Downloads
284
Maintainers
Readme
executive-pi
JavaScript SDK wrapper for Pi Platform API backend flows (U2A + A2U). Pi, Pi Network and the Pi logo are trademarks of the Pi Community Company.
About
executive-pi is a public library for Pi SDK / Pi Platform API backend integration.
This library is created and published by Deni Darmayana.
Requirements
- Node.js 18+
- Pi Platform API key from Pi Developer Portal
Install
npm install executive-piPackage npm:
- https://www.npmjs.com/package/executive-pi
Quick Start
import { PiJavascript } from 'executive-pi'
const pi = new PiJavascript({
apiKey: process.env.PI_API_KEY,
})
const payment = await pi.getPayment('PAYMENT_ID')
console.log(payment)Constructor
new PiJavascript({
apiKey: process.env.PI_API_KEY,
baseUrl: 'https://api.minepi.com/v2', // optional
fetchImpl: fetch, // optional
})API
approvePayment(paymentId)completePayment(paymentId, txid)cancelPayment(paymentId)getPayment(paymentId)listIncompleteServerPayments()createA2UPayment({ amount, memo, metadata, uid })verifyUserAccessToken(accessToken)
Run example
PI_API_KEY=your_key node examples/list-incomplete.jsTest
npm testContact
- Author: Deni Darmayana
- WhatsApp: 085711999369
- Email: [email protected]
