diff --git a/.changeset/rare-ladybugs-allow.md b/.changeset/rare-ladybugs-allow.md new file mode 100644 index 000000000..bee69833c --- /dev/null +++ b/.changeset/rare-ladybugs-allow.md @@ -0,0 +1,14 @@ +--- +"@lightsparkdev/ls-react-native-crypto": patch +"@lightsparkdev/lightspark-cli": patch +"@lightsparkdev/lightspark-sdk": patch +"@lightsparkdev/react-native": patch +"@lightsparkdev/react-wallet": patch +"@lightsparkdev/wallet-cli": patch +"@lightsparkdev/wallet-sdk": patch +"@lightsparkdev/oauth": patch +"@lightsparkdev/core": patch +"@lightsparkdev/ui": patch +--- + +Upgrade to Typescript 5, lint config changes diff --git a/apps/examples/jwt-server/package.json b/apps/examples/jwt-server/package.json index 240ff00ca..38d9ea844 100644 --- a/apps/examples/jwt-server/package.json +++ b/apps/examples/jwt-server/package.json @@ -30,7 +30,7 @@ "eslint-config-google": "^0.14.0", "eslint-plugin-import": "^2.26.0", "firebase-functions-test": "^3.0.0", - "typescript": "^4.9.5" + "typescript": "^5.0.0" }, "private": true } diff --git a/apps/examples/ls-react-native-crypto-app/package.json b/apps/examples/ls-react-native-crypto-app/package.json index 3f0ba8952..283f51398 100644 --- a/apps/examples/ls-react-native-crypto-app/package.json +++ b/apps/examples/ls-react-native-crypto-app/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@babel/core": "^7.21.4", "@types/react": "^18.2.12", - "typescript": "^4.9.5" + "typescript": "^5.0.0" }, "private": true, "expo": { diff --git a/apps/examples/oauth-app/index.html b/apps/examples/oauth-app/index.html index e06eff1f7..917765e92 100644 --- a/apps/examples/oauth-app/index.html +++ b/apps/examples/oauth-app/index.html @@ -11,17 +11,7 @@ /> - - - Lightspark OAuth Demo diff --git a/apps/examples/oauth-app/package.json b/apps/examples/oauth-app/package.json index 9940344ac..fa48bc086 100644 --- a/apps/examples/oauth-app/package.json +++ b/apps/examples/oauth-app/package.json @@ -8,7 +8,7 @@ "@emotion/styled": "^11.11.0", "@lightsparkdev/lightspark-sdk": "1.2.2", "@lightsparkdev/oauth": "*", - "@lightsparkdev/ui": "*", + "@lightsparkdev/ui": "0.0.0", "qrcode.react": "^3.1.0", "react": "^18.2.0", "react-dom": "^18.1.0", @@ -26,7 +26,7 @@ "eslint": "^8.3.0", "eslint-watch": "^8.0.0", "tsc-absolute": "^1.0.1", - "typescript": "^4.9.5", + "typescript": "^5.0.0", "vite": "^4.3.9" }, "scripts": { diff --git a/apps/examples/oauth-app/tsconfig.json b/apps/examples/oauth-app/tsconfig.json index 1dcec583e..bedeb707d 100644 --- a/apps/examples/oauth-app/tsconfig.json +++ b/apps/examples/oauth-app/tsconfig.json @@ -7,6 +7,6 @@ }, "types": ["node", "vite/client"] }, - "include": ["src/**/*", "../../../packages/ui/**/*"], + "include": ["src/**/*"], "exclude": ["node_modules"] } diff --git a/apps/examples/react-wallet-app/index.html b/apps/examples/react-wallet-app/index.html index 11444df90..3be4f6d62 100644 --- a/apps/examples/react-wallet-app/index.html +++ b/apps/examples/react-wallet-app/index.html @@ -1,4 +1,4 @@ - + @@ -10,20 +10,8 @@ content="A demo of react hooks from the Lightspark Wallet SDK" /> - - - - - Lightspark React Wallet App Demo diff --git a/apps/examples/react-wallet-app/package.json b/apps/examples/react-wallet-app/package.json index e4f85f607..06e866a80 100644 --- a/apps/examples/react-wallet-app/package.json +++ b/apps/examples/react-wallet-app/package.json @@ -8,7 +8,7 @@ "@emotion/styled": "^11.11.0", "@lightsparkdev/core": "1.0.10", "@lightsparkdev/react-wallet": "0.6.35", - "@lightsparkdev/ui": "*", + "@lightsparkdev/ui": "0.0.0", "@lightsparkdev/wallet-sdk": "0.8.1", "react": "^18.2.0", "react-dom": "^18.1.0", @@ -37,7 +37,7 @@ "eslint": "^8.3.0", "eslint-watch": "^8.0.0", "tsc-absolute": "^1.0.1", - "typescript": "^4.9.5", + "typescript": "^5.0.0", "vite": "^4.3.9" } } diff --git a/apps/examples/react-wallet-app/src/components/Dashboard.tsx b/apps/examples/react-wallet-app/src/components/Dashboard.tsx index 1474d1ba2..3767e8b1b 100644 --- a/apps/examples/react-wallet-app/src/components/Dashboard.tsx +++ b/apps/examples/react-wallet-app/src/components/Dashboard.tsx @@ -4,10 +4,9 @@ import { CurrencyAmount } from "@lightsparkdev/ui/components/CurrencyAmount"; import type { CurrencyAmount as CurrencyAmountType, Transaction, - WalletDashboard} from "@lightsparkdev/wallet-sdk"; -import { - CurrencyUnit + WalletDashboard, } from "@lightsparkdev/wallet-sdk"; +import { CurrencyUnit } from "@lightsparkdev/wallet-sdk"; import { Button } from "src/components/Button"; import { Table, Td, Th, Tr } from "./Table"; diff --git a/apps/examples/react-wallet-app/src/pages/DashboardPage.tsx b/apps/examples/react-wallet-app/src/pages/DashboardPage.tsx index 685467149..db5df7ff2 100644 --- a/apps/examples/react-wallet-app/src/pages/DashboardPage.tsx +++ b/apps/examples/react-wallet-app/src/pages/DashboardPage.tsx @@ -76,8 +76,9 @@ function DashboardPage() { await DefaultCrypto.serializeSigningKey(keys.publicKey, "spki"); const serializedPrivateKeyBytes = await DefaultCrypto.serializeSigningKey(keys.privateKey, "pkcs8"); - // You can save the keys somewhere here if you want to use them later. Here, - // we're just logging them to the console for demo purposes. + // You can save the keys somewhere here if you want to use them + // later. Here, we're just logging them to the console for demo + // purposes. console.log( "Save these keys if you want to use this wallet later!" ); diff --git a/apps/examples/react-wallet-app/tsconfig.json b/apps/examples/react-wallet-app/tsconfig.json index 1dcec583e..bedeb707d 100644 --- a/apps/examples/react-wallet-app/tsconfig.json +++ b/apps/examples/react-wallet-app/tsconfig.json @@ -7,6 +7,6 @@ }, "types": ["node", "vite/client"] }, - "include": ["src/**/*", "../../../packages/ui/**/*"], + "include": ["src/**/*"], "exclude": ["node_modules"] } diff --git a/apps/examples/remote-signing-server/package.json b/apps/examples/remote-signing-server/package.json index 92ff58b39..e7214bc36 100644 --- a/apps/examples/remote-signing-server/package.json +++ b/apps/examples/remote-signing-server/package.json @@ -23,6 +23,6 @@ "supertest": "^6.3.3", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^4.9.5" + "typescript": "^5.0.0" } } diff --git a/apps/examples/streaming-wallet-extension/index.html b/apps/examples/streaming-wallet-extension/index.html index 3a45e7df0..694de17a6 100644 --- a/apps/examples/streaming-wallet-extension/index.html +++ b/apps/examples/streaming-wallet-extension/index.html @@ -6,15 +6,7 @@ - - + Lightspark Wallet diff --git a/apps/examples/streaming-wallet-extension/package.json b/apps/examples/streaming-wallet-extension/package.json index 4c8cbc52a..aba6c0f14 100644 --- a/apps/examples/streaming-wallet-extension/package.json +++ b/apps/examples/streaming-wallet-extension/package.json @@ -7,6 +7,7 @@ "@emotion/styled": "^11.11.0", "@lightsparkdev/core": "1.0.10", "@lightsparkdev/lightspark-sdk": "1.2.2", + "@lightsparkdev/ui": "0.0.0", "eslint": "^8.3.0", "react": "^18.2.0", "react-dom": "^18.1.0", @@ -39,7 +40,7 @@ "@vitejs/plugin-react": "^4.0.1", "eslint-watch": "^8.0.0", "tsc-absolute": "^1.0.1", - "typescript": "^4.9.5", + "typescript": "^5.0.0", "vite": "^4.3.9" } } diff --git a/apps/examples/streaming-wallet-extension/src/common/types.tsx b/apps/examples/streaming-wallet-extension/src/common/types.tsx index d2124c823..cccc4d45f 100644 --- a/apps/examples/streaming-wallet-extension/src/common/types.tsx +++ b/apps/examples/streaming-wallet-extension/src/common/types.tsx @@ -4,7 +4,7 @@ export type Maybe = T | null | undefined; export type ExpandRecursively = T extends object ? T extends infer O - ? { [K in keyof O]: ExpandRecursively } // eslint-disable-line @typescript-eslint/no-unused-vars + ? { [K in keyof O]: ExpandRecursively } : never : T; diff --git a/apps/examples/uma-vasp/package.json b/apps/examples/uma-vasp/package.json index cbe0d8146..9f20d73f2 100644 --- a/apps/examples/uma-vasp/package.json +++ b/apps/examples/uma-vasp/package.json @@ -25,6 +25,6 @@ "supertest": "^6.3.3", "ts-jest": "^29.1.1", "ts-node": "^10.9.1", - "typescript": "^4.9.5" + "typescript": "^5.0.0" } } diff --git a/apps/examples/wallet-node-scripts/package.json b/apps/examples/wallet-node-scripts/package.json index b5ea3bf83..b5207a817 100644 --- a/apps/examples/wallet-node-scripts/package.json +++ b/apps/examples/wallet-node-scripts/package.json @@ -13,7 +13,7 @@ "devDependencies": { "@types/node": "^20.2.5", "ts-node": "^10.9.1", - "typescript": "^4.9.5" + "typescript": "^5.0.0" }, "dependencies": { "@lightsparkdev/core": "1.0.10", diff --git a/packages/core/package.json b/packages/core/package.json index e8d414a55..1077fe52c 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -61,7 +61,7 @@ ], "scripts": { "build": "yarn tsc && tsup", - "build:watch": "yarn build --watch", + "build:watch": "yarn build --watch --clean=false", "clean": "rm -rf .turbo && rm -rf dist", "dev": "yarn build -- --watch", "format:fix": "prettier src --write", @@ -101,6 +101,6 @@ "ts-jest": "^29.1.1", "tsc-absolute": "^1.0.1", "tsup": "^7.2.0", - "typescript": "^4.9.5" + "typescript": "^5.0.0" } } diff --git a/packages/core/src/crypto/crypto.ts b/packages/core/src/crypto/crypto.ts index 4d5b21d82..3a0a6b70d 100644 --- a/packages/core/src/crypto/crypto.ts +++ b/packages/core/src/crypto/crypto.ts @@ -154,8 +154,7 @@ const decrypt = async ( const salt = decoded.slice(decoded.length - 8, decoded.length); const nonce = decoded.slice(0, 12); const cipherText = decoded.slice(12, decoded.length - 8); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [key, _iv] = await deriveKey( + const [key /* , _iv */] = await deriveKey( password, salt, header.i, diff --git a/packages/core/src/crypto/index.ts b/packages/core/src/crypto/index.ts index efcd95e12..6b6203412 100644 --- a/packages/core/src/crypto/index.ts +++ b/packages/core/src/crypto/index.ts @@ -1,8 +1,8 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -export * from "./crypto.js"; export * from "./KeyOrAlias.js"; export { default as LightsparkSigningException } from "./LightsparkSigningException.js"; export { default as NodeKeyCache } from "./NodeKeyCache.js"; export * from "./SigningKey.js"; +export * from "./crypto.js"; export * from "./types.js"; diff --git a/packages/core/src/crypto/tests/crypto.test.ts b/packages/core/src/crypto/tests/crypto.test.ts index 7a474027d..0ce327ae0 100644 --- a/packages/core/src/crypto/tests/crypto.test.ts +++ b/packages/core/src/crypto/tests/crypto.test.ts @@ -1,5 +1,5 @@ import { describe, expect, test } from "@jest/globals"; -import { b64encode, DefaultCrypto } from "../../index.js"; +import { DefaultCrypto, b64encode } from "../../index.js"; describe("Crypto tests", () => { test("should generate a key", async () => { diff --git a/packages/core/src/index.ts b/packages/core/src/index.ts index e48604053..48f6c948a 100644 --- a/packages/core/src/index.ts +++ b/packages/core/src/index.ts @@ -1,13 +1,13 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -export * from "./auth/index.js"; -export * from "./constants/index.js"; -export * from "./crypto/index.js"; export { default as LightsparkException } from "./LightsparkException.js"; export { Logger } from "./Logger.js"; -export * from "./requester/index.js"; export { - apiDomainForEnvironment, default as ServerEnvironment, + apiDomainForEnvironment, } from "./ServerEnvironment.js"; +export * from "./auth/index.js"; +export * from "./constants/index.js"; +export * from "./crypto/index.js"; +export * from "./requester/index.js"; export * from "./utils/index.js"; diff --git a/packages/core/src/requester/Query.ts b/packages/core/src/requester/Query.ts index d01db6efa..e58c950fe 100644 --- a/packages/core/src/requester/Query.ts +++ b/packages/core/src/requester/Query.ts @@ -7,7 +7,10 @@ type Query = { /** The variables that will be passed to the query. **/ variables?: { [key: string]: unknown }; - /** The function that will be called to construct the object from the response. **/ + /** + * The function that will be called to construct the object from the + * response. * + */ constructObject: (rawData: any) => T; // eslint-disable-line @typescript-eslint/no-explicit-any -- LIG-3400 /** The id of the node that will be used to sign the query. **/ diff --git a/packages/core/src/utils/currency.ts b/packages/core/src/utils/currency.ts index 66556cbf3..0bfdd2bc0 100644 --- a/packages/core/src/utils/currency.ts +++ b/packages/core/src/utils/currency.ts @@ -7,26 +7,53 @@ import { isNumber, round } from "./numbers.js"; export const defaultCurrencyCode = "USD"; -/** This enum identifies the unit of currency associated with a CurrencyAmount. **/ +/** + * This enum identifies the unit of currency associated with a CurrencyAmount. + * * + */ export enum CurrencyUnit { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", - /** Bitcoin is the cryptocurrency native to the Bitcoin network. It is used as the native medium for value transfer for the Lightning Network. **/ + /** + * Bitcoin is the cryptocurrency native to the Bitcoin network. + * It is used as the native medium for value transfer for the Lightning + * Network. * + */ BITCOIN = "BITCOIN", - /** 0.00000001 (10e-8) Bitcoin or one hundred millionth of a Bitcoin. This is the unit most commonly used in Lightning transactions. **/ + /** + * 0.00000001 (10e-8) Bitcoin or one hundred millionth of a Bitcoin. + * This is the unit most commonly used in Lightning transactions. + * * + */ SATOSHI = "SATOSHI", - /** 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible. **/ + /** + * 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit + * instead when possible. * + */ MILLISATOSHI = "MILLISATOSHI", /** United States Dollar. **/ USD = "USD", - /** 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/ + /** + * 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin. + * We recommend using the Satoshi unit instead when possible. + * * + */ NANOBITCOIN = "NANOBITCOIN", - /** 0.000001 (10e-6) Bitcoin or a millionth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/ + /** + * 0.000001 (10e-6) Bitcoin or a millionth of a Bitcoin. + * We recommend using the Satoshi unit instead when possible. + * * + */ MICROBITCOIN = "MICROBITCOIN", - /** 0.001 (10e-3) Bitcoin or a thousandth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/ + /** + * 0.001 (10e-3) Bitcoin or a thousandth of a Bitcoin. + * We recommend using the Satoshi unit instead when possible. + * * + */ MILLIBITCOIN = "MILLIBITCOIN", } @@ -39,13 +66,15 @@ export type CurrencyAmountType = { /** The unit of user's preferred currency. **/ preferredCurrencyUnit: CurrencyUnit; /** - * The rounded numeric value for this CurrencyAmount in the very base level of user's preferred - * currency. For example, for USD, the value will be in cents. + * The rounded numeric value for this CurrencyAmount in the very base level + * of user's preferred currency. For example, for USD, the value will be in + * cents. **/ preferredCurrencyValueRounded: number; /** - * The approximate float value for this CurrencyAmount in the very base level of user's preferred - * currency. For example, for USD, the value will be in cents. + * The approximate float value for this CurrencyAmount in the very base level + * of user's preferred currency. For example, for USD, the value will be in + * cents. **/ preferredCurrencyValueApprox: number; }; @@ -211,8 +240,12 @@ export type CurrencyMap = { }; export type CurrencyAmountObj = { - /* Technically the generated graphql schema has value as `any` but it's always a number. - We are intentionally widening the type here to allow for more forgiving input: */ + /* + * Technically the generated graphql schema has value as `any` but it's + * always a number. + * We are intentionally widening the type here to allow for more forgiving + * input: + */ value?: number | string | null; /* assume satoshi if not provided */ unit?: CurrencyUnit; @@ -402,7 +435,10 @@ export function formatCurrencyStr( let { value: num } = currencyAmount; const { unit } = currencyAmount; - /* Currencies should always be represented in the smallest unit, e.g. cents for USD: */ + /** + * Currencies should always be represented in the smallest unit, e.g. + * cents for USD: + */ if (unit === CurrencyUnit.USD) { num = num / 100; } @@ -415,7 +451,8 @@ export function formatCurrencyStr( : maxFractionDigits; } - // Symbol handled by toLocaleString for USD. These rely on the LightsparkIcons font + // Symbol handled by toLocaleString for USD. + // These rely on the LightsparkIcons font const symbol = !showBtcSymbol ? "" : unit === CurrencyUnit.BITCOIN @@ -472,7 +509,8 @@ export function localeToCurrencySymbol(locale: string) { maximumFractionDigits: 0, }).format(0); - // Remove numeric and non-breaking space characters to extract the currency symbol + // Remove numeric and non-breaking space characters to extract the currency + // symbol const { symbol } = separateCurrencyStrParts(formatted); return symbol; } diff --git a/packages/core/src/utils/localeToCurrencyCodes.ts b/packages/core/src/utils/localeToCurrencyCodes.ts index 9014889b5..1d14c77c1 100644 --- a/packages/core/src/utils/localeToCurrencyCodes.ts +++ b/packages/core/src/utils/localeToCurrencyCodes.ts @@ -1,5 +1,7 @@ /* From https://github.com/tadeegan/locale-currency. For now only USD conversion from - BTC is supported by sparkcore, strip additional currency codes from the bundle: */ + * BTC is supported by sparkcore, strip additional currency codes from the + * bundle: + */ export const countryCodesToCurrencyCodes = { AD: "EUR", // AE: "AED", diff --git a/packages/core/src/utils/types.ts b/packages/core/src/utils/types.ts index 790df82b1..2e0c02e1f 100644 --- a/packages/core/src/utils/types.ts +++ b/packages/core/src/utils/types.ts @@ -4,7 +4,7 @@ export type Maybe = T | null | undefined; export type ExpandRecursively = T extends object ? T extends infer O - ? { [K in keyof O]: ExpandRecursively } // eslint-disable-line @typescript-eslint/no-unused-vars + ? { [K in keyof O]: ExpandRecursively } : never : T; diff --git a/packages/eslint-config/base.js b/packages/eslint-config/base.js index 671a7bc9f..d75dcf01a 100644 --- a/packages/eslint-config/base.js +++ b/packages/eslint-config/base.js @@ -1,5 +1,14 @@ const path = require("path"); +const commentOptions = { + mode: "overflow-only", + maxLength: 80, + logicalWrap: true, + ignoreUrls: true, + ignoreCommentsWithCode: true, + tabSize: 2, +}; + module.exports = { root: true, @@ -15,13 +24,22 @@ module.exports = { overrides: [ { + /* All Typescript files, including tests and files outside src: */ files: ["**/*.ts?(x)"], - extends: ["plugin:@typescript-eslint/recommended-type-checked"], + extends: [ + "eslint:recommended", + "plugin:@typescript-eslint/recommended", + "plugin:comment-length/recommended", + ], parser: "@typescript-eslint/parser", - parserOptions: { - project: [path.join(process.cwd(), "tsconfig.json")], - }, rules: { + /* TypeScript's `noFallthroughCasesInSwitch` option is more robust */ + "default-case": "off", + /* tsc already handles this */ + "no-dupe-class-members": "off", + /* tsc already handles this */ + "no-undef": "off", + /* Add TypeScript specific rules (and turn off ESLint equivalents) */ "@typescript-eslint/consistent-type-imports": [ "error", { @@ -30,20 +48,81 @@ module.exports = { fixStyle: "inline-type-imports", }, ], + "@typescript-eslint/consistent-type-assertions": [ + "error", + { assertionStyle: "as" }, + ], + "no-use-before-define": "off", + "@typescript-eslint/no-use-before-define": [ + "error", + { + functions: false, + classes: false, + variables: false, + typedefs: false, + }, + ], + "no-unused-expressions": "off", + "@typescript-eslint/no-unused-expressions": [ + "error", + { + allowShortCircuit: true, + allowTernary: true, + allowTaggedTemplates: true, + }, + ], + "no-unused-vars": "off", + "@typescript-eslint/no-unused-vars": [ + "error", + { + args: "none", + ignoreRestSiblings: true, + }, + ], + "no-array-constructor": "off", + "@typescript-eslint/no-array-constructor": "warn", + + /* Other overrides */ + "no-extra-boolean-cast": "off", + "comment-length/limit-single-line-comments": ["error", commentOptions], + "comment-length/limit-multi-line-comments": ["error", commentOptions], + "comment-length/limit-multi-line-comments": [ + "error", + { + tags: ["css"], + ...commentOptions, + }, + ], }, }, { + /* Typescript files in workspace `src` folders with extra tsconfig aware lint rules: */ + files: ["**/src/**/*.ts?(x)"], + excludedFiles: ["**/tests/**"], + extends: ["plugin:@typescript-eslint/recommended-type-checked"], + parserOptions: { + project: [path.join(process.cwd(), "tsconfig.json")], + }, + rules: {}, + }, + { + /* Typescript test files: */ files: ["**/tests/**/*.ts?(x)"], + parser: "@typescript-eslint/parser", parserOptions: { /* Allow linting for test files with tsconfig-test: */ project: [path.join(process.cwd(), "./tsconfig-test.json")], }, }, { - files: ["**/*.ts?(x)"], - excludedFiles: ["src/**"], - /* Allow linting for files outside workspace src folders: */ - extends: ["plugin:@typescript-eslint/disable-type-checked"], + /* Javascript files outside `src` directory, presumed to be Node.js config or scripts */ + files: ["**/*.?(m|c)js?(x)"], + excludedFiles: ["**/src/**/*"], + env: { + node: true, + }, + excludedFiles: ["**/src/**/*"], + extends: ["eslint:recommended"], }, ], }; diff --git a/packages/eslint-config/react-lib/constants.js b/packages/eslint-config/constants/react-restricted-imports.js similarity index 100% rename from packages/eslint-config/react-lib/constants.js rename to packages/eslint-config/constants/react-restricted-imports.js diff --git a/packages/eslint-config/cra-jest.js b/packages/eslint-config/cra-jest.js deleted file mode 100644 index 4a0a8b619..000000000 --- a/packages/eslint-config/cra-jest.js +++ /dev/null @@ -1,36 +0,0 @@ -// from https://github.com/facebook/create-react-app/blob/main/packages/eslint-config-react-app/jest.js - -"use strict"; - -// Fix eslint shareable config (https://github.com/eslint/eslint/issues/3458) -require("@rushstack/eslint-patch/modern-module-resolution"); - -// We use eslint-loader so even warnings are very visible. -// This is why we prefer to use "WARNING" level for potential errors, -// and we try not to use "ERROR" level at all. - -module.exports = { - plugins: ["jest"], - overrides: [ - { - extends: ["plugin:testing-library/react"], - files: ["**/__tests__/**/*", "**/*.{spec,test}.*"], - env: { - "jest/globals": true, - }, - // A subset of the recommended rules: - rules: { - // https://github.com/jest-community/eslint-plugin-jest - "jest/no-conditional-expect": "error", - "jest/no-identical-title": "error", - "jest/no-interpolation-in-snapshots": "error", - "jest/no-jasmine-globals": "error", - "jest/no-mocks-import": "error", - "jest/valid-describe-callback": "error", - "jest/valid-expect": "error", - "jest/valid-expect-in-promise": "error", - "jest/valid-title": "warn", - }, - }, - ], -}; diff --git a/packages/eslint-config/cra.js b/packages/eslint-config/cra.js deleted file mode 100644 index 28bbf4b77..000000000 --- a/packages/eslint-config/cra.js +++ /dev/null @@ -1,283 +0,0 @@ -/* Config adopted originally from CRA with some slight modifications to allow extending our base config. - We'll move towards an updated set of rules over time but leaving for now to keep compatibility with - existing code */ - -const restrictedGlobals = require("confusing-browser-globals"); - -module.exports = { - plugins: ["react", "import", "flowtype", "jsx-a11y", "react-hooks"], - - settings: { - react: { - version: "detect", - }, - }, - - env: { - browser: true, - commonjs: true, - es6: true, - jest: true, - node: true, - }, - - overrides: [ - { - files: ["**/*.ts?(x)"], - parserOptions: { - ecmaVersion: 2018, - sourceType: "module", - ecmaFeatures: { - jsx: true, - }, - - // typescript-eslint specific options - warnOnUnsupportedTypeScriptVersion: true, - }, - // If adding a typescript-eslint version of an existing ESLint rule, - // make sure to disable the ESLint rule here. - rules: { - // TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906) - "default-case": "off", - // 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291) - "no-dupe-class-members": "off", - // 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477) - "no-undef": "off", - - // Add TypeScript specific rules (and turn off ESLint equivalents) - "@typescript-eslint/consistent-type-assertions": "warn", - "no-array-constructor": "off", - "@typescript-eslint/no-array-constructor": "warn", - "no-redeclare": "off", - "@typescript-eslint/no-redeclare": "warn", - "no-use-before-define": "off", - "@typescript-eslint/no-use-before-define": [ - "warn", - { - functions: false, - classes: false, - variables: false, - typedefs: false, - }, - ], - "no-unused-expressions": "off", - "@typescript-eslint/no-unused-expressions": [ - "error", - { - allowShortCircuit: true, - allowTernary: true, - allowTaggedTemplates: true, - }, - ], - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": [ - "warn", - { - args: "none", - ignoreRestSiblings: true, - }, - ], - }, - }, - ], - - // NOTE: When adding rules here, you need to make sure they are compatible with - // `typescript-eslint`, as some rules such as `no-array-constructor` aren't compatible. - rules: { - "react/jsx-uses-vars": "warn", - "react/jsx-uses-react": "warn", - - // http://eslint.org/docs/rules/ - "array-callback-return": "warn", - "default-case": ["warn", { commentPattern: "^no default$" }], - "dot-location": ["warn", "property"], - eqeqeq: ["warn", "smart"], - "new-parens": "warn", - "no-array-constructor": "warn", - "no-caller": "warn", - "no-cond-assign": ["warn", "except-parens"], - "no-const-assign": "warn", - "no-control-regex": "warn", - "no-delete-var": "warn", - "no-dupe-args": "warn", - "no-dupe-class-members": "warn", - "no-dupe-keys": "warn", - "no-duplicate-case": "warn", - "no-empty-character-class": "warn", - "no-empty-pattern": "warn", - "no-eval": "warn", - "no-ex-assign": "warn", - "no-extend-native": "warn", - "no-extra-bind": "warn", - "no-extra-label": "warn", - "no-fallthrough": "warn", - "no-func-assign": "warn", - "no-implied-eval": "warn", - "no-invalid-regexp": "warn", - "no-iterator": "warn", - "no-label-var": "warn", - "no-labels": ["warn", { allowLoop: true, allowSwitch: false }], - "no-lone-blocks": "warn", - "no-loop-func": "warn", - "no-mixed-operators": [ - "warn", - { - groups: [ - ["&", "|", "^", "~", "<<", ">>", ">>>"], - ["==", "!=", "===", "!==", ">", ">=", "<", "<="], - ["&&", "||"], - ["in", "instanceof"], - ], - allowSamePrecedence: false, - }, - ], - "no-multi-str": "warn", - "no-global-assign": "warn", - "no-unsafe-negation": "warn", - "no-new-func": "warn", - "no-new-object": "warn", - "no-new-symbol": "warn", - "no-new-wrappers": "warn", - "no-obj-calls": "warn", - "no-octal": "warn", - "no-octal-escape": "warn", - "no-redeclare": "warn", - "no-regex-spaces": "warn", - "no-restricted-syntax": ["warn", "WithStatement"], - "no-script-url": "warn", - "no-self-assign": "warn", - "no-self-compare": "warn", - "no-sequences": "warn", - "no-shadow-restricted-names": "warn", - "no-sparse-arrays": "warn", - "no-template-curly-in-string": "warn", - "no-this-before-super": "warn", - "no-throw-literal": "warn", - "no-undef": "error", - "no-restricted-globals": ["error"].concat(restrictedGlobals), - "no-unreachable": "warn", - "no-unused-expressions": [ - "error", - { - allowShortCircuit: true, - allowTernary: true, - allowTaggedTemplates: true, - }, - ], - "no-unused-labels": "warn", - "no-unused-vars": [ - "warn", - { - args: "none", - ignoreRestSiblings: true, - }, - ], - "no-use-before-define": [ - "warn", - { - functions: false, - classes: false, - variables: false, - }, - ], - "no-useless-computed-key": "warn", - "no-useless-concat": "warn", - "no-useless-constructor": "warn", - "no-useless-escape": "warn", - "no-useless-rename": [ - "warn", - { - ignoreDestructuring: false, - ignoreImport: false, - ignoreExport: false, - }, - ], - "no-with": "warn", - "no-whitespace-before-property": "warn", - "react-hooks/exhaustive-deps": "warn", - "require-yield": "warn", - "rest-spread-spacing": ["warn", "never"], - strict: ["warn", "never"], - "unicode-bom": ["warn", "never"], - "use-isnan": "warn", - "valid-typeof": "warn", - "no-restricted-properties": [ - "error", - { - object: "require", - property: "ensure", - message: - "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting", - }, - { - object: "System", - property: "import", - message: - "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting", - }, - ], - "getter-return": "warn", - - // https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules - "import/first": "error", - "import/no-amd": "error", - "import/no-anonymous-default-export": "warn", - "import/no-webpack-loader-syntax": "error", - - // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules - "react/forbid-foreign-prop-types": ["warn", { allowInPropTypes: true }], - "react/jsx-no-comment-textnodes": "warn", - "react/jsx-no-duplicate-props": "warn", - "react/jsx-no-target-blank": "warn", - "react/jsx-no-undef": "error", - "react/jsx-pascal-case": [ - "warn", - { - allowAllCaps: true, - ignore: [], - }, - ], - "react/no-danger-with-children": "warn", - // Disabled because of undesirable warnings - // See https://github.com/facebook/create-react-app/issues/5204 for - // blockers until its re-enabled - // 'react/no-deprecated': 'warn', - "react/no-direct-mutation-state": "warn", - "react/no-is-mounted": "warn", - "react/no-typos": "error", - "react/require-render-return": "error", - "react/style-prop-object": "warn", - - // https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules - "jsx-a11y/alt-text": "warn", - "jsx-a11y/anchor-has-content": "warn", - "jsx-a11y/anchor-is-valid": [ - "warn", - { - aspects: ["noHref", "invalidHref"], - }, - ], - "jsx-a11y/aria-activedescendant-has-tabindex": "warn", - "jsx-a11y/aria-props": "warn", - "jsx-a11y/aria-proptypes": "warn", - "jsx-a11y/aria-role": ["warn", { ignoreNonDOM: true }], - "jsx-a11y/aria-unsupported-elements": "warn", - "jsx-a11y/heading-has-content": "warn", - "jsx-a11y/iframe-has-title": "warn", - "jsx-a11y/img-redundant-alt": "warn", - "jsx-a11y/no-access-key": "warn", - "jsx-a11y/no-distracting-elements": "warn", - "jsx-a11y/no-redundant-roles": "warn", - "jsx-a11y/role-has-required-aria-props": "warn", - "jsx-a11y/role-supports-aria-props": "warn", - "jsx-a11y/scope": "warn", - - // https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks - "react-hooks/rules-of-hooks": "error", - - // https://github.com/gajus/eslint-plugin-flowtype - "flowtype/define-flow-type": "warn", - "flowtype/require-valid-file-annotation": "warn", - "flowtype/use-flow-type": "warn", - }, -}; diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 046a426f8..b566acdd7 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -19,6 +19,7 @@ "webpack": "5.88.2" }, "dependencies": { - "@typescript-eslint/eslint-plugin": "^6.2.0" + "@typescript-eslint/eslint-plugin": "^6.2.0", + "eslint-plugin-comment-length": "^1.7.2" } } diff --git a/packages/eslint-config/react-app.js b/packages/eslint-config/react-app.js index d92682766..f57ec89c3 100644 --- a/packages/eslint-config/react-app.js +++ b/packages/eslint-config/react-app.js @@ -1,9 +1,9 @@ const baseRestrictedImportPaths = - require("./react-lib/constants").restrictedImportPaths; + require("./constants/react-restricted-imports").restrictedImportPaths; module.exports = { - extends: ["./react-lib/config"], - ignorePatterns: ["src/generated/", "storybook-static/"], + extends: ["./react-lib"], + ignorePatterns: ["src/generated/"], rules: { "no-restricted-imports": [ "error", @@ -20,7 +20,7 @@ module.exports = { importNames: ["Link", "Navigate", "useNavigate"], message: "Please use typesafe imports from components/router instead.", - name: "@lightsparkdev/ui/router", + name: "@lightsparkdev/ui/src/router", }, { importNames: ["default", "QRCodeSVG"], @@ -28,28 +28,6 @@ module.exports = { "Please use imports from @lightsparkdev/ui components instead.", name: "qrcode.react", }, - { - importNames: [ - "Button", - "ButtonProps", - "ButtonRow", - "ButtonRowContainer", - ], - message: - "Please do not import typesafe route components directly, use bound versions from src/components/[COMPONENT] instead.", - name: "@lightsparkdev/ui/components", - }, - { - importNames: [ - "CardFormTextWithLink", - "Dropdown", - "Table", - "TableCell", - ], - message: - "Please do not import typesafe route components directly, use bound versions from src/components/[COMPONENT] instead.", - name: "@lightsparkdev/private-ui/src/components", - }, { importNames: ["useWhatChanged"], message: "This is for use in local development only.", @@ -67,17 +45,28 @@ module.exports = { message: "Please do not import services directly, use Services class to access.", }, + { + group: [ + "@lightsparkdev/ui", + "@lightsparkdev/ui/**", + "@lightsparkdev/private-ui", + "@lightsparkdev/private-ui/**", + ], + importNames: [ + "Button", + "ButtonProps", + "ButtonRow", + "ButtonRowContainer", + "CardFormTextWithLink", + "Dropdown", + "Table", + "TableCell", + ], + message: + "Please do not import typesafe route components directly, use bound versions from src/components/[COMPONENT] instead.", + }, ], }, ], }, - overrides: [ - { - files: ["src/**/__tests__/**/*", "cypress/**/*"], - rules: { - "@typescript-eslint/no-explicit-any": "warn", - "@typescript-eslint/no-unused-vars": "warn", - }, - }, - ], }; diff --git a/packages/eslint-config/react-lib.js b/packages/eslint-config/react-lib.js new file mode 100644 index 000000000..ba3e4072a --- /dev/null +++ b/packages/eslint-config/react-lib.js @@ -0,0 +1,244 @@ +const restrictedGlobals = require("confusing-browser-globals"); +const constants = require("./constants/react-restricted-imports"); + +module.exports = { + extends: ["./base"], + plugins: [ + "react", + "import", + "flowtype", + "jsx-a11y", + "react-hooks", + "jest", + "testing-library", + ], + settings: { + react: { + version: "detect", + }, + }, + env: { + browser: true, + commonjs: true, + es6: true, + jest: true, + node: true, + }, + overrides: [ + { + files: ["**/src/**/*.ts?(x)"], + excludedFiles: ["**/tests/**/*"], + /* NOTE: When adding rules here, you need to make sure they are compatible with + `typescript-eslint`, as some rules such as `no-array-constructor` aren't compatible. */ + rules: { + "react/jsx-uses-vars": "warn", + "react/jsx-uses-react": "warn", + + // http://eslint.org/docs/rules/ + "array-callback-return": "warn", + "dot-location": ["warn", "property"], + eqeqeq: ["warn", "smart"], + "new-parens": "warn", + "no-array-constructor": "warn", + "no-caller": "warn", + "no-cond-assign": ["warn", "except-parens"], + "no-const-assign": "warn", + "no-control-regex": "warn", + "no-delete-var": "warn", + "no-dupe-args": "warn", + "no-dupe-class-members": "warn", + "no-dupe-keys": "warn", + "no-duplicate-case": "warn", + "no-empty-character-class": "warn", + "no-empty-pattern": "warn", + "no-eval": "warn", + "no-ex-assign": "warn", + "no-extend-native": "warn", + "no-extra-bind": "warn", + "no-extra-label": "warn", + "no-fallthrough": "warn", + "no-func-assign": "warn", + "no-implied-eval": "warn", + "no-invalid-regexp": "warn", + "no-iterator": "warn", + "no-label-var": "warn", + "no-labels": ["warn", { allowLoop: true, allowSwitch: false }], + "no-lone-blocks": "warn", + "no-loop-func": "warn", + "no-mixed-operators": [ + "warn", + { + groups: [ + ["&", "|", "^", "~", "<<", ">>", ">>>"], + ["==", "!=", "===", "!==", ">", ">=", "<", "<="], + ["&&", "||"], + ["in", "instanceof"], + ], + allowSamePrecedence: false, + }, + ], + "no-multi-str": "warn", + "no-global-assign": "warn", + "no-unsafe-negation": "warn", + "no-new-func": "warn", + "no-new-object": "warn", + "no-new-symbol": "warn", + "no-new-wrappers": "warn", + "no-obj-calls": "warn", + "no-octal": "warn", + "no-octal-escape": "warn", + "no-redeclare": "warn", + "no-regex-spaces": "warn", + "no-restricted-syntax": ["warn", "WithStatement"], + "no-script-url": "warn", + "no-self-assign": "warn", + "no-self-compare": "warn", + "no-sequences": "warn", + "no-shadow-restricted-names": "warn", + "no-sparse-arrays": "warn", + "no-template-curly-in-string": "warn", + "no-this-before-super": "warn", + "no-throw-literal": "warn", + "no-restricted-globals": ["error"].concat(restrictedGlobals), + "no-unreachable": "warn", + "no-unused-expressions": [ + "error", + { + allowShortCircuit: true, + allowTernary: true, + allowTaggedTemplates: true, + }, + ], + "no-unused-labels": "warn", + "no-useless-computed-key": "warn", + "no-useless-concat": "warn", + "no-useless-constructor": "warn", + "no-useless-escape": "warn", + "no-useless-rename": [ + "warn", + { + ignoreDestructuring: false, + ignoreImport: false, + ignoreExport: false, + }, + ], + "no-with": "warn", + "no-whitespace-before-property": "warn", + "react-hooks/exhaustive-deps": "warn", + "require-yield": "warn", + "rest-spread-spacing": ["warn", "never"], + strict: ["warn", "never"], + "unicode-bom": ["warn", "never"], + "use-isnan": "warn", + "valid-typeof": "warn", + "no-restricted-properties": [ + "error", + { + object: "require", + property: "ensure", + message: + "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting", + }, + { + object: "System", + property: "import", + message: + "Please use import() instead. More info: https://facebook.github.io/create-react-app/docs/code-splitting", + }, + ], + "getter-return": "warn", + + // https://github.com/benmosher/eslint-plugin-import/tree/master/docs/rules + "import/first": "error", + "import/no-amd": "error", + "import/no-anonymous-default-export": "warn", + "import/no-webpack-loader-syntax": "error", + + // https://github.com/yannickcr/eslint-plugin-react/tree/master/docs/rules + "react/forbid-foreign-prop-types": ["warn", { allowInPropTypes: true }], + "react/jsx-no-comment-textnodes": "warn", + "react/jsx-no-duplicate-props": "warn", + "react/jsx-no-target-blank": "warn", + "react/jsx-no-undef": "error", + "react/jsx-pascal-case": [ + "warn", + { + allowAllCaps: true, + ignore: [], + }, + ], + "react/no-danger-with-children": "warn", + // Disabled because of undesirable warnings + // See https://github.com/facebook/create-react-app/issues/5204 for + // blockers until its re-enabled + // 'react/no-deprecated': 'warn', + "react/no-direct-mutation-state": "warn", + "react/no-is-mounted": "warn", + "react/no-typos": "error", + "react/require-render-return": "error", + "react/style-prop-object": "warn", + + // https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules + "jsx-a11y/alt-text": "warn", + "jsx-a11y/anchor-has-content": "warn", + "jsx-a11y/anchor-is-valid": [ + "warn", + { + aspects: ["noHref", "invalidHref"], + }, + ], + "jsx-a11y/aria-activedescendant-has-tabindex": "warn", + "jsx-a11y/aria-props": "warn", + "jsx-a11y/aria-proptypes": "warn", + "jsx-a11y/aria-role": ["warn", { ignoreNonDOM: true }], + "jsx-a11y/aria-unsupported-elements": "warn", + "jsx-a11y/heading-has-content": "warn", + "jsx-a11y/iframe-has-title": "warn", + "jsx-a11y/img-redundant-alt": "warn", + "jsx-a11y/no-access-key": "warn", + "jsx-a11y/no-distracting-elements": "warn", + "jsx-a11y/no-redundant-roles": "warn", + "jsx-a11y/role-has-required-aria-props": "warn", + "jsx-a11y/role-supports-aria-props": "warn", + "jsx-a11y/scope": "warn", + + // https://github.com/facebook/react/tree/main/packages/eslint-plugin-react-hooks + "react-hooks/rules-of-hooks": "error", + + // https://github.com/gajus/eslint-plugin-flowtype + "flowtype/define-flow-type": "warn", + "flowtype/require-valid-file-annotation": "warn", + "flowtype/use-flow-type": "warn", + + /* LS Rules */ + "import/no-anonymous-default-export": "off", + "no-restricted-imports": [ + "error", + { + paths: [...constants.restrictedImportPaths], + }, + ], + }, + }, + { + extends: ["plugin:testing-library/react"], + files: ["**/tests/**/*.ts?(x)"], + env: { + "jest/globals": true, + }, + // A subset of the recommended rules: + rules: { + // https://github.com/jest-community/eslint-plugin-jest + "jest/no-conditional-expect": "error", + "jest/no-identical-title": "error", + "jest/no-interpolation-in-snapshots": "error", + "jest/no-jasmine-globals": "error", + "jest/no-mocks-import": "error", + "jest/valid-describe-callback": "error", + "jest/valid-expect": "error", + "jest/valid-expect-in-promise": "error", + "jest/valid-title": "warn", + }, + }, + ], +}; diff --git a/packages/eslint-config/react-lib/config.js b/packages/eslint-config/react-lib/config.js deleted file mode 100644 index 14fe0af58..000000000 --- a/packages/eslint-config/react-lib/config.js +++ /dev/null @@ -1,17 +0,0 @@ -const constants = require("./constants"); - -module.exports = { - extends: ["../base", "../cra", "../cra-jest"], - - rules: { - /* LS Rules */ - "import/no-anonymous-default-export": "off", - "@typescript-eslint/no-unused-vars": "error", - "no-restricted-imports": [ - "error", - { - paths: [...constants.restrictedImportPaths], - }, - ], - }, -}; diff --git a/packages/lightspark-cli/package.json b/packages/lightspark-cli/package.json index 962b94b64..7ac914777 100644 --- a/packages/lightspark-cli/package.json +++ b/packages/lightspark-cli/package.json @@ -40,7 +40,7 @@ "prettier-plugin-organize-imports": "^3.2.4", "ts-node": "^10.9.1", "tsc-absolute": "^1.0.1", - "typescript": "^4.9.5" + "typescript": "^5.0.0" }, "dependencies": { "@inquirer/prompts": "^1.1.3", diff --git a/packages/lightspark-cli/src/index.ts b/packages/lightspark-cli/src/index.ts index 6ad4329af..163efc864 100644 --- a/packages/lightspark-cli/src/index.ts +++ b/packages/lightspark-cli/src/index.ts @@ -6,14 +6,14 @@ import { LightsparkSigner, Mnemonic, Seed } from "@lightsparkdev/crypto-wasm"; import { AccountTokenAuthProvider, BitcoinNetwork, - getBitcoinNetworkOrThrow, InvoiceType, - isBitcoinNetwork, LightsparkClient, + getBitcoinNetworkOrThrow, + isBitcoinNetwork, } from "@lightsparkdev/lightspark-sdk"; import { - getCredentialsFromEnvOrThrow, RequiredCredentials, + getCredentialsFromEnvOrThrow, type EnvCredentials, } from "@lightsparkdev/lightspark-sdk/env"; import type { OptionValues } from "commander"; diff --git a/packages/lightspark-sdk/examples/node-scripts/package.json b/packages/lightspark-sdk/examples/node-scripts/package.json index d2fa18483..ca51ed6f6 100644 --- a/packages/lightspark-sdk/examples/node-scripts/package.json +++ b/packages/lightspark-sdk/examples/node-scripts/package.json @@ -11,7 +11,7 @@ "license": "ISC", "devDependencies": { "ts-node": "^10.9.1", - "typescript": "^4.9.5" + "typescript": "^5.0.0" }, "dependencies": { "@lightsparkdev/core": "file:../../../core", diff --git a/packages/lightspark-sdk/package.json b/packages/lightspark-sdk/package.json index 2f153ba9a..159e69a73 100644 --- a/packages/lightspark-sdk/package.json +++ b/packages/lightspark-sdk/package.json @@ -69,7 +69,7 @@ ], "scripts": { "build": "yarn tsc && tsup", - "build:watch": "yarn build --watch", + "build:watch": "yarn build --watch --clean=false", "clean": "rm -rf .turbo && rm -rf dist", "dev": "yarn build -- --watch", "docs": "typedoc src", @@ -115,6 +115,6 @@ "tsc-absolute": "^1.0.1", "tsup": "^7.2.0", "typedoc": "^0.24.7", - "typescript": "^4.9.5" + "typescript": "^5.0.0" } } diff --git a/packages/lightspark-sdk/src/NodeKeyLoaderCache.ts b/packages/lightspark-sdk/src/NodeKeyLoaderCache.ts index 6af91be3e..ef0aa70c1 100644 --- a/packages/lightspark-sdk/src/NodeKeyLoaderCache.ts +++ b/packages/lightspark-sdk/src/NodeKeyLoaderCache.ts @@ -7,10 +7,10 @@ import { type SigningKey, } from "@lightsparkdev/core"; import { - isMasterSeedSigningKeyLoaderArgs, - isNodeIdAndPasswordSigningKeyLoaderArgs, MasterSeedSigningKeyLoader, NodeIdAndPasswordSigningKeyLoader, + isMasterSeedSigningKeyLoaderArgs, + isNodeIdAndPasswordSigningKeyLoaderArgs, type SigningKeyLoader, type SigningKeyLoaderArgs, } from "./SigningKeyLoader.js"; @@ -30,7 +30,8 @@ export default class NodeKeyLoaderCache { /** * Sets the signing key loader for a node. - * Instantiates a signing key loader based on the type of args passed in by the user. + * Instantiates a signing key loader based on the type of args passed in by + * the user. * * @param nodeId The ID of the node to get the key for * @param loaderArgs Loader arguments for loading the key diff --git a/packages/lightspark-sdk/src/SigningKeyLoader.ts b/packages/lightspark-sdk/src/SigningKeyLoader.ts index e880973d7..bd639664b 100644 --- a/packages/lightspark-sdk/src/SigningKeyLoader.ts +++ b/packages/lightspark-sdk/src/SigningKeyLoader.ts @@ -1,8 +1,8 @@ import { - b64encode, - isBrowser, LightsparkSigningException, SigningKeyType, + b64encode, + isBrowser, type CryptoInterface, type Maybe, type Requester, @@ -21,15 +21,18 @@ export type SigningKeyLoaderArgs = /** * Args for creating a new SigningKeyLoader from a node ID and password. - * This cannot be used if you are using remote signing. It is used to recover an RSA operation signing key using - * the password you chose when setting up your node. For REGTEST nodes, the password is "1234!@#$". + * This cannot be used if you are using remote signing. + * It is used to recover an RSA operation signing key using the password you + * chose when setting up your node. For REGTEST nodes, the password is + * "1234!@#$". */ export interface NodeIdAndPasswordSigningKeyLoaderArgs { password: string; } /** - * Internal version of NodeIdAndPasswordSigningKeyLoaderArgs that includes the node ID. + * Internal version of NodeIdAndPasswordSigningKeyLoaderArgs that includes the + * node ID. */ interface NodeIdAndPasswordSigningKeyLoaderArgsInternal extends NodeIdAndPasswordSigningKeyLoaderArgs { @@ -38,7 +41,8 @@ interface NodeIdAndPasswordSigningKeyLoaderArgsInternal /** * Args for creating a new SigningKeyLoader from a master seed and network. - * This should be used if you are using remote signing, rather than an RSA operation signing key. + * This should be used if you are using remote signing, + * rather than an RSA operation signing key. */ export interface MasterSeedSigningKeyLoaderArgs { masterSeed: Uint8Array; @@ -70,7 +74,8 @@ export function isMasterSeedSigningKeyLoaderArgs( } /** - * Key loader that loads an RSA signing key by providing a node ID and password to recover the key from Lightspark. + * Key loader that loads an RSA signing key by providing a node ID and password + * to recover the key from Lightspark. */ export class NodeIdAndPasswordSigningKeyLoader implements SigningKeyLoader { private readonly nodeId: string; diff --git a/packages/lightspark-sdk/src/client.ts b/packages/lightspark-sdk/src/client.ts index 9bde56d64..e38ba80c3 100644 --- a/packages/lightspark-sdk/src/client.ts +++ b/packages/lightspark-sdk/src/client.ts @@ -12,18 +12,20 @@ import type { SigningKey, } from "@lightsparkdev/core"; import { - createSha256Hash, DefaultCrypto, LightsparkAuthException, LightsparkException, LightsparkSigningException, NodeKeyCache, - pollUntil, Requester, SigningKeyType, StubAuthProvider, + createSha256Hash, + pollUntil, } from "@lightsparkdev/core"; import packageJson from "../package.json"; +import NodeKeyLoaderCache from "./NodeKeyLoaderCache.js"; +import { type SigningKeyLoaderArgs } from "./SigningKeyLoader.js"; import { BitcoinFeeEstimate as BitcoinFeeEstimateQuery } from "./graphql/BitcoinFeeEstimate.js"; import { ClaimUmaInvitation } from "./graphql/ClaimUmaInvitation.js"; import { ClaimUmaInvitationWithIncentives } from "./graphql/ClaimUmaInvitationWithIncentives.js"; @@ -45,14 +47,14 @@ import { LightningFeeEstimateForNode } from "./graphql/LightningFeeEstimateForNo import type { AccountDashboard } from "./graphql/MultiNodeDashboard.js"; import { MultiNodeDashboard } from "./graphql/MultiNodeDashboard.js"; import { PayInvoice } from "./graphql/PayInvoice.js"; -import { PaymentRequestsForNode } from "./graphql/PaymentRequestsForNode.js"; import { PayUmaInvoice } from "./graphql/PayUmaInvoice.js"; +import { PaymentRequestsForNode } from "./graphql/PaymentRequestsForNode.js"; import { RequestWithdrawal } from "./graphql/RequestWithdrawal.js"; import { SendPayment } from "./graphql/SendPayment.js"; import { SingleNodeDashboard as SingleNodeDashboardQuery } from "./graphql/SingleNodeDashboard.js"; -import { TransactionsForNode } from "./graphql/TransactionsForNode.js"; import { TransactionSubscription } from "./graphql/TransactionSubscription.js"; -import NodeKeyLoaderCache from "./NodeKeyLoaderCache.js"; +import { TransactionsForNode } from "./graphql/TransactionsForNode.js"; +import { TransactionStatus } from "./index.js"; import Account from "./objects/Account.js"; import { ApiTokenFromJson } from "./objects/ApiToken.js"; import BitcoinNetwork from "./objects/BitcoinNetwork.js"; @@ -76,10 +78,9 @@ import type RegionCode from "./objects/RegionCode.js"; import type SingleNodeDashboard from "./objects/SingleNodeDashboard.js"; import type Transaction from "./objects/Transaction.js"; import { - getTransactionQuery, TransactionFromJson, + getTransactionQuery, } from "./objects/Transaction.js"; -import TransactionStatus from "./objects/TransactionStatus.js"; import type TransactionUpdate from "./objects/TransactionUpdate.js"; import { TransactionUpdateFromJson } from "./objects/TransactionUpdate.js"; import type UmaInvitation from "./objects/UmaInvitation.js"; @@ -87,12 +88,12 @@ import { UmaInvitationFromJson } from "./objects/UmaInvitation.js"; import type WithdrawalMode from "./objects/WithdrawalMode.js"; import type WithdrawalRequest from "./objects/WithdrawalRequest.js"; import { WithdrawalRequestFromJson } from "./objects/WithdrawalRequest.js"; -import { type SigningKeyLoaderArgs } from "./SigningKeyLoader.js"; const sdkVersion = packageJson.version; /** - * The LightsparkClient is the main entrypoint for interacting with the Lightspark API. + * The LightsparkClient is the main entrypoint for interacting with the + * Lightspark API. * * ```ts * const lightsparkClient = new LightsparkClient( @@ -129,7 +130,8 @@ class LightsparkClient { * use, you should use the `AccountTokenAuthProvider`. * @param serverUrl The base URL of the server to connect to. Defaults to lightspark production. * @param cryptoImpl The crypto implementation to use. Defaults to web and node compatible crypto. - * For React Native, you should use the `ReactNativeCrypto` implementation from `@lightsparkdev/react-native`. + * For React Native, you should use the `ReactNativeCrypto` + * implementation from `@lightsparkdev/react-native`. */ constructor( private authProvider: AuthProvider = new StubAuthProvider(), @@ -154,9 +156,11 @@ class LightsparkClient { } /** - * Sets the key loader for a node. This unlocks client operations that require a private key. - * Passing in [NodeIdAndPasswordSigningKeyLoaderArgs] loads the RSA key for an OSK node. - * Passing in [MasterSeedSigningKeyLoaderArgs] loads the Secp256k1 key for a remote signing node. + * Sets the key loader for a node. This unlocks client operations that + * require a private key. Passing in [NodeIdAndPasswordSigningKeyLoaderArgs] + * loads the RSA key for an OSK node. + * Passing in [MasterSeedSigningKeyLoaderArgs] loads the Secp256k1 key for a + * remote signing node. * * @param nodeId The ID of the node the key is for * @param loader The loader for the key @@ -171,7 +175,8 @@ class LightsparkClient { } /** - * Gets the signing key for a node. Must have previously called [loadNodeSigningKey]. + * Gets the signing key for a node. Must have previously called + * [loadNodeSigningKey]. * * @param nodeId The ID of the node the key is for * @returns The signing key for the node @@ -183,7 +188,8 @@ class LightsparkClient { } /** - * Sets the auth provider for the client. This is useful for switching between auth providers if you are using + * Sets the auth provider for the client. + * This is useful for switching between auth providers if you are using * multiple accounts or waiting for the user to log in. * * @param authProvider @@ -282,7 +288,8 @@ class LightsparkClient { } /** - * Starts listening for new transactions or updates to existing transactions for a list of nodes. + * Starts listening for new transactions or updates to existing transactions + * for a list of nodes. * * @param nodeIds The node IDs for which to listen to transactions. * @returns A zen-observable that emits transaction updates for the given node IDs. @@ -305,8 +312,8 @@ class LightsparkClient { } /** - * Retrieves a dashboard of basic info for the authenticated account. See `AccountDashboard` for which info is - * included. + * Retrieves a dashboard of basic info for the authenticated account. + * See `AccountDashboard` for which info is included. * * @param nodeIds The node IDs to include in the dashboard. Defaults to undefined (all nodes). * @param bitcoinNetwork The bitcoin network to include in the dashboard. Defaults to MAINNET. @@ -397,8 +404,8 @@ class LightsparkClient { } /** - * Gets a basic dashboard for a single node, including recent transactions. See `SingleNodeDashboard` for which info is - * included. + * Gets a basic dashboard for a single node, including recent transactions. + * See `SingleNodeDashboard` for which info is included. * * @param nodeId The node ID for which to get a dashboard. * @param bitcoinNetwork The bitcoin network for which to get a dashboard. Defaults to MAINNET. @@ -479,7 +486,8 @@ class LightsparkClient { /** * Creates an invoice for the given node. * - * Test mode note: You can simulate a payment of this invoice in test move using [createTestModePayment]. + * Test mode note: You can simulate a payment of this invoice in test move + * using [createTestModePayment]. * * @param nodeId The node ID for which to create an invoice. * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount. @@ -514,11 +522,13 @@ class LightsparkClient { } /** - * Generates a Lightning Invoice (follows the Bolt 11 specification) to request a payment - * from another Lightning Node. This should only be used for generating invoices for LNURLs, + * Generates a Lightning Invoice (follows the Bolt 11 specification) to + * request a payment from another Lightning Node. + * This should only be used for generating invoices for LNURLs, * with [createInvoice] preferred in the general case. * - * Test mode note: You can simulate a payment of this invoice in test move using [createTestModePayment]. + * Test mode note: You can simulate a payment of this invoice in test move + * using [createTestModePayment]. * * @param nodeId The node ID for which to create an invoice. * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount. @@ -555,10 +565,12 @@ class LightsparkClient { } /** - * Creates a new invoice for the UMA protocol. The metadata is hashed and included in the invoice. - * This API generates a Lightning Invoice (follows the Bolt 11 specification) to request a payment - * from another Lightning Node. This should only be used for generating invoices for UMA, with `createInvoice` - * preferred in the general case. + * Creates a new invoice for the UMA protocol. + * The metadata is hashed and included in the invoice. + * This API generates a Lightning Invoice (follows the Bolt 11 specification) + * to request a payment from another Lightning Node. + * This should only be used for generating invoices for UMA, + * with `createInvoice` preferred in the general case. * * @param nodeId The node ID for which to create an invoice. * @param amountMsats The amount of the invoice in msats. You can create a zero-amount invoice to accept any payment amount. @@ -606,7 +618,8 @@ class LightsparkClient { } /** - * Gets an estimate of the fee for sending a payment over the given bitcoin network. + * Gets an estimate of the fee for sending a payment over the given bitcoin + * network. * * @param bitcoinNetwork The bitcoin network for which to get a fee estimate. Defaults to MAINNET. * @returns A fee estimate for the given bitcoin network including a minimum fee rate, and a max-speed fee rate. @@ -652,7 +665,8 @@ class LightsparkClient { } /** - * Returns an estimate of the fees that will be paid to send a payment to another Lightning node. + * Returns an estimate of the fees that will be paid to send a payment to + * another Lightning node. * * @param nodeId The node from where you want to send the payment. * @param destinationNodePublicKey The public key of the node that you want to pay. @@ -698,17 +712,20 @@ class LightsparkClient { /** * Sends a lightning payment for a given invoice. * - * Test mode note: For test mode, you can use the [createTestModeInvoice] function to create an invoice you can - * pay in test mode. + * Test mode note: For test mode, you can use the [createTestModeInvoice] + * function to create an invoice you can pay in test mode. * * @param payerNodeId The ID of the node that will pay the invoice. * @param encodedInvoice The encoded invoice to pay. * @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required. - * As guidance, a maximum fee of 16 basis points should make almost all transactions succeed. For example, - * for a transaction between 10k sats and 100k sats, this would mean a fee limit of 16 to 160 sats. + * As guidance, a maximum fee of 16 basis points should make almost all + * transactions succeed. For example, + * for a transaction between 10k sats and 100k sats, + * this would mean a fee limit of 16 to 160 sats. * @param timeoutSecs A timeout for the payment in seconds. Defaults to 60 seconds. * @param amountMsats The amount to pay in msats for a zero-amount invoice. Defaults to the full amount of the - * invoice. NOTE: This parameter can only be passed for a zero-amount invoice. Otherwise, the call will fail. + * invoice. NOTE: This parameter can only be passed for a zero-amount + * invoice. Otherwise, the call will fail. * @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed. */ public async payInvoice( @@ -749,18 +766,23 @@ class LightsparkClient { } /** - * sends an UMA payment to a node on the Lightning Network, based on the invoice - * (as defined by the BOLT11 specification) that you provide. - * This should only be used for paying UMA invoices, with `payInvoice` preferred in the general case. + * sends an UMA payment to a node on the Lightning Network, + * based on the invoice (as defined by the BOLT11 specification) that you + * provide. + * This should only be used for paying UMA invoices, + * with `payInvoice` preferred in the general case. * * @param payerNodeId The ID of the node that will pay the invoice. * @param encodedInvoice The encoded invoice to pay. * @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required. - * As guidance, a maximum fee of 16 basis points should make almost all transactions succeed. For example, - * for a transaction between 10k sats and 100k sats, this would mean a fee limit of 16 to 160 sats. + * As guidance, a maximum fee of 16 basis points should make almost all + * transactions succeed. For example, + * for a transaction between 10k sats and 100k sats, + * this would mean a fee limit of 16 to 160 sats. * @param timeoutSecs A timeout for the payment in seconds. Defaults to 60 seconds. * @param amountMsats The amount to pay in msats for a zero-amount invoice. Defaults to the full amount of the - * invoice. NOTE: This parameter can only be passed for a zero-amount invoice. Otherwise, the call will fail. + * invoice. NOTE: This parameter can only be passed for a zero-amount + * invoice. Otherwise, the call will fail. * @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed. */ public async payUmaInvoice( @@ -801,7 +823,8 @@ class LightsparkClient { } /** - * Waits for a transaction to have a completed status, and returns the transaction. + * Waits for a transaction to have a completed status, and returns the + * transaction. * * @param transactionId The ID of the transaction to wait for * @param pollTimeoutSecs The timeout in seconds that we will wait before throwing an exception @@ -848,15 +871,18 @@ class LightsparkClient { } /** - * Sends a payment directly to a node on the Lightning Network through the public key of the node without an invoice. + * Sends a payment directly to a node on the Lightning Network through the + * public key of the node without an invoice. * * @param payerNodeId The ID of the node that will send the payment. * @param destinationPublicKey The public key of the destination node. * @param timeoutSecs The timeout in seconds that we will try to make the payment. * @param amountMsats The amount to pay in msats. * @param maximumFeesMsats Maximum fees (in msats) to pay for the payment. This parameter is required. - * As guidance, a maximum fee of 15 basis points should make almost all transactions succeed. For example, - * for a transaction between 10k sats and 100k sats, this would mean a fee limit of 15 to 150 sats. + * As guidance, a maximum fee of 15 basis points should make almost all + * transactions succeed. For example, + * for a transaction between 10k sats and 100k sats, + * this would mean a fee limit of 15 to 150 sats. * @returns An `OutgoingPayment` object if the payment was successful, or undefined if the payment failed. */ public async sendPayment( @@ -894,7 +920,8 @@ class LightsparkClient { } /** - * Creates an L1 Bitcoin wallet address for a given node which can be used to deposit or withdraw funds. + * Creates an L1 Bitcoin wallet address for a given node which can be used to + * deposit or withdraw funds. * * @param nodeId The ID of the node to create a wallet address for. * @returns A string containing the wallet address for the given node. @@ -908,12 +935,15 @@ class LightsparkClient { } /** - * Withdraws funds from the account and sends it to the requested bitcoin address. + * Withdraws funds from the account and sends it to the requested bitcoin + * address. * - * Depending on the chosen mode, it will first take the funds from the wallet, and if applicable, close channels - * appropriately to recover enough funds and reopen channels with the remaining funds. - * The process is asynchronous and may take up to a few minutes. You can check the progress by polling the - * `WithdrawalRequest` that is created, or by subscribing to a webhook. + * Depending on the chosen mode, it will first take the funds from the + * wallet, and if applicable, close channels appropriately to recover enough + * funds and reopen channels with the remaining funds. + * The process is asynchronous and may take up to a few minutes. + * You can check the progress by polling the `WithdrawalRequest` that is + * created, or by subscribing to a webhook. * * @param nodeId The ID of the node from which to withdraw funds. * @param amountSats The amount of funds to withdraw in satoshis. @@ -940,9 +970,10 @@ class LightsparkClient { } /** - * Adds funds to a Lightspark node on the REGTEST network. If the amount is not specified, 10,000,000 SATOSHI will be - * added. This API only functions for nodes created on the REGTEST network and will return an error when called for - * any non-REGTEST node. + * Adds funds to a Lightspark node on the REGTEST network. + * If the amount is not specified, 10,000,000 SATOSHI will be added. + * This API only functions for nodes created on the REGTEST network and will + * return an error when called for any non-REGTEST node. * * @param nodeId The ID of the node to fund. Must be a REGTEST node. * @param amountSats The amount of funds to add to the node in satoshis. Defaults to 10,000,000 SATOSHI. @@ -960,8 +991,8 @@ class LightsparkClient { } /** - * Creates a new API token that can be used to authenticate requests for this account when using the Lightspark APIs - * and SDKs. + * Creates a new API token that can be used to authenticate requests for this + * account when using the Lightspark APIs and SDKs. * * @param name Creates a new API token that can be used to authenticate requests for this account when using the * Lightspark APIs and SDKs. @@ -1005,8 +1036,9 @@ class LightsparkClient { } /** - * In test mode, generates a Lightning Invoice which can be paid by a local node. - * This call is only valid in test mode. You can then pay the invoice using [payInvoice]. + * In test mode, generates a Lightning Invoice which can be paid by a local + * node. This call is only valid in test mode. + * You can then pay the invoice using [payInvoice]. * * @param localNodeId The ID of the node that will pay the invoice. * @param amountMsats The amount to pay in milli-satoshis. @@ -1046,8 +1078,9 @@ class LightsparkClient { } /** - * In test mode, simulates a payment of a Lightning Invoice from another node. - * This can only be used in test mode and should be used with invoices generated by [createInvoice]. + * In test mode, simulates a payment of a Lightning Invoice from another + * node. This can only be used in test mode and should be used with invoices + * generated by [createInvoice]. * * @param localNodeId The ID of the node that will receive the payment. * @param encodedInvoice The encoded invoice to pay. @@ -1079,8 +1112,8 @@ class LightsparkClient { } /** - * Creates an UMA invitation. If you are part of the incentive program, you should use - * [createUmaInvitationWithIncentives]. + * Creates an UMA invitation. If you are part of the incentive program, + * you should use [createUmaInvitationWithIncentives]. * * @param inviterUma The UMA of the inviter. * @returns The invitation that was created. @@ -1150,8 +1183,8 @@ class LightsparkClient { } /** - * Claims an UMA invitation. If you are part of the incentive program, you should use - * [claimUmaInvitationWithIncentives]. + * Claims an UMA invitation. If you are part of the incentive program, + * you should use [claimUmaInvitationWithIncentives]. * * @param invitationCode The invitation code to claim. * @param inviteeUma The UMA of the invitee. @@ -1266,7 +1299,8 @@ class LightsparkClient { /** * Executes a raw `Query` against the Lightspark API. * - * This generally should not be used directly, but is exposed for advanced use cases and for internal use to retrieve + * This generally should not be used directly, + * but is exposed for advanced use cases and for internal use to retrieve * complex fields from objects. * * @param query The `Query` to execute. diff --git a/packages/lightspark-sdk/src/env.ts b/packages/lightspark-sdk/src/env.ts index f5d0c9872..08a59d9d0 100644 --- a/packages/lightspark-sdk/src/env.ts +++ b/packages/lightspark-sdk/src/env.ts @@ -1,6 +1,8 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/* These utils are only needed in NodeJS contexts and so the file is exported separately +/* + * These utils are only needed in NodeJS contexts and so the file is exported + * separately in the package to avoid eg unnecessary browser bundling */ import dotenv from "dotenv"; import { getBitcoinNetworkOrThrow } from "./helpers.js"; diff --git a/packages/lightspark-sdk/src/objects/Account.ts b/packages/lightspark-sdk/src/objects/Account.ts index 8f76f5e8b..06b0f9a87 100644 --- a/packages/lightspark-sdk/src/objects/Account.ts +++ b/packages/lightspark-sdk/src/objects/Account.ts @@ -26,12 +26,16 @@ import type TransactionFailures from "./TransactionFailures.js"; import type TransactionStatus from "./TransactionStatus.js"; import type TransactionType from "./TransactionType.js"; -/** This is an object representing the connected Lightspark account. You can retrieve this object to see your account information and objects tied to your account. **/ +/** + * This is an object representing the connected Lightspark account. + * You can retrieve this object to see your account information and objects + * tied to your account. * + */ class Account implements LightsparkNodeOwner, Entity { constructor( /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ public readonly id: string, /** The date and time when the entity was first created. **/ diff --git a/packages/lightspark-sdk/src/objects/AccountToApiTokensConnection.ts b/packages/lightspark-sdk/src/objects/AccountToApiTokensConnection.ts index 1fceaecb9..da2d8ea1d 100644 --- a/packages/lightspark-sdk/src/objects/AccountToApiTokensConnection.ts +++ b/packages/lightspark-sdk/src/objects/AccountToApiTokensConnection.ts @@ -7,12 +7,16 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js"; interface AccountToApiTokensConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The API tokens for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/AccountToChannelsConnection.ts b/packages/lightspark-sdk/src/objects/AccountToChannelsConnection.ts index 69fd979cc..8a9e61d0d 100644 --- a/packages/lightspark-sdk/src/objects/AccountToChannelsConnection.ts +++ b/packages/lightspark-sdk/src/objects/AccountToChannelsConnection.ts @@ -7,8 +7,9 @@ import { ChannelFromJson } from "./Channel.js"; class AccountToChannelsConnection { constructor( /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current + * filters. It is different from the number of objects returned in the + * current page (in the `entities` field). **/ public readonly count: number, /** The channels for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/AccountToNodesConnection.ts b/packages/lightspark-sdk/src/objects/AccountToNodesConnection.ts index c1253615c..18b62d26f 100644 --- a/packages/lightspark-sdk/src/objects/AccountToNodesConnection.ts +++ b/packages/lightspark-sdk/src/objects/AccountToNodesConnection.ts @@ -11,12 +11,16 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js"; /** A connection between an account and the nodes it manages. **/ interface AccountToNodesConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The nodes for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/AccountToPaymentRequestsConnection.ts b/packages/lightspark-sdk/src/objects/AccountToPaymentRequestsConnection.ts index 6a01a74b4..a26200d8e 100644 --- a/packages/lightspark-sdk/src/objects/AccountToPaymentRequestsConnection.ts +++ b/packages/lightspark-sdk/src/objects/AccountToPaymentRequestsConnection.ts @@ -10,12 +10,16 @@ import { interface AccountToPaymentRequestsConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The payment requests for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/AccountToTransactionsConnection.ts b/packages/lightspark-sdk/src/objects/AccountToTransactionsConnection.ts index 86d8228f6..f4b555566 100644 --- a/packages/lightspark-sdk/src/objects/AccountToTransactionsConnection.ts +++ b/packages/lightspark-sdk/src/objects/AccountToTransactionsConnection.ts @@ -12,12 +12,16 @@ import { TransactionFromJson, TransactionToJson } from "./Transaction.js"; interface AccountToTransactionsConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The transactions for the current page of this connection. **/ @@ -27,20 +31,20 @@ interface AccountToTransactionsConnection { typename: string; /** - * Profit (or loss) generated by the transactions in this connection, with the set of filters and - * constraints provided. + * Profit (or loss) generated by the transactions in this connection, + * with the set of filters and constraints provided. **/ profitLoss?: CurrencyAmount | undefined; /** - * Average fee earned for the transactions in this connection, with the set of filters and constraints - * provided. + * Average fee earned for the transactions in this connection, + * with the set of filters and constraints provided. **/ averageFeeEarned?: CurrencyAmount | undefined; /** - * Total amount transacted by the transactions in this connection, with the set of filters and - * constraints provided. + * Total amount transacted by the transactions in this connection, + * with the set of filters and constraints provided. **/ totalAmountTransacted?: CurrencyAmount | undefined; } diff --git a/packages/lightspark-sdk/src/objects/AccountToWalletsConnection.ts b/packages/lightspark-sdk/src/objects/AccountToWalletsConnection.ts index fa4cab269..19e81b475 100644 --- a/packages/lightspark-sdk/src/objects/AccountToWalletsConnection.ts +++ b/packages/lightspark-sdk/src/objects/AccountToWalletsConnection.ts @@ -7,12 +7,16 @@ import { WalletFromJson } from "./Wallet.js"; interface AccountToWalletsConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The wallets for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/ApiToken.ts b/packages/lightspark-sdk/src/objects/ApiToken.ts index 5dff9ed5e..59bb94c0c 100644 --- a/packages/lightspark-sdk/src/objects/ApiToken.ts +++ b/packages/lightspark-sdk/src/objects/ApiToken.ts @@ -3,11 +3,16 @@ import { type Query } from "@lightsparkdev/core"; import Permission from "./Permission.js"; -/** This is an object representing a Lightspark API token, that can be used to authenticate this account when making API calls or using our SDKs. See the “Authentication” section of our API docs for more details on its usage. **/ +/** + * This is an object representing a Lightspark API token, + * that can be used to authenticate this account when making API calls or using + * our SDKs. See the “Authentication” section of our API docs for more details + * on its usage. * + */ interface ApiToken { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -18,14 +23,15 @@ interface ApiToken { updatedAt: string; /** - * An opaque identifier that should be used as a client_id (or username) in the HTTP Basic - * Authentication scheme when issuing requests against the Lightspark API. + * An opaque identifier that should be used as a client_id (or username) in + * the HTTP Basic Authentication scheme when issuing requests against the + * Lightspark API. **/ clientId: string; /** - * An arbitrary name chosen by the creator of the token to help identify the token in the list of - * tokens that have been created for the account. + * An arbitrary name chosen by the creator of the token to help identify the + * token in the list of tokens that have been created for the account. **/ name: string; diff --git a/packages/lightspark-sdk/src/objects/Balances.ts b/packages/lightspark-sdk/src/objects/Balances.ts index 003b784bb..ddd07526f 100644 --- a/packages/lightspark-sdk/src/objects/Balances.ts +++ b/packages/lightspark-sdk/src/objects/Balances.ts @@ -6,28 +6,38 @@ import { CurrencyAmountToJson, } from "./CurrencyAmount.js"; -/** This is an object representing the balance associated with your Lightspark account. You can retrieve this object to see your balance, which can be broken down into several different categorizations. **/ +/** + * This is an object representing the balance associated with your Lightspark + * account. You can retrieve this object to see your balance, + * which can be broken down into several different categorizations. + * * + */ interface Balances { /** - * This represents the balance that should be displayed when asked "how much do I own right now?". It - * represents the amount currently owned, including things that may not be owned soon (e.g. in-flight - * outgoing payments, in-flight withdrawals, commit fees, etc.). It really is a snapshot of what is - * officially owned at this instant. + * This represents the balance that should be displayed when asked "how much + * do I own right now?". It represents the amount currently owned, + * including things that may not be owned soon (e.g. in-flight outgoing + * payments, in-flight withdrawals, commit fees, etc.). + * It really is a snapshot of what is officially owned at this instant. **/ ownedBalance: CurrencyAmount; /** - * This represents the balance that should be displayed when asked "how much can I send on Lightning - * right now?". It represents the amount currently available to be sent on the Lightning network. We - * remove from the balance all the funds that are temporarily locked (e.g. channel reserves). + * This represents the balance that should be displayed when asked "how much + * can I send on Lightning right now?". + * It represents the amount currently available to be sent on the Lightning + * network. We remove from the balance all the funds that are temporarily + * locked (e.g. channel reserves). **/ availableToSendBalance: CurrencyAmount; /** - * This represents the balance that should be displayed when asked "how much money can I withdraw on - * the Bitcoin network right now?". It represents the amount currently available to withdraw and is - * usually equal to the `owned_balance` but it does not include in-flight operations (which would - * likely succeed and therefore likely make your withdrawal fail). + * This represents the balance that should be displayed when asked "how much + * money can I withdraw on the Bitcoin network right now?". + * It represents the amount currently available to withdraw and is usually + * equal to the `owned_balance` but it does not include in-flight operations + * (which would likely succeed and therefore likely make your withdrawal + * fail). **/ availableToWithdrawBalance: CurrencyAmount; } diff --git a/packages/lightspark-sdk/src/objects/BitcoinNetwork.ts b/packages/lightspark-sdk/src/objects/BitcoinNetwork.ts index 03247b137..6f203d4ce 100644 --- a/packages/lightspark-sdk/src/objects/BitcoinNetwork.ts +++ b/packages/lightspark-sdk/src/objects/BitcoinNetwork.ts @@ -3,15 +3,20 @@ /** This is an enum identifying a particular Bitcoin Network. **/ export enum BitcoinNetwork { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", /** The production version of the Bitcoin Blockchain. **/ MAINNET = "MAINNET", /** A test version of the Bitcoin Blockchain, maintained by Lightspark. **/ REGTEST = "REGTEST", - /** A test version of the Bitcoin Blockchain, maintained by a centralized organization. Not in use at Lightspark. **/ + /** + * A test version of the Bitcoin Blockchain, maintained by a centralized + * organization. Not in use at Lightspark. + * * + */ SIGNET = "SIGNET", /** A test version of the Bitcoin Blockchain, publicly available. **/ TESTNET = "TESTNET", diff --git a/packages/lightspark-sdk/src/objects/BlockchainBalance.ts b/packages/lightspark-sdk/src/objects/BlockchainBalance.ts index 4852d5003..f2063e0d9 100644 --- a/packages/lightspark-sdk/src/objects/BlockchainBalance.ts +++ b/packages/lightspark-sdk/src/objects/BlockchainBalance.ts @@ -6,7 +6,10 @@ import { CurrencyAmountToJson, } from "./CurrencyAmount.js"; -/** This is an object representing a detailed breakdown of the balance for a Lightspark Node. **/ +/** + * This is an object representing a detailed breakdown of the balance for a + * Lightspark Node. * + */ interface BlockchainBalance { /** The total wallet balance, including unconfirmed UTXOs. **/ totalBalance?: CurrencyAmount | undefined; diff --git a/packages/lightspark-sdk/src/objects/Channel.ts b/packages/lightspark-sdk/src/objects/Channel.ts index 7d3695740..3627db9b3 100644 --- a/packages/lightspark-sdk/src/objects/Channel.ts +++ b/packages/lightspark-sdk/src/objects/Channel.ts @@ -16,12 +16,16 @@ import { import type Entity from "./Entity.js"; import type TransactionType from "./TransactionType.js"; -/** This is an object representing a channel on the Lightning Network. You can retrieve this object to get detailed information on a specific Lightning Network channel. **/ +/** + * This is an object representing a channel on the Lightning Network. + * You can retrieve this object to get detailed information on a specific + * Lightning Network channel. * + */ class Channel implements Entity { constructor( /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ public readonly id: string, /** The date and time when the entity was first created. **/ @@ -35,38 +39,57 @@ class Channel implements Entity { /** The transaction that funded the channel upon channel opening. **/ public readonly fundingTransactionId?: string | undefined, /** - * The total amount of funds in this channel, including the channel balance on the local node, the - * channel balance on the remote node and the on-chain fees to close the channel. + * The total amount of funds in this channel, + * including the channel balance on the local node, + * the channel balance on the remote node and the on-chain fees to close + * the channel. **/ public readonly capacity?: CurrencyAmount | undefined, /** The channel balance on the local node. **/ public readonly localBalance?: CurrencyAmount | undefined, - /** The channel balance on the local node that is currently allocated to in-progress payments. **/ + /** + * The channel balance on the local node that is currently allocated to + * in-progress payments. * + */ public readonly localUnsettledBalance?: CurrencyAmount | undefined, /** The channel balance on the remote node. **/ public readonly remoteBalance?: CurrencyAmount | undefined, - /** The channel balance on the remote node that is currently allocated to in-progress payments. **/ + /** + * The channel balance on the remote node that is currently allocated to + * in-progress payments. * + */ public readonly remoteUnsettledBalance?: CurrencyAmount | undefined, - /** The channel balance that is currently allocated to in-progress payments. **/ + /** + * The channel balance that is currently allocated to in-progress payments. + * * + */ public readonly unsettledBalance?: CurrencyAmount | undefined, - /** The total balance in this channel, including the channel balance on both local and remote nodes. **/ + /** + * The total balance in this channel, + * including the channel balance on both local and remote nodes. + * * + */ public readonly totalBalance?: CurrencyAmount | undefined, /** The current status of this channel. **/ public readonly status?: ChannelStatus | undefined, /** - * The estimated time to wait for the channel's hash timelock contract to expire when force closing - * the channel. It is in unit of minutes. + * The estimated time to wait for the channel's hash timelock contract to + * expire when force closing the channel. It is in unit of minutes. **/ public readonly estimatedForceClosureWaitMinutes?: number | undefined, - /** The amount to be paid in fees for the current set of commitment transactions. **/ + /** + * The amount to be paid in fees for the current set of commitment + * transactions. * + */ public readonly commitFee?: CurrencyAmount | undefined, /** The fees charged for routing payments through this channel. **/ public readonly fees?: ChannelFees | undefined, /** If known, the remote node of the channel. **/ public readonly remoteNodeId?: string | undefined, /** - * The unique identifier of the channel on Lightning Network, which is the location in the chain that - * the channel was confirmed. The format is ::. + * The unique identifier of the channel on Lightning Network, + * which is the location in the chain that the channel was confirmed. + * The format is ::. **/ public readonly shortChannelId?: string | undefined, ) { diff --git a/packages/lightspark-sdk/src/objects/ChannelClosingTransaction.ts b/packages/lightspark-sdk/src/objects/ChannelClosingTransaction.ts index 2c97ba57d..d4aebc4de 100644 --- a/packages/lightspark-sdk/src/objects/ChannelClosingTransaction.ts +++ b/packages/lightspark-sdk/src/objects/ChannelClosingTransaction.ts @@ -8,11 +8,16 @@ import { } from "./CurrencyAmount.js"; import TransactionStatus from "./TransactionStatus.js"; -/** This is an object representing a transaction which closes a channel on the Lightning Network. This operation allocates balances back to the local and remote nodes. **/ +/** + * This is an object representing a transaction which closes a channel on the + * Lightning Network. This operation allocates balances back to the local and + * remote nodes. + * * + */ interface ChannelClosingTransaction { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -29,8 +34,8 @@ interface ChannelClosingTransaction { amount: CurrencyAmount; /** - * The height of the block that included this transaction. This will be zero for unconfirmed - * transactions. + * The height of the block that included this transaction. + * This will be zero for unconfirmed transactions. **/ blockHeight: number; @@ -43,22 +48,28 @@ interface ChannelClosingTransaction { /** The date and time when this transaction was completed or failed. **/ resolvedAt?: string | undefined; - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ transactionHash?: string | undefined; /** - * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin - * blockchain. + * The fees that were paid by the wallet sending the transaction to commit it + * to the Bitcoin blockchain. **/ fees?: CurrencyAmount | undefined; /** - * The hash of the block that included this transaction. This will be null for unconfirmed - * transactions. + * The hash of the block that included this transaction. + * This will be null for unconfirmed transactions. **/ blockHash?: string | undefined; - /** The number of blockchain confirmations for this transaction in real time. **/ + /** + * The number of blockchain confirmations for this transaction in real time. + * * + */ numConfirmations?: number | undefined; /** If known, the channel this transaction is closing. **/ diff --git a/packages/lightspark-sdk/src/objects/ChannelFees.ts b/packages/lightspark-sdk/src/objects/ChannelFees.ts index 6230227fb..897a3f406 100644 --- a/packages/lightspark-sdk/src/objects/ChannelFees.ts +++ b/packages/lightspark-sdk/src/objects/ChannelFees.ts @@ -6,7 +6,10 @@ import { CurrencyAmountToJson, } from "./CurrencyAmount.js"; -/** This represents the fee policies set for a channel on the Lightning Network. **/ +/** + * This represents the fee policies set for a channel on the Lightning Network. + * * + */ interface ChannelFees { baseFee?: CurrencyAmount | undefined; diff --git a/packages/lightspark-sdk/src/objects/ChannelOpeningTransaction.ts b/packages/lightspark-sdk/src/objects/ChannelOpeningTransaction.ts index b6c094dbb..87606faaa 100644 --- a/packages/lightspark-sdk/src/objects/ChannelOpeningTransaction.ts +++ b/packages/lightspark-sdk/src/objects/ChannelOpeningTransaction.ts @@ -8,11 +8,16 @@ import { } from "./CurrencyAmount.js"; import TransactionStatus from "./TransactionStatus.js"; -/** This is an object representing a transaction which opens a channel on the Lightning Network. This object occurs only for channels funded by the local Lightspark node. **/ +/** + * This is an object representing a transaction which opens a channel on the + * Lightning Network. This object occurs only for channels funded by the local + * Lightspark node. + * * + */ interface ChannelOpeningTransaction { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -29,8 +34,8 @@ interface ChannelOpeningTransaction { amount: CurrencyAmount; /** - * The height of the block that included this transaction. This will be zero for unconfirmed - * transactions. + * The height of the block that included this transaction. + * This will be zero for unconfirmed transactions. **/ blockHeight: number; @@ -43,22 +48,28 @@ interface ChannelOpeningTransaction { /** The date and time when this transaction was completed or failed. **/ resolvedAt?: string | undefined; - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ transactionHash?: string | undefined; /** - * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin - * blockchain. + * The fees that were paid by the wallet sending the transaction to commit it + * to the Bitcoin blockchain. **/ fees?: CurrencyAmount | undefined; /** - * The hash of the block that included this transaction. This will be null for unconfirmed - * transactions. + * The hash of the block that included this transaction. + * This will be null for unconfirmed transactions. **/ blockHash?: string | undefined; - /** The number of blockchain confirmations for this transaction in real time. **/ + /** + * The number of blockchain confirmations for this transaction in real time. + * * + */ numConfirmations?: number | undefined; /** If known, the channel this transaction is opening. **/ diff --git a/packages/lightspark-sdk/src/objects/ChannelStatus.ts b/packages/lightspark-sdk/src/objects/ChannelStatus.ts index 00308380a..317db7f3b 100644 --- a/packages/lightspark-sdk/src/objects/ChannelStatus.ts +++ b/packages/lightspark-sdk/src/objects/ChannelStatus.ts @@ -1,25 +1,50 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum representing the status of a channel on the Lightning Network. **/ +/** + * This is an enum representing the status of a channel on the Lightning + * Network. * + */ export enum ChannelStatus { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", /** The channel is online and ready to send and receive funds. **/ OK = "OK", - /** The channel has been created, but the Bitcoin transaction that initiates it still needs to be confirmed on the Bitcoin blockchain. **/ + /** + * The channel has been created, but the Bitcoin transaction that initiates + * it still needs to be confirmed on the Bitcoin blockchain. + * * + */ PENDING = "PENDING", /** The channel is not available, likely because the peer is not online. **/ OFFLINE = "OFFLINE", - /** The channel is behaving properly, but its remote balance is much higher than its local balance so it is not balanced properly for sending funds out. **/ + /** + * The channel is behaving properly, but its remote balance is much higher + * than its local balance so it is not balanced properly for sending funds + * out. + * * + */ UNBALANCED_FOR_SEND = "UNBALANCED_FOR_SEND", - /** The channel is behaving properly, but its remote balance is much lower than its local balance so it is not balanced properly for receiving funds. **/ + /** + * The channel is behaving properly, but its remote balance is much lower + * than its local balance so it is not balanced properly for receiving funds. + * * + */ UNBALANCED_FOR_RECEIVE = "UNBALANCED_FOR_RECEIVE", - /** The channel has been closed. Information about the channel is still available for historical purposes but the channel cannot be used anymore. **/ + /** + * The channel has been closed. Information about the channel is still + * available for historical purposes but the channel cannot be used anymore. + * * + */ CLOSED = "CLOSED", - /** Something unexpected happened and we cannot determine the status of this channel. Please try again later or contact the support. **/ + /** + * Something unexpected happened and we cannot determine the status of this + * channel. Please try again later or contact the support. + * * + */ ERROR = "ERROR", } diff --git a/packages/lightspark-sdk/src/objects/ChannelToTransactionsConnection.ts b/packages/lightspark-sdk/src/objects/ChannelToTransactionsConnection.ts index e5250afa2..1182e7bce 100644 --- a/packages/lightspark-sdk/src/objects/ChannelToTransactionsConnection.ts +++ b/packages/lightspark-sdk/src/objects/ChannelToTransactionsConnection.ts @@ -8,26 +8,27 @@ import { interface ChannelToTransactionsConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; /** - * The average fee for the transactions that transited through this channel, according to the filters - * and constraints of the connection. + * The average fee for the transactions that transited through this channel, + * according to the filters and constraints of the connection. **/ averageFee?: CurrencyAmount | undefined; /** - * The total amount transacted for the transactions that transited through this channel, according to - * the filters and constraints of the connection. + * The total amount transacted for the transactions that transited through + * this channel, according to the filters and constraints of the connection. **/ totalAmountTransacted?: CurrencyAmount | undefined; /** - * The total amount of fees for the transactions that transited through this channel, according to the - * filters and constraints of the connection. + * The total amount of fees for the transactions that transited through this + * channel, according to the filters and constraints of the connection. **/ totalFees?: CurrencyAmount | undefined; } diff --git a/packages/lightspark-sdk/src/objects/ComplianceProvider.ts b/packages/lightspark-sdk/src/objects/ComplianceProvider.ts index 6b4100aee..f05d100bb 100644 --- a/packages/lightspark-sdk/src/objects/ComplianceProvider.ts +++ b/packages/lightspark-sdk/src/objects/ComplianceProvider.ts @@ -3,8 +3,9 @@ /** This is an enum identifying a type of compliance provider. **/ export enum ComplianceProvider { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/Connection.ts b/packages/lightspark-sdk/src/objects/Connection.ts index 18f22f722..f6997e702 100644 --- a/packages/lightspark-sdk/src/objects/Connection.ts +++ b/packages/lightspark-sdk/src/objects/Connection.ts @@ -39,12 +39,16 @@ import type WalletToTransactionsConnection from "./WalletToTransactionsConnectio interface Connection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The typename of the object **/ diff --git a/packages/lightspark-sdk/src/objects/CreateApiTokenInput.ts b/packages/lightspark-sdk/src/objects/CreateApiTokenInput.ts index fb952e428..0aa004635 100644 --- a/packages/lightspark-sdk/src/objects/CreateApiTokenInput.ts +++ b/packages/lightspark-sdk/src/objects/CreateApiTokenInput.ts @@ -3,7 +3,10 @@ import Permission from "./Permission.js"; interface CreateApiTokenInput { - /** An arbitrary name that the user can choose to identify the API token in a list. **/ + /** + * An arbitrary name that the user can choose to identify the API token in a + * list. * + */ name: string; /** List of permissions to grant to the API token **/ diff --git a/packages/lightspark-sdk/src/objects/CreateApiTokenOutput.ts b/packages/lightspark-sdk/src/objects/CreateApiTokenOutput.ts index 3396c1cbc..abd1b22f8 100644 --- a/packages/lightspark-sdk/src/objects/CreateApiTokenOutput.ts +++ b/packages/lightspark-sdk/src/objects/CreateApiTokenOutput.ts @@ -8,9 +8,9 @@ interface CreateApiTokenOutput { apiToken: ApiToken; /** - * The secret that should be used to authenticate against our API. This secret is not stored and will - * never be available again after this. You must keep this secret secure as it grants access to your - * account. + * The secret that should be used to authenticate against our API. + * This secret is not stored and will never be available again after this. + * You must keep this secret secure as it grants access to your account. **/ clientSecret: string; } diff --git a/packages/lightspark-sdk/src/objects/CreateLnurlInvoiceInput.ts b/packages/lightspark-sdk/src/objects/CreateLnurlInvoiceInput.ts index 33ff166f3..3d38c088d 100644 --- a/packages/lightspark-sdk/src/objects/CreateLnurlInvoiceInput.ts +++ b/packages/lightspark-sdk/src/objects/CreateLnurlInvoiceInput.ts @@ -8,8 +8,9 @@ interface CreateLnurlInvoiceInput { amountMsats: number; /** - * The SHA256 hash of the LNURL metadata payload. This will be present in the h-tag (SHA256 purpose of - * payment) of the resulting Bolt 11 invoice. + * The SHA256 hash of the LNURL metadata payload. + * This will be present in the h-tag (SHA256 purpose of payment) of the + * resulting Bolt 11 invoice. **/ metadataHash: string; diff --git a/packages/lightspark-sdk/src/objects/CreateTestModePaymentInput.ts b/packages/lightspark-sdk/src/objects/CreateTestModePaymentInput.ts index fc77e3a7a..02591b912 100644 --- a/packages/lightspark-sdk/src/objects/CreateTestModePaymentInput.ts +++ b/packages/lightspark-sdk/src/objects/CreateTestModePaymentInput.ts @@ -8,8 +8,8 @@ interface CreateTestModePaymentInput { encodedInvoice: string; /** - * The amount you will be paid for this invoice, expressed in msats. It should ONLY be set when the - * invoice amount is zero. + * The amount you will be paid for this invoice, expressed in msats. + * It should ONLY be set when the invoice amount is zero. **/ amountMsats?: number | undefined; } diff --git a/packages/lightspark-sdk/src/objects/CreateTestModePaymentoutput.ts b/packages/lightspark-sdk/src/objects/CreateTestModePaymentoutput.ts index b86e81533..3e06937e7 100644 --- a/packages/lightspark-sdk/src/objects/CreateTestModePaymentoutput.ts +++ b/packages/lightspark-sdk/src/objects/CreateTestModePaymentoutput.ts @@ -1,6 +1,10 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an object identifying the output of a test mode payment. This object can be used to retrieve the associated payment made from a Test Mode Payment call. **/ +/** + * This is an object identifying the output of a test mode payment. + * This object can be used to retrieve the associated payment made from a Test + * Mode Payment call. * + */ interface CreateTestModePaymentoutput { /** * The payment that has been sent. diff --git a/packages/lightspark-sdk/src/objects/CurrencyAmount.ts b/packages/lightspark-sdk/src/objects/CurrencyAmount.ts index 0f3075057..ea3156caa 100644 --- a/packages/lightspark-sdk/src/objects/CurrencyAmount.ts +++ b/packages/lightspark-sdk/src/objects/CurrencyAmount.ts @@ -14,14 +14,16 @@ interface CurrencyAmount { preferredCurrencyUnit: CurrencyUnit; /** - * The rounded numeric value for this CurrencyAmount in the very base level of user's preferred - * currency. For example, for USD, the value will be in cents. + * The rounded numeric value for this CurrencyAmount in the very base level + * of user's preferred currency. For example, for USD, the value will be in + * cents. **/ preferredCurrencyValueRounded: number; /** - * The approximate float value for this CurrencyAmount in the very base level of user's preferred - * currency. For example, for USD, the value will be in cents. + * The approximate float value for this CurrencyAmount in the very base level + * of user's preferred currency. For example, for USD, the value will be in + * cents. **/ preferredCurrencyValueApprox: number; } diff --git a/packages/lightspark-sdk/src/objects/CurrencyUnit.ts b/packages/lightspark-sdk/src/objects/CurrencyUnit.ts index 52bb36c6a..fa4faa3c8 100644 --- a/packages/lightspark-sdk/src/objects/CurrencyUnit.ts +++ b/packages/lightspark-sdk/src/objects/CurrencyUnit.ts @@ -1,25 +1,52 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This enum identifies the unit of currency associated with a CurrencyAmount. **/ +/** + * This enum identifies the unit of currency associated with a CurrencyAmount. + * * + */ export enum CurrencyUnit { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", - /** Bitcoin is the cryptocurrency native to the Bitcoin network. It is used as the native medium for value transfer for the Lightning Network. **/ + /** + * Bitcoin is the cryptocurrency native to the Bitcoin network. + * It is used as the native medium for value transfer for the Lightning + * Network. * + */ BITCOIN = "BITCOIN", - /** 0.00000001 (10e-8) Bitcoin or one hundred millionth of a Bitcoin. This is the unit most commonly used in Lightning transactions. **/ + /** + * 0.00000001 (10e-8) Bitcoin or one hundred millionth of a Bitcoin. + * This is the unit most commonly used in Lightning transactions. + * * + */ SATOSHI = "SATOSHI", - /** 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit instead when possible. **/ + /** + * 0.001 Satoshi, or 10e-11 Bitcoin. We recommend using the Satoshi unit + * instead when possible. * + */ MILLISATOSHI = "MILLISATOSHI", /** United States Dollar. **/ USD = "USD", - /** 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/ + /** + * 0.000000001 (10e-9) Bitcoin or a billionth of a Bitcoin. + * We recommend using the Satoshi unit instead when possible. + * * + */ NANOBITCOIN = "NANOBITCOIN", - /** 0.000001 (10e-6) Bitcoin or a millionth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/ + /** + * 0.000001 (10e-6) Bitcoin or a millionth of a Bitcoin. + * We recommend using the Satoshi unit instead when possible. + * * + */ MICROBITCOIN = "MICROBITCOIN", - /** 0.001 (10e-3) Bitcoin or a thousandth of a Bitcoin. We recommend using the Satoshi unit instead when possible. **/ + /** + * 0.001 (10e-3) Bitcoin or a thousandth of a Bitcoin. + * We recommend using the Satoshi unit instead when possible. + * * + */ MILLIBITCOIN = "MILLIBITCOIN", } diff --git a/packages/lightspark-sdk/src/objects/Deposit.ts b/packages/lightspark-sdk/src/objects/Deposit.ts index b3ed24569..3c6576ccd 100644 --- a/packages/lightspark-sdk/src/objects/Deposit.ts +++ b/packages/lightspark-sdk/src/objects/Deposit.ts @@ -8,11 +8,16 @@ import { } from "./CurrencyAmount.js"; import TransactionStatus from "./TransactionStatus.js"; -/** This object represents a Deposit made to a Lightspark node wallet. This operation occurs for any L1 funding transaction to the wallet. You can retrieve this object to receive detailed information about the deposit. **/ +/** + * This object represents a Deposit made to a Lightspark node wallet. + * This operation occurs for any L1 funding transaction to the wallet. + * You can retrieve this object to receive detailed information about the + * deposit. * + */ interface Deposit { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -29,8 +34,8 @@ interface Deposit { amount: CurrencyAmount; /** - * The height of the block that included this transaction. This will be zero for unconfirmed - * transactions. + * The height of the block that included this transaction. + * This will be zero for unconfirmed transactions. **/ blockHeight: number; @@ -46,22 +51,28 @@ interface Deposit { /** The date and time when this transaction was completed or failed. **/ resolvedAt?: string | undefined; - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ transactionHash?: string | undefined; /** - * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin - * blockchain. + * The fees that were paid by the wallet sending the transaction to commit it + * to the Bitcoin blockchain. **/ fees?: CurrencyAmount | undefined; /** - * The hash of the block that included this transaction. This will be null for unconfirmed - * transactions. + * The hash of the block that included this transaction. + * This will be null for unconfirmed transactions. **/ blockHash?: string | undefined; - /** The number of blockchain confirmations for this transaction in real time. **/ + /** + * The number of blockchain confirmations for this transaction in real time. + * * + */ numConfirmations?: number | undefined; } diff --git a/packages/lightspark-sdk/src/objects/Entity.ts b/packages/lightspark-sdk/src/objects/Entity.ts index 3040ab8b4..e9bc8cab1 100644 --- a/packages/lightspark-sdk/src/objects/Entity.ts +++ b/packages/lightspark-sdk/src/objects/Entity.ts @@ -1,10 +1,15 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This interface is used by all the entities in the Lightspark system. It defines a few core fields that are available everywhere. Any object that implements this interface can be queried using the `entity` query and its ID. **/ +/** + * This interface is used by all the entities in the Lightspark system. + * It defines a few core fields that are available everywhere. + * Any object that implements this interface can be queried using the `entity` + * query and its ID. * + */ interface Entity { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; diff --git a/packages/lightspark-sdk/src/objects/FeeEstimate.ts b/packages/lightspark-sdk/src/objects/FeeEstimate.ts index 92b8b5ff5..d4800c3d2 100644 --- a/packages/lightspark-sdk/src/objects/FeeEstimate.ts +++ b/packages/lightspark-sdk/src/objects/FeeEstimate.ts @@ -6,7 +6,11 @@ import { CurrencyAmountToJson, } from "./CurrencyAmount.js"; -/** This object represents the estimated L1 transaction fees for the Bitcoin network. Fee estimates are separated by potential confirmation speeds for settlement. **/ +/** + * This object represents the estimated L1 transaction fees for the Bitcoin + * network. Fee estimates are separated by potential confirmation speeds for + * settlement. * + */ interface FeeEstimate { feeFast: CurrencyAmount; diff --git a/packages/lightspark-sdk/src/objects/GraphNode.ts b/packages/lightspark-sdk/src/objects/GraphNode.ts index 0f403ff76..6d3eed2a6 100644 --- a/packages/lightspark-sdk/src/objects/GraphNode.ts +++ b/packages/lightspark-sdk/src/objects/GraphNode.ts @@ -10,12 +10,18 @@ import type NodeAddressType from "./NodeAddressType.js"; import type NodeToAddressesConnection from "./NodeToAddressesConnection.js"; import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.js"; -/** This object represents a node that exists on the Lightning Network, including nodes not managed by Lightspark. You can retrieve this object to get publicly available information about any node on the Lightning Network. **/ +/** + * This object represents a node that exists on the Lightning Network, + * including nodes not managed by Lightspark. + * You can retrieve this object to get publicly available information about any + * node on the Lightning Network. + * * + */ class GraphNode implements Node, Entity { constructor( /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ public readonly id: string, /** The date and time when the entity was first created. **/ @@ -25,31 +31,41 @@ class GraphNode implements Node, Entity { /** The Bitcoin Network this node is deployed in. **/ public readonly bitcoinNetwork: BitcoinNetwork, /** - * The name of this node in the network. It will be the most human-readable option possible, depending - * on the data available for this node. + * The name of this node in the network. + * It will be the most human-readable option possible, + * depending on the data available for this node. **/ public readonly displayName: string, /** The typename of the object **/ public readonly typename: string, /** - * A name that identifies the node. It has no importance in terms of operating the node, it is just a - * way to identify and search for commercial services or popular nodes. This alias can be changed at - * any time by the node operator. + * A name that identifies the node. + * It has no importance in terms of operating the node, + * it is just a way to identify and search for commercial services or + * popular nodes. This alias can be changed at any time by the node + * operator. **/ public readonly alias?: string | undefined, /** - * A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It - * has no importance in terms of operating the node, it is just a way to visually differentiate nodes. + * A hexadecimal string that describes a color. For example "#000000" is + * black, "#FFFFFF" is white. It has no importance in terms of operating + * the node, + * it is just a way to visually differentiate nodes. * That color can be changed at any time by the node operator. **/ public readonly color?: string | undefined, /** - * A summary metric used to capture how well positioned a node is to send, receive, or route - * transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be - * capital efficient. The value is an integer ranging between 0 and 10 (bounds included). + * A summary metric used to capture how well positioned a node is to send, + * receive, or route transactions efficiently. + * Maximizing a node's conductivity helps a node’s transactions to be + * capital efficient. The value is an integer ranging between 0 and 10 + * (bounds included). **/ public readonly conductivity?: number | undefined, - /** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/ + /** + * The public key of this node. It acts as a unique identifier of this node + * in the Lightning Network. * + */ public readonly publicKey?: string | undefined, ) { autoBind(this); diff --git a/packages/lightspark-sdk/src/objects/Hop.ts b/packages/lightspark-sdk/src/objects/Hop.ts index 4838fcb03..8bbef6cbe 100644 --- a/packages/lightspark-sdk/src/objects/Hop.ts +++ b/packages/lightspark-sdk/src/objects/Hop.ts @@ -7,11 +7,16 @@ import { CurrencyAmountToJson, } from "./CurrencyAmount.js"; -/** This object represents a specific node that existed on a particular payment route. You can retrieve this object to get information about a node on a particular payment path and all payment-relevant information for that node. **/ +/** + * This object represents a specific node that existed on a particular payment + * route. You can retrieve this object to get information about a node on a + * particular payment path and all payment-relevant information for that node. + * * + */ interface Hop { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -36,7 +41,10 @@ interface Hop { /** The amount that is to be forwarded to the destination node. **/ amountToForward?: CurrencyAmount | undefined; - /** The fees to be collected by the source node for forwarding the payment over the hop. **/ + /** + * The fees to be collected by the source node for forwarding the payment + * over the hop. * + */ fee?: CurrencyAmount | undefined; /** The block height at which an unsettled HTLC is considered expired. **/ diff --git a/packages/lightspark-sdk/src/objects/HtlcAttemptFailureCode.ts b/packages/lightspark-sdk/src/objects/HtlcAttemptFailureCode.ts index 76689eb7a..d1923b9ac 100644 --- a/packages/lightspark-sdk/src/objects/HtlcAttemptFailureCode.ts +++ b/packages/lightspark-sdk/src/objects/HtlcAttemptFailureCode.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum representing a particular reason why an htlc sent over the Lightning Network may have failed. **/ +/** + * This is an enum representing a particular reason why an htlc sent over the + * Lightning Network may have failed. * + */ export enum HtlcAttemptFailureCode { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/IncentivesIneligibilityReason.ts b/packages/lightspark-sdk/src/objects/IncentivesIneligibilityReason.ts index 1e6556a3a..95c72bca8 100644 --- a/packages/lightspark-sdk/src/objects/IncentivesIneligibilityReason.ts +++ b/packages/lightspark-sdk/src/objects/IncentivesIneligibilityReason.ts @@ -1,23 +1,47 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** Describes the reason for an invitation to not be eligible for incentives. **/ +/** + * Describes the reason for an invitation to not be eligible for incentives. + * * + */ export enum IncentivesIneligibilityReason { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", - /** This invitation is not eligible for incentives because it has been created outside of the incentives flow. **/ + /** + * This invitation is not eligible for incentives because it has been created + * outside of the incentives flow. * + */ DISABLED = "DISABLED", - /** This invitation is not eligible for incentives because the sender is not eligible. **/ + /** + * This invitation is not eligible for incentives because the sender is not + * eligible. * + */ SENDER_NOT_ELIGIBLE = "SENDER_NOT_ELIGIBLE", - /** This invitation is not eligible for incentives because the receiver is not eligible. **/ + /** + * This invitation is not eligible for incentives because the receiver is not + * eligible. * + */ RECEIVER_NOT_ELIGIBLE = "RECEIVER_NOT_ELIGIBLE", - /** This invitation is not eligible for incentives because the sending VASP is not part of the incentives program. **/ + /** + * This invitation is not eligible for incentives because the sending VASP is + * not part of the incentives program. + * * + */ SENDING_VASP_NOT_ELIGIBLE = "SENDING_VASP_NOT_ELIGIBLE", - /** This invitation is not eligible for incentives because the receiving VASP is not part of the incentives program. **/ + /** + * This invitation is not eligible for incentives because the receiving VASP + * is not part of the incentives program. + * * + */ RECEIVING_VASP_NOT_ELIGIBLE = "RECEIVING_VASP_NOT_ELIGIBLE", - /** This invitation is not eligible for incentives because the sender and receiver are in the same region. **/ + /** + * This invitation is not eligible for incentives because the sender and + * receiver are in the same region. * + */ NOT_CROSS_BORDER = "NOT_CROSS_BORDER", } diff --git a/packages/lightspark-sdk/src/objects/IncentivesStatus.ts b/packages/lightspark-sdk/src/objects/IncentivesStatus.ts index 4935acf16..23c8732bc 100644 --- a/packages/lightspark-sdk/src/objects/IncentivesStatus.ts +++ b/packages/lightspark-sdk/src/objects/IncentivesStatus.ts @@ -3,15 +3,25 @@ /** Describes the status of the incentives for this invitation. **/ export enum IncentivesStatus { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", - /** The invitation is eligible for incentives in its current state. When it is claimed, we will reassess. **/ + /** + * The invitation is eligible for incentives in its current state. + * When it is claimed, we will reassess. + * * + */ PENDING = "PENDING", /** The incentives have been validated. **/ VALIDATED = "VALIDATED", - /** This invitation is not eligible for incentives. A more detailed reason can be found in the `incentives_ineligibility_reason` field. **/ + /** + * This invitation is not eligible for incentives. + * A more detailed reason can be found in the + * `incentives_ineligibility_reason` field. + * * + */ INELIGIBLE = "INELIGIBLE", } diff --git a/packages/lightspark-sdk/src/objects/IncomingPayment.ts b/packages/lightspark-sdk/src/objects/IncomingPayment.ts index 15e6c9c6b..5d254a0e5 100644 --- a/packages/lightspark-sdk/src/objects/IncomingPayment.ts +++ b/packages/lightspark-sdk/src/objects/IncomingPayment.ts @@ -21,12 +21,17 @@ import { import type Transaction from "./Transaction.js"; import TransactionStatus from "./TransactionStatus.js"; -/** This object represents any payment sent to a Lightspark node on the Lightning Network. You can retrieve this object to receive payment related information about a specific payment received by a Lightspark node. **/ +/** + * This object represents any payment sent to a Lightspark node on the + * Lightning Network. You can retrieve this object to receive payment related + * information about a specific payment received by a Lightspark node. + * * + */ class IncomingPayment implements LightningTransaction, Transaction, Entity { constructor( /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ public readonly id: string, /** The date and time when this transaction was initiated. **/ @@ -43,14 +48,20 @@ class IncomingPayment implements LightningTransaction, Transaction, Entity { public readonly typename: string, /** The date and time when this transaction was completed or failed. **/ public readonly resolvedAt?: string | undefined, - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ public readonly transactionHash?: string | undefined, /** - * The optional payment request for this incoming payment, which will be null if the payment is sent - * through keysend. + * The optional payment request for this incoming payment, + * which will be null if the payment is sent through keysend. **/ public readonly paymentRequestId?: string | undefined, - /** The post transaction data which can be used in KYT payment registration. **/ + /** + * The post transaction data which can be used in KYT payment registration. + * * + */ public readonly umaPostTransactionData?: PostTransactionData[] | undefined, ) { autoBind(this); diff --git a/packages/lightspark-sdk/src/objects/IncomingPaymentAttempt.ts b/packages/lightspark-sdk/src/objects/IncomingPaymentAttempt.ts index 361b0cf8c..6c2cd6430 100644 --- a/packages/lightspark-sdk/src/objects/IncomingPaymentAttempt.ts +++ b/packages/lightspark-sdk/src/objects/IncomingPaymentAttempt.ts @@ -8,11 +8,16 @@ import { } from "./CurrencyAmount.js"; import IncomingPaymentAttemptStatus from "./IncomingPaymentAttemptStatus.js"; -/** This object represents any attempted payment sent to a Lightspark node on the Lightning Network. You can retrieve this object to receive payment related information about a specific incoming payment attempt. **/ +/** + * This object represents any attempted payment sent to a Lightspark node on + * the Lightning Network. You can retrieve this object to receive payment + * related information about a specific incoming payment attempt. + * * + */ interface IncomingPaymentAttempt { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; diff --git a/packages/lightspark-sdk/src/objects/IncomingPaymentAttemptStatus.ts b/packages/lightspark-sdk/src/objects/IncomingPaymentAttemptStatus.ts index 176e48f67..b4ebdd078 100644 --- a/packages/lightspark-sdk/src/objects/IncomingPaymentAttemptStatus.ts +++ b/packages/lightspark-sdk/src/objects/IncomingPaymentAttemptStatus.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum that enumerates all potential statuses for an incoming payment attempt. **/ +/** + * This is an enum that enumerates all potential statuses for an incoming + * payment attempt. * + */ export enum IncomingPaymentAttemptStatus { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/IncomingPaymentToAttemptsConnection.ts b/packages/lightspark-sdk/src/objects/IncomingPaymentToAttemptsConnection.ts index 8e8b84b9f..3bdca2ce2 100644 --- a/packages/lightspark-sdk/src/objects/IncomingPaymentToAttemptsConnection.ts +++ b/packages/lightspark-sdk/src/objects/IncomingPaymentToAttemptsConnection.ts @@ -11,12 +11,16 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js"; /** The connection from incoming payment to all attempts. **/ interface IncomingPaymentToAttemptsConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The incoming payment attempts for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/Invoice.ts b/packages/lightspark-sdk/src/objects/Invoice.ts index 7eef1f1f0..bf989dab4 100644 --- a/packages/lightspark-sdk/src/objects/Invoice.ts +++ b/packages/lightspark-sdk/src/objects/Invoice.ts @@ -13,8 +13,8 @@ import PaymentRequestStatus from "./PaymentRequestStatus.js"; /** This object represents a BOLT #11 invoice (https://github.com/lightning/bolts/blob/master/11-payment-encoding.md) created by a Lightspark Node. You can retrieve this object to receive relevant payment information for a specific invoice generated by a Lightspark node. **/ interface Invoice { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; diff --git a/packages/lightspark-sdk/src/objects/InvoiceData.ts b/packages/lightspark-sdk/src/objects/InvoiceData.ts index 298284931..856ca7129 100644 --- a/packages/lightspark-sdk/src/objects/InvoiceData.ts +++ b/packages/lightspark-sdk/src/objects/InvoiceData.ts @@ -9,7 +9,11 @@ import { import type Node from "./Node.js"; import { NodeFromJson, NodeToJson } from "./Node.js"; -/** This object represents the data associated with a BOLT #11 invoice. You can retrieve this object to receive the relevant data associated with a specific invoice. **/ +/** + * This object represents the data associated with a BOLT #11 invoice. + * You can retrieve this object to receive the relevant data associated with a + * specific invoice. * + */ interface InvoiceData { encodedPaymentRequest: string; @@ -19,8 +23,8 @@ interface InvoiceData { paymentHash: string; /** - * The requested amount in this invoice. If it is equal to 0, the sender should choose the amount to - * send. + * The requested amount in this invoice. If it is equal to 0, + * the sender should choose the amount to send. **/ amount: CurrencyAmount; diff --git a/packages/lightspark-sdk/src/objects/InvoiceType.ts b/packages/lightspark-sdk/src/objects/InvoiceType.ts index 089132fc3..33df9e0d2 100644 --- a/packages/lightspark-sdk/src/objects/InvoiceType.ts +++ b/packages/lightspark-sdk/src/objects/InvoiceType.ts @@ -3,8 +3,9 @@ /** This is an enum for potential invoice types. **/ export enum InvoiceType { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", /** A standard Bolt 11 invoice. **/ diff --git a/packages/lightspark-sdk/src/objects/LightningFeeEstimateForInvoiceInput.ts b/packages/lightspark-sdk/src/objects/LightningFeeEstimateForInvoiceInput.ts index 566fc5722..bb7b51a18 100644 --- a/packages/lightspark-sdk/src/objects/LightningFeeEstimateForInvoiceInput.ts +++ b/packages/lightspark-sdk/src/objects/LightningFeeEstimateForInvoiceInput.ts @@ -8,8 +8,8 @@ interface LightningFeeEstimateForInvoiceInput { encodedPaymentRequest: string; /** - * If the invoice does not specify a payment amount, then the amount that you wish to pay, expressed - * in msats. + * If the invoice does not specify a payment amount, + * then the amount that you wish to pay, expressed in msats. **/ amountMsats?: number | undefined; } diff --git a/packages/lightspark-sdk/src/objects/LightningTransaction.ts b/packages/lightspark-sdk/src/objects/LightningTransaction.ts index 0f679f77b..c5a4e8851 100644 --- a/packages/lightspark-sdk/src/objects/LightningTransaction.ts +++ b/packages/lightspark-sdk/src/objects/LightningTransaction.ts @@ -22,11 +22,16 @@ import type RoutingTransaction from "./RoutingTransaction.js"; import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js"; import TransactionStatus from "./TransactionStatus.js"; -/** This is an object representing a transaction made over the Lightning Network. You can retrieve this object to receive information about a specific transaction made over Lightning for a Lightspark node. **/ +/** + * This is an object representing a transaction made over the Lightning + * Network. You can retrieve this object to receive information about a + * specific transaction made over Lightning for a Lightspark node. + * * + */ interface LightningTransaction { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -48,7 +53,10 @@ interface LightningTransaction { /** The date and time when this transaction was completed or failed. **/ resolvedAt?: string | undefined; - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ transactionHash?: string | undefined; } diff --git a/packages/lightspark-sdk/src/objects/LightsparkNode.ts b/packages/lightspark-sdk/src/objects/LightsparkNode.ts index a1a67e1cc..ae6c57d08 100644 --- a/packages/lightspark-sdk/src/objects/LightsparkNode.ts +++ b/packages/lightspark-sdk/src/objects/LightsparkNode.ts @@ -24,11 +24,15 @@ import type NodeAddressType from "./NodeAddressType.js"; import type NodeToAddressesConnection from "./NodeToAddressesConnection.js"; import { SecretFromJson, SecretToJson } from "./Secret.js"; -/** This is an object representing a node managed by Lightspark and owned by the current connected account. This object contains information about the node’s configuration, state, and metadata. **/ +/** + * This is an object representing a node managed by Lightspark and owned by the + * current connected account. This object contains information about the node’s + * configuration, state, and metadata. * + */ interface LightsparkNode { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -42,8 +46,9 @@ interface LightsparkNode { bitcoinNetwork: BitcoinNetwork; /** - * The name of this node in the network. It will be the most human-readable option possible, depending - * on the data available for this node. + * The name of this node in the network. + * It will be the most human-readable option possible, + * depending on the data available for this node. **/ displayName: string; @@ -51,8 +56,8 @@ interface LightsparkNode { ownerId: string; /** - * The utxos of the channels that are connected to this node. This is used in uma flow for - * pre-screening. + * The utxos of the channels that are connected to this node. + * This is used in uma flow for pre-screening. **/ umaPrescreeningUtxos: string[]; @@ -60,34 +65,43 @@ interface LightsparkNode { typename: string; /** - * A name that identifies the node. It has no importance in terms of operating the node, it is just a - * way to identify and search for commercial services or popular nodes. This alias can be changed at - * any time by the node operator. + * A name that identifies the node. It has no importance in terms of + * operating the node, it is just a way to identify and search for commercial + * services or popular nodes. This alias can be changed at any time by the + * node operator. **/ alias?: string | undefined; /** - * A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It - * has no importance in terms of operating the node, it is just a way to visually differentiate nodes. + * A hexadecimal string that describes a color. For example "#000000" is + * black, "#FFFFFF" is white. It has no importance in terms of operating the + * node, + * it is just a way to visually differentiate nodes. * That color can be changed at any time by the node operator. **/ color?: string | undefined; /** - * A summary metric used to capture how well positioned a node is to send, receive, or route - * transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be - * capital efficient. The value is an integer ranging between 0 and 10 (bounds included). + * A summary metric used to capture how well positioned a node is to send, + * receive, or route transactions efficiently. + * Maximizing a node's conductivity helps a node’s transactions to be capital + * efficient. The value is an integer ranging between 0 and 10 (bounds + * included). **/ conductivity?: number | undefined; - /** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/ + /** + * The public key of this node. It acts as a unique identifier of this node + * in the Lightning Network. * + */ publicKey?: string | undefined; /** The current status of this node. **/ status?: LightsparkNodeStatus | undefined; /** - * The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this node. + * The sum of the balance on the Bitcoin Network, channel balances, + * and commit fees on this node. * * @deprecated Use `balances` instead. **/ @@ -101,7 +115,8 @@ interface LightsparkNode { totalLocalBalance?: CurrencyAmount | undefined; /** - * The sum of the channel balances (online only) that are available to send on this node. + * The sum of the channel balances (online only) that are available to send + * on this node. * * @deprecated Use `balances` instead. **/ diff --git a/packages/lightspark-sdk/src/objects/LightsparkNodeOwner.ts b/packages/lightspark-sdk/src/objects/LightsparkNodeOwner.ts index f2cf54708..a67c0f140 100644 --- a/packages/lightspark-sdk/src/objects/LightsparkNodeOwner.ts +++ b/packages/lightspark-sdk/src/objects/LightsparkNodeOwner.ts @@ -9,8 +9,8 @@ import WalletStatus from "./WalletStatus.js"; /** This is an object representing the owner of a LightsparkNode. **/ interface LightsparkNodeOwner { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; diff --git a/packages/lightspark-sdk/src/objects/LightsparkNodeStatus.ts b/packages/lightspark-sdk/src/objects/LightsparkNodeStatus.ts index ae34adb32..511e5de94 100644 --- a/packages/lightspark-sdk/src/objects/LightsparkNodeStatus.ts +++ b/packages/lightspark-sdk/src/objects/LightsparkNodeStatus.ts @@ -2,8 +2,9 @@ export enum LightsparkNodeStatus { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/LightsparkNodeToChannelsConnection.ts b/packages/lightspark-sdk/src/objects/LightsparkNodeToChannelsConnection.ts index 030f9a65f..be89d8901 100644 --- a/packages/lightspark-sdk/src/objects/LightsparkNodeToChannelsConnection.ts +++ b/packages/lightspark-sdk/src/objects/LightsparkNodeToChannelsConnection.ts @@ -7,12 +7,16 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js"; interface LightsparkNodeToChannelsConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The channels for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/LightsparkNodeWithOSK.ts b/packages/lightspark-sdk/src/objects/LightsparkNodeWithOSK.ts index 6951c5886..49803d93c 100644 --- a/packages/lightspark-sdk/src/objects/LightsparkNodeWithOSK.ts +++ b/packages/lightspark-sdk/src/objects/LightsparkNodeWithOSK.ts @@ -33,8 +33,8 @@ import { SecretFromJson, SecretToJson } from "./Secret.js"; class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity { constructor( /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ public readonly id: string, /** The date and time when the entity was first created. **/ @@ -44,43 +44,54 @@ class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity { /** The Bitcoin Network this node is deployed in. **/ public readonly bitcoinNetwork: BitcoinNetwork, /** - * The name of this node in the network. It will be the most human-readable option possible, depending - * on the data available for this node. + * The name of this node in the network. + * It will be the most human-readable option possible, + * depending on the data available for this node. **/ public readonly displayName: string, /** The owner of this LightsparkNode. **/ public readonly ownerId: string, /** - * The utxos of the channels that are connected to this node. This is used in uma flow for - * pre-screening. + * The utxos of the channels that are connected to this node. + * This is used in uma flow for pre-screening. **/ public readonly umaPrescreeningUtxos: string[], /** The typename of the object **/ public readonly typename: string, /** - * A name that identifies the node. It has no importance in terms of operating the node, it is just a - * way to identify and search for commercial services or popular nodes. This alias can be changed at - * any time by the node operator. + * A name that identifies the node. + * It has no importance in terms of operating the node, + * it is just a way to identify and search for commercial services or + * popular nodes. This alias can be changed at any time by the node + * operator. **/ public readonly alias?: string | undefined, /** - * A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It - * has no importance in terms of operating the node, it is just a way to visually differentiate nodes. + * A hexadecimal string that describes a color. For example "#000000" is + * black, "#FFFFFF" is white. It has no importance in terms of operating + * the node, + * it is just a way to visually differentiate nodes. * That color can be changed at any time by the node operator. **/ public readonly color?: string | undefined, /** - * A summary metric used to capture how well positioned a node is to send, receive, or route - * transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be - * capital efficient. The value is an integer ranging between 0 and 10 (bounds included). + * A summary metric used to capture how well positioned a node is to send, + * receive, or route transactions efficiently. + * Maximizing a node's conductivity helps a node’s transactions to be + * capital efficient. The value is an integer ranging between 0 and 10 + * (bounds included). **/ public readonly conductivity?: number | undefined, - /** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/ + /** + * The public key of this node. It acts as a unique identifier of this node + * in the Lightning Network. * + */ public readonly publicKey?: string | undefined, /** The current status of this node. **/ public readonly status?: LightsparkNodeStatus | undefined, /** - * The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this node. + * The sum of the balance on the Bitcoin Network, channel balances, + * and commit fees on this node. * * @deprecated Use `balances` instead. **/ @@ -92,13 +103,15 @@ class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity { **/ public readonly totalLocalBalance?: CurrencyAmount | undefined, /** - * The sum of the channel balances (online only) that are available to send on this node. + * The sum of the channel balances (online only) that are available to send + * on this node. * * @deprecated Use `balances` instead. **/ public readonly localBalance?: CurrencyAmount | undefined, /** - * The sum of the channel balances that are available to receive on this node. + * The sum of the channel balances that are available to receive on this + * node. * * @deprecated Use `balances` instead. **/ @@ -111,7 +124,10 @@ class LightsparkNodeWithOSK implements LightsparkNode, Node, Entity { public readonly blockchainBalance?: BlockchainBalance | undefined, /** The balances that describe the funds in this node. **/ public readonly balances?: Balances | undefined, - /** The private key client is using to sign a GraphQL request which will be verified at server side. **/ + /** + * The private key client is using to sign a GraphQL request which will be + * verified at server side. * + */ public readonly encryptedSigningPrivateKey?: Secret | undefined, ) { autoBind(this); diff --git a/packages/lightspark-sdk/src/objects/LightsparkNodeWithRemoteSigning.ts b/packages/lightspark-sdk/src/objects/LightsparkNodeWithRemoteSigning.ts index 0a38bb81f..a67a15581 100644 --- a/packages/lightspark-sdk/src/objects/LightsparkNodeWithRemoteSigning.ts +++ b/packages/lightspark-sdk/src/objects/LightsparkNodeWithRemoteSigning.ts @@ -31,8 +31,8 @@ import { NodeToAddressesConnectionFromJson } from "./NodeToAddressesConnection.j class LightsparkNodeWithRemoteSigning implements LightsparkNode, Node, Entity { constructor( /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ public readonly id: string, /** The date and time when the entity was first created. **/ @@ -42,43 +42,54 @@ class LightsparkNodeWithRemoteSigning implements LightsparkNode, Node, Entity { /** The Bitcoin Network this node is deployed in. **/ public readonly bitcoinNetwork: BitcoinNetwork, /** - * The name of this node in the network. It will be the most human-readable option possible, depending - * on the data available for this node. + * The name of this node in the network. + * It will be the most human-readable option possible, + * depending on the data available for this node. **/ public readonly displayName: string, /** The owner of this LightsparkNode. **/ public readonly ownerId: string, /** - * The utxos of the channels that are connected to this node. This is used in uma flow for - * pre-screening. + * The utxos of the channels that are connected to this node. + * This is used in uma flow for pre-screening. **/ public readonly umaPrescreeningUtxos: string[], /** The typename of the object **/ public readonly typename: string, /** - * A name that identifies the node. It has no importance in terms of operating the node, it is just a - * way to identify and search for commercial services or popular nodes. This alias can be changed at - * any time by the node operator. + * A name that identifies the node. + * It has no importance in terms of operating the node, + * it is just a way to identify and search for commercial services or + * popular nodes. This alias can be changed at any time by the node + * operator. **/ public readonly alias?: string | undefined, /** - * A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It - * has no importance in terms of operating the node, it is just a way to visually differentiate nodes. + * A hexadecimal string that describes a color. For example "#000000" is + * black, "#FFFFFF" is white. It has no importance in terms of operating + * the node, + * it is just a way to visually differentiate nodes. * That color can be changed at any time by the node operator. **/ public readonly color?: string | undefined, /** - * A summary metric used to capture how well positioned a node is to send, receive, or route - * transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be - * capital efficient. The value is an integer ranging between 0 and 10 (bounds included). + * A summary metric used to capture how well positioned a node is to send, + * receive, or route transactions efficiently. + * Maximizing a node's conductivity helps a node’s transactions to be + * capital efficient. The value is an integer ranging between 0 and 10 + * (bounds included). **/ public readonly conductivity?: number | undefined, - /** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/ + /** + * The public key of this node. It acts as a unique identifier of this node + * in the Lightning Network. * + */ public readonly publicKey?: string | undefined, /** The current status of this node. **/ public readonly status?: LightsparkNodeStatus | undefined, /** - * The sum of the balance on the Bitcoin Network, channel balances, and commit fees on this node. + * The sum of the balance on the Bitcoin Network, channel balances, + * and commit fees on this node. * * @deprecated Use `balances` instead. **/ @@ -90,13 +101,15 @@ class LightsparkNodeWithRemoteSigning implements LightsparkNode, Node, Entity { **/ public readonly totalLocalBalance?: CurrencyAmount | undefined, /** - * The sum of the channel balances (online only) that are available to send on this node. + * The sum of the channel balances (online only) that are available to send + * on this node. * * @deprecated Use `balances` instead. **/ public readonly localBalance?: CurrencyAmount | undefined, /** - * The sum of the channel balances that are available to receive on this node. + * The sum of the channel balances that are available to receive on this + * node. * * @deprecated Use `balances` instead. **/ diff --git a/packages/lightspark-sdk/src/objects/Node.ts b/packages/lightspark-sdk/src/objects/Node.ts index 57b005556..49ea01242 100644 --- a/packages/lightspark-sdk/src/objects/Node.ts +++ b/packages/lightspark-sdk/src/objects/Node.ts @@ -20,11 +20,16 @@ import type NodeAddressType from "./NodeAddressType.js"; import type NodeToAddressesConnection from "./NodeToAddressesConnection.js"; import { SecretFromJson, SecretToJson } from "./Secret.js"; -/** This object is an interface representing a Lightning Node on the Lightning Network, and could either be a Lightspark node or a node managed by a third party. **/ +/** + * This object is an interface representing a Lightning Node on the Lightning + * Network, and could either be a Lightspark node or a node managed by a third + * party. + * * + */ interface Node { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -38,8 +43,9 @@ interface Node { bitcoinNetwork: BitcoinNetwork; /** - * The name of this node in the network. It will be the most human-readable option possible, depending - * on the data available for this node. + * The name of this node in the network. + * It will be the most human-readable option possible, + * depending on the data available for this node. **/ displayName: string; @@ -47,27 +53,35 @@ interface Node { typename: string; /** - * A name that identifies the node. It has no importance in terms of operating the node, it is just a - * way to identify and search for commercial services or popular nodes. This alias can be changed at - * any time by the node operator. + * A name that identifies the node. It has no importance in terms of + * operating the node, it is just a way to identify and search for commercial + * services or popular nodes. This alias can be changed at any time by the + * node operator. **/ alias?: string | undefined; /** - * A hexadecimal string that describes a color. For example "#000000" is black, "#FFFFFF" is white. It - * has no importance in terms of operating the node, it is just a way to visually differentiate nodes. + * A hexadecimal string that describes a color. For example "#000000" is + * black, "#FFFFFF" is white. It has no importance in terms of operating the + * node, + * it is just a way to visually differentiate nodes. * That color can be changed at any time by the node operator. **/ color?: string | undefined; /** - * A summary metric used to capture how well positioned a node is to send, receive, or route - * transactions efficiently. Maximizing a node's conductivity helps a node’s transactions to be - * capital efficient. The value is an integer ranging between 0 and 10 (bounds included). + * A summary metric used to capture how well positioned a node is to send, + * receive, or route transactions efficiently. + * Maximizing a node's conductivity helps a node’s transactions to be capital + * efficient. The value is an integer ranging between 0 and 10 (bounds + * included). **/ conductivity?: number | undefined; - /** The public key of this node. It acts as a unique identifier of this node in the Lightning Network. **/ + /** + * The public key of this node. It acts as a unique identifier of this node + * in the Lightning Network. * + */ publicKey?: string | undefined; getAddresses( diff --git a/packages/lightspark-sdk/src/objects/NodeAddressType.ts b/packages/lightspark-sdk/src/objects/NodeAddressType.ts index 5807e3e8b..38093d18b 100644 --- a/packages/lightspark-sdk/src/objects/NodeAddressType.ts +++ b/packages/lightspark-sdk/src/objects/NodeAddressType.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential types of addresses that a node on the Lightning Network can have. **/ +/** + * This is an enum of the potential types of addresses that a node on the + * Lightning Network can have. * + */ export enum NodeAddressType { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/NodeToAddressesConnection.ts b/packages/lightspark-sdk/src/objects/NodeToAddressesConnection.ts index afe34cc55..6e73333c3 100644 --- a/packages/lightspark-sdk/src/objects/NodeToAddressesConnection.ts +++ b/packages/lightspark-sdk/src/objects/NodeToAddressesConnection.ts @@ -3,11 +3,15 @@ import type NodeAddress from "./NodeAddress.js"; import { NodeAddressFromJson, NodeAddressToJson } from "./NodeAddress.js"; -/** A connection between a node and the addresses it has announced for itself on Lightning Network. **/ +/** + * A connection between a node and the addresses it has announced for itself on + * Lightning Network. * + */ interface NodeToAddressesConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; diff --git a/packages/lightspark-sdk/src/objects/OnChainTransaction.ts b/packages/lightspark-sdk/src/objects/OnChainTransaction.ts index dc9bff749..d5b2ce998 100644 --- a/packages/lightspark-sdk/src/objects/OnChainTransaction.ts +++ b/packages/lightspark-sdk/src/objects/OnChainTransaction.ts @@ -12,11 +12,17 @@ import type Deposit from "./Deposit.js"; import TransactionStatus from "./TransactionStatus.js"; import type Withdrawal from "./Withdrawal.js"; -/** This object represents an L1 transaction that occurred on the Bitcoin Network. You can retrieve this object to receive information about a specific on-chain transaction made on the Lightning Network associated with your Lightspark Node. **/ +/** + * This object represents an L1 transaction that occurred on the Bitcoin + * Network. You can retrieve this object to receive information about a + * specific on-chain transaction made on the Lightning Network associated with + * your Lightspark Node. + * * + */ interface OnChainTransaction { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -33,8 +39,8 @@ interface OnChainTransaction { amount: CurrencyAmount; /** - * The height of the block that included this transaction. This will be zero for unconfirmed - * transactions. + * The height of the block that included this transaction. + * This will be zero for unconfirmed transactions. **/ blockHeight: number; @@ -47,22 +53,28 @@ interface OnChainTransaction { /** The date and time when this transaction was completed or failed. **/ resolvedAt?: string | undefined; - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ transactionHash?: string | undefined; /** - * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin - * blockchain. + * The fees that were paid by the wallet sending the transaction to commit it + * to the Bitcoin blockchain. **/ fees?: CurrencyAmount | undefined; /** - * The hash of the block that included this transaction. This will be null for unconfirmed - * transactions. + * The hash of the block that included this transaction. + * This will be null for unconfirmed transactions. **/ blockHash?: string | undefined; - /** The number of blockchain confirmations for this transaction in real time. **/ + /** + * The number of blockchain confirmations for this transaction in real time. + * * + */ numConfirmations?: number | undefined; } diff --git a/packages/lightspark-sdk/src/objects/OutgoingPayment.ts b/packages/lightspark-sdk/src/objects/OutgoingPayment.ts index 0a596f6af..f1e337585 100644 --- a/packages/lightspark-sdk/src/objects/OutgoingPayment.ts +++ b/packages/lightspark-sdk/src/objects/OutgoingPayment.ts @@ -28,12 +28,17 @@ import { RichTextFromJson, RichTextToJson } from "./RichText.js"; import type Transaction from "./Transaction.js"; import TransactionStatus from "./TransactionStatus.js"; -/** This object represents a Lightning Network payment sent from a Lightspark Node. You can retrieve this object to receive payment related information about any payment sent from your Lightspark Node on the Lightning Network. **/ +/** + * This object represents a Lightning Network payment sent from a Lightspark + * Node. You can retrieve this object to receive payment related information + * about any payment sent from your Lightspark Node on the Lightning Network. + * * + */ class OutgoingPayment implements LightningTransaction, Transaction, Entity { constructor( /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ public readonly id: string, /** The date and time when this transaction was initiated. **/ @@ -50,19 +55,31 @@ class OutgoingPayment implements LightningTransaction, Transaction, Entity { public readonly typename: string, /** The date and time when this transaction was completed or failed. **/ public readonly resolvedAt?: string | undefined, - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ public readonly transactionHash?: string | undefined, /** If known, the final recipient node this payment was sent to. **/ public readonly destinationId?: string | undefined, /** The fees paid by the sender node to send the payment. **/ public readonly fees?: CurrencyAmount | undefined, - /** The data of the payment request that was paid by this transaction, if known. **/ + /** + * The data of the payment request that was paid by this transaction, if + * known. * + */ public readonly paymentRequestData?: PaymentRequestData | undefined, /** If applicable, the reason why the payment failed. **/ public readonly failureReason?: PaymentFailureReason | undefined, - /** If applicable, user-facing error message describing why the payment failed. **/ + /** + * If applicable, user-facing error message describing why the payment + * failed. * + */ public readonly failureMessage?: RichText | undefined, - /** The post transaction data which can be used in KYT payment registration. **/ + /** + * The post transaction data which can be used in KYT payment registration. + * * + */ public readonly umaPostTransactionData?: PostTransactionData[] | undefined, /** The preimage of the payment. **/ public readonly paymentPreimage?: string | undefined, diff --git a/packages/lightspark-sdk/src/objects/OutgoingPaymentAttempt.ts b/packages/lightspark-sdk/src/objects/OutgoingPaymentAttempt.ts index f6c31726f..736ed12ac 100644 --- a/packages/lightspark-sdk/src/objects/OutgoingPaymentAttempt.ts +++ b/packages/lightspark-sdk/src/objects/OutgoingPaymentAttempt.ts @@ -19,12 +19,19 @@ import OutgoingPaymentAttemptStatus from "./OutgoingPaymentAttemptStatus.js"; import type OutgoingPaymentAttemptToHopsConnection from "./OutgoingPaymentAttemptToHopsConnection.js"; import { OutgoingPaymentAttemptToHopsConnectionFromJson } from "./OutgoingPaymentAttemptToHopsConnection.js"; -/** This object represents an attempted Lightning Network payment sent from a Lightspark Node. You can retrieve this object to receive payment related information about any payment attempt sent from your Lightspark Node on the Lightning Network, including any potential reasons the payment may have failed. **/ +/** + * This object represents an attempted Lightning Network payment sent from a + * Lightspark Node. You can retrieve this object to receive payment related + * information about any payment attempt sent from your Lightspark Node on the + * Lightning Network, + * including any potential reasons the payment may have failed. + * * + */ class OutgoingPaymentAttempt implements Entity { constructor( /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ public readonly id: string, /** The date and time when the entity was first created. **/ @@ -39,28 +46,36 @@ class OutgoingPaymentAttempt implements Entity { public readonly outgoingPaymentId: string, /** The typename of the object **/ public readonly typename: string, - /** If the payment attempt failed, then this contains the Bolt #4 failure code. **/ + /** + * If the payment attempt failed, then this contains the Bolt #4 failure + * code. * + */ public readonly failureCode?: HtlcAttemptFailureCode | undefined, /** - * If the payment attempt failed, then this contains the index of the hop at which the problem - * occurred. + * If the payment attempt failed, then this contains the index of the hop + * at which the problem occurred. **/ public readonly failureSourceIndex?: number | undefined, /** The time the outgoing payment attempt failed or succeeded. **/ public readonly resolvedAt?: string | undefined, /** - * The total amount of funds required to complete a payment over this route. This value includes the - * cumulative fees for each hop. As a result, the attempt extended to the first-hop in the route will - * need to have at least this much value, otherwise the route will fail at an intermediate node due to - * an insufficient amount. + * The total amount of funds required to complete a payment over this route. + * This value includes the cumulative fees for each hop. As a result, + * the attempt extended to the first-hop in the route will need to have at + * least this much value, otherwise the route will fail at an intermediate + * node due to an insufficient amount. **/ public readonly amount?: CurrencyAmount | undefined, /** - * The sum of the fees paid at each hop within the route of this attempt. In the case of a one-hop - * payment, this value will be zero as we don't need to pay a fee to ourselves. + * The sum of the fees paid at each hop within the route of this attempt. + * In the case of a one-hop payment, + * this value will be zero as we don't need to pay a fee to ourselves. **/ public readonly fees?: CurrencyAmount | undefined, - /** The channel snapshot at the time the outgoing payment attempt was made. **/ + /** + * The channel snapshot at the time the outgoing payment attempt was made. + * * + */ public readonly channelSnapshot?: ChannelSnapshot | undefined, ) { autoBind(this); diff --git a/packages/lightspark-sdk/src/objects/OutgoingPaymentAttemptStatus.ts b/packages/lightspark-sdk/src/objects/OutgoingPaymentAttemptStatus.ts index 567168c6a..4783879a9 100644 --- a/packages/lightspark-sdk/src/objects/OutgoingPaymentAttemptStatus.ts +++ b/packages/lightspark-sdk/src/objects/OutgoingPaymentAttemptStatus.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of all potential statuses of a payment attempt made from a Lightspark Node. **/ +/** + * This is an enum of all potential statuses of a payment attempt made from a + * Lightspark Node. * + */ export enum OutgoingPaymentAttemptStatus { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/OutgoingPaymentAttemptToHopsConnection.ts b/packages/lightspark-sdk/src/objects/OutgoingPaymentAttemptToHopsConnection.ts index 89641bab6..8365a05c7 100644 --- a/packages/lightspark-sdk/src/objects/OutgoingPaymentAttemptToHopsConnection.ts +++ b/packages/lightspark-sdk/src/objects/OutgoingPaymentAttemptToHopsConnection.ts @@ -5,15 +5,23 @@ import { HopFromJson, HopToJson } from "./Hop.js"; import type PageInfo from "./PageInfo.js"; import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js"; -/** The connection from an outgoing payment attempt to the list of sequential hops that define the path from sender node to recipient node. **/ +/** + * The connection from an outgoing payment attempt to the list of sequential + * hops that define the path from sender node to recipient node. + * * + */ interface OutgoingPaymentAttemptToHopsConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The hops for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/OutgoingPaymentToAttemptsConnection.ts b/packages/lightspark-sdk/src/objects/OutgoingPaymentToAttemptsConnection.ts index 6cfd32a79..90a70aeb5 100644 --- a/packages/lightspark-sdk/src/objects/OutgoingPaymentToAttemptsConnection.ts +++ b/packages/lightspark-sdk/src/objects/OutgoingPaymentToAttemptsConnection.ts @@ -8,12 +8,16 @@ import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js"; /** The connection from outgoing payment to all attempts. **/ interface OutgoingPaymentToAttemptsConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The attempts for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/PageInfo.ts b/packages/lightspark-sdk/src/objects/PageInfo.ts index 069e4bcee..468a2639d 100644 --- a/packages/lightspark-sdk/src/objects/PageInfo.ts +++ b/packages/lightspark-sdk/src/objects/PageInfo.ts @@ -1,6 +1,11 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an object representing information about a page returned by the Lightspark API. For more information, please see the “Pagination” section of our API docs for more information about its usage. **/ +/** + * This is an object representing information about a page returned by the + * Lightspark API. For more information, + * please see the “Pagination” section of our API docs for more information + * about its usage. * + */ interface PageInfo { hasNextPage?: boolean | undefined; diff --git a/packages/lightspark-sdk/src/objects/PayInvoiceInput.ts b/packages/lightspark-sdk/src/objects/PayInvoiceInput.ts index ab7980381..fd4b634c5 100644 --- a/packages/lightspark-sdk/src/objects/PayInvoiceInput.ts +++ b/packages/lightspark-sdk/src/objects/PayInvoiceInput.ts @@ -10,12 +10,15 @@ interface PayInvoiceInput { /** The timeout in seconds that we will try to make the payment. **/ timeoutSecs: number; - /** The maximum amount of fees that you want to pay for this payment to be sent, expressed in msats. **/ + /** + * The maximum amount of fees that you want to pay for this payment to be + * sent, expressed in msats. * + */ maximumFeesMsats: number; /** - * The amount you will pay for this invoice, expressed in msats. It should ONLY be set when the - * invoice amount is zero. + * The amount you will pay for this invoice, expressed in msats. + * It should ONLY be set when the invoice amount is zero. **/ amountMsats?: number | undefined; } diff --git a/packages/lightspark-sdk/src/objects/PaymentDirection.ts b/packages/lightspark-sdk/src/objects/PaymentDirection.ts index 50aa9e706..fb31f2779 100644 --- a/packages/lightspark-sdk/src/objects/PaymentDirection.ts +++ b/packages/lightspark-sdk/src/objects/PaymentDirection.ts @@ -3,8 +3,9 @@ /** This is an enum indicating the direction of the payment. **/ export enum PaymentDirection { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/PaymentFailureReason.ts b/packages/lightspark-sdk/src/objects/PaymentFailureReason.ts index 06ebafa5d..95a1b9b41 100644 --- a/packages/lightspark-sdk/src/objects/PaymentFailureReason.ts +++ b/packages/lightspark-sdk/src/objects/PaymentFailureReason.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential reasons why an OutgoingPayment sent from a Lightspark Node may have failed. **/ +/** + * This is an enum of the potential reasons why an OutgoingPayment sent from a + * Lightspark Node may have failed. * + */ export enum PaymentFailureReason { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/PaymentRequest.ts b/packages/lightspark-sdk/src/objects/PaymentRequest.ts index 8bb471b40..18217354f 100644 --- a/packages/lightspark-sdk/src/objects/PaymentRequest.ts +++ b/packages/lightspark-sdk/src/objects/PaymentRequest.ts @@ -10,11 +10,16 @@ import { InvoiceDataFromJson, InvoiceDataToJson } from "./InvoiceData.js"; import type PaymentRequestData from "./PaymentRequestData.js"; import PaymentRequestStatus from "./PaymentRequestStatus.js"; -/** This object contains information related to a payment request generated or received by a LightsparkNode. You can retrieve this object to receive payment information about a specific invoice. **/ +/** + * This object contains information related to a payment request generated or + * received by a LightsparkNode. You can retrieve this object to receive + * payment information about a specific invoice. + * * + */ interface PaymentRequest { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; diff --git a/packages/lightspark-sdk/src/objects/PaymentRequestData.ts b/packages/lightspark-sdk/src/objects/PaymentRequestData.ts index 149131561..55a9b866a 100644 --- a/packages/lightspark-sdk/src/objects/PaymentRequestData.ts +++ b/packages/lightspark-sdk/src/objects/PaymentRequestData.ts @@ -9,7 +9,11 @@ import { import type InvoiceData from "./InvoiceData.js"; import { NodeFromJson, NodeToJson } from "./Node.js"; -/** This object is an interface of a payment request on the Lightning Network (i.e., a Lightning Invoice). It contains data related to parsing the payment details of a Lightning Invoice. **/ +/** + * This object is an interface of a payment request on the Lightning Network + * (i.e., a Lightning Invoice). It contains data related to parsing the payment + * details of a Lightning Invoice. * + */ interface PaymentRequestData { encodedPaymentRequest: string; diff --git a/packages/lightspark-sdk/src/objects/PaymentRequestStatus.ts b/packages/lightspark-sdk/src/objects/PaymentRequestStatus.ts index b7ac64d43..c650a307a 100644 --- a/packages/lightspark-sdk/src/objects/PaymentRequestStatus.ts +++ b/packages/lightspark-sdk/src/objects/PaymentRequestStatus.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential states that a payment request on the Lightning Network can take. **/ +/** + * This is an enum of the potential states that a payment request on the + * Lightning Network can take. * + */ export enum PaymentRequestStatus { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/Permission.ts b/packages/lightspark-sdk/src/objects/Permission.ts index 186b0ef7b..6d47ede56 100644 --- a/packages/lightspark-sdk/src/objects/Permission.ts +++ b/packages/lightspark-sdk/src/objects/Permission.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential permissions that a Lightspark user can have in regards to account management. **/ +/** + * This is an enum of the potential permissions that a Lightspark user can have + * in regards to account management. * + */ export enum Permission { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/PostTransactionData.ts b/packages/lightspark-sdk/src/objects/PostTransactionData.ts index 1a85826f9..e7d33a0eb 100644 --- a/packages/lightspark-sdk/src/objects/PostTransactionData.ts +++ b/packages/lightspark-sdk/src/objects/PostTransactionData.ts @@ -6,11 +6,14 @@ import { CurrencyAmountToJson, } from "./CurrencyAmount.js"; -/** This object represents post-transaction data that could be used to register payment for KYT. **/ +/** + * This object represents post-transaction data that could be used to register + * payment for KYT. * + */ interface PostTransactionData { /** - * The utxo of the channel over which the payment went through in the format of - * :. + * The utxo of the channel over which the payment went through in the format + * of :. **/ utxo: string; diff --git a/packages/lightspark-sdk/src/objects/RegionCode.ts b/packages/lightspark-sdk/src/objects/RegionCode.ts index cce0eba48..b814f814a 100644 --- a/packages/lightspark-sdk/src/objects/RegionCode.ts +++ b/packages/lightspark-sdk/src/objects/RegionCode.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** The alpha-2 representation of a country, as defined by the ISO 3166-1 standard. **/ +/** + * The alpha-2 representation of a country, as defined by the ISO 3166-1 + * standard. * + */ export enum RegionCode { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", /** The code representing the country of Afghanistan. **/ @@ -59,9 +63,15 @@ export enum RegionCode { BM = "BM", /** The code representing the country of Bhutan. **/ BT = "BT", - /** The code representing the country of The Plurinational State of Bolivia. **/ + /** + * The code representing the country of The Plurinational State of Bolivia. + * * + */ BO = "BO", - /** The code representing the country of Bonaire, Sint Eustatius, and Saba. **/ + /** + * The code representing the country of Bonaire, Sint Eustatius, and Saba. + * * + */ BQ = "BQ", /** The code representing the country of Bosnia and Herzegovina. **/ BA = "BA", @@ -109,7 +119,10 @@ export enum RegionCode { KM = "KM", /** The code representing the country of Congo. **/ CG = "CG", - /** The code representing the country of The Democratic Republic of the Congo. **/ + /** + * The code representing the country of The Democratic Republic of the Congo. + * * + */ CD = "CD", /** The code representing the country of Cook Islands. **/ CK = "CK", @@ -199,7 +212,10 @@ export enum RegionCode { GY = "GY", /** The code representing the country of Haiti. **/ HT = "HT", - /** The code representing the country of Heard Island and McDonald Islands. **/ + /** + * The code representing the country of Heard Island and McDonald Islands. + * * + */ HM = "HM", /** The code representing the country of Holy See (Vatican City State). **/ VA = "VA", @@ -241,7 +257,10 @@ export enum RegionCode { KE = "KE", /** The code representing the country of Kiribati. **/ KI = "KI", - /** The code representing the country of Democratic People's Republic ofKorea. **/ + /** + * The code representing the country of Democratic People's Republic ofKorea. + * * + */ KP = "KP", /** The code representing the country of Republic of Korea. **/ KR = "KR", @@ -269,7 +288,10 @@ export enum RegionCode { LU = "LU", /** The code representing the country of Macao. **/ MO = "MO", - /** The code representing the country of The Former Yugoslav Republic of Macedonia. **/ + /** + * The code representing the country of The Former Yugoslav Republic of + * Macedonia. * + */ MK = "MK", /** The code representing the country of Madagascar. **/ MG = "MG", @@ -377,7 +399,10 @@ export enum RegionCode { RW = "RW", /** The code representing the country of Saint Barthélemy. **/ BL = "BL", - /** The code representing the country of Saint Helena Ascension and Tristan da Cunha. **/ + /** + * The code representing the country of Saint Helena Ascension and Tristan + * da Cunha. * + */ SH = "SH", /** The code representing the country of Saint Kitts and Nevis. **/ KN = "KN", @@ -419,7 +444,10 @@ export enum RegionCode { SO = "SO", /** The code representing the country of South Africa. **/ ZA = "ZA", - /** The code representing the country of South Georgia and the South Sandwich Islands. **/ + /** + * The code representing the country of South Georgia and the South Sandwich + * Islands. * + */ GS = "GS", /** The code representing the country of South Sudan. **/ SS = "SS", @@ -479,7 +507,10 @@ export enum RegionCode { GB = "GB", /** The code representing the country of United States. **/ US = "US", - /** The code representing the country of United States Minor Outlying Islands. **/ + /** + * The code representing the country of United States Minor Outlying Islands. + * * + */ UM = "UM", /** The code representing the country of Uruguay. **/ UY = "UY", diff --git a/packages/lightspark-sdk/src/objects/RegisterPaymentInput.ts b/packages/lightspark-sdk/src/objects/RegisterPaymentInput.ts index bbfd5a82b..3133ad58f 100644 --- a/packages/lightspark-sdk/src/objects/RegisterPaymentInput.ts +++ b/packages/lightspark-sdk/src/objects/RegisterPaymentInput.ts @@ -5,25 +5,30 @@ import PaymentDirection from "./PaymentDirection.js"; interface RegisterPaymentInput { /** - * The compliance provider that is going to screen the node. You need to be a customer of the selected - * provider and store the API key on the Lightspark account setting page. + * The compliance provider that is going to screen the node. + * You need to be a customer of the selected provider and store the API key + * on the Lightspark account setting page. **/ provider: ComplianceProvider; /** - * The Lightspark ID of the lightning payment you want to register. It can be the id of either an - * OutgoingPayment or an IncomingPayment. + * The Lightspark ID of the lightning payment you want to register. + * It can be the id of either an OutgoingPayment or an IncomingPayment. **/ paymentId: string; /** - * The public key of the counterparty lightning node, which would be the public key of the recipient - * node if it is to register an outgoing payment, or the public key of the sender node if it is to + * The public key of the counterparty lightning node, + * which would be the public key of the recipient node if it is to register + * an outgoing payment, or the public key of the sender node if it is to * register an incoming payment. **/ nodePubkey: string; - /** Indicates whether this payment is an OutgoingPayment or an IncomingPayment. **/ + /** + * Indicates whether this payment is an OutgoingPayment or an + * IncomingPayment. * + */ direction: PaymentDirection; } diff --git a/packages/lightspark-sdk/src/objects/RemoteSigningSubEventType.ts b/packages/lightspark-sdk/src/objects/RemoteSigningSubEventType.ts index 7b48c21c0..12d0cd0e3 100644 --- a/packages/lightspark-sdk/src/objects/RemoteSigningSubEventType.ts +++ b/packages/lightspark-sdk/src/objects/RemoteSigningSubEventType.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential sub-event types for Remote Signing webook events. **/ +/** + * This is an enum of the potential sub-event types for Remote Signing webook + * events. * + */ export enum RemoteSigningSubEventType { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/RequestWithdrawalInput.ts b/packages/lightspark-sdk/src/objects/RequestWithdrawalInput.ts index 4e6a9ea9b..4cc7761b7 100644 --- a/packages/lightspark-sdk/src/objects/RequestWithdrawalInput.ts +++ b/packages/lightspark-sdk/src/objects/RequestWithdrawalInput.ts @@ -10,8 +10,8 @@ interface RequestWithdrawalInput { bitcoinAddress: string; /** - * The amount you want to withdraw from this node in Satoshis. Use the special value -1 to withdrawal - * all funds from this node. + * The amount you want to withdraw from this node in Satoshis. + * Use the special value -1 to withdrawal all funds from this node. **/ amountSats: number; diff --git a/packages/lightspark-sdk/src/objects/RiskRating.ts b/packages/lightspark-sdk/src/objects/RiskRating.ts index f7dd2f057..7e3e6b3f5 100644 --- a/packages/lightspark-sdk/src/objects/RiskRating.ts +++ b/packages/lightspark-sdk/src/objects/RiskRating.ts @@ -1,10 +1,15 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential risk ratings related to a transaction made over the Lightning Network. These risk ratings are returned from the CryptoSanctionScreeningProvider. **/ +/** + * This is an enum of the potential risk ratings related to a transaction made + * over the Lightning Network. These risk ratings are returned from the + * CryptoSanctionScreeningProvider. * + */ export enum RiskRating { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/RoutingTransaction.ts b/packages/lightspark-sdk/src/objects/RoutingTransaction.ts index e1feab238..fbe6873d2 100644 --- a/packages/lightspark-sdk/src/objects/RoutingTransaction.ts +++ b/packages/lightspark-sdk/src/objects/RoutingTransaction.ts @@ -11,11 +11,17 @@ import { RichTextFromJson, RichTextToJson } from "./RichText.js"; import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js"; import TransactionStatus from "./TransactionStatus.js"; -/** This object represents a transaction that was forwarded through a Lightspark node on the Lightning Network, i.e., a routed transaction. You can retrieve this object to receive information about any transaction routed through your Lightspark Node. **/ +/** + * This object represents a transaction that was forwarded through a Lightspark + * node on the Lightning Network, i.e., a routed transaction. + * You can retrieve this object to receive information about any transaction + * routed through your Lightspark Node. + * * + */ interface RoutingTransaction { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -37,7 +43,10 @@ interface RoutingTransaction { /** The date and time when this transaction was completed or failed. **/ resolvedAt?: string | undefined; - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ transactionHash?: string | undefined; /** If known, the channel this transaction was received from. **/ @@ -47,12 +56,16 @@ interface RoutingTransaction { outgoingChannelId?: string | undefined; /** - * The fees collected by the node when routing this transaction. We subtract the outgoing amount to - * the incoming amount to determine how much fees were collected. + * The fees collected by the node when routing this transaction. + * We subtract the outgoing amount to the incoming amount to determine how + * much fees were collected. **/ fees?: CurrencyAmount | undefined; - /** If applicable, user-facing error message describing why the routing failed. **/ + /** + * If applicable, user-facing error message describing why the routing + * failed. * + */ failureMessage?: RichText | undefined; /** If applicable, the reason why the routing failed. **/ diff --git a/packages/lightspark-sdk/src/objects/RoutingTransactionFailureReason.ts b/packages/lightspark-sdk/src/objects/RoutingTransactionFailureReason.ts index 6b25dfb28..5063e1fbc 100644 --- a/packages/lightspark-sdk/src/objects/RoutingTransactionFailureReason.ts +++ b/packages/lightspark-sdk/src/objects/RoutingTransactionFailureReason.ts @@ -1,10 +1,15 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential reasons that an attempted routed transaction through a Lightspark node may have failed. **/ +/** + * This is an enum of the potential reasons that an attempted routed + * transaction through a Lightspark node may have failed. + * * + */ export enum RoutingTransactionFailureReason { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/ScreenNodeInput.ts b/packages/lightspark-sdk/src/objects/ScreenNodeInput.ts index c6b007432..10694bca1 100644 --- a/packages/lightspark-sdk/src/objects/ScreenNodeInput.ts +++ b/packages/lightspark-sdk/src/objects/ScreenNodeInput.ts @@ -4,8 +4,9 @@ import ComplianceProvider from "./ComplianceProvider.js"; interface ScreenNodeInput { /** - * The compliance provider that is going to screen the node. You need to be a customer of the selected - * provider and store the API key on the Lightspark account setting page. + * The compliance provider that is going to screen the node. + * You need to be a customer of the selected provider and store the API key + * on the Lightspark account setting page. **/ provider: ComplianceProvider; diff --git a/packages/lightspark-sdk/src/objects/SendPaymentInput.ts b/packages/lightspark-sdk/src/objects/SendPaymentInput.ts index 2cb29d8cf..b66ebe73c 100644 --- a/packages/lightspark-sdk/src/objects/SendPaymentInput.ts +++ b/packages/lightspark-sdk/src/objects/SendPaymentInput.ts @@ -13,7 +13,10 @@ interface SendPaymentInput { /** The amount you will send to the destination node, expressed in msats. **/ amountMsats: number; - /** The maximum amount of fees that you want to pay for this payment to be sent, expressed in msats. **/ + /** + * The maximum amount of fees that you want to pay for this payment to be + * sent, expressed in msats. * + */ maximumFeesMsats: number; } diff --git a/packages/lightspark-sdk/src/objects/SetInvoicePaymentHashInput.ts b/packages/lightspark-sdk/src/objects/SetInvoicePaymentHashInput.ts index 4d455c439..936053eb7 100644 --- a/packages/lightspark-sdk/src/objects/SetInvoicePaymentHashInput.ts +++ b/packages/lightspark-sdk/src/objects/SetInvoicePaymentHashInput.ts @@ -8,8 +8,9 @@ interface SetInvoicePaymentHashInput { paymentHash: string; /** - * The 32-byte nonce used to generate the invoice preimage if applicable. It will later be included in - * RELEASE_PAYMENT_PREIMAGE webhook to help recover the raw preimage. + * The 32-byte nonce used to generate the invoice preimage if applicable. + * It will later be included in RELEASE_PAYMENT_PREIMAGE webhook to help + * recover the raw preimage. **/ preimageNonce?: string | undefined; } diff --git a/packages/lightspark-sdk/src/objects/Signable.ts b/packages/lightspark-sdk/src/objects/Signable.ts index 308688061..cc9e32460 100644 --- a/packages/lightspark-sdk/src/objects/Signable.ts +++ b/packages/lightspark-sdk/src/objects/Signable.ts @@ -4,8 +4,8 @@ import { type Query } from "@lightsparkdev/core"; interface Signable { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; diff --git a/packages/lightspark-sdk/src/objects/SignablePayload.ts b/packages/lightspark-sdk/src/objects/SignablePayload.ts index 5a2fd7de6..8a729f5ed 100644 --- a/packages/lightspark-sdk/src/objects/SignablePayload.ts +++ b/packages/lightspark-sdk/src/objects/SignablePayload.ts @@ -5,8 +5,8 @@ import SignablePayloadStatus from "./SignablePayloadStatus.js"; interface SignablePayload { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -19,7 +19,10 @@ interface SignablePayload { /** The payload that needs to be signed. **/ payload: string; - /** The consistent method for generating the same set of accounts and wallets for a given private key **/ + /** + * The consistent method for generating the same set of accounts and wallets + * for a given private key * + */ derivationPath: string; /** The status of the payload. **/ diff --git a/packages/lightspark-sdk/src/objects/SignablePayloadStatus.ts b/packages/lightspark-sdk/src/objects/SignablePayloadStatus.ts index 58fa76127..e0f50dfa7 100644 --- a/packages/lightspark-sdk/src/objects/SignablePayloadStatus.ts +++ b/packages/lightspark-sdk/src/objects/SignablePayloadStatus.ts @@ -2,8 +2,9 @@ export enum SignablePayloadStatus { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/Transaction.ts b/packages/lightspark-sdk/src/objects/Transaction.ts index a9c884524..5d070d5c1 100644 --- a/packages/lightspark-sdk/src/objects/Transaction.ts +++ b/packages/lightspark-sdk/src/objects/Transaction.ts @@ -26,11 +26,18 @@ import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.j import TransactionStatus from "./TransactionStatus.js"; import type Withdrawal from "./Withdrawal.js"; -/** This object represents a payment transaction. The transaction can occur either on a Bitcoin Network, or over the Lightning Network. You can retrieve this object to receive specific information about a particular transaction tied to your Lightspark Node. **/ +/** + * This object represents a payment transaction. + * The transaction can occur either on a Bitcoin Network, + * or over the Lightning Network. You can retrieve this object to receive + * specific information about a particular transaction tied to your Lightspark + * Node. + * * + */ interface Transaction { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -52,7 +59,10 @@ interface Transaction { /** The date and time when this transaction was completed or failed. **/ resolvedAt?: string | undefined; - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ transactionHash?: string | undefined; } diff --git a/packages/lightspark-sdk/src/objects/TransactionFailures.ts b/packages/lightspark-sdk/src/objects/TransactionFailures.ts index c1ca0d736..e3a922e72 100644 --- a/packages/lightspark-sdk/src/objects/TransactionFailures.ts +++ b/packages/lightspark-sdk/src/objects/TransactionFailures.ts @@ -3,7 +3,10 @@ import PaymentFailureReason from "./PaymentFailureReason.js"; import RoutingTransactionFailureReason from "./RoutingTransactionFailureReason.js"; -/** This object represents payment failures associated with your Lightspark Node. **/ +/** + * This object represents payment failures associated with your Lightspark + * Node. * + */ interface TransactionFailures { paymentFailures?: PaymentFailureReason[] | undefined; diff --git a/packages/lightspark-sdk/src/objects/TransactionStatus.ts b/packages/lightspark-sdk/src/objects/TransactionStatus.ts index 0fa23ec79..8320a5716 100644 --- a/packages/lightspark-sdk/src/objects/TransactionStatus.ts +++ b/packages/lightspark-sdk/src/objects/TransactionStatus.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential statuses a transaction associated with your Lightspark Node can take. **/ +/** + * This is an enum of the potential statuses a transaction associated with your + * Lightspark Node can take. * + */ export enum TransactionStatus { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", /** Transaction succeeded.. **/ @@ -13,9 +17,16 @@ export enum TransactionStatus { FAILED = "FAILED", /** Transaction has been initiated and is currently in-flight. **/ PENDING = "PENDING", - /** For transaction type PAYMENT_REQUEST only. No payments have been made to a payment request. **/ + /** + * For transaction type PAYMENT_REQUEST only. + * No payments have been made to a payment request. + * * + */ NOT_STARTED = "NOT_STARTED", - /** For transaction type PAYMENT_REQUEST only. A payment request has expired. **/ + /** + * For transaction type PAYMENT_REQUEST only. A payment request has expired. + * * + */ EXPIRED = "EXPIRED", /** For transaction type PAYMENT_REQUEST only. **/ CANCELLED = "CANCELLED", diff --git a/packages/lightspark-sdk/src/objects/TransactionType.ts b/packages/lightspark-sdk/src/objects/TransactionType.ts index 16aa140d0..de505d932 100644 --- a/packages/lightspark-sdk/src/objects/TransactionType.ts +++ b/packages/lightspark-sdk/src/objects/TransactionType.ts @@ -1,31 +1,53 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential types of transactions that can be associated with your Lightspark Node. **/ +/** + * This is an enum of the potential types of transactions that can be + * associated with your Lightspark Node. + * * + */ export enum TransactionType { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", /** Transactions initiated from a Lightspark node on Lightning Network. **/ OUTGOING_PAYMENT = "OUTGOING_PAYMENT", /** Transactions received by a Lightspark node on Lightning Network. **/ INCOMING_PAYMENT = "INCOMING_PAYMENT", - /** Transactions that forwarded payments through Lightspark nodes on Lightning Network. **/ + /** + * Transactions that forwarded payments through Lightspark nodes on Lightning + * Network. * + */ ROUTED = "ROUTED", - /** Transactions on the Bitcoin blockchain to withdraw funds from a Lightspark node to a Bitcoin wallet. **/ + /** + * Transactions on the Bitcoin blockchain to withdraw funds from a Lightspark + * node to a Bitcoin wallet. * + */ L1_WITHDRAW = "L1_WITHDRAW", /** Transactions on Bitcoin blockchain to fund a Lightspark node's wallet. **/ L1_DEPOSIT = "L1_DEPOSIT", - /** Transactions on Bitcoin blockchain to open a channel on Lightning Network funded by the local Lightspark node. **/ + /** + * Transactions on Bitcoin blockchain to open a channel on Lightning Network + * funded by the local Lightspark node. + * * + */ CHANNEL_OPEN = "CHANNEL_OPEN", - /** Transactions on Bitcoin blockchain to close a channel on Lightning Network where the balances are allocated back to local and remote nodes. **/ + /** + * Transactions on Bitcoin blockchain to close a channel on Lightning Network + * where the balances are allocated back to local and remote nodes. + * * + */ CHANNEL_CLOSE = "CHANNEL_CLOSE", /** Transactions initiated from a Lightspark node on Lightning Network. **/ PAYMENT = "PAYMENT", /** Payment requests from a Lightspark node on Lightning Network **/ PAYMENT_REQUEST = "PAYMENT_REQUEST", - /** Transactions that forwarded payments through Lightspark nodes on Lightning Network. **/ + /** + * Transactions that forwarded payments through Lightspark nodes on Lightning + * Network. * + */ ROUTE = "ROUTE", } diff --git a/packages/lightspark-sdk/src/objects/TransactionUpdate.ts b/packages/lightspark-sdk/src/objects/TransactionUpdate.ts index 04d716e13..7b1c93f32 100644 --- a/packages/lightspark-sdk/src/objects/TransactionUpdate.ts +++ b/packages/lightspark-sdk/src/objects/TransactionUpdate.ts @@ -6,8 +6,8 @@ import TransactionStatus from "./TransactionStatus.js"; type TransactionUpdate = { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -29,7 +29,10 @@ type TransactionUpdate = { /** The date and time when this transaction was completed or failed. **/ resolvedAt?: string; - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ transactionHash?: string; }; diff --git a/packages/lightspark-sdk/src/objects/UmaInvitation.ts b/packages/lightspark-sdk/src/objects/UmaInvitation.ts index 196342adf..afb5b3c27 100644 --- a/packages/lightspark-sdk/src/objects/UmaInvitation.ts +++ b/packages/lightspark-sdk/src/objects/UmaInvitation.ts @@ -7,8 +7,8 @@ import IncentivesStatus from "./IncentivesStatus.js"; /** This is an object representing an UMA.ME invitation. **/ interface UmaInvitation { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -27,7 +27,10 @@ interface UmaInvitation { /** The UMA of the user who created the invitation. **/ inviterUma: string; - /** The current status of the incentives that may be tied to this invitation. **/ + /** + * The current status of the incentives that may be tied to this invitation. + * * + */ incentivesStatus: IncentivesStatus; /** The typename of the object **/ @@ -36,7 +39,10 @@ interface UmaInvitation { /** The UMA of the user who claimed the invitation. **/ inviteeUma?: string | undefined; - /** The reason why the invitation is not eligible for incentives, if applicable. **/ + /** + * The reason why the invitation is not eligible for incentives, if + * applicable. * + */ incentivesIneligibilityReason?: IncentivesIneligibilityReason | undefined; } diff --git a/packages/lightspark-sdk/src/objects/Wallet.ts b/packages/lightspark-sdk/src/objects/Wallet.ts index 3751c984e..c378e880f 100644 --- a/packages/lightspark-sdk/src/objects/Wallet.ts +++ b/packages/lightspark-sdk/src/objects/Wallet.ts @@ -17,19 +17,28 @@ import { WalletToPaymentRequestsConnectionFromJson } from "./WalletToPaymentRequ import type WalletToTransactionsConnection from "./WalletToTransactionsConnection.js"; import { WalletToTransactionsConnectionFromJson } from "./WalletToTransactionsConnection.js"; -/** This object represents a Lightspark Wallet, tied to your Lightspark account. Wallets can be used to send or receive funds over the Lightning Network. You can retrieve this object to receive information about a specific wallet tied to your Lightspark account. **/ +/** + * This object represents a Lightspark Wallet, tied to your Lightspark account. + * Wallets can be used to send or receive funds over the Lightning Network. + * You can retrieve this object to receive information about a specific wallet + * tied to your Lightspark account. * + */ class Wallet implements LightsparkNodeOwner, Entity { constructor( /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ public readonly id: string, /** The date and time when the entity was first created. **/ public readonly createdAt: string, /** The date and time when the entity was last updated. **/ public readonly updatedAt: string, - /** The unique identifier of this wallet, as provided by the Lightspark Customer during login. **/ + /** + * The unique identifier of this wallet, + * as provided by the Lightspark Customer during login. + * * + */ public readonly thirdPartyIdentifier: string, /** The status of this wallet. **/ public readonly status: WalletStatus, diff --git a/packages/lightspark-sdk/src/objects/WalletStatus.ts b/packages/lightspark-sdk/src/objects/WalletStatus.ts index 49244b986..8b36b95b6 100644 --- a/packages/lightspark-sdk/src/objects/WalletStatus.ts +++ b/packages/lightspark-sdk/src/objects/WalletStatus.ts @@ -1,29 +1,56 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential statuses that your Lightspark wallet can take. **/ +/** + * This is an enum of the potential statuses that your Lightspark wallet can + * take. * + */ export enum WalletStatus { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", - /** The wallet has not been set up yet and is ready to be deployed. This is the default status after the first login. **/ + /** + * The wallet has not been set up yet and is ready to be deployed. + * This is the default status after the first login. + * * + */ NOT_SETUP = "NOT_SETUP", - /** The wallet is currently being deployed in the Lightspark infrastructure. **/ + /** + * The wallet is currently being deployed in the Lightspark infrastructure. + * * + */ DEPLOYING = "DEPLOYING", - /** The wallet has been deployed in the Lightspark infrastructure and is ready to be initialized. **/ + /** + * The wallet has been deployed in the Lightspark infrastructure and is ready + * to be initialized. * + */ DEPLOYED = "DEPLOYED", /** The wallet is currently being initialized. **/ INITIALIZING = "INITIALIZING", /** The wallet is available and ready to be used. **/ READY = "READY", - /** The wallet is temporarily available, due to a transient issue or a scheduled maintenance. **/ + /** + * The wallet is temporarily available, + * due to a transient issue or a scheduled maintenance. + * * + */ UNAVAILABLE = "UNAVAILABLE", - /** The wallet had an unrecoverable failure. This status is not expected to happend and will be investigated by the Lightspark team. **/ + /** + * The wallet had an unrecoverable failure. + * This status is not expected to happend and will be investigated by the + * Lightspark team. * + */ FAILED = "FAILED", /** The wallet is being terminated. **/ TERMINATING = "TERMINATING", - /** The wallet has been terminated and is not available in the Lightspark infrastructure anymore. It is not connected to the Lightning network and its funds can only be accessed using the Funds Recovery flow. **/ + /** + * The wallet has been terminated and is not available in the Lightspark + * infrastructure anymore. It is not connected to the Lightning network and + * its funds can only be accessed using the Funds Recovery flow. + * * + */ TERMINATED = "TERMINATED", } diff --git a/packages/lightspark-sdk/src/objects/WalletToPaymentRequestsConnection.ts b/packages/lightspark-sdk/src/objects/WalletToPaymentRequestsConnection.ts index f0a4ab731..37315099c 100644 --- a/packages/lightspark-sdk/src/objects/WalletToPaymentRequestsConnection.ts +++ b/packages/lightspark-sdk/src/objects/WalletToPaymentRequestsConnection.ts @@ -10,12 +10,16 @@ import { interface WalletToPaymentRequestsConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The payment requests for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/WalletToTransactionsConnection.ts b/packages/lightspark-sdk/src/objects/WalletToTransactionsConnection.ts index 8361a25dd..a8c9906d3 100644 --- a/packages/lightspark-sdk/src/objects/WalletToTransactionsConnection.ts +++ b/packages/lightspark-sdk/src/objects/WalletToTransactionsConnection.ts @@ -7,12 +7,16 @@ import { TransactionFromJson, TransactionToJson } from "./Transaction.js"; interface WalletToTransactionsConnection { /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** The transactions for the current page of this connection. **/ diff --git a/packages/lightspark-sdk/src/objects/WebhookEventType.ts b/packages/lightspark-sdk/src/objects/WebhookEventType.ts index 45daae05a..1980d0c87 100644 --- a/packages/lightspark-sdk/src/objects/WebhookEventType.ts +++ b/packages/lightspark-sdk/src/objects/WebhookEventType.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential event types that can be associated with your Lightspark wallets. **/ +/** + * This is an enum of the potential event types that can be associated with + * your Lightspark wallets. * + */ export enum WebhookEventType { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/Withdrawal.ts b/packages/lightspark-sdk/src/objects/Withdrawal.ts index 995e5e1d7..da48889dc 100644 --- a/packages/lightspark-sdk/src/objects/Withdrawal.ts +++ b/packages/lightspark-sdk/src/objects/Withdrawal.ts @@ -8,11 +8,16 @@ import { } from "./CurrencyAmount.js"; import TransactionStatus from "./TransactionStatus.js"; -/** This object represents an L1 withdrawal from your Lightspark Node to any Bitcoin wallet. You can retrieve this object to receive detailed information about any L1 withdrawal associated with your Lightspark Node or account. **/ +/** + * This object represents an L1 withdrawal from your Lightspark Node to any + * Bitcoin wallet. You can retrieve this object to receive detailed information + * about any L1 withdrawal associated with your Lightspark Node or account. + * * + */ interface Withdrawal { /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ id: string; @@ -29,8 +34,8 @@ interface Withdrawal { amount: CurrencyAmount; /** - * The height of the block that included this transaction. This will be zero for unconfirmed - * transactions. + * The height of the block that included this transaction. + * This will be zero for unconfirmed transactions. **/ blockHeight: number; @@ -46,22 +51,28 @@ interface Withdrawal { /** The date and time when this transaction was completed or failed. **/ resolvedAt?: string | undefined; - /** The hash of this transaction, so it can be uniquely identified on the Lightning Network. **/ + /** + * The hash of this transaction, so it can be uniquely identified on the + * Lightning Network. * + */ transactionHash?: string | undefined; /** - * The fees that were paid by the wallet sending the transaction to commit it to the Bitcoin - * blockchain. + * The fees that were paid by the wallet sending the transaction to commit it + * to the Bitcoin blockchain. **/ fees?: CurrencyAmount | undefined; /** - * The hash of the block that included this transaction. This will be null for unconfirmed - * transactions. + * The hash of the block that included this transaction. + * This will be null for unconfirmed transactions. **/ blockHash?: string | undefined; - /** The number of blockchain confirmations for this transaction in real time. **/ + /** + * The number of blockchain confirmations for this transaction in real time. + * * + */ numConfirmations?: number | undefined; } diff --git a/packages/lightspark-sdk/src/objects/WithdrawalMode.ts b/packages/lightspark-sdk/src/objects/WithdrawalMode.ts index c7c6f94aa..71b9536fe 100644 --- a/packages/lightspark-sdk/src/objects/WithdrawalMode.ts +++ b/packages/lightspark-sdk/src/objects/WithdrawalMode.ts @@ -1,10 +1,14 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved -/** This is an enum of the potential modes that your Bitcoin withdrawal can take. **/ +/** + * This is an enum of the potential modes that your Bitcoin withdrawal can + * take. * + */ export enum WithdrawalMode { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/WithdrawalRequest.ts b/packages/lightspark-sdk/src/objects/WithdrawalRequest.ts index 947830edd..0664d0c11 100644 --- a/packages/lightspark-sdk/src/objects/WithdrawalRequest.ts +++ b/packages/lightspark-sdk/src/objects/WithdrawalRequest.ts @@ -16,12 +16,18 @@ import { WithdrawalRequestToChannelClosingTransactionsConnectionFromJson } from import type WithdrawalRequestToChannelOpeningTransactionsConnection from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js"; import { WithdrawalRequestToChannelOpeningTransactionsConnectionFromJson } from "./WithdrawalRequestToChannelOpeningTransactionsConnection.js"; -/** This object represents a request made for an L1 withdrawal from your Lightspark Node to any Bitcoin wallet. You can retrieve this object to receive detailed information about any withdrawal request made from your Lightspark account. **/ +/** + * This object represents a request made for an L1 withdrawal from your + * Lightspark Node to any Bitcoin wallet. + * You can retrieve this object to receive detailed information about any + * withdrawal request made from your Lightspark account. + * * + */ class WithdrawalRequest implements Entity { constructor( /** - * The unique identifier of this entity across all Lightspark systems. Should be treated as an opaque - * string. + * The unique identifier of this entity across all Lightspark systems. + * Should be treated as an opaque string. **/ public readonly id: string, /** The date and time when the entity was first created. **/ @@ -32,15 +38,18 @@ class WithdrawalRequest implements Entity { public readonly amount: CurrencyAmount, /** The bitcoin address where the funds should be sent. **/ public readonly bitcoinAddress: string, - /** The strategy that should be used to withdraw the funds from the account. **/ + /** + * The strategy that should be used to withdraw the funds from the account. + * * + */ public readonly withdrawalMode: WithdrawalMode, /** The current status of this withdrawal request. **/ public readonly status: WithdrawalRequestStatus, /** The typename of the object **/ public readonly typename: string, /** - * If the requested amount is `-1` (i.e. everything), this field may contain an estimate of the amount - * for the withdrawal. + * If the requested amount is `-1` (i.e. everything), + * this field may contain an estimate of the amount for the withdrawal. **/ public readonly estimatedAmount?: CurrencyAmount | undefined, /** The time at which this request was completed. **/ diff --git a/packages/lightspark-sdk/src/objects/WithdrawalRequestStatus.ts b/packages/lightspark-sdk/src/objects/WithdrawalRequestStatus.ts index ef59ede54..75062e86d 100644 --- a/packages/lightspark-sdk/src/objects/WithdrawalRequestStatus.ts +++ b/packages/lightspark-sdk/src/objects/WithdrawalRequestStatus.ts @@ -3,8 +3,9 @@ /** This is an enum of the potential statuses that a Withdrawal can take. **/ export enum WithdrawalRequestStatus { /** - * This is an enum value that represents values that could be added in the future. - * Clients should support unknown values as more of them could be added without notice. + * This is an enum value that represents values that could be added in the + * future. Clients should support unknown values as more of them could be + * added without notice. */ FUTURE_VALUE = "FUTURE_VALUE", diff --git a/packages/lightspark-sdk/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts b/packages/lightspark-sdk/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts index daa4c2cbf..4884b7091 100644 --- a/packages/lightspark-sdk/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts +++ b/packages/lightspark-sdk/src/objects/WithdrawalRequestToChannelClosingTransactionsConnection.ts @@ -9,16 +9,23 @@ import type PageInfo from "./PageInfo.js"; import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js"; interface WithdrawalRequestToChannelClosingTransactionsConnection { - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** The channel closing transactions for the current page of this connection. **/ + /** + * The channel closing transactions for the current page of this connection. + * * + */ entities: ChannelClosingTransaction[]; } diff --git a/packages/lightspark-sdk/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts b/packages/lightspark-sdk/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts index c84b0fb81..911965eff 100644 --- a/packages/lightspark-sdk/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts +++ b/packages/lightspark-sdk/src/objects/WithdrawalRequestToChannelOpeningTransactionsConnection.ts @@ -9,16 +9,23 @@ import type PageInfo from "./PageInfo.js"; import { PageInfoFromJson, PageInfoToJson } from "./PageInfo.js"; interface WithdrawalRequestToChannelOpeningTransactionsConnection { - /** An object that holds pagination information about the objects in this connection. **/ + /** + * An object that holds pagination information about the objects in this + * connection. * + */ pageInfo: PageInfo; /** - * The total count of objects in this connection, using the current filters. It is different from the - * number of objects returned in the current page (in the `entities` field). + * The total count of objects in this connection, using the current filters. + * It is different from the number of objects returned in the current page + * (in the `entities` field). **/ count: number; - /** The channel opening transactions for the current page of this connection. **/ + /** + * The channel opening transactions for the current page of this connection. + * * + */ entities: ChannelOpeningTransaction[]; } diff --git a/packages/lightspark-sdk/src/objects/index.ts b/packages/lightspark-sdk/src/objects/index.ts index 1cb8b26cf..42e618804 100644 --- a/packages/lightspark-sdk/src/objects/index.ts +++ b/packages/lightspark-sdk/src/objects/index.ts @@ -102,12 +102,13 @@ export { default as OutgoingPayment } from "./OutgoingPayment.js"; export { default as OutgoingPaymentAttempt } from "./OutgoingPaymentAttempt.js"; export { default as OutgoingPaymentAttemptStatus } from "./OutgoingPaymentAttemptStatus.js"; export { default as OutgoingPaymentAttemptToHopsConnection } from "./OutgoingPaymentAttemptToHopsConnection.js"; +export { default as OutgoingPaymentToAttemptsConnection } from "./OutgoingPaymentToAttemptsConnection.js"; export { default as OutgoingPaymentsForInvoiceQueryInput } from "./OutgoingPaymentsForInvoiceQueryInput.js"; export { default as OutgoingPaymentsForInvoiceQueryOutput } from "./OutgoingPaymentsForInvoiceQueryOutput.js"; -export { default as OutgoingPaymentToAttemptsConnection } from "./OutgoingPaymentToAttemptsConnection.js"; export { default as PageInfo } from "./PageInfo.js"; export { default as PayInvoiceInput } from "./PayInvoiceInput.js"; export { default as PayInvoiceOutput } from "./PayInvoiceOutput.js"; +export { default as PayUmaInvoiceInput } from "./PayUmaInvoiceInput.js"; export { default as PaymentDirection } from "./PaymentDirection.js"; export { default as PaymentFailureReason } from "./PaymentFailureReason.js"; export { @@ -116,7 +117,6 @@ export { } from "./PaymentRequest.js"; export { default as PaymentRequestData } from "./PaymentRequestData.js"; export { default as PaymentRequestStatus } from "./PaymentRequestStatus.js"; -export { default as PayUmaInvoiceInput } from "./PayUmaInvoiceInput.js"; export { default as Permission } from "./Permission.js"; export { default as PostTransactionData } from "./PostTransactionData.js"; export { default as RegionCode } from "./RegionCode.js"; @@ -143,16 +143,16 @@ export { default as SendPaymentInput } from "./SendPaymentInput.js"; export { default as SendPaymentOutput } from "./SendPaymentOutput.js"; export { default as SetInvoicePaymentHashInput } from "./SetInvoicePaymentHashInput.js"; export { default as SetInvoicePaymentHashOutput } from "./SetInvoicePaymentHashOutput.js"; +export { default as SignInvoiceInput } from "./SignInvoiceInput.js"; +export { default as SignInvoiceOutput } from "./SignInvoiceOutput.js"; +export { default as SignMessagesInput } from "./SignMessagesInput.js"; +export { default as SignMessagesOutput } from "./SignMessagesOutput.js"; export { default as Signable, getSignableQuery } from "./Signable.js"; export { default as SignablePayload, getSignablePayloadQuery, } from "./SignablePayload.js"; export { default as SignablePayloadStatus } from "./SignablePayloadStatus.js"; -export { default as SignInvoiceInput } from "./SignInvoiceInput.js"; -export { default as SignInvoiceOutput } from "./SignInvoiceOutput.js"; -export { default as SignMessagesInput } from "./SignMessagesInput.js"; -export { default as SignMessagesOutput } from "./SignMessagesOutput.js"; export { default as SingleNodeDashboard } from "./SingleNodeDashboard.js"; export { default as Transaction, getTransactionQuery } from "./Transaction.js"; export { default as TransactionFailures } from "./TransactionFailures.js"; diff --git a/packages/lightspark-sdk/src/tests/integration/general-regtest.test.ts b/packages/lightspark-sdk/src/tests/integration/general-regtest.test.ts index f174d5e47..704074f37 100644 --- a/packages/lightspark-sdk/src/tests/integration/general-regtest.test.ts +++ b/packages/lightspark-sdk/src/tests/integration/general-regtest.test.ts @@ -213,7 +213,7 @@ describe(initSuiteName, () => { throw new TypeError("No connections in account"); } - const [regtestNode] = nodesConnection?.entities; + const [regtestNode] = nodesConnection.entities; regtestNodeId = regtestNode?.id; log("regtestNodeId", regtestNode?.id); diff --git a/packages/ls-react-native-crypto/package.json b/packages/ls-react-native-crypto/package.json index 136cbd6da..a6fc80a33 100644 --- a/packages/ls-react-native-crypto/package.json +++ b/packages/ls-react-native-crypto/package.json @@ -51,7 +51,7 @@ "react": "^18.2.0", "react-native": "^0.71.8", "tsc-absolute": "^1.0.1", - "typescript": "^4.9.5" + "typescript": "^5.0.0" }, "peerDependencies": { "expo": "*", diff --git a/packages/ls-react-native-crypto/src/LightsparkdevReactNativeCryptoModule.ts b/packages/ls-react-native-crypto/src/LightsparkdevReactNativeCryptoModule.ts index 8b2da9d96..d2f331c4a 100644 --- a/packages/ls-react-native-crypto/src/LightsparkdevReactNativeCryptoModule.ts +++ b/packages/ls-react-native-crypto/src/LightsparkdevReactNativeCryptoModule.ts @@ -1,5 +1,5 @@ import { requireNativeModule } from "expo-modules-core"; -// It loads the native module object from the JSI or falls back to -// the bridge module (from NativeModulesProxy) if the remote debugger is on. +// It loads the native module object from the JSI or falls back to the bridge +// module (from NativeModulesProxy) if the remote debugger is on. export default requireNativeModule("LightsparkdevReactNativeCrypto"); diff --git a/packages/ls-react-native-crypto/src/index.ts b/packages/ls-react-native-crypto/src/index.ts index 4f96c70bb..d3ed68a4b 100644 --- a/packages/ls-react-native-crypto/src/index.ts +++ b/packages/ls-react-native-crypto/src/index.ts @@ -10,7 +10,7 @@ export { b64decode, b64encode }; * @property {ExportedKey} privateKey The private key of the key pair. * @property {ExportedKey} publicKey The public key of the key pair. * @property {string} alias The alias of the key pair in the native keystore. This is used to retrieve the key pair - * for signing, etc. + * for signing, etc. */ export type ExportedKeys = { privateKey: ExportedKey; @@ -53,11 +53,13 @@ export type Seed = { }; /** - * Generate a key pair for signing and ensures that the private key is stored in the native keystore. - * After running this function, the alias in the {@link ExportedKeys.alias} property of the returned object can be - * used to signing messages. + * Generate a key pair for signing and ensures that the private key is stored + * in the native keystore. After running this function, + * the alias in the {@link ExportedKeys.alias} property of the returned object + * can be used to signing messages. * - * You likely want to store the alias in a a persistent local store (like AsyncStorage) so that you can use it later. + * You likely want to store the alias in a a persistent local store (like + * AsyncStorage) so that you can use it later. * * @returns {Promise} A promise that resolves to an object containing the public and private keys, along * with an alias for the key pair. @@ -67,9 +69,9 @@ export async function generateSigningKeyPair(): Promise { } /** - * Exports the raw byes of the key pair with the given alias. This should only be used for - * debugging purposes or for backing up the key pair. Do not keep these bytes in memory for - * longer than necessary. + * Exports the raw byes of the key pair with the given alias. + * This should only be used for debugging purposes or for backing up the key + * pair. Do not keep these bytes in memory for longer than necessary. * * @param keyAlias The alias of the key to export. * @returns {Promise} A promise that resolves to an object containing the public and private keys. @@ -85,11 +87,12 @@ export async function serializeSigningKey( /** * Imports a private key into the native keystore. * - * You likely want to store the returned alias in a a persistent local store (like AsyncStorage) so that you can use - * it later. + * You likely want to store the returned alias in a a persistent local store + * (like AsyncStorage) so that you can use it later. * - * NOTE: iOS can only import pkcs1 format private keys! Other formats will fail. However, if you're just importing a - * key that was generated by this native crypto module, it will be in the correct format. + * NOTE: iOS can only import pkcs1 format private keys! Other formats will + * fail. However, if you're just importing a key that was generated by this + * native crypto module, it will be in the correct format. * * @param keyData The raw bytes of the private key to import. * @returns {Promise} A promise that resolves to the alias of the imported key pair that can be used to sign @@ -158,7 +161,8 @@ export async function derivePublicKey( } /** - * Derives the private key from a seed and a derivation path, then sign a message with it. + * Derives the private key from a seed and a derivation path, + * then sign a message with it. * * @param seed The master seed. * @param message The message to sign. diff --git a/packages/oauth/package.json b/packages/oauth/package.json index 6705a5fe4..070f08225 100644 --- a/packages/oauth/package.json +++ b/packages/oauth/package.json @@ -35,7 +35,7 @@ ], "scripts": { "build": "yarn tsc && tsup src/index.ts --format cjs,esm --dts", - "build:watch": "yarn build --watch", + "build:watch": "yarn build --watch --clean=false", "clean": "rm -rf .turbo && rm -rf dist", "dev": "yarn build -- --watch", "format:fix": "prettier src --write", @@ -67,7 +67,7 @@ "ts-jest": "^29.1.1", "tsc-absolute": "^1.0.1", "tsup": "^7.2.0", - "typescript": "^4.9.5" + "typescript": "^5.0.0" }, "private": true } diff --git a/packages/oauth/src/auth/OAuthStateHelper.ts b/packages/oauth/src/auth/OAuthStateHelper.ts index 81f5a3cd3..e5864f1f5 100644 --- a/packages/oauth/src/auth/OAuthStateHelper.ts +++ b/packages/oauth/src/auth/OAuthStateHelper.ts @@ -281,8 +281,8 @@ class OAuthStateHelper { } /** - * Completes the authorization flow once the user has been redirected back to the app - * if the current url contains an authorization response. + * Completes the authorization flow once the user has been redirected back to + * the app if the current url contains an authorization response. */ public checkForAuthorizationResponse() { return this.authorizationHandler.completeAuthorizationRequestIfPossible(); diff --git a/packages/react-native/package.json b/packages/react-native/package.json index 961bf5172..160316acf 100644 --- a/packages/react-native/package.json +++ b/packages/react-native/package.json @@ -35,7 +35,7 @@ ], "scripts": { "build": "yarn tsc && tsup src/index.ts --format cjs,esm --dts", - "build:watch": "yarn build --watch", + "build:watch": "yarn build --watch --clean=false", "clean": "rm -rf .turbo && rm -rf dist", "dev": "yarn build -- --watch", "format:fix": "prettier src --write", @@ -66,6 +66,6 @@ "ts-jest": "^29.1.1", "tsc-absolute": "^1.0.1", "tsup": "^7.2.0", - "typescript": "^4.9.5" + "typescript": "^5.0.0" } } diff --git a/packages/react-native/src/crypto/index.ts b/packages/react-native/src/crypto/index.ts index c10d6c75c..355e6314f 100644 --- a/packages/react-native/src/crypto/index.ts +++ b/packages/react-native/src/crypto/index.ts @@ -1,6 +1,6 @@ // Copyright ©, 2023-present, Lightspark Group, Inc. - All Rights Reserved import type { CryptoInterface, GeneratedKeyPair } from "@lightsparkdev/core"; -import { b64decode, b64encode, LightsparkException } from "@lightsparkdev/core"; +import { LightsparkException, b64decode, b64encode } from "@lightsparkdev/core"; import * as LsCrypto from "@lightsparkdev/ls-react-native-crypto"; export function decryptSecretWithNodePassword(/* cipher: string, encryptedSecret: string, nodePassword: string */): Promise { diff --git a/packages/react-wallet/package.json b/packages/react-wallet/package.json index f0af8487c..c210e6333 100644 --- a/packages/react-wallet/package.json +++ b/packages/react-wallet/package.json @@ -35,7 +35,7 @@ ], "scripts": { "build": "yarn tsc && tsup src/index.ts --format cjs,esm --dts", - "build:watch": "yarn build --watch", + "build:watch": "yarn build --watch --clean=false", "clean": "rm -rf .turbo && rm -rf dist", "dev": "yarn build -- --watch", "format:fix": "prettier src --write", @@ -68,7 +68,7 @@ "ts-jest": "^29.1.1", "tsc-absolute": "^1.0.1", "tsup": "^7.2.0", - "typescript": "^4.9.5" + "typescript": "^5.0.0" }, "peerDependencies": { "@types/react": "*", diff --git a/packages/tsconfig/base.json b/packages/tsconfig/base.json index 16aa32147..010c3b752 100644 --- a/packages/tsconfig/base.json +++ b/packages/tsconfig/base.json @@ -1,7 +1,7 @@ { "compilerOptions": { "target": "ES2022", - "module": "ES2022", + "module": "node16", "allowJs": true, "declaration": true, "sourceMap": true, diff --git a/packages/tsconfig/react-app.json b/packages/tsconfig/react-app.json index f0b769038..f18b44bf3 100644 --- a/packages/tsconfig/react-app.json +++ b/packages/tsconfig/react-app.json @@ -2,7 +2,8 @@ "extends": "@lightsparkdev/tsconfig/base.json", "compilerOptions": { "lib": ["DOM", "DOM.Iterable", "ESNext"], - "moduleResolution": "node", + "moduleResolution": "bundler", + "module": "esnext", "isolatedModules": true, "jsx": "react-jsx", "noEmit": true, diff --git a/packages/tsconfig/react-package.json b/packages/tsconfig/react-package.json index bb695c1ff..0c4455593 100644 --- a/packages/tsconfig/react-package.json +++ b/packages/tsconfig/react-package.json @@ -4,7 +4,8 @@ "lib": ["DOM", "ESNext"], "jsx": "react-jsx", "jsxImportSource": "@emotion/react", - "module": "ESNext", + "module": "nodenext", + "moduleResolution": "nodenext", "target": "es6" } } diff --git a/packages/ui/.eslintrc.cjs b/packages/ui/.eslintrc.cjs index 7725b13ba..2e6b96acf 100644 --- a/packages/ui/.eslintrc.cjs +++ b/packages/ui/.eslintrc.cjs @@ -1,3 +1,3 @@ module.exports = { - extends: ["@lightsparkdev/eslint-config/react-lib/config"], + extends: ["@lightsparkdev/eslint-config/react-lib"], }; diff --git a/packages/ui/.prettierignore b/packages/ui/.prettierignore index e1a453e79..f85a1101e 100644 --- a/packages/ui/.prettierignore +++ b/packages/ui/.prettierignore @@ -1,2 +1,3 @@ gql/generated/* gql/*.graphql +dist/ \ No newline at end of file diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md deleted file mode 100644 index 91276a032..000000000 --- a/packages/ui/CHANGELOG.md +++ /dev/null @@ -1,54 +0,0 @@ -# @lightsparkdev/ui - -## 0.0.7 - -### Patch Changes - -- 4ffd9a1: Upgrade prettier, fix lint configs, move ls-react-native-crypto-app to examples - -## 0.0.6 - -### Patch Changes - -- Updated dependencies [6cd80d4] - - @lightsparkdev/wallet-sdk@0.6.16 - -## 0.0.5 - -### Patch Changes - -- Updated dependencies [565f0ab] - - @lightsparkdev/wallet-sdk@0.6.15 - -## 0.0.4 - -### Patch Changes - -- Updated dependencies [cf11549] - - @lightsparkdev/wallet-sdk@0.6.14 - -## 0.0.3 - -### Patch Changes - -- Updated dependencies [df28af1] - - @lightsparkdev/wallet-sdk@0.6.13 - -## 0.0.2 - -### Patch Changes - -- Updated dependencies [141d73a] - - @lightsparkdev/wallet-sdk@0.6.12 - -## 0.0.1 - -### Patch Changes - -- 19c8513: Ensure lint runs for ui libs. Consolidate lint configs -- 19c8513: Update README.md . - - Mutation to screen bitcoin addresses - -- Updated dependencies [19c8513] - - @lightsparkdev/wallet-sdk@0.6.11 diff --git a/packages/ui/LICENSE b/packages/ui/LICENSE new file mode 100644 index 000000000..2c224b911 --- /dev/null +++ b/packages/ui/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright 2023 Lightspark Group, Inc. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/packages/ui/README.md b/packages/ui/README.md new file mode 100644 index 000000000..e6105f710 --- /dev/null +++ b/packages/ui/README.md @@ -0,0 +1,23 @@ +# Lightspark UI + +![npm (scoped)](https://img.shields.io/npm/v/@lightsparkdev/ui) + +This package contains React components and design system utilities from Lightspark UI. + +## Getting started + +```bash +$ npm install @lightsparkdev/ui +``` + +```jsx +import { LightsparkProvider, Button } from "@lightsparkdev/ui/components"; + +function App() { + return ( + +