zimppy-ts
v0.5.0
Published
TypeScript SDK for Zimppy — private machine payments on Zcash
Readme
zimppy-ts
TypeScript SDK for zimppy — the privacy stack for MPP.
Charge, session, and SSE streaming payments over Zcash.
Server
import { Mppx } from 'mppx/server'
import { zcash } from 'zimppy-ts/server'
const mppx = Mppx.create({
methods: [await zcash({ wallet: 'server' })],
realm: 'my-api',
secretKey: process.env.MPP_SECRET_KEY,
})
const result = await mppx.charge({ amount: '42000', currency: 'zec' })(request)
if (result.status === 402) return result.challenge
return result.withReceipt(Response.json({ data }))Client
import { Mppx } from 'mppx/client'
import { zcash } from 'zimppy-ts/client'
const mppx = Mppx.create({ methods: [zcash({ wallet: 'default' })] })
const res = await mppx.fetch('https://api.example.com/resource')Install
npm install zimppy-tsLicense
MIT
