0.10.10-rc1 • Published 11 months ago

@lnbits/client v0.10.10-rc1

Weekly downloads
-
License
MIT License
Repository
-
Last release
11 months ago

@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 --save

Finally, you need to build the module:

npm run build
Local 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 install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To 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 build

git

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 --save

For 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.js

Then 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

ClassMethodHTTP requestDescription
LnbitsClient.CoreApiapiDeleteSettingsAdminApiV1SettingsDeleteDELETE /admin/api/v1/settings/Api Delete Settings
LnbitsClient.CoreApiapiDownloadBackupAdminApiV1BackupGetGET /admin/api/v1/backup/Api Download Backup
LnbitsClient.CoreApiapiFiatAsSatsApiV1ConversionPostPOST /api/v1/conversionApi Fiat As Sats
LnbitsClient.CoreApiapiGetSettingsAdminApiV1SettingsGetGET /admin/api/v1/settings/Api Get Settings
LnbitsClient.CoreApiapiInstallExtensionApiV1ExtensionPostPOST /api/v1/extensionApi Install Extension
LnbitsClient.CoreApiapiListCurrenciesAvailableApiV1CurrenciesGetGET /api/v1/currenciesApi List Currencies Available
LnbitsClient.CoreApiapiLnurlscanApiV1LnurlscanCodeGetGET /api/v1/lnurlscan/{code}Api Lnurlscan
LnbitsClient.CoreApiapiPaymentApiV1PaymentsPaymentHashGetGET /api/v1/payments/{payment_hash}Api Payment
LnbitsClient.CoreApiapiPaymentsCreateApiV1PaymentsPostPOST /api/v1/paymentsApi Payments Create
LnbitsClient.CoreApiapiPaymentsDecodeApiV1PaymentsDecodePostPOST /api/v1/payments/decodeApi Payments Decode
LnbitsClient.CoreApiapiPaymentsPayLnurlApiV1PaymentsLnurlPostPOST /api/v1/payments/lnurlApi Payments Pay Lnurl
LnbitsClient.CoreApiapiPaymentsSseApiV1PaymentsSseGetGET /api/v1/payments/sseApi Payments Sse
LnbitsClient.CoreApiapiPerformLnurlauthApiV1LnurlauthPostPOST /api/v1/lnurlauthApi Perform Lnurlauth
LnbitsClient.CoreApiapiPublicPaymentLongpollingPublicV1PaymentPaymentHashGetGET /public/v1/payment/{payment_hash}Api Public Payment Longpolling
LnbitsClient.CoreApiapiRestartServerAdminApiV1RestartGetGET /admin/api/v1/restart/Api Restart Server
LnbitsClient.CoreApiapiUninstallExtensionApiV1ExtensionExtIdDeleteDELETE /api/v1/extension/{ext_id}Api Uninstall Extension
LnbitsClient.CoreApiapiUpdateSettingsAdminApiV1SettingsPutPUT /admin/api/v1/settings/Api Update Settings
LnbitsClient.CoreApiapiUpdateWalletApiV1WalletNewNamePutPUT /api/v1/wallet/{new_name}Api Update Wallet
LnbitsClient.CoreApiapiWalletApiV1WalletGetGET /api/v1/walletApi Wallet
LnbitsClient.CoreApiauditAdminApiV1AuditGetGET /admin/api/v1/auditAudit
LnbitsClient.CoreApideleteExtensionDbApiV1ExtensionExtIdDbDeleteDELETE /api/v1/extension/{ext_id}/dbDelete Extension Db
LnbitsClient.CoreApigetExtensionReleaseApiV1ExtensionReleaseOrgRepoTagNameGetGET /api/v1/extension/release/{org}/{repo}/{tag_name}Get Extension Release
LnbitsClient.CoreApigetExtensionReleasesApiV1ExtensionExtIdReleasesGetGET /api/v1/extension/{ext_id}/releasesGet Extension Releases
LnbitsClient.CoreApihealthApiV1HealthGetGET /api/v1/healthHealth
LnbitsClient.CoreApiimgApiV1QrcodeDataGetGET /api/v1/qrcode/{data}Img
LnbitsClient.CoreApipaymentListApiV1PaymentsGetGET /api/v1/paymentsget list of payments
LnbitsClient.CoreApipaymentListApiV1PaymentsPaginatedGetGET /api/v1/payments/paginatedget paginated list of payments
LnbitsClient.CoreApitinyurlApiV1TinyurlPostPOST /api/v1/tinyurlTinyurl
LnbitsClient.CoreApitinyurlApiV1TinyurlTinyurlIdDeleteDELETE /api/v1/tinyurl/{tinyurl_id}Tinyurl
LnbitsClient.CoreApitinyurlApiV1TinyurlTinyurlIdGetGET /api/v1/tinyurl/{tinyurl_id}Tinyurl
LnbitsClient.CoreApitinyurlTTinyurlIdGetGET /t/{tinyurl_id}Tinyurl
LnbitsClient.CoreApitopupAdminApiV1TopupPutPUT /admin/api/v1/topup/Topup
LnbitsClient.CoreApiwebsocketUpdateGetApiV1WsItemIdDataGetGET /api/v1/ws/{item_id}/{data}Websocket Update Get
LnbitsClient.CoreApiwebsocketUpdatePostApiV1WsItemIdPostPOST /api/v1/ws/{item_id}Websocket Update Post

Documentation for Models

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
0.10.10-rc1

11 months ago

0.10.9

11 months ago