Skip to content

Commit

Permalink
add new features
Browse files Browse the repository at this point in the history
  • Loading branch information
darioAnongba committed Oct 22, 2024
1 parent e0fc28c commit 3874e46
Show file tree
Hide file tree
Showing 11 changed files with 168 additions and 12 deletions.
1 change: 1 addition & 0 deletions docs/account/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ You can get started by [registering a Numeraire account](account/register.mdx).
- Sort and filter your transactions
- Manage a list of contacts
- Generate invoices
- Programmatically access your account with API Keys
- And much more...
46 changes: 44 additions & 2 deletions docs/developers/api-keys.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,48 @@ sidebar_position: 2
image: /img/social.jpg
---

(WIP - Feature Coming soon)
Integrate all functionalities provided by Numeraire into your applications, with the [Numeraire API](https://api.numeraire.tech/docs) using API Keys.

API Keys are used to authenticate requests to the [Numeraire API](https://api.numeraire.tech/docs). They are generated in the [Dashboard](https://app.numeraire.tech) and can be used to access the API endpoints.
API Keys are used to authenticate requests. They are generated in the [Dashboard](https://app.numeraire.tech) and can be used to access the API endpoints.
When deploying your own Numeraire SwissKnife, you also have access to the API in the same way by connecting to your own instance.
With the right permissions, you also access the API on behalf of other users as an admin, allowing you to behave as banking infrastructure for your users.

## Generate an API token

1. Go to your [Settings](https://app.numeraire.tech/settings?tab=apikeys) on the API Keys tab.

<div class="center-container" style={{ marginBottom: 20 }}>
<img
src="/img/article_images/developers/apikeys_overview.png"
alt="Numeraire SwissKnife"
/>
</div>

2. Click on the `New` button.

<div class="center-container" style={{ marginBottom: 20 }}>
<img
src="/img/article_images/developers/apikeys_new.png"
alt="Numeraire SwissKnife"
/>
</div>

3. Fill in the form and select the permissions you want to grant. As user, you can only generate an API key to access your own account.
4. Once the token is generated, copy it and store it in a safe place. You will not be able to see it again!

## Use your API token

Once your API key is generated, you can pass the token in the `Api-Key` header of your requests.

```bash
curl https://api.numeraire.tech/v1/payments -H 'Api-Key: YOUR_API_KEY'
```

:::tip
Always send payload data in JSON format using the `Content-Type: application/json` header.
:::

## BUIDL

You are now ready to start building with Numeraire! Start integrating into your application, create a Wordpress plugin, register Lightning and Nostr Addresses
for your users, etc. The possibilities are endless!
30 changes: 27 additions & 3 deletions docs/swissknife/configuration/default.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ seed = "CHANGE_ME"

# Core Lightning provider
[cln_grpc_config]
endpoint = "https://localhost:50051"
endpoint = "https://localhost:11002"
certs_dir = "certs/lightningd"
maxfeepercent = 0.5
payment_timeout = "60s"
Expand All @@ -46,6 +46,7 @@ retry_delay = "5s"

[cln_rest_config]
endpoint = "http://localhost:3010"
ca_cert_path = "certs/lightningd/ca.cert"
rune = "CHANGE_ME"
connect_timeout = "5s"
timeout = "90s"
Expand All @@ -55,8 +56,23 @@ accept_invalid_hostnames = false
maxfeepercent = 0.5
payment_timeout = "60s"
payment_exemptfee = 5000
ws_min_reconnect_delay_delay = 1
ws_max_reconnect_delay_delay = 30
ws_min_reconnect_delay = "1s"
ws_max_reconnect_delay = "30s"

# LND Lightning provider
[lnd_config]
host = "localhost:8080"
macaroon_path = "certs/lnd/admin.macaroon"
ca_cert_path = "certs/lnd/tls.cert"
connect_timeout = "5s"
timeout = "90s"
connection_verbose = true
accept_invalid_certs = false
accept_invalid_hostnames = false
payment_timeout = "60s"
fee_limit_msat = 25000
ws_min_reconnect_delay = "1s"
ws_max_reconnect_delay = "30s"

# Logging
[logging]
Expand Down Expand Up @@ -91,6 +107,14 @@ min_connections = 0
acquire_timeout = "5s"
connect_timeout = "30s"
sqlx_logging = true

# RGB
[rgb]
data_dir = "storage/rgblib"
media_dir = "storage/media"
electrum_url = "localhost:50001"
proxy_server_url = "rpc://localhost:3030/json-rpc"
min_confirmations = 3
```

This file should ideally not be modified directly. Instead, you should create a new configuration file (called `development.toml` or `production.toml`) and override the default values.
Expand Down
29 changes: 25 additions & 4 deletions docs/swissknife/configuration/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ Config values for Breez Lightning provider. To be placed under `breez_config`.

### Core Lightning provider (gRPC)

Config values for Core [Lightning provider using gRPC](https://docs.corelightning.org/docs/grpc). To be placed under `cln_grpc_config`.
Config values for [Core Lightning provider using gRPC](https://docs.corelightning.org/docs/grpc). To be placed under `cln_grpc_config`.

| Config Value | Description |
|---------------------------|--------------------------------------------------|
Expand All @@ -66,7 +66,7 @@ Config values for Core [Lightning provider using gRPC](https://docs.corelightnin

### Core Lightning provider (REST)

Config values for Core [Lightning provider using REST](https://docs.corelightning.org/docs/rest). To be placed under `cln_rest_config`.
Config values for [Core Lightning provider using REST](https://docs.corelightning.org/docs/rest). To be placed under `cln_rest_config`.
Numeraire SwisskKnife uses runes and the websocket server to sync events from the node.

| Config Value | Description |
Expand All @@ -81,13 +81,34 @@ Numeraire SwisskKnife uses runes and the websocket server to sync events from th
| `cln_rest_config.maxfeepercent` | Maximum fee percentage for payments |
| `cln_rest_config.payment_timeout`| Payment timeout duration |
| `cln_rest_config.payment_exemptfee` | Exempt fee value for payments |
| `cln_rest_config.ws_min_reconnect_delay_delay` | Minimum WebSocket reconnect delay |
| `cln_rest_config.ws_max_reconnect_delay_delay` | Maximum WebSocket reconnect delay |
| `cln_rest_config.ws_min_reconnect_delay` | Minimum WebSocket reconnect delay |
| `cln_rest_config.ws_max_reconnect_delay` | Maximum WebSocket reconnect delay |


:::tip
Use an ENV var for `SWISSKNIFE_CLN_REST_CONFIG__RUNE`, as that value is highly sensitive.
:::

### LND provider

Config values for [LND provider using REST](https://lightning.engineering/api-docs/api/lnd/). To be placed under `lnd_config`.
Numeraire SwisskKnife uses macaroons and the websocket server to sync events from the node.

| Config Value | Description |
|----------------------------------|--------------------------------------------------|
| `lnd_config.host` | Host and port for LND gRPC API |
| `lnd_config.macaroon_path` | File path to the admin macaroon |
| `lnd_config.ca_cert_path` | File path to the TLS certificate |
| `lnd_config.connect_timeout` | Connection timeout duration |
| `lnd_config.timeout` | Request timeout duration |
| `lnd_config.connection_verbose` | Enable verbose connection logging |
| `lnd_config.accept_invalid_certs`| Accept invalid certificates |
| `lnd_config.accept_invalid_hostnames` | Accept invalid hostnames |
| `lnd_config.payment_timeout` | Payment timeout duration |
| `lnd_config.fee_limit_msat` | Maximum fee limit in millisatoshis for payments |
| `lnd_config.ws_min_reconnect_delay` | Minimum WebSocket reconnect delay |
| `lnd_config.ws_max_reconnect_delay` | Maximum WebSocket reconnect delay |

### Logging

Config values for logging. To be placed under `logging`.
Expand Down
7 changes: 6 additions & 1 deletion docs/swissknife/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ installing SwissKnife on your own hardware, either on your desktop, on a Raspber
- Data availability through pagination and advanced search.
- Advanced [Dashboard](https://github.com/bitcoin-numeraire/swissknife-dashboard).
- Runs in the cloud, on your desktop or on a Raspberry Pi (or similar).
- [`Nostr`](https://github.com/nostr-protocol/nips/blob/master/05.md). NIP-05 and Zap support through your Lightning Address.
- API keys authentication

## Lightning Providers

Expand All @@ -49,4 +51,7 @@ SwissKnife allows direct Lightning integration, supporting the most used node im
- Non-custodial
- Automatic node management.
- Automatic liquidity management via LSPs (user can switch LSPs)

- [`LND`](https://github.com/lightningnetwork/lnd)
- Non-custodial
- Run your own node
- Manage your own liquidity
13 changes: 12 additions & 1 deletion docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,12 @@ const config: Config = {
position: "right",
"aria-label": "Twitter",
},
{
href: "https://nostr.com/npub1m8pwckdf3n5lyd2m463ad3u4kk98qmwfs9s7hrmj6knd07frenlsfr0uje",
className: "header-nostr-link",
position: "right",
"aria-label": "Nostr",
},
],
},
footer: {
Expand All @@ -140,6 +146,10 @@ const config: Config = {
label: 'API Reference',
href: 'https://api.numeraire.tech/docs',
},
{
label: 'Lightning Node',
href: 'https://amboss.space/node/02fc22cb2dd9c71b39ad246ae206259376e0127cce2192d4061abd0172b53f391b',
},
],
},
{
Expand All @@ -155,7 +165,7 @@ const config: Config = {
},
{
label: 'Nostr',
href: '#',
href: 'https://nostr.com/npub1m8pwckdf3n5lyd2m463ad3u4kk98qmwfs9s7hrmj6knd07frenlsfr0uje',
},
],
},
Expand All @@ -170,6 +180,7 @@ const config: Config = {
label: 'Contribute to our docs',
href: 'https://github.com/bitcoin-numeraire/doc',
},

],
},
],
Expand Down
48 changes: 47 additions & 1 deletion src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,47 @@
html[data-theme="dark"] .header-dockerhub-link::before {
filter: invert(100%);
}

/* nostr */
.header-nostr-link:hover {
opacity: 0.6;
}

.header-nostr-link::before {
content: "";
width: 24px;
height: 24px;
margin-top: 8px;
display: flex;
background: url("icon_nostr.svg")
no-repeat;
background-size: 20px 20px;
}

html[data-theme="dark"] .header-nostr-link::before {
content: "";
width: 24px;
height: 24px;
margin-top: 8px;
display: flex;
background: url("icon_nostr_dark.svg")
no-repeat;
background-size: 20px 20px;
}

@media (max-width: 996px) {
.header-nostr-link::before {
margin-top: 0;
background-size: 24px 24px;
margin-left: 2px;
}

html[data-theme="dark"] .header-nostr-link::before {
margin-top: 0;
background-size: 24px 24px;
margin-left: 2px;
}
}

@media only screen and (max-width: 525px) {
.menu__link {
Expand Down Expand Up @@ -419,6 +460,11 @@
margin-left: 20px;
content: "DockerHub ";
}

.header-nostr-link::after {
margin-left: 20px;
content: "Twitter ";
}
}

/* Navbar formatting */
Expand Down Expand Up @@ -647,4 +693,4 @@

.footer__copyright {
color: var(--banner-text);
}
}
3 changes: 3 additions & 0 deletions src/css/icon_nostr.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions src/css/icon_nostr_dark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3874e46

Please sign in to comment.