Zapple Pay lets you use nostr wallet connect to automatically zap notes based on a configured emoji or to subscribe to a user and zap them on a regular basis.
If you are having trouble building you may need to install libpq-dev
.
sudo apt-get install libpq-dev
POST /set-user
payload:
the emoji and donations are optional
only one of nwc
or auth_id
can be set.
{
"npub": "user's npub",
"amount_sats": 1000,
"nwc": "user's nwc",
"auth_id": "id from /wallet-auth",
"emoji": "⚡",
"donations": [
{
"amount_sats": 1000,
"lnurl": "donation lnurl",
"npub": "donation npub"
}
]
}
returns: the user's current configs
{
"zaps": [
{
"npub": "user's npub",
"amount_sats": 1000,
"emoji": "⚡",
"donations": [
{
"amount_sats": 1000,
"lnurl": "donation lnurl",
"npub": "donation npub"
}
]
}
],
"subscriptions": []
}
POST /create-subscription
time_period can be minute
, hour
, day
, week
, month
, or year
only one of nwc
or auth_id
can be set.
payload:
{
"npub": "user's npub",
"to_npub": "user to zap npub",
"amount_sats": 1000,
"time_period": "day",
"nwc": "user's nwc",
"auth_id": "id from /wallet-auth"
}
returns: the user's current configs
{
"zaps": [],
"subscriptions": [
{
"npub": "user's npub",
"to_npub": "user to zap npub",
"amount_sats": 1000,
"time_period": "day"
}
]
}
GET /get-user/:npub
returns: the user's current configs
{
"zaps": [
{
"npub": "user's npub",
"amount_sats": 1000,
"emoji": "⚡",
"donations": [
{
"amount_sats": 1000,
"lnurl": "donation lnurl",
"npub": "donation npub"
}
]
}
],
"subscriptions": [
{
"npub": "user's npub",
"to_npub": "user to zap npub",
"amount_sats": 1000,
"time_period": "day"
}
]
}
GET /get-user/:npub/:emoji
returns: the user's current config
{
"npub": "user's npub",
"amount_sats": 1000,
"emoji": "⚡",
"donations": [
{
"amount_sats": 1000,
"lnurl": "donation lnurl",
"npub": "donation npub"
}
]
}
GET /get-subscriptions/:npub/:to_npub
returns:
the user's current subscription config for to_npub
{
"npub": "user's npub",
"to_npub": "user to zap npub",
"amount_sats": 1000,
"time_period": "day"
}
GET /delete-user/:npub
deletes all the user's zap configs and subscriptions
returns: the user's current configs
{
"zaps": [
{
"npub": "user's npub",
"amount_sats": 1000,
"emoji": "⚡",
"donations": [
{
"amount_sats": 1000,
"lnurl": "donation lnurl",
"npub": "donation npub"
}
]
}
],
"subscriptions": [
{
"npub": "user's npub",
"to_npub": "user to zap npub",
"amount_sats": 1000,
"time_period": "day"
}
]
}
GET /delete-user/:npub/:emoji
returns: the user's current configs
{
"zaps": [
{
"npub": "user's npub",
"amount_sats": 1000,
"emoji": "⚡",
"donations": [
{
"amount_sats": 1000,
"lnurl": "donation lnurl",
"npub": "donation npub"
}
]
}
],
"subscriptions": [
{
"npub": "user's npub",
"to_npub": "user to zap npub",
"amount_sats": 1000,
"time_period": "day"
}
]
}
GET /delete-subscription/:npub/:to_npub
returns: the user's current configs
{
"zaps": [
{
"npub": "user's npub",
"amount_sats": 1000,
"emoji": "⚡",
"donations": [
{
"amount_sats": 1000,
"lnurl": "donation lnurl",
"npub": "donation npub"
}
]
}
],
"subscriptions": [
{
"npub": "user's npub",
"to_npub": "user to zap npub",
"amount_sats": 1000,
"time_period": "day"
}
]
}
GET /wallet-auth
query params:
These query parameters are optional ways to modify the NWA uri given. If you are setting them time_period
and amount
but both be set identity
is optional.
day
, week
, month
, or year
returns:
Nostr Wallet Auth uri and id to reference in future api calls.
{
"id": "hex encoded id",
"uri": "nostr+walletauth://blahblah"
}
GET /check-wallet-auth
query params:
id
given in /wallet-auth
returns:
boolean for if we have successfully connected
true
GET /count
returns: metrics on zapple pay
{
"users": 426,
"zap_configs": 572,
"subscription_configs": 2,
"zap_count": 4909,
"zap_total": 213485
}