@lnbits/client
v0.10.10-rc1
Published
API for LNbits, the free and open source bitcoin wallet and accounts system with plugins.
Readme
@lnbits/client
LnbitsClient - JavaScript client for @lnbits/client API for LNbits, the free and open source bitcoin wallet and accounts system with plugins. This SDK is automatically generated by the OpenAPI Generator project:
- API version: 0.10.9
- Package version: 0.10.9
- Build package: org.openapitools.codegen.languages.JavascriptClientCodegen
Installation
For Node.js
npm
To publish the library as a npm, please follow the procedure in "Publishing npm packages".
Then install it via:
npm install @lnbits/client --saveFinally, you need to build the module:
npm run buildLocal development
To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:
npm installNext, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:
npm linkTo use the link you just defined in your project, switch to the directory you want to use your @lnbits/client from, and run:
npm link /path/to/<JAVASCRIPT_CLIENT_DIR>Finally, you need to build the module:
npm run buildgit
If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:
npm install GIT_USER_ID/GIT_REPO_ID --saveFor browser
The library also works in the browser environment via npm and browserify. After following
the above steps with Node.js and installing browserify with npm install -g browserify,
perform the following (assuming main.js is your entry file):
browserify main.js > bundle.jsThen include bundle.js in the HTML pages.
Webpack Configuration
Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:
module: {
rules: [
{
parser: {
amd: false
}
}
]
}Getting Started
Please follow the installation instruction and execute the following JS code:
var LnbitsClient = require('@lnbits/client');
var api = new LnbitsClient.CoreApi()
var usr = "usr_example"; // {String}
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
api.apiDeleteSettingsAdminApiV1SettingsDelete(usr, callback);
Documentation for API Endpoints
All URIs are relative to http://localhost
Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- LnbitsClient.CoreApi | apiDeleteSettingsAdminApiV1SettingsDelete | DELETE /admin/api/v1/settings/ | Api Delete Settings LnbitsClient.CoreApi | apiDownloadBackupAdminApiV1BackupGet | GET /admin/api/v1/backup/ | Api Download Backup LnbitsClient.CoreApi | apiFiatAsSatsApiV1ConversionPost | POST /api/v1/conversion | Api Fiat As Sats LnbitsClient.CoreApi | apiGetSettingsAdminApiV1SettingsGet | GET /admin/api/v1/settings/ | Api Get Settings LnbitsClient.CoreApi | apiInstallExtensionApiV1ExtensionPost | POST /api/v1/extension | Api Install Extension LnbitsClient.CoreApi | apiListCurrenciesAvailableApiV1CurrenciesGet | GET /api/v1/currencies | Api List Currencies Available LnbitsClient.CoreApi | apiLnurlscanApiV1LnurlscanCodeGet | GET /api/v1/lnurlscan/{code} | Api Lnurlscan LnbitsClient.CoreApi | apiPaymentApiV1PaymentsPaymentHashGet | GET /api/v1/payments/{payment_hash} | Api Payment LnbitsClient.CoreApi | apiPaymentsCreateApiV1PaymentsPost | POST /api/v1/payments | Api Payments Create LnbitsClient.CoreApi | apiPaymentsDecodeApiV1PaymentsDecodePost | POST /api/v1/payments/decode | Api Payments Decode LnbitsClient.CoreApi | apiPaymentsPayLnurlApiV1PaymentsLnurlPost | POST /api/v1/payments/lnurl | Api Payments Pay Lnurl LnbitsClient.CoreApi | apiPaymentsSseApiV1PaymentsSseGet | GET /api/v1/payments/sse | Api Payments Sse LnbitsClient.CoreApi | apiPerformLnurlauthApiV1LnurlauthPost | POST /api/v1/lnurlauth | Api Perform Lnurlauth LnbitsClient.CoreApi | apiPublicPaymentLongpollingPublicV1PaymentPaymentHashGet | GET /public/v1/payment/{payment_hash} | Api Public Payment Longpolling LnbitsClient.CoreApi | apiRestartServerAdminApiV1RestartGet | GET /admin/api/v1/restart/ | Api Restart Server LnbitsClient.CoreApi | apiUninstallExtensionApiV1ExtensionExtIdDelete | DELETE /api/v1/extension/{ext_id} | Api Uninstall Extension LnbitsClient.CoreApi | apiUpdateSettingsAdminApiV1SettingsPut | PUT /admin/api/v1/settings/ | Api Update Settings LnbitsClient.CoreApi | apiUpdateWalletApiV1WalletNewNamePut | PUT /api/v1/wallet/{new_name} | Api Update Wallet LnbitsClient.CoreApi | apiWalletApiV1WalletGet | GET /api/v1/wallet | Api Wallet LnbitsClient.CoreApi | auditAdminApiV1AuditGet | GET /admin/api/v1/audit | Audit LnbitsClient.CoreApi | deleteExtensionDbApiV1ExtensionExtIdDbDelete | DELETE /api/v1/extension/{ext_id}/db | Delete Extension Db LnbitsClient.CoreApi | getExtensionReleaseApiV1ExtensionReleaseOrgRepoTagNameGet | GET /api/v1/extension/release/{org}/{repo}/{tag_name} | Get Extension Release LnbitsClient.CoreApi | getExtensionReleasesApiV1ExtensionExtIdReleasesGet | GET /api/v1/extension/{ext_id}/releases | Get Extension Releases LnbitsClient.CoreApi | healthApiV1HealthGet | GET /api/v1/health | Health LnbitsClient.CoreApi | imgApiV1QrcodeDataGet | GET /api/v1/qrcode/{data} | Img LnbitsClient.CoreApi | paymentListApiV1PaymentsGet | GET /api/v1/payments | get list of payments LnbitsClient.CoreApi | paymentListApiV1PaymentsPaginatedGet | GET /api/v1/payments/paginated | get paginated list of payments LnbitsClient.CoreApi | tinyurlApiV1TinyurlPost | POST /api/v1/tinyurl | Tinyurl LnbitsClient.CoreApi | tinyurlApiV1TinyurlTinyurlIdDelete | DELETE /api/v1/tinyurl/{tinyurl_id} | Tinyurl LnbitsClient.CoreApi | tinyurlApiV1TinyurlTinyurlIdGet | GET /api/v1/tinyurl/{tinyurl_id} | Tinyurl LnbitsClient.CoreApi | tinyurlTTinyurlIdGet | GET /t/{tinyurl_id} | Tinyurl LnbitsClient.CoreApi | topupAdminApiV1TopupPut | PUT /admin/api/v1/topup/ | Topup LnbitsClient.CoreApi | websocketUpdateGetApiV1WsItemIdDataGet | GET /api/v1/ws/{item_id}/{data} | Websocket Update Get LnbitsClient.CoreApi | websocketUpdatePostApiV1WsItemIdPost | POST /api/v1/ws/{item_id} | Websocket Update Post
Documentation for Models
- LnbitsClient.ConversionData
- LnbitsClient.CreateExtension
- LnbitsClient.CreateInvoiceData
- LnbitsClient.CreateLNURLData
- LnbitsClient.CreateLnurlAuth
- LnbitsClient.CreateTopup
- LnbitsClient.DecodePayment
- LnbitsClient.EditableSettings
- LnbitsClient.HTTPValidationError
- LnbitsClient.LocationInner
- LnbitsClient.Page
- LnbitsClient.Payment
- LnbitsClient.ValidationError
Documentation for Authorization
Authentication schemes defined for the API:
APIKeyHeader
- Type: API key
- API key parameter name: X-API-KEY
- Location: HTTP header
APIKeyQuery
- Type: API key
- API key parameter name: api-key
- Location: URL query string
